色んなとこで同じようなアラート出すことが稀によくあるので、AlertControllerを別クラスに分けて使い回す方法を少し調べてみました。
他にもカテゴリを使うなどやり方は色々あるみたいですが、これが一番簡単そうだったのでこのやり方でやってみました。
ソースコード
Util.h
@interface Util : NSObject
+ (void)dispOKAlert:(UIViewController*)viewController
   title:(NSString*)titleText
 message:(NSString*)messageText
  actionFunc:(void(^)(UIAlertAction *alertAction))actionFunc;
@end
Util.m
@implementation Util
+ (void)dispOKAlert:(UIViewController*)viewConrtroller
   title:(NSString*)titleText
 message:(NSString*)messageText
  actionFunc:(void(^)(UIAlertAction *alertAction))actionFunc
{
    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:titleText
                                                                             message:messageText
                                                                      preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction * alertAction =
    [UIAlertAction actionWithTitle:@"OK"
                             style:UIAlertActionStyleDefault
                           handler:actionFunc];
    [alertController addAction:alertAction];
    [viewController presentViewController:alertController animated:YES completion:nil];
}
@end
呼び出す方
[Util dispOKAlert:self title:@"Title" message:@"Message"
           actionFunc:^(UIAlertAction *alertAction){ 
/*OKボタンが押された時の処理*/
}];
今回はOKボタンだけのシンプルなものですが、
同じ感じでキャンセルボタン追加したり、styleを変えてActionSheetにしたりできます。
弁明
まだ始めたばかりで間違っている箇所があるかもしれません。
何か間違っている点があれば編集リクエスト等で指摘していただければ幸いです。
参考サイト
[Objective-C] UIAlertControllerをがんばってメソッドにしてみた: スタジオプリズム㐧3ブログ