A popview framework with Swift 3.0 includes LoadingView, ProgressView, SheetView and AlertView.
你可以在「这里」找到详细的中文介绍和扩展方法。
- iOS 10
- Xcode 8
Use cocoaPods like this:
pod `EMPopView`Just read the code in example.
To let popview know when the screen rotation. Put this code in AppDelegate.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
EMPopViewFactory.regist()
return true
}Before use the popview, we need to create a config object.
let config = EMLoadingViewConfig.init(colorStyle: .white,
showAniStyle: .fadeIn,
closeAniStyle: .fadeOut)Now we get an EMLoadingViewConfig. We can use it to config an EMLoadingView like this:
let index = EMPopViewFactory.showView(withType: .loading, config: config)The value of index is the index of the EMLoadingView we already buld. When we want to close this view, we need to let EMPopViewFactory know the index.
EMPopViewFactory.closeView(withIndex: index)Edit the code.
Add some option in EMPopViewShowAnimationStyle and EMPopViewCloseAnimationStyle to extension animations.
Add some option in EMPopViewColorStyle to extension skins.