iOS-判断系统版本

作者: d2031869e667 | 来源:发表于2017-07-28 11:37 被阅读49次

在使用UISearchController时,发现这是一个要求在iOS版本8以上才可以使用的,而在8之前需要要UISearchBarDelegate 和UISearchDisplayDelegate实现。这就要求我们在敲代码实例化UISearchController前,判断一下iOS系统版本是否大于8,其实一句话就可以搞定!

if ( UIDevice currentDevice].systemVersion.floatValue > 8.0f )

是不是很简单!

至于UISearchBarDelegate 和UISearchDisplayDelegated 的实现,可以参考http://www.jianshu.com/p/11b141e2605b

相关文章

网友评论

    本文标题:iOS-判断系统版本

    本文链接:https://www.haomeiwen.com/subject/fvmxlxtx.html