[iOS 오토레이아웃 가이드] Advanced Auto Layout - Programmatically Creating Constraints코드로 오토리아웃을 구현하는 방법은 3가지 입니다. Layout AnchorsView의 다양한 Anchor들을 가지고 하는 방식입니다. topAnchor, bottomAnchor, heightAnchor등이 있습니다. topAnchor는 뷰의 top edge를 가리킵니다.https://developer.apple.com/documentation/uikit/uiview - Creating Constraints Using Layout Anchors 보시면 모든 anchors가 나와있습니다. 3개 방법 중 가독성이 좋다고 생각합니다. apple 문서에 나와있는 예제를 보도록..
[iOS 오토레이아웃 가이드] Debugging Auto Layout - Debugging Tricks and TipsUnderstanding the LogsView의 제약조건에 관한 정보는 콘솔에 출력됩니다. unsatisfiable layout이 있거나 constraintAffectingLayoutForAxix(Orientation)을 썼을 때 콘솔에 출력됩니다. 다음은 예입니다.2015-08-26 14:27:54.790 Auto Layout Cookbook[10040:1906606] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you do..
[iOS 오토레이아웃 가이드] Debugging Auto Layout - Logical ErrorsLogical Error에 도움 될만한 의견들...- 현재 존재하는 제약조건들을 살펴보기. 어떤 제약조건도 놓치진 않았는지 혹은 예기치 않게 원하지 않는 제약조건이 추가됐는지 확인하기. 뒤로가기나 drag and drop할 때 많이 생김 그러니 제약조건이 정확한 뷰와 속성에 추가됐는지 확인하기 - 뷰 프레임 확인하기. 백그라운드 확인하기. Show layout rectangles켜서 확인 가능 혹은 컬러 주기. 특히 레이블이나 버튼처럼 text를 가진 뷰들의 baseline으로 정렬할 경우 해당 뷰가 intrinsic content height를 가지고 있는 지 확인하기 intrinsic content he..