Skip to content

kokitang/KTLoadingView

Repository files navigation

KTLoadingView

Version License Platform


Banner


Intro

KTLoadingView is a subclass of UIView which embedded KTLoadingLabel and NVActivityIndicator to provide a one-line loading view solution.

Requirements

  • iOS 9.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 8.3+
  • Swift 4

Installation

KTLoadingView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'KTLoadingView'

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

Basic

import KTLoadingView

KTLoadingView.show()

Basic (with text)

import KTLoadingView

KTLoadingView.show(text: "Loading", animateText: "...")

Customize

If you want to do some customization. You can get the instance of KTLoadingView

let shared = KTLoadingView.shared

// Customize
shared.type = .pacman
/*And more to discover...*/
//

shared.show() // or KTLoadingView.show()

You can also customize the KTLoadingLabel by simply set the attributes of it.

let shared = KTLoadingView.shared

// Customize
shared.label.animationType = .reverse
shared.label.stringType = .fullString
shared.label.repeats = false
/*And more to discover...*/
//

shared.show()

Custom Font

You can set any font to text label as you want. Just set textFont as your dedicated font.

KTLoadingView.shared.textFont = UIFont.systemFont(ofSize: 40)
KTLoadingView.show() // Same as KTLoadingView.shared.show()

If you want to use the font in the sample gif, you can download here. Or you can find this font file inside /Example/KTLoadingLabel.

Author

Koki Tang

License

KTLoadingView is available under the MIT license. See the LICENSE file for more info.

About

KTLoadingView is a subclass of UIView that provides animated loading page.

Resources

License

Stars

Watchers

Forks

Packages

No packages published