iOS8的新特性之一,UIAlertView变成了UIAlertController, 看到了不少关于兼容性的解决方案,恰好需要一个弹出的model做一下Date&Time的Pick Up,考虑了一下是打开新界面还是用弹出Dialog…
提供两个UIAlertController的帖子:
http://www.awnlab.com/archives/2516.html
http://blog.youkuaiyun.com/liangliang103377/article/details/40078015
最终还是决定用ActionSheet来解决问题,对于用户流程会更简单一些。
于是在github上找到了这个:ActionSheetPicker
通过pod安装:
pod 'ActionSheetPicker-3.0', '~> 1.6.1'
ActionSheetPicker的特性
- 通杀(Universal)
– iPhone/iPod ActionSheetPicker = ActionSheetPicker = A Picker + UIActionSheet
– iPad ActionSheetPicker = A Picker + UIPopoverController - 提供四种Picker组合
– ActionSheetStringPicker
– ActionSheetDistancePicker
– ActionSheetDatePicker
–ActionSheetCustomPicker
Benefits
- Spawn pickers with convenience function - delegate or reference not required. Just provide a target/action callback.
- Add buttons to UIToolbar for quick selection (see ActionSheetDatePicker below)
- Delegate protocol available for more control
- Universal (iPhone/iPod/iPad)
并且在代码中提供了大量Example:
丰富的交互以及快捷的API, 大大提高了效率