TIL 32

오늘 한 일 / 배운점

  • 9/18 14:30 실시간 세션 : IT 직군 확장 (커리어개발팀 HS매니저님)

    → 이번 부트 캠프를 통해서 무조건 개발자로만 가야 하는 게 아니라 다른 직무를 선택할 수도 있음
    개발 실력이 떨어져서 다른 직무로 눈을 돌리라는 것이 아닌
    개발 실력을 겸하면 개발자가 아니어도 선택지가 무궁무진해진다는 것..
    IT 유사 직무로 첫 커리어를 시작할 수도 있다

    PM : Product Manager 프로덕트(제품)를 매니징(관리) 하는 직무. 기획
    PM은 모든 이해관계자의 요구를 충족하는 제품을 만들기 위해
    회사, 고객 및 제품 팀 간의 커뮤니케이션 및 다리 역할 함
    개발자와 자주 소통하고 마감 직전의 개발자들의 일정을 조율해 주는 게 PM의 역할
    개발 베이스가 조금이라도 있으면 합리적인 솔루션 제공 가능
    디자이너들과도 협업을 많이 함

    SI : System Integration 다양한 프로젝트 경험 가능
    온보딩 하고 바로 프로젝트 형식으로 투입, 업무 강도 높은 편이라 느낄 수 있지만
    초기 업무 빠르게 배울 수 있는 장점

    QA : Quality Assuarance IT업계에서 솔루션 업체나 게임 개발사 등 자사의 제품 기능을 검증하고 관리하기 위한 QA 팀을 별도로 두고 운영함
    프로젝트 시작과 마무리까지 모든 과정을 함께 기획하고 올바른 방향을 찾고 품질 저하 요소를 발견하여
    해당 프로젝트의 품질을 올리는데 주 목적을 가지고 있음

  • iOS 앱개발 심화 개인 과제(~9/22 14:00)

과제

  • iOS 앱개발 심화 개인 과제(~9/22 14:00)

느낀점

뻘짓 1:

EntryView라는 UIView를 만들고

override init(frame: CGRect) {
    super.init(frame: frame)
    backgroundColor = .darkGray
}

이런 식으로 배경색을 지정했는데 배경색이 반영되지 않았다.
원인은 EntryView의 크기를 내가 지정해 주지 않았기 때문

entryView.snp.makeConstraints { make in
    make.edges.equalToSuperview()
}

이렇게 뷰의 가장자리를 부모 뷰의 가장자리와 맞춰주니 아주 잘 보인다
내가 아무리 별짓을 다해도 정작 뷰의 크기를 안정하면 0x0인 거나 마찬가지겠지..
크기 지정.. 기억하자

뻘짓 2:

1

나는 이렇게 부모 뷰의 x, y 축 중심에 entryBtnOne을 두고
entryBtnOne으로부터 20 위로 titleLabel
entryBtnOne으로부터 15 아래로 entryBtnTwo를 두고 싶었다

*** Terminating app due to uncaught exception 'NSGenericException', reason: 'Unable to activate constraint with anchors <NSLayoutYAxisAnchor:0x600001701480 "UILabel:0x10bf08460.bottom"> and <NSLayoutYAxisAnchor:0x600001700b80 "UIButton:0x10bf0b5c0'과제1
(ProfileDesignView)'.top"> because they have no common ancestor.  Does the constraint or its anchors reference items in different view hierarchies?  That's illegal.'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001804658a8 __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x000000018005c09c objc_exception_throw + 56
	2   CoreAutoLayout                      0x00000001ab19c430 -[NSLayoutConstraint setActive:] + 0
	3   CoreAutoLayout                      0x00000001ab19c574 +[NSLayoutConstraint _addOrRemoveConstraints:activate:] + 296
	4   SnapKit                             0x000000010412e770 $s7SnapKit10ConstraintC16activateIfNeeded16updatingExistingySb_tF + 1888
	5   SnapKit                             0x0000000104143cb4 $s7SnapKit15ConstraintMakerC15makeConstraints4item7closureyAA06LayoutC4Item_p_yACXEtFZ + 256
	6   SnapKit                             0x000000010414abac $s7SnapKit17ConstraintViewDSLV15makeConstraintsyyyAA0C5MakerCXEF + 96
	7   assignment01                        0x0000000102a0bf50 $s12assignment019EntryViewC5frameACSo6CGRectV_tcfc + 644
	8   assignment01                        0x0000000102a0c980 $s12assignment019EntryViewC5frameACSo6CGRectV_tcfcTo + 56
	9   assignment01                        0x0000000102a082ec $sSo6UIViewCABycfcTO + 24
	10  assignment01                        0x0000000102a07b1c $sSo6UIViewCABycfC + 32
	11  assignment01                        0x0000000102a09278 $s12assignment0119EntryViewControllerC7nibName6bundleACSSSg_So8NSBundleCSgtcfc + 120
	12  assignment01                        0x0000000102a09488 $s12assignment0119EntryViewControllerC7nibName6bundleACSSSg_So8NSBundleCSgtcfcTo + 168
	13  assignment01                        0x0000000102a0975c $sSo16UIViewControllerCABycfcTO + 24
	14  assignment01                        0x0000000102a08b38 $sSo16UIViewControllerCABycfC + 32
	15  assignment01                        0x0000000102a0d148 $s12assignment0113SceneDelegateC5scene_13willConnectTo7optionsySo7UISceneC_So0I7SessionCSo0I17ConnectionOptionsCtF + 232
	16  assignment01                        0x0000000102a0d3d0 $s12assignment0113SceneDelegateC5scene_13willConnectTo7optionsySo7UISceneC_So0I7SessionCSo0I17ConnectionOptionsCtFTo + 84
	17  UIKitCore                           0x000000010451bca4 +[UIScene _sceneForFBSScene:create:withSession:connectionOptions:] + 1012
	18  UIKitCore                           0x0000000104ff533c -[UIApplication _connectUISceneFromFBSScene:transitionContext:] + 804
	19  UIKitCore                           0x0000000104ff5624 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 356
	20  UIKitCore                           0x0000000104aec704 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 260
	21  FrontBoardServices                  0x000000018544d014 -[FBSScene _callOutQueue_didCreateWithTransitionContext:completion:] + 296
	22  FrontBoardServices                  0x0000000185475acc __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke.82 + 224
	23  FrontBoardServices                  0x0000000185459bb4 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 160
	24  FrontBoardServices                  0x0000000185475844 __92-[FBSWorkspaceScenesClient createSceneWithIdentity:parameters:transitionContext:completion:]_block_invoke + 284
	25  libdispatch.dylib                   0x0000000102c1993c _dispatch_client_callout + 16
	26  libdispatch.dylib                   0x0000000102c1d534 _dispatch_block_invoke_direct + 392
	27  FrontBoardServices                  0x0000000185498fa0 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 44
	28  FrontBoardServices                  0x0000000185498e7c -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 196
	29  FrontBoardServices                  0x0000000185498fd4 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 24
	30  CoreFoundation                      0x00000001803c669c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
	31  CoreFoundation                      0x00000001803c65e4 __CFRunLoopDoSource0 + 172
	32  CoreFoundation                      0x00000001803c5dac __CFRunLoopDoSources0 + 320
	33  CoreFoundation                      0x00000001803c043c __CFRunLoopRun + 768
	34  CoreFoundation                      0x00000001803bfd28 CFRunLoopRunSpecific + 572
	35  GraphicsServices                    0x000000018986ebc0 GSEventRunModal + 160
	36  UIKitCore                           0x0000000104ff3fdc -[UIApplication _run] + 868
	37  UIKitCore                           0x0000000104ff7c54 UIApplicationMain + 124
	38  UIKitCore                           0x00000001044b9ab8 __swift_destroy_boxed_opaque_existential_1Tm + 12244
	39  assignment01                        0x0000000102a0aaa4 $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 120
	40  assignment01                        0x0000000102a0aa1c $s12assignment0111AppDelegateC5$mainyyFZ + 44
	41  assignment01                        0x0000000102a0ab78 main + 28
	42  dyld                                0x0000000102b91558 start_sim + 20
	43  ???                                 0x0000000102da6058 0x0 + 4342833240
	44  ???                                 0x4106800000000000 0x0 + 4685573199813935104
)
libc++abi: terminating due to uncaught exception of type NSException

이런 무시무시한 에러가 남..

addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
    make.centerX.equalToSuperview()
    make.bottom.equalTo(entryBtnOne.snp.top).offset(-20) // 문제원인
}

addSubview(entryBtnOne)
entryBtnOne.snp.makeConstraints { make in
    make.centerX.equalToSuperview()
    make.centerY.equalToSuperview()
    make.width.equalTo(200)
    make.height.equalTo(90)
}

addSubview(entryBtnTwo)
entryBtnTwo.snp.makeConstraints { make in
    make.centerX.equalToSuperview()
    make.top.equalTo(entryBtnOne.snp.bottom).offset(15)
    make.width.equalTo(200)
    make.height.equalTo(90)
}

이것도 알고보니 매우 단순한 문제였다.
생각을 해보니 코드는 순차적으로 내려올 텐데 entryBtnOne이 아직 정의되지도 않았는데
먼저 titleLabel을 없는 entryBtnOne를 기준으로 제약조건을 잡으려고 했던 게 문제였다 ㄱ-

addSubview(entryBtnOne)
entryBtnOne.snp.makeConstraints { make in
    make.centerX.equalToSuperview()
    make.centerY.equalToSuperview()
    make.width.equalTo(200)
    make.height.equalTo(90)
}

addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
    make.centerX.equalToSuperview()
    make.bottom.equalTo(entryBtnOne.snp.top).offset(-20)
}

addSubview(entryBtnTwo)
entryBtnTwo.snp.makeConstraints { make in
    make.centerX.equalToSuperview()
    make.top.equalTo(entryBtnOne.snp.bottom).offset(15)
    make.width.equalTo(200)
    make.height.equalTo(90)
}

이렇게 titleLabelentryBtnOne뒤로 위치를 바꿔주니

2

잘 나온다

현재 진행중 :

3

분명 나는 내비게이션바와 탭바를 과제1 View 안에다 지정했는데
어째서 과제 2에서도 내비게이션바와 탭바가 보이는 것인가…

그리고 tabBarItem은 왜 탭바 위로 튀어나오는 것인가
과제 필수 구현에서 present 방식으로 하라 그래서
그래서 아랫부분이 잘려서 위로 튀어나온 건가?
근데 그러면 push 방식으로 넘어가는 과제2 View에선 왜 튀어나오는 것이여 😞
대체 뭘까.. 왜…