LoginSignup
0
1

More than 3 years have passed since last update.

Swift if文の中にアラートを入れる方法

Last updated at Posted at 2019-09-12

自分用のメモです。

ネットで多く用いられている方法を使うとif文の中にアラートを入れられないのですが、以下のコードで試したところうまく行きました。

ViewVontroller.swift
//if分の中に挿入しても問題なく出せる。
let alert = UIAlertView()
alert.title = "Title"
alert.message = "My message"
alert.addButton(withTitle: "Ok")
alert.show()
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1