BrickBatView It can be simply composed of view components into a alert view. Each component is created by you
To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 8.0+
- Swift4+
BrickBatView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'BrickBatView'
BrickBatView(inView: view)?
.setup()
.addTitleItem(title: "Title", infoicon: nil)
.addMessageItem(text: "message")
.addButtonItem(title: ["cancel", "done"], style: .fill)
.show()
BrickBatView(inView: view)?
.handle(action: { (index) in
print("sender index: \(index)")
}, tapHidden: true)
.identifier("BrickView_SETUP")
.lifeCyle(showFinishedAction: { (show) in
print("isShowFinished")
}, hiddenAction: {
print("isHidden")
})
.offset(10)
.position(.bottom, edgeInster: 20)
...
extension BrickBatView {
func addExtensionTextField() -> Self {
let textField = UITextField()
textField.bounds.size.height = 50
textField.placeholder = "BrickView addTextField Extension"
textField.borderStyle = .roundedRect
return addContentView(textField)
}
brickBatView
.addExtensionTextField()
...
let buttonView = ButtonView()
brickBatView
.addContentView(buttonView, controls: buttonView.button)
...
let item = BrickBarItem()
brickBatView
.addBrickItem(item)
...
let imageView = UIimageView()
brickBatView
.addGesture([imageView])
...
ZeroJian, [email protected]
BrickBatView is available under the MIT license. See the LICENSE file for more info.