A simple, lightweight and customizable loading interface for iOS written by Swift. 中文说明文档
- iOS 8.0+
- Xcode 8.0+
- Swift 3.0+
Create a Cartfile
that lists the framework and run carthage update
. Follow the instructions to add $(SRCROOT)/Carthage/Build/iOS/SimpleLoadingView.framework
to an iOS project.
github "pangpingfei/SimpleLoadingView"
Run carthage update --platform iOS
to build the framework and drag the built SimpleLoadingView.framework
into your Xcode project.
To get the full benefits import SimpleLoadingView
import SimpleLoadingView
- Download and drop
SimpleLoading.swift
SimpleLoadingView.swift
into your project. - Congratulations!
// show activity only
SimpleLoading.show()
// show text only
SimpleLoading.show(.text("Welcome!"))
// show activity with text
SimpleLoading.show(.textRight("Loading"))
// show in other view
SimpleLoading.show(inView: self.view)
// hide view manually
SimpleLoading.hide()
// hide view after duration
SimpleLoading.show(duration: 2)
You can see all styles in public enum
SimpleLoading.Style
.
SimpleLoading.Config.maskViewAlpha = 0.5
SimpleLoading.Config.viewBorderWidth = 1
SimpleLoading.Config.activityStyle = .whiteLarge
SimpleLoading.Config.textColor = .white
SimpleLoading.Config.verticalPadding = 30
// ...
You can see all settings in public struct
SimpleLoading.Config
.
https://github.com/pangpingfei/SimpleLoadingView/blob/master/Screenshots/Desc.png
For more information please see the demo in project.
SimpleLoadingView is available under the MIT license. See the LICENSE file.