To run the example project, clone the repo, and run pod install
from the Example directory first.
Xcode 10+
Swift 4.2
AJPopAlert is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'AJPopAlert'
let vc = AJPopAlert(title: "Lorem Ipsum", message: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum",position:.bottom)
vc.addAction(title: "Ok") { (action) in
print("ok")
}
vc.addAction(title: "Later") { (action) in
print("later")
}
vc.addAction(title: "Cancel", type: .destructive) { (action) in
action.dismiss(animated: true, completion: nil)
}
vc.show()
let customView = MyCustomView()
let vc = AJPopAlert(customView: customView)
vc.addAction(title: "Ok") { (action) in
print("ok")
}
vc.addAction(title: "Later") { (action) in
print("later")
}
vc.addAction(title: "Cancel", type: .destructive) { (action) in
action.dismiss(animated: true, completion: nil)
}
vc.show()
Make sure you inheritent AJPopAction
add pass to addAction(popAction: <#T##AJPopAction#>)
class MyCustomAction : AJPopAction {
init(){
type = .normal
}
}
//// in other class
let customView = MyCustomView()
let vc = AJPopAlert(customView: customView)
vc.addAction(title: "Ok") { (action) in
print("ok")
}
vc.addAction(title: "Later") { (action) in
print("later")
}
let action = MyCustomAction()
action.action = { (viewcontroller) in
print("DidTap")
}
vc.addAction(popAction:action)
vc.show()
See in Wiki Tab for further information
ajijoyo, [email protected]
Feel free to pull request for adding new feature or fixing bugs.
AJPopAlert is available under the MIT license. See the LICENSE file for more info.