You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
안타깝게도 nib파일을 열어보는건 유로 프로그램이라 확인을 해보지 못했지만 스토리보드 파일을 소스코드로 확인해보면 viewcontroller와 view의 ID로 파일명이 생성된것을 확인할 수 있다.
storyboardc 파일에 함께 생성되는 info.plist 파일을 확인해보면 아래 3개의 파일명이UIViewControllerIdentifiersToNibNames인 것을 확인할 수 있다. 그리고 해당 value 값은 storyboard ID의 값과 동일한것도 확인할 수 있다.
스토리보드와 xib
일반적으로 스토리보드에서 여러 뷰 컨트롤러들을 만들어서 앱의 화면과 전체적인 플로우를 구성하고 table view cell, collection view cell, custom view들을 xib파일로 만들어서 사용하는데 이 둘은 정확하게 어떤 차이가 있는 것일까?
우선 컴파일 이후 생성되는 파일을 확인해보면 xib 파일은
nib
으로 스토리보드는stroyboardc
로 변경되는 것을 확인할 수 있다.storyboardc
파일에 생성된 저 의문의 nib파일들은 무엇일까?안타깝게도 nib파일을 열어보는건 유로 프로그램이라 확인을 해보지 못했지만 스토리보드 파일을 소스코드로 확인해보면 viewcontroller와 view의 ID로 파일명이 생성된것을 확인할 수 있다.
storyboardc 파일에 함께 생성되는 info.plist 파일을 확인해보면 아래 3개의 파일명이UIViewControllerIdentifiersToNibNames인 것을 확인할 수 있다. 그리고 해당 value 값은 storyboard ID의 값과 동일한것도 확인할 수 있다.
그럼 이제 스토리보드에서 Segue가 아닌 navigation push로 구현할 때 identifier를 설정해야 했던 이유를 명확히 알 수 있다!
그럼 xib 파일을 컴파일 했을때도 nib파일이 생성되고 스토리보드를 컴파일 했을 때도 nib파일들과 info.plist 파일이 생성되는데 그 둘의 차이는 무엇일까?
스토리보드와 xib파일을 모두 소스코드로 확인해보면 xml로 표현된 xib파일임을 알 수 있다.
그럼 스토리보드와 xib는 무엇이 다른걸까?
우리가 일반적으로 xib파일로 생성하는 cell, custom view들은 하나의 뷰 정보만 포함하고 있는 반면 스토리보드는 여러 뷰 컨트롤러 xib파일들과 뷰 관계정보들을 포함하고 있는 파일로 구성되어 있다
The text was updated successfully, but these errors were encountered: