반응형
1. 스토리보드 사용
//Storyboard ID에 이름 설정 후("MainViewController") let storyboard = UIStoryboard(name: "Main", bundle: nil) let mainVC: MainViewController = storyboard.instantiateViewController(withIdentifier: "MainViewController") as! MainViewController mainVC.arg1 = arg1//넘기는 파라미터 mainVC.modalPresentationStyle = .fullScreen//전체화면(기본은 팝업형태) self.present(mainVC, animated: true, completion: nil)
2. Xib 사용
let vc:MainViewController = MainViewController() vc.modalPresentationStyle = .fullScreen vc.delegate = self self.present(vc, animated: false, completion: nil)
3. 투명 ViewController
//띄우기 let transVC = TransViewController() transVC.modalPresentationStyle = .overCurrentContext self.present(transVC, animated: true, completion: nil) //TransViewController override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = UIColor.init(red: 0, green: 0, blue: 0, alpha: 0.4) view.isOpaque = false //... }
반응형
'아이폰' 카테고리의 다른 글
Swift Outline UILabel (0) | 2021.11.20 |
---|---|
Swift Dispatch async, asyncAfter (0) | 2021.11.20 |
Swift Post 통신, VO <-> Json(Codable 사용) (0) | 2021.11.18 |
Swift Alert, Confirm(얼럿, 컨펌 확인창) (0) | 2021.11.18 |
IOS Swift AES(128, 192, 256) 암복호화 (0) | 2021.11.18 |
최근댓글