AWLoader 1.0.1

AWLoader 1.0.1

Aymen Rebouh 维护。



AWLoader 1.0.1

AWLoader

AWLoader 是一个 UI 组件,允许您将满足您需求的加载器集成到您的应用程序中。

概述

外观

AWLoader all gif

幕后

就像这样:[点击查看图片](./AWLoaderWhimsical.png)

🔶要求

  • iOS 9.0+
  • Swift 5.0

👨🏻‍💻 使用

正常加载器

使用方法

let loader = AWLoader(showInView: view,
                      animationDuration: 1,
                      blurStyle: .light,
                      shape: .rounded(6),
                      containerBackgroundColor: .white,
                      lineWidth: 2,
                      lineColor: .darkGray)
loader.show()

DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
    loader.hide()
}

自定义

这些属性

public init(showInView presentingView: UIView,
                animationDuration: CFTimeInterval = 1.5,
                blurStyle: UIBlurEffect.Style? = .light,
                shape: AWLoaderShape = .rounded(6),
                containerBackgroundColor: UIColor = .lightGray,
                lineWidth: CGFloat = 2,
                lineColor: UIColor = .black
                )

渐变加载器

使用方法

let gradientLoader = AWGradientLoader(showInView: self.view,
                                      animationDuration: 0.7,
                                      blurStyle: .dark,
                                      shape: .rounded(6),
                                      containerBackgroundColor: .white,
                                      gradientColors: [.purple, .black, .purple],
                                      gradientLocations: [0.2, 0.5, 1])
gradientLoader.show()

DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
    gradientLoader.hide()
}

自定义

这些属性

public init(showInView presentingView: UIView,
              animationDuration: CFTimeInterval = 1.5,
              blurStyle: UIBlurEffect.Style? = nil,
              shape: AWLoaderShape = .circle,
              containerBackgroundColor: UIColor = .lightGray,
              lineWidth: CGFloat = 2,
              gradientColors: [UIColor],
              gradientLocations: [NSNumber]
      )

安装

CocoaPods

pod 'AWLoader'

Carthage

github "Aymenworks/AWLoader"

授权

AWLoader在MIT许可证下发布。