Showing a UIPickerView
with UIActionSheet
in iOS8 not working
The code works in iOS7, however it is not working in iOS8. I'm sure it is because UIActionSheet is deprecated in iOS8 and Apple recommends to use UIAlertController
.
However, how to do it in iOS8? I should use UIAlertController
?
iOS7:
iOS8:
EDIT:
I have faced the same issue and solved it by this way it will work in all ios version
In ios 8 apple has changed so many things i here faced one problem in my own project so , i just want to provide the solution in replacement of
UIActionsheet
.in ios 8
UIActionsheet
deprecated as well its delegate methods also deprecated. Instead of thatUIAlertController
with prefferedstyleUIAlertControllerStyleActionSheet
is used. you can check this thread as well:https://developer.apple.com/library/ios/documentation/Uikit/reference/UIActionSheet_Class/index.html
This example will work both in ios 8 and previous version of it.
in .h file declare this variable
in .m file
you can check my blog also, http://ioscodesample.blogspot.in/2014/10/ios-8-changes-for-actionsheet.html
Thanks.
Try to use this action sheet simulation:
I write the time picker by my self instead UIActionSheet in iOS8:
UIActionSheet is depricated in iOS8. Use UIAlertController for iOS8 or later
Ref : UIAlertController
Example : https://github.com/KiritVaghela/UIAlertController
I have the same problem with you, showing a UIPickerView with UIActionSheet is not working in iOS 8. Because UIActionSheet is deprecated and Apple recommends to use UIAlertController. So we should round to wind.
I wrote some code to resolve my case. I hope it can help you.
I think it's all to fix this issue. Happy coding!
From the reference for UIActionSheet:
My guess is your seeing exactly why.
The reference for UIAlertController doesn't have a similar disclaimer, but looking at its interface, my guess is Apple will add it before release.
My recommendation would be to just create a small view containing your picker and buttons and show and hide it as needed. It's not that hard to do and your not pushing interfaces beyond their intended uses.