CustomViewPlus 1.1.5

CustomViewPlus 1.1.5

测试测试通过
Lang语言 SwiftSwift
许可 BSD
发布最新发布2017年2月
SwiftSwift 版本3.0
SPM支持 SPM

Flavian Mary维护。



  • 作者:
  • Flavian Mary

CustomViewPlus

CustomViewPlus 是使用 Swift 编写的视图集合。

安装

CustomViewPlus 通过 CocoaPods 提供。安装时,只需将以下行添加到 Podfile 即可:

pod "CustomViewPlus"

要求

最低要求是 iOS 9.0。此对话框是用 Swift 3 编写的。

示例

要运行示例项目,首先克隆仓库 ProjetCustomView,然后先从 Example 目录运行 pod install

用法

自定义视图

CircularImageView

用于创建圆形图片

let image = CircularImage()
image.image = UIImage(named:"nom_de_l_image")
CircleButton

用于创建圆形按钮

let button = CircleButton()
let img = UIImage(named:"nom_de_l_image")
button.setImage(img, for: .normal)

自定义导航

BubbleMenu

用于创建气泡菜单

let b1 = CircleButton()
[...]
let b2 = CircleButton()
[...]
let b3 = CircleButton()
[...]
let b4 = CircleButton()
[...]
let b5 = CircleButton()
[...]
let vc = UIViewController()
let rootViewController = BubbleMenu(rootViewController: vc, buttons: [b1,b2,b3,b4,b5])
TabbedSheet

用于创建标签页

let vc1 = UIViewController()
let vc2 = UIViewController()
let vc3 = UIViewController()
let vc4 = UIViewController()
let vc5 = UIViewController()

let tab: [TabActionSheet] = [
    TabActionSheet(name: "first", image: UIImage(named:"nom_de_l_image"), viewController: vc1, isTemplateIcon: true),
    TabActionSheet(name: "second", image: UIImage(named:"nom_de_l_image"), viewController: vc2, isTemplateIcon: true),
    TabActionSheet(name: "third", image: UIImage(named:"nom_de_l_image"), viewController: vc3, isTemplateIcon: true),
    TabActionSheet(name: "fourth", image: UIImage(named:"nom_de_l_image"), viewController: vc4, isTemplateIcon: true),
    TabActionSheet(name: "fifth", image: UIImage(named:"nom_de_l_image"), viewController: vc5, isTemplateIcon: true),
]
let rootViewController = TabbedSheet(tab: tab)

扩展

UIView.addInfo

用于为任何 UIView 添加信息

let view = UIView()

view.addInfo(text: "Ceci est un text")
// or
view.addInfo(text: "Ceci est un text", color: UIColor.white)
// or
view.addInfo(text: "Ceci est un text", textColor: UIColor.black)
// or
view.addInfo(text: "Ceci est un text", color: UIColor.white, textColor: UIColor.black)
UIAlertAction.addImage

用于为任何 UIAlertAction 添加图片

let action = UIAlertAction(title: "nom_de_l_action", style: .default, handler: nil).addImage(image: UIImage(named:"nom_de_l_image"))
UIImage.withSize

用于任何UIImage的withSize方法

let image = UIImage(named:"nom_de_l_image").withSize(size: CGSize(width: 30, height: 30))

许可证

CustomViewPlus遵循BSD 3-Clause许可证。有关更多信息,请参阅LICENSE文件。