본문 바로가기

Development/IOS & Mac

ViewController를 View처럼 넣기~!

간혹 ViewController로 만들어진 라이브러리를 합쳐서 사용하고 싶을 때가 있다.

하지만 view만 가져와서 넣으면 정상적으로 작동하지 않는다. 


정상적으로 작동하게 하려면 아래와 같이 viewController를 넣어주면 된다.


[self addChildViewController:imagePickerViewController];

[self.view addSubview:imagePickerViewController.view];