Hi, Humans!
My name is Hamza Farooq and I love 'Swift' programming. I always try to implement new ideas. Do check Swift-TopViewController for this ActionSheetManager to work
This class is used to make native ActionSheet as per requirements
Do the following simple steps to add this Manager class in your project and present ActionSheets without code redundancy
First of all follow this link to add the Swift-TopViewController in your project. Because this file is used to present this ActionSheet
Then, simply download or copy this code and place it in your project. (Click on the link, this will take you to the directory where ActionSheetManager is placed)
If you do not want to add Swift-TopViewController in your project. then you can modify ActionSheetManager on your on
ActionSheetManager.actionSheetDynamic(buttonTitlesArray: ["Take Picture", "Choose From Library"], successCallBack: { (callBackText) in
if callBackText == "Take Picture" {
// do camera stuff here
} else {
// do gallary stuff here
}
}) {
print("nothing")
}
- You can also pass your custom title and message strings as follows:
ActionSheetManager.actionSheetDynamic(title: "Action", message: "Choose Options", buttonTitlesArray: ["Take Picture", "Choose From Library"], successCallBack: { (callBackText) in
That's it.
I uses this class for my own personal use, if you want to use some other methods or want to modify this class on your own, you can. :-)
Your contributions are most welcomed. Do let me know if you find any kind of issue while using this file. Please open an issue to discuss that problem. Thanks
Hamza Farooq, hamza_faroooq@yahoo.com
MIT (Click Me O_o)