본문 바로가기
iOS/설명

[iOS] present로 화면 이동 시 full screen으로 이동

by Sky Titan 2021. 2. 3.
728x90

 

 일반적으로 present메서드로 다른 ViewController로 이동하면 위에 틈이 비어있는 형태로 이동하게 된다. 완전히 꽉찬 형태로 화면 이동을 하고 싶다면 이동하려는 ViewController 객체에 modlPresentationStyle을 지정한다.

 

 @IBAction func click(_ sender: Any) {
  
        let vc2 = ViewController2()
        vc2.text = "이동 완료"
        vc2.modalPresentationStyle = UIModalPresentationStyle.fullScreen
        present(vc2, animated: true, completion: nil)
        
        print(presentingViewController)
    }

 

결과

 완전히 꽉찬 형태로 이동가능하다.

728x90

'iOS > 설명' 카테고리의 다른 글

[iOS] UIControl  (0) 2021.04.25
[iOS] 코코아 터치 프레임워크 (Cocoa Touch Framework)  (0) 2021.04.22
[iOS] frame과 bounds의 차이  (0) 2021.01.21
[iOS] UIView의 clipToBounds  (0) 2021.01.21
[iOS] UIViewController Life Cycle (생명주기)  (0) 2021.01.20

댓글