Latest 1.0
Homepage https://github.com/WangWenzhuang/ZKProgressHUD
License MIT
Platforms ios 8.0, requires ARC
Authors

(logo)

license
CocoaPods
platform
contact

中文说明

A easy-to-use HUD for your iOS app.

demo

Requirements

  • iOS 8.0 +

  • Xcode 8 +

  • Swift 3.0 +

Installation

CocoaPods

You can use CocoaPods to install ZKProgressHUD by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!

target 'MyApp' do
    pod 'ZKProgressHUD'
end

Manually

  • Drag the ZKProgressHUD folder into your project.

  • Take care that ZKProgressHUD.bundle is added to Targets->Build Phases->Copy Bundle Resources.

Usage

Import library

import ZKProgressHUD

show

ZKProgressHUD.show()
// Simulation time consuming operation
DispatchQueue.global().asyncAfter(deadline: DispatchTime.now() + .seconds(3), execute: {
    DispatchQueue.main.async {
        ZKProgressHUD.hide()
    }
})

show with status

ZKProgressHUD.show("loading")
// Simulation time consuming operation
DispatchQueue.global().asyncAfter(deadline: DispatchTime.now() + .seconds(3), execute: {
    DispatchQueue.main.async {
        ZKProgressHUD.hide()
    }
})

showProgress

ZKProgressHUD.showProgress(1 / 10)

showImage

ZKProgressHUD.showImage(UIImage(named: "image"))

showImage with status

ZKProgressHUD.showImage(UIImage(named: "image"), status: "Hello world")

showInfo

ZKProgressHUD.showInfo("Hello world")

showSuccess

ZKProgressHUD.showSuccess("Hello world")

showError

ZKProgressHUD.showError("Hello world")

showMessage

ZKProgressHUD.showMessage("Hello world")

hide

ZKProgressHUD.hide()

hide with delay

ZKProgressHUD.hide(delay: 3)

Customization😏

style1
style2
style3
style4
style5
style6
style7
style8

ZKProgressHUD can be customized via the following methods:

setMaskStyle (_ maskStyle : ZKProgressHUDMaskStyle )

setMaskBackgroundColor(_ color: UIColor)

setForegroundColor(_ color: UIColor)

setBackgroundColor(_ color: UIColor)

setFont(_ font: UIFont)

setCornerRadius(_ cornerRadius: CGFloat)

setAnimationStyle(_ animationStyle : ZKProgressHUDAnimationStyle )

setHideDelay(_ hideDelay: Int)

TODO💪

  • GIF image display

  • Code refactoring

Latest podspec

{
    "name": "ZKProgressHUD",
    "version": "1.0",
    "platforms": {
        "ios": "8.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "A easy-to-use HUD for your iOS app.",
    "homepage": "https://github.com/WangWenzhuang/ZKProgressHUD",
    "authors": {
        "WangWenzhuang": "[email protected]"
    },
    "source": {
        "git": "https://github.com/WangWenzhuang/ZKProgressHUD.git",
        "tag": "1.0"
    },
    "description": "ZKProgressHUD is a easy-to-use HUD meant to display the progress of an ongoing task on iOS.",
    "source_files": "ZKProgressHUD/*.swift",
    "resources": "ZKProgressHUD/ZKProgressHUD.bundle",
    "requires_arc": true,
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3.0"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This