KTLoadingView
is a subclass of UIView
which embedded KTLoadingLabel
and NVActivityIndicator
to provide a one-line loading view solution.
- iOS 9.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
- Xcode 8.3+
- Swift 4
KTLoadingView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'KTLoadingView'
To run the example project, clone the repo, and run pod install
from the Example directory first.
import KTLoadingView
KTLoadingView.show()
import KTLoadingView
KTLoadingView.show(text: "Loading", animateText: "...")
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()
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
.
KTLoadingView is available under the MIT license. See the LICENSE file for more info.