#author("2017-01-24T14:53:21+09:00","default:wikiwriter","wikiwriter")
&tag(UIKit/アラート);
*目次 [#tb611134]
#contents
*関連ページ [#ab6a3b4a]
-[[UIKit]]

*参考情報 [#xcd186c0]


*ダイアログを表示する [#h0b16a92]
-iOS 9以降UIAlertViewが非推奨。UIAlertControllerを使用する。
#pre{{
        let alertConroller = UIAlertController(
            title: "タイトル",
            message: "メッセージ",
            preferredStyle: UIAlertControllerStyle.Alert
        )
        alertConroller.addAction(UIAlertAction(title:"OK", style:UIAlertActionStyle.Default, handler: nil))
        presentViewController(alertConroller, animated: true, completion: nil)
}}


*メモリ管理 [#b0a421bc]

**循環参照について [#e3d048b9]
-[[Objective-C - 【swift】循環参照の見つけ方について(29931)|teratail:https://teratail.com/questions/29931]]にあるとおり、alertControllerをプロパティとして保持しない限り、ブロック内でselfをキャプチャしても循環参照は派生しない。

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS