【アプリ開発】iOS 8とiOS 7でUIAlertController・UIAlertView・UIActionSheetを切り替えて使う方法 @akio0911です。今までお世話になったUIAlertViewとUIActionSheetがiOS 8からはdeprecatedになり、新たにUIAlertControllerというクラスが導入されるということで、iOS 7の時はUIAlertViewとUIActionSheet、iOS 8の時はUIAlertControllerを使うコードを書いてみました。 UIAlertControllerが使えるか確認する まずはUIAlertControllerが使えるか使えないかで、iOS 7かiOS8 かを判定します。 Class class = NSClassFromString(@"UIAlertController"); if(class)
![【アプリ開発】iOS 8とiOS 7でUIAlertController・UIAlertView・UIActionSheetを切り替えて使う方法 - 卵は世界である](https://cdn-ak-scissors.b.st-hatena.com/image/square/9bea5a4b014cac45f94fd500d762297497992ddb/height=288;version=1;width=512/https%3A%2F%2Fegg-is-world.com%2Fwp-content%2Fuploads%2F2014%2F08%2F20140807-182914.jpg)