I'm trying to make my iOS7 app work on iOS8 and I saw that the UISearchController
replaces the UISearchDisplayController
in iOS8.
Of course I can use UISearchController
instead of UISearchDisplayController
, but than my app is no longer working on iOS7.
How can I make my app work on both iOS versions? Do I need to make another storyboard for iOS8?
Thanks in advance
If your Deployment Target is set to iOS 7 and you wish to support iOS 8, you can still use UISearchDisplayController
and it should run without issue on iOS 8, and without warnings presented in Xcode. I have not experienced any misbehavior with my apps that implement UISearchDisplayController
. When I decide to no longer support iOS 7, then I will replace it completely with UISearchController
.
You may be able to detect the OS version and implement UISearchController
programmatically if 8+, but if you're using a Storyboard it would be difficult to implement both unless you create two different Storyboards, one for each OS. But I don't really find that necessary when you need to support the previous OS. Deprecation normally does not mean it will not work anymore when running on the latest OS, but rather it's just not recommended to use anymore because there are better solutions available. It's rare when deprecated methods do not work properly when run on newer iOS versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With