UIViewController
-
[iOS] ํ์ ์๋ฆผ์ฐฝ ๊ตฌํ ์ค ๋ฐ์ํ Cannot be called with asCopy = NO on non-main thread. ๋ฌธ์ ํด๊ฒฐiOS 2022. 7. 7. 01:21
๋๋ ์๋ ๋ณดํต ํ์ ์๋ฆผ์ฐฝ์ ๋ค์๊ณผ ๊ฐ์ด UIViewController์ extension์ผ๋ก ๋ง๋ค์ด์ ์ฌ์ฉํ๊ณค ํ๋ค. import UIKit extension UIViewController { func alert(title: String = "์๋ฆผ", message: String, okTitle: String = "ํ์ธ", handler: ((UIAlertAction) -> Void)? = nil) { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) let okAction = UIAlertAction(title: okTitle, style: .default, handler: handler) ale..