All Projects → stackhou → Swiftprogresshud

stackhou / Swiftprogresshud

Licence: mit
📦 SwiftProgressHUD is a user-friendly pure swift HUD. 支持Cocoapods 及 Carthage

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Swiftprogresshud

Kydrawercontroller
Side Drawer Navigation Controller similar to Android
Stars: ✭ 632 (+117.93%)
Mutual labels:  cocoapods, carthage, pod
Jgprogresshud
An elegant and simple progress HUD for iOS and tvOS, compatible with Swift and ObjC.
Stars: ✭ 3,110 (+972.41%)
Mutual labels:  cocoapods, carthage, hud
Apesuperhud
A simple way to display a HUD with a message or progress information in your application.
Stars: ✭ 156 (-46.21%)
Mutual labels:  cocoapods, carthage, hud
Kyshutterbutton
KYShutterButton is a custom button that is similar to the shutter button of the camera app
Stars: ✭ 293 (+1.03%)
Mutual labels:  cocoapods, carthage, pod
Svprogresshud
A clean and lightweight progress HUD for your iOS and tvOS app.
Stars: ✭ 12,339 (+4154.83%)
Mutual labels:  cocoapods, carthage, hud
Gemini
Gemini is rich scroll based animation framework for iOS, written in Swift.
Stars: ✭ 2,965 (+922.41%)
Mutual labels:  cocoapods, carthage
Uxmpdfkit
An iOS PDF viewer and annotator written in Swift that can be embedded into any application.
Stars: ✭ 260 (-10.34%)
Mutual labels:  cocoapods, carthage
Passwordtextfield
A custom TextField with a switchable icon which shows or hides the password and enforce good password policies
Stars: ✭ 281 (-3.1%)
Mutual labels:  cocoapods, carthage
Xcode One Dark
Atom One Dark theme for Xcode
Stars: ✭ 273 (-5.86%)
Mutual labels:  cocoapods, carthage
Swiftytexttable
A lightweight library for generating text tables.
Stars: ✭ 252 (-13.1%)
Mutual labels:  cocoapods, carthage
Progress.swift
⌛️ Add beautiful progress bars to your loops.
Stars: ✭ 265 (-8.62%)
Mutual labels:  cocoapods, carthage
Faceaware
An extension that gives UIImageView the ability to focus on faces within an image.
Stars: ✭ 3,004 (+935.86%)
Mutual labels:  cocoapods, carthage
Serpent
A protocol to serialize Swift structs and classes for encoding and decoding.
Stars: ✭ 281 (-3.1%)
Mutual labels:  cocoapods, carthage
Corestore
Unleashing the real power of Core Data with the elegance and safety of Swift
Stars: ✭ 3,254 (+1022.07%)
Mutual labels:  cocoapods, carthage
Yoshi
A convenient wrapper around the UI code that is often needed for displaying debug menus.
Stars: ✭ 263 (-9.31%)
Mutual labels:  cocoapods, carthage
Datez
📆 Breeze through Date, DateComponents, and TimeInterval with Swift!
Stars: ✭ 254 (-12.41%)
Mutual labels:  cocoapods, carthage
Audioindicatorbars
AIB indicates for your app users which audio is playing. Just like the Podcasts app.
Stars: ✭ 279 (-3.79%)
Mutual labels:  cocoapods, carthage
Ezswiftextensions
😏 How Swift standard types and classes were supposed to work.
Stars: ✭ 2,911 (+903.79%)
Mutual labels:  cocoapods, carthage
Animoji
Animoji Generator 🦊
Stars: ✭ 277 (-4.48%)
Mutual labels:  cocoapods, carthage
Cocoapods Pod Merge
Cocoapods plugin to merge pods used by your Xcode project, reducing the number of dynamic frameworks your app has to load on startup
Stars: ✭ 276 (-4.83%)
Mutual labels:  cocoapods, pod

SwiftProgressHUD

Travis Platform Platform CocoaPods Carthage Compatible GitHub tag GitHub stars license

SwiftProgressHUD is an iOS drop-in class that displays a translucent HUD with an indicator and/or labels while work is being done in a background thread. The HUD is meant as a replacement for the undocumented, private UIKit UIProgressHUD with some additional features.

Effect

1 2 3 4
1 2 3 4

Requirements

SwiftProgressHUD works on iOS 8+ and requires ARC to build. It depends on the following Apple frameworks, which should already be included with most Xcode templates:

  • Swift 3.0+
  • Foundation.framework
  • UIKit.framework
  • CoreGraphics.framework

You will need the latest developer tools in order to build SwiftProgressHUD. Old Xcode versions might work, but compatibility will not be explicitly maintained.

Adding SwiftProgressHUD to your project (添加 SwiftProgressHUD 到你的项目)

CocoaPods

CocoaPods is the recommended way to add SwiftProgressHUD to your project.

  1. Add a pod entry for SwiftProgressHUD to your Podfile
pod 'SwiftProgressHUD'
  1. Install the pod(s) by running
pod install
  1. Include SwiftProgressHUD wherever you need it with
import SwiftProgressHUD

Carthage

  1. Add SwiftProgressHUD to your Cartfile.
github "stackhou/SwiftProgressHUD"
  1. Run
carthage update
  1. Follow the rest of the standard Carthage installation instructions to add SwiftProgressHUD to your project.

使用举例

在需要等待的时候, 可以使用 showWait, 代码及效果如下:

/// 设置蒙版背景颜色, 默认是clear
//            SwiftProgressHUD.hudBackgroundColor = UIColor.black.withAlphaComponent(0.2)

/// 开始loading...
SwiftProgressHUD.showWait()

/// 模拟 1s后 加载完成
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
SwiftProgressHUD.hideAllHUD()
}

加载成功时, 提示可以使用 showSuccess, 代码及效果如下:

SwiftProgressHUD.showSuccess("加载成功")

/// 模拟 1s后 加载完成
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
SwiftProgressHUD.hideAllHUD()
}

加载失败时, 提示可以使用 showFail, 代码及效果如下:

SwiftProgressHUD.showFail("加载失败")

/// 模拟 1s后 加载完成
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
SwiftProgressHUD.hideAllHUD()
}

友情提示信息, 可以使用 showInfo, 代码及效果如下:

SwiftProgressHUD.showInfo("请稍后")

/// 模拟 1s后 加载完成
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
SwiftProgressHUD.hideAllHUD()
}

错误Toast提示信息, 可以使用 showOnlyText, 代码及效果如下:

SwiftProgressHUD.showOnlyText("请输入合法的手机号")

/// 模拟 1s后 加载完成
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
SwiftProgressHUD.hideAllHUD()
}

状态栏提示信息, 可以使用 showOnStatusBar, 代码及效果如下:

SwiftProgressHUD.showOnStatusBar("你有一条新消息", autoClear: true, autoClearTime: 1, textColor: UIColor.orange, backgroundColor: UIColor.lightGray)

/// 模拟 1s后 加载完成
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
SwiftProgressHUD.hideAllHUD()
}

加载动画提示, 可以使用 showAnimationImages, 代码及效果如下:

let animationDuration = 70 // 动画时间 单位毫秒Int

var loadingImages = [UIImage]()
for index in 0...16 {
let loadImageName = String(format: "new_brand_progress%02d", index)
if let loadImage = UIImage(named: loadImageName) {
loadingImages.append(loadImage)
}
}

SwiftProgressHUD.showAnimationImages(loadingImages, timeMilliseconds: animationDuration, backgroundColor: backgroundColor, scale: scale)

/// 模拟 1s后 加载完成
DispatchQueue.main.asyncAfter(deadline: .now() + 4) {
SwiftProgressHUD.hideAllHUD()
}
1 2 3

License

This code is distributed under the terms and conditions of the MIT license.

Change-log

A brief summary of each MBProgressHUD release can be found in the CHANGELOG.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].