tag:blogger.com,1999:blog-44155363323321357062024-02-21T00:05:56.567+09:00SPARROWAPPSsparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.comBlogger350125tag:blogger.com,1999:blog-4415536332332135706.post-59083214540992396192020-04-16T09:43:00.001+09:002020-04-16T09:43:27.689+09:00Objective C로 만들어진 프로젝트에서 swift 사용하기기존에 Objective C로 구현되어 있는 App 에 신규 기능을 추가 해야 하는데 swift로 하고 싶으면?<br />
<br />
<br />
1. Xcode Project -> Target -> Build Settings -> Defines Modules 'Yes'<br />
Xcode Project -> Target -> Build Settings -> Swift Language Version 5<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbtkBXqgDqPepi5cm_ovUbFd-DjWhJmBkrKAASl_OhObVOBhZspBSml-TYvThTkRwtzDzmhHhApyIS0cglSpPmUmeW6oKyQOKhgycERukQjPbwBwGKAnlo-xM5o3J_i1ZkiJntkdeMfUs/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2020-04-16+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.32.26.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbtkBXqgDqPepi5cm_ovUbFd-DjWhJmBkrKAASl_OhObVOBhZspBSml-TYvThTkRwtzDzmhHhApyIS0cglSpPmUmeW6oKyQOKhgycERukQjPbwBwGKAnlo-xM5o3J_i1ZkiJntkdeMfUs/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2020-04-16+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.32.26.png" /></a><br />
<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj8l0XzZCaLn4QyzN6d0PHh-vbHJ4tKe_EiP3TwDq21z6zp0y5HqKwJiBhvFMbDgVtEtAPHmzzjUFXFjjYl2MwXdBlDvXKKJUJZNVC9Vrd1YPPTkDBlG2EZnQUjZlE80Prv7JPJAP2rW4/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2020-04-16+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.32.52.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj8l0XzZCaLn4QyzN6d0PHh-vbHJ4tKe_EiP3TwDq21z6zp0y5HqKwJiBhvFMbDgVtEtAPHmzzjUFXFjjYl2MwXdBlDvXKKJUJZNVC9Vrd1YPPTkDBlG2EZnQUjZlE80Prv7JPJAP2rW4/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2020-04-16+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.32.52.png" /></a><br />
<br />
2. Swift Code 추가<br />
<br />
3. Objective C 에서 swift 함수를 사용할 경우 @objc func , 프로퍼티를 참조 할 경우 @objc var<br />
<br />
4. Swift에서 기존 Objective C 모듈에 연동이 필요한 경우<br />
프로젝트이름-Bridging-Header.h 에 #import 추가<br />
<br />
이 과정을 거치고 나면 objective c / swift를 함께 이용할 수 있다.<br />
ojbective c 에서 swift 로 만든 ViewController를 이용하고 swift로 만든 ViewController에서 기존 objective c 모듈에 기능을 이용 할 수 있다.<br />
<br />
<br />
<br />
<br />sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-56419031152061659722019-10-03T15:42:00.002+09:002019-10-03T15:42:53.093+09:00Xcode 11 storyboard 앱에서 swiftUI 함께 쓰기iOS 개발에 많은 변화 들이 있었다.<br />
<br />
xib에서 storyboard<br />
Objective C에서 swift<br />
그리고 swift 버젼업들<br />
<br />
storyboard에 auto resize 에서 auto layout<br />
<br />
그리고 또 swift 버젼업<br />
<br />
계속해서 바뀌고 바뀌고 나름대로 즐겁게 따라 갔다.<br />
<br />
그런데 swiftUI 이번에 한번더 완전 새로와 지는듯 하다.<br />
<br />
Xcode 11이 릴리즈 되어 맛볼수 있으나<br />
macOS를 카탈리나로 업그레이 하지 않아 미리보기 창이 되지 않는다.<br />
<br />
Xcode 11로 새프로젝트를 만들면 디폴트가 swiftUI다<br />
<br />
언젠가는 늘 그렇듯이 대세가 될것이다.<br />
<br />
하지만 지금은 마음의 준비가 되지 않았고 익숙한 스토리보드를 좀더 쓸듯 하다.<br />
<br />
그래서 스토리보드 기반 프로젝트에 간단한 UI만 swiftUI를 쓰고 싶은 생각이 들어<br />
이래저래 리서치를 하고 아래와 같은 방법으로 간단하게 이용할 수 있음을 알게 되었다.<br />
<br />
<br />
<br />
1. 프로젝트 시작은 storyboard<br />
<br />
2. 디폴트로 생성된 ViewController에 ContainerView를 추가<br />
<br />
3. ContainerView와 연결된 ViewController를 삭제<br />
<br />
4. 스토리보드에 HostingViewController를 추가<br />
<br />
5. ContainerView와 HostingViewController를 Embed Segue로 연결<br />
<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMu9WJed3g9tprcr2uyavFJcDOM7yI22YPzgz_I9pxSaksSwvWoE3wKhcs5c_NKcqGvIE5pFGnHVOvFRgmPe5igSyVVa8x0Q-yJx2Zdzg28vYT44ugt7rW-2Nj0SXJlFG83h84DEl0L38/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-10-03+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+3.27.22.png" imageanchor="1"><img border="0" height="387" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMu9WJed3g9tprcr2uyavFJcDOM7yI22YPzgz_I9pxSaksSwvWoE3wKhcs5c_NKcqGvIE5pFGnHVOvFRgmPe5igSyVVa8x0Q-yJx2Zdzg28vYT44ugt7rW-2Nj0SXJlFG83h84DEl0L38/s640/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-10-03+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+3.27.22.png" width="640" /></a><br />
<br />
<br />
6. New 메뉴로 swiftUI 를 하나 추가<br />
기본적으로 hello world 코드가 되어 있는 SwiftUI 파일 그대로 이용한다.<br />
<br />
7. 스토리보드에 EmbedSegue를 ViewController 코드로 연결 한다.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRoq6dxqMBMdL_bFCd6wT_RE9YyXmRAlBHzohNxnafRJ0FB-ZW-798CxHftpZ1uK-FfO7HiDtwNQHsKVHuY7Xtj3__0eIOrafud8simFbBJawUrlqs2l-ryZDHSYEhUMC1dpqUVUDcMiE/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-10-03+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+3.32.02.png" imageanchor="1"><img border="0" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRoq6dxqMBMdL_bFCd6wT_RE9YyXmRAlBHzohNxnafRJ0FB-ZW-798CxHftpZ1uK-FfO7HiDtwNQHsKVHuY7Xtj3__0eIOrafud8simFbBJawUrlqs2l-ryZDHSYEhUMC1dpqUVUDcMiE/s640/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-10-03+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+3.32.02.png" width="640" /></a><br />
<br />
<div style="background-color: #1f1f24; color: #d0a8ff; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>@IBSegueAction</b></span><span style="color: rgba(255 , 255 , 255 , 0.85);"> </span><span style="color: #fc5fa3;"><b>func</b></span><span style="color: rgba(255 , 255 , 255 , 0.85);"> </span><span style="color: #41a1c0;">addSwiftUIView</span><span style="color: rgba(255 , 255 , 255 , 0.85);">(</span><span style="color: #fc5fa3;"><b>_</b></span><span style="color: rgba(255 , 255 , 255 , 0.85);"> coder: </span>NSCoder<span style="color: rgba(255 , 255 , 255 , 0.85);">) -> </span>UIViewController<span style="color: rgba(255 , 255 , 255 , 0.85);">? {</span></div>
<div style="background-color: #1f1f24; color: rgba(255, 255, 255, 0.85098); font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>return</b></span> <span style="color: #d0a8ff;">UIHostingController</span>(coder: coder, rootView: <span style="color: #9ef1dd;">SwiftUIView</span>())</div>
<br />
<div style="background-color: #1f1f24; color: rgba(255, 255, 255, 0.85098); font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<br />
자이제 run을 해보면 시작 ViewController에 ContainerView가 SwiftUI로 동작 한다.<br />
<br />
요방법으로 당분간 짬뽕해서 쓰다가<br />
swiftUI가 되세가 되면 익숙해 지겠지...<br />
<br />
실행화면과 프로젝트 구성된 파일들은 다음과 같다.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYEmValBpkSTLjoKmvsQyFLlifeZGgLhcFGX920FnaFdzgDAAiJQ0SSlTtsjkZ1qfO8T8U68Eavs6bs_iyAonYwCj77AlWHaff2S8aXcVU0-rN9pc9ysvgH2BEC5crx_C8KvjHSlrqaBk/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-10-03+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+3.41.22.png" imageanchor="1"><img border="0" height="494" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYEmValBpkSTLjoKmvsQyFLlifeZGgLhcFGX920FnaFdzgDAAiJQ0SSlTtsjkZ1qfO8T8U68Eavs6bs_iyAonYwCj77AlWHaff2S8aXcVU0-rN9pc9ysvgH2BEC5crx_C8KvjHSlrqaBk/s640/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-10-03+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+3.41.22.png" width="640" /></a>sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-59244604141197382682019-05-04T15:18:00.000+09:002019-05-07T19:44:19.737+09:00Xcode Server 를 이용한 CI (Continuous Integration)<h2>
Xcode Sever 를 이용한 CI (Continuous Integration)</h2>
<br />
Xcode로 개발 하면서 bitbucket에 있는 repository에 프로젝트를 자동으로 내려 받아 빌드 하고 테스트 하는 CI를 설정 하고 사용 하는 방법을 기록으로 남겨 본다.<br />
<br />
<h4>
Xcode 서버 활성</h4>
<br />
Xcode 서버를 활성 시키려면<br />
Xcode -> Preference -> Server & Bots<br />
<img src="blob:https://www.blogger.com/745c3d4f-8278-4d6c-82d0-e549fb175eff" /><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2fe3HRSkWCbvKsxtZ7ZMdSeSVmyaWUee-77CmyZDZn_JFP2QlfEG4EYA6wpIIUCMiTOwxXF7A5ZCOe2a8AHgRUdEwYHoaasFARFWZ4zuSSrebFpKEYflY1jgLhy3tWW04s7NIhekOOpA/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-05-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+7.40.42.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="224" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2fe3HRSkWCbvKsxtZ7ZMdSeSVmyaWUee-77CmyZDZn_JFP2QlfEG4EYA6wpIIUCMiTOwxXF7A5ZCOe2a8AHgRUdEwYHoaasFARFWZ4zuSSrebFpKEYflY1jgLhy3tWW04s7NIhekOOpA/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-05-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+7.40.42.png" width="320" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
스위치를 켜기만 하면 끝이다.<br />
<br />
이제 Account로 가서 Xcode Server를 추가 한다.<br />
<br />
<img src="blob:https://www.blogger.com/f2ec4640-5457-4b19-ab11-f6b0e267a9c0" /><br />
<br />
<br />
<h4>
Bot 설정</h4>
<br />
이제 비트 버킷으로 관리 되는 프로젝트를 클론 하여 Xcode로 열어 본다.<br />
<br />
cocoapod 을 이용하여 xcworkspace로 열려진 프로젝트의 경우<br />
.xcworkspace는 git으로 관리 하지 않는 상황에서 Xcode Server가 스스로 pod install 및 .xcworkspace를 로드 하여 프로젝트를 빌드 하고 테스트 하는 방법을 기술 한다.<br />
<br />
bitbucket으로 클론 하면 xcworkspace가 존재 하지 않는다.<br />
.xcworkspace는 git으로 add 하지 않고 관리 하지 않기 때문이다.<br />
<br />
# pod install을 수행한다.<br />
# open projectname.xcworkspace 로 워크스페이스를 연다.<br />
<br />
워크스페이스로 열고 Xcode bot을 설정 하는 이유는 단지 bitbucket 의 url을 자동으로 열기 위함이었다.<br />
<br />
상관 없다.<br />
<br />
Product->Create Bot 으로 봇을 생성 한다.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG2T1o_A-EqbdiiBGE-wEU7ymLQ5GeORvL3EU3Rsxx_zMFb2NO9kz2G-2Pe25_b7Rd48jCImdcN_Kfmf5ON2PKVKfcp21KYGUVXZrBDgwVxSTbB4A3FrRSRGtRDfmlkGnHe_YBK1f5P74/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-05-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+7.41.59.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="183" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG2T1o_A-EqbdiiBGE-wEU7ymLQ5GeORvL3EU3Rsxx_zMFb2NO9kz2G-2Pe25_b7Rd48jCImdcN_Kfmf5ON2PKVKfcp21KYGUVXZrBDgwVxSTbB4A3FrRSRGtRDfmlkGnHe_YBK1f5P74/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-05-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+7.41.59.png" width="320" /></a><br />
<img src="blob:https://www.blogger.com/df63e3ae-d925-4215-b442-8c7b7619c9c5" /><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
워크스페이스를 연 이유는 자동으로 bitbucket 설정 을 위해서 였다.<br />
<br />
<img src="blob:https://www.blogger.com/ef96ce82-a7fe-4239-8e81-e4640e3a6d2b" /><br />
<br />
<br />
<img src="blob:https://www.blogger.com/79e5e60c-4806-4b1d-8ba1-da3e30824a7f" /><br />
<br />
<br />
CI 스케줄을 정한다. 매시간 이 디폴트이다.<br />
<br />
<img src="blob:https://www.blogger.com/18b7168c-0b6f-461a-badb-eced2b9ac2b8" /><br />
<br />
<br />
테스트를 하는 시뮬레이터 및 디바이스를 선택 하는 단계 모든 디바이스와 모든 시뮬레이터를 설정 할 경우 Xcode Server가 빌드하고 테스트 하는동안 수많은 시뮬레이터 와 CPU 점유을 맥머신에 이륙 소리를 만날 것이다. 특정된 모델만 선택 하는 것을 강추 한다.<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4WgnKKQgoFLJUkY69orDYZsS1jetYT_jcqjbmP8JWwMIf8jB_AhyphenhyphenR5BiMUD62GbcUbROkiVlvU-MXXMyTLnJU5Hbk_G36Ez_XGIXPTTuptVusjGcghozCt132SyeS8HXf4BpfoohtViU/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-05-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+7.43.50.png" imageanchor="1"><img border="0" height="202" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4WgnKKQgoFLJUkY69orDYZsS1jetYT_jcqjbmP8JWwMIf8jB_AhyphenhyphenR5BiMUD62GbcUbROkiVlvU-MXXMyTLnJU5Hbk_G36Ez_XGIXPTTuptVusjGcghozCt132SyeS8HXf4BpfoohtViU/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-05-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+7.43.50.png" width="320" /></a><br />
<img src="blob:https://www.blogger.com/8fc51ba6-7152-4c77-8edf-1b6037c69f92" /><br />
<br />
<br />
<br />
인증 서 단계등을 완료 하고 나면 봇이 생성 된다.<br />
<br />
봇이 완료되면 바로 integration을 수행하는데 100% 실패 한다.<br />
<br />
이유는 cocoa pod 프로젝트 그리고 .xcworkspace를 bitbucket에 pull 하지 않았기 때문에 빌드 과정에서 에러가 발생 한다. projectname.xcworkspace 파일이 없기 때문에 실패 하는 것이다.<br />
<br />
<img src="blob:https://www.blogger.com/08796845-7db6-4650-85f1-88ddb53c3d25" /><br />
<br />
<br />
상단에 Edit bot을 클릭 한다.<br />
맨 오른쪽 Trigger를 선택 한다.<br />
하단 + 버튼을 클릭 하여<br />
<br />
pre-integration script를 생성 한다.<br />
<br />
<div style="background-color: #1f1f24; color: #6c7986; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<i>#!/bin/sh</i></div>
<div style="background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;">cd </span>"${XCS_PRIMARY_REPO_DIR}/projectname"</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
pwd</div>
<span style="background-color: #1f1f24; color: white; font-family: "menlo"; font-size: 12px;">/usr/local/bin/pod install</span><br />
<br />
위와 같은 스크립트를 생성한다.<br />
<br />
Xcode Server bot 이 프로젝트를 클론 해온다음<br />
스크립트가 pod install을 수행하여 모든 pod 라이브러리를 내려 받아 놓고<br />
생성된 .xcworkspace를 로드하여 빌드 및 테스트를 진행 한다.<br />
<br />
unit test, ui test를 프로젝트에 등록 해두었으면 자동으로 빌드 및 테스트 까지 수행 하여 Xcode bot이 리포팅 해준다.<br />
<br />
<img src="blob:https://www.blogger.com/d239358e-39aa-43dd-9596-13c9f096ab47" />sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-25182764245191771022019-02-09T09:29:00.002+09:002019-02-09T09:29:48.001+09:00macOS 에서 eclipse jee 와 CDT 동시에 설치 및 아이콘 변경 하기요즘 회사에서 web 이나 서버 API 를 간간히 배우면 개발을 해야하기 때문에 spring을 이용하기 위해 vscode 부터 eclipse 까지 이것 저것 만저 보았다.<br />
<br />
스프링 개발을 위해 eclipse jee를 설치 하고 잘 사용 하고 있는 상황 그런데 raspberry pi에 C 로 개발해야 할 일이 생겨서 eclipse CDT도 설치 해봐야 하는 상황이 발생 했다.<br />
<br />
<br />
기존 설치되어 있는 eclipse jee에 CDT 플러그인을 install software 메뉴로 추가로 설치를 하면 하나의 이클립스가 java / c++ 모두 되는 IDE가 되는 것으로 보인다.<br />
<br />
하지만 자바 프로젝트 워크 스페이스가 열리면서 무언가 화면은 C++ IDE 였다가, java IDE 였다가 하는 것이 맘에 안든다.<br />
<br />
해서 eclipse jee 가 설치된 mac 머신에 새로 eclipse cdt를 설치 하기로 했다.<br />
<br />
eclipse/cpp-2018-12 , jee-2018-12 로 나뉘어 설치 되게 된다.<br />
<br />
하지만 아이콘이 같은 모양이라서 어떤게 java IDE인지 어떤게 c++ IDE인지 구분이 가지 않는다.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5QMYjnn7zuOVk3E-HucyY776wd98Wxh9SdEjE_B1lk8Ry6RIQ34iuUA2Ne4iN_sBlDvUDDBY5p84Y_dAbKb1JG8lYC5AvSP_lkOh6oNXjU69fl0fTxVDZ7J-68QB_5yRjSa9_oD6tSnU/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-02-09+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.22.36.png" imageanchor="1"><img border="0" height="125" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5QMYjnn7zuOVk3E-HucyY776wd98Wxh9SdEjE_B1lk8Ry6RIQ34iuUA2Ne4iN_sBlDvUDDBY5p84Y_dAbKb1JG8lYC5AvSP_lkOh6oNXjU69fl0fTxVDZ7J-68QB_5yRjSa9_oD6tSnU/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-02-09+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.22.36.png" width="320" /></a><br />
<br />
https://github.com/eclipse-cdt/cdt/blob/master/debug/org.eclipse.cdt.debug.application/icons/cc.icns<br />
여기에서 C++ eclipse icns를 다운 받는다.<br />
<br />
cc.icns 를 Eclipse.icns로 이름을 변경 하고<br />
<br />
eclipse CDT 설치 경로에서 패키지 보기로 하여 Resource 디렉토리에 있는<br />
Eclipse.icns에 복사하여 아이콘을 바꾼다.<br />
<br />
어떤이유에서인지는 모르지만 실행전에는 dock에 아이콘이 변경 되지 않지만 실행중에는<br />
변경되어 어떤것이 java인지 C++인지 구분이 된다.<br />
<br />
이정도면 만족 한다.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1tjjGQZt9sst0R9gYGWoEn19HRmuPhAnbt0q2fdmQM8zU3leMeMBAYq3l5n7l5x8YEuthpHKTLcahECXc_uFVHN-zszb8gHq32GNWDlA5iBlOMczKOQdH3sCF8Q0kryE8gMt2-GwC4IA/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-02-09+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.23.08.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1tjjGQZt9sst0R9gYGWoEn19HRmuPhAnbt0q2fdmQM8zU3leMeMBAYq3l5n7l5x8YEuthpHKTLcahECXc_uFVHN-zszb8gHq32GNWDlA5iBlOMczKOQdH3sCF8Q0kryE8gMt2-GwC4IA/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-02-09+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.23.08.png" /></a><br />
<br />
<br />
<br />
<br />
<br />sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-21312414335753391422019-01-15T12:22:00.001+09:002019-01-15T12:22:50.703+09:00visual studio code 로 spring maven project를 할때 너무 package does not exist로 밑줄이 많을떄https://github.com/redhat-developer/vscode-java/issues/161<br />
<br />
java linter 플러그인을 제거 해야 한다.<br />
<br />
springframework.beans.factory.anotation 등등<br />
멀쩡한 코드들이 빨간줄이 가는 문제가 있었다.<br />
<br />
https://github.com/redhat-developer/vscode-java/issues/161의 답변중에 하나인<br />
java linter 플러그인이 문제 인 듯 하다.sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-83550967697328706762019-01-12T09:30:00.001+09:002019-01-12T09:30:45.685+09:00visual studio code로 java spring maven project 하기<span style="font-family: inherit;">java spring 은 eclipse로 작업하는게 일반적이다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">spring을 시작하는 입장에서 eclipse의 불편함이 개발에 어려움에 한 몫 하고 있다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">현업에서 가장 많이 사용 하는게 eclipse이니 사실 장점이 더 많을 수 있지만</span><br />
eclipse는 느리고 macOS에서 다크 테마도 부자연 스럽고 맘에 들지 않는다.<br />
<br />
하여 code 편집기로 자주 사용하는 vscode를 spring 개발에 이용하려 함이다.<br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">이미 eclipse로 만들어진 spring maven 프로젝트 폴더를 vscode로 열어서 빌드및 tomcat debug가 가능 하도록 하는것이 목표이다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">MacOS 기준에서 테스트 하였다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">1. tomcat 설치 mac os</span><br />
<span style="font-family: inherit;">eclipse 개발 환경으로도 tomcat 설치는 필요하다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">http://igeniusdo.tistory.com/12</span><br />
<span style="font-family: inherit;">톰캣 버젼을 다운로드 받아서 /usr/local 폴더에 복사한다.</span><br />
<span style="font-family: inherit;">/Library/Tomcat 으로 심볼릭 링크를 걸어준다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">2. maven 설치</span><br />
<span style="font-family: inherit;">아파치 maven을 다운 받아서 /usr/local 에 복사한다.</span><br />
<span style="font-family: inherit;">https://maven.apache.org/install.html</span><br />
<span style="font-family: inherit;"><br /></span>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;">cat .bash_profile </span></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;">export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home</span></span></div>
<br />
<div style="font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;">export PATH=/usr/local/apache-maven-3.6.0/bin:$PATH</span></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;"><br /></span></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;">위와 같이 JAVA홈과 maven PATH를 설정 한다.</span></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit; font-size: x-small;"><br /></span></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit; font-size: x-small;"><br /></span></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;">3.vscode에 java 관련 플러그인 설치</span></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;">https://code.visualstudio.com/docs/languages/java</span></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;"><br /></span></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;">여기에 언급한 플러그인을 몽땅 설치 한다.</span></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhexlyf1noq20gS2z8fO72mXP1mFfE9aHF95Zs3lRFYwjzWLMvxKPMaL8kO5vv9TKL2eOjWygrjWi03xdxvlKbXC4QHshJH2HT0yTCLWmUVJvhgU3igpL9F6TPQF-I3nUhaRiukJOcD_Oo/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.57.44.png" imageanchor="1"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhexlyf1noq20gS2z8fO72mXP1mFfE9aHF95Zs3lRFYwjzWLMvxKPMaL8kO5vv9TKL2eOjWygrjWi03xdxvlKbXC4QHshJH2HT0yTCLWmUVJvhgU3igpL9F6TPQF-I3nUhaRiukJOcD_Oo/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.57.44.png" width="144" /></a></span></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">이상태에서 eclipse spring maven project 폴더를 폴더 열기를 하면 다음과 비슷한 화면으로 로딩 된다</span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">.<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLCFpjrf2pU9Rzokdmv2SIFwYLuex0CWrWxCNXpPVDq4HSG7jPcSo_d5uOrfw_TEK-CINgd0ZSyrHcXc1z8PRVLjmPTJr33e3Dg_6YGQVdXhrll-uThH0j556e2gX0dsFp31TCfvsVTug/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.01.32.png" imageanchor="1"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLCFpjrf2pU9Rzokdmv2SIFwYLuex0CWrWxCNXpPVDq4HSG7jPcSo_d5uOrfw_TEK-CINgd0ZSyrHcXc1z8PRVLjmPTJr33e3Dg_6YGQVdXhrll-uThH0j556e2gX0dsFp31TCfvsVTug/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.01.32.png" width="137" /></a></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">4.톰캣 서버 추가</span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcKANK2QBXir4z4zXSIEF8WI26NTQxjJdiUI4nR8a5DNgPeX_IZklQQTtC5cWJgpGIWj_uweL5rEpc5JMJj5302xyv7cgG2NTONWJaX9F7fDNEZvHsu_pM2wFKuZ6LHmXgsdI0_uboCeU/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.08.09.png" imageanchor="1"><img border="0" height="183" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcKANK2QBXir4z4zXSIEF8WI26NTQxjJdiUI4nR8a5DNgPeX_IZklQQTtC5cWJgpGIWj_uweL5rEpc5JMJj5302xyv7cgG2NTONWJaX9F7fDNEZvHsu_pM2wFKuZ6LHmXgsdI0_uboCeU/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.08.09.png" width="320" /></a></span></div>
<div style="font-stretch: normal; line-height: normal;">
<br /></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">TOMCAT SEVERS에서 +를 누른다음 /Library/Tomcat 폴더를 선택하여 tomcat 을 추가한다.</span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">tomcat의 마우스 오른쪽 버튼을 눌러 Open Server Configuration을 선택 하여 server.xml을 편집 할 수 있다. port 설정등을 할 수 있다.</span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">5. 프로젝트 maven 빌드</span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">MAVEN PROJECTS 에서 마우스 오른쪽 버튼으로 package를 선택 한다.</span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW8QYV0IgwQbz2F9oPD54Jl_dt0aX0DHi17rIF54NKy28HBhkB-ZM8KvV6sgw9QTc7_vhASiF1NJxbWzb5Nf6u2KJkZso3ZoFOqpna9MxpatITuwHMEGWizXeJgFluP1NlIe5IV-F8AIU/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.11.19.png" imageanchor="1"><img border="0" height="183" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW8QYV0IgwQbz2F9oPD54Jl_dt0aX0DHi17rIF54NKy28HBhkB-ZM8KvV6sgw9QTc7_vhASiF1NJxbWzb5Nf6u2KJkZso3ZoFOqpna9MxpatITuwHMEGWizXeJgFluP1NlIe5IV-F8AIU/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.11.19.png" width="320" /></a></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">정상적으로 빌드가 끝나면 target 디렉토리에 .war 파일이 생성 된다.</span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">6. tomcat 디버깅</span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAbOnYehVHMnwUKlQ-Qb6Ebm41p_jB9iLEPtjhyphenhyphenMtztCb2mWKa4_ok7_U9KcWaHq-nMP4XBaGbEI8lEw1_t1yvVB-_fqd4Vo3jTP72eaCNPn2G4HsyR5URTJ9UGwASfM-vcNMyj2Wo1ck/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.14.04.png" imageanchor="1"><img border="0" height="183" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAbOnYehVHMnwUKlQ-Qb6Ebm41p_jB9iLEPtjhyphenhyphenMtztCb2mWKa4_ok7_U9KcWaHq-nMP4XBaGbEI8lEw1_t1yvVB-_fqd4Vo3jTP72eaCNPn2G4HsyR5URTJ9UGwASfM-vcNMyj2Wo1ck/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.14.04.png" width="320" /></a></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjbjrHeHvTVw75ELHCAjmPw5xVcUrgODa-JdVb0SRJKjKx0im1sObQph7haJXGgSKU7qwl5hA5Sf60uG0qLE4sbGSAsOpeaVZtnMrEJLXwi2WsqFZlCAVcWgstQwbppf_-2zbF6CQelUs/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.13.48.png" imageanchor="1"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjbjrHeHvTVw75ELHCAjmPw5xVcUrgODa-JdVb0SRJKjKx0im1sObQph7haJXGgSKU7qwl5hA5Sf60uG0qLE4sbGSAsOpeaVZtnMrEJLXwi2WsqFZlCAVcWgstQwbppf_-2zbF6CQelUs/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.13.48.png" width="258" /></a></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvT6Esn3thHqT7BpXcKKp2pBQwILgrLT0A6qH8va9i-ax6jQiiwhIKT9Sb1HWID0xK3QnnyhOhcexb8EH-e218ET6LsQxdw26kZL7J8RmN92QE54exEDtLWkqVtOwNAMqZVk4YS7oWHsw/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.14.04.png" imageanchor="1"><img border="0" height="183" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvT6Esn3thHqT7BpXcKKp2pBQwILgrLT0A6qH8va9i-ax6jQiiwhIKT9Sb1HWID0xK3QnnyhOhcexb8EH-e218ET6LsQxdw26kZL7J8RmN92QE54exEDtLWkqVtOwNAMqZVk4YS7oWHsw/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2019-01-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.14.04.png" width="320" /></a></span></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">디버깅도 잘 된다.</span></div>
<div style="font-stretch: normal; line-height: normal;">
<br /></div>
<div style="font-stretch: normal; line-height: normal;">
<span style="font-family: inherit; font-size: x-small;"><br /></span></div>
<div style="font-size: 11px; font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com1tag:blogger.com,1999:blog-4415536332332135706.post-47823672914607998472018-12-14T16:29:00.001+09:002018-12-14T16:29:39.258+09:00XCTest 에서 비동기 통신 class를 테스트를 하려면?https://developer.apple.com/documentation/xctest/asynchronous_tests_and_expectations/testing_asynchronous_operations_with_expectations<br />
<br />
<br />
위 링크를 보면 좋은 예제가 있다.<br />
<br />
<br />
만일 네트워크 RESTFul API를 요청 하는 함수들 과<br />
응답에 결과를 delegate로 호출 해주는 방법으로 만든 클래스가 있다면<br />
<br />
이 class의 unit 테스트를 만들려면 testcase 함수 에서는 응답이 오기전에 XCAssertEqual()등의 메서드를 호출 할 수 없다. 네트워크 응답을 delegate로 받고 테스트가 진행 되어야 한다.<br />
<br />
<br />
XCTest case 함수에서<br />
XCTestExpectation 변수를 전역 변수로 만들고<br />
<br />
테스트 케이스 함수에서 네트워크 요청 후<br />
wait(for: [expectation], timeout: 10.0)<br />
위와 같은 코드로 대기를 하게 한다.<br />
<br />
XCAssertEqual() 메서드든 wait 코드 아래에 위치 하게 한다.<br />
<br />
네트워크 클래스의 delegate 응답 결과를 처리 하는 protocol 메서드에서<br />
expectation.fulfill() 을 호출 하여 대기를 풀어 준다.<br />
<br />
그럼 wait이 풀리고 XCAssertEqual에서 테스트 판단이 이루어진다.<br />
<br />
말로 설명한 TestCase 코드는 다음과 같다.<br />
<br />
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>let</b></span> expectation = <span style="color: #7ac8b6;">XCTestExpectation</span>(description: <span style="color: #fc6a5d;">"Network API TEST"</span>)</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>func</b></span> testLogin() {</div>
<div style="background-color: #1f1f24; color: #6c7986; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span><i>// 1. given</i></div>
<div style="background-color: #1f1f24; font-family: Helvetica; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<div style="background-color: #1f1f24; color: #6c7986; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span><i>// 2. when</i></div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #91d462;">network</span>.<span style="color: #91d462;">login</span> = <span style="color: #91d462;">Network</span>.<span style="color: #91d462;">Login</span>(aId: <span style="color: #fc6a5d;">"choijh"</span>, aPassword: <span style="color: #fc6a5d;">"1234567a"</span>)</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #91d462;">network</span>.<span style="color: #aef37d;">request</span>(API: <span style="color: #91d462;">Network</span>.<span style="color: #91d462;">API</span>.<span style="color: #aef37d;">Login</span>, delegate: <span style="color: #fc5fa3;"><b>self</b></span>)</div>
<div style="background-color: #1f1f24; font-family: Helvetica; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #99e8d5;">wait</span>(for: [<span style="color: #91d462;">expectation</span>], timeout: <span style="color: #9686f5;">10.0</span>)</div>
<div style="background-color: #1f1f24; font-family: Helvetica; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<div style="background-color: #1f1f24; color: #6c7986; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span><i>// 3. then</i></div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #99e8d5;">XCTAssertEqual</span>( <span style="color: #fc5fa3;"><b>self</b></span>.<span style="color: #91d462;">success</span>, <span style="color: #fc5fa3;"><b>true</b></span>, <span style="color: #fc6a5d;">"Login success"</span>)</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>func</b></span> testLoginFail() {</div>
<div style="background-color: #1f1f24; color: #6c7986; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span><i>// 1. given</i></div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #1f1f24; color: #6c7986; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span><i>// 2. when</i></div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #91d462;">network</span>.<span style="color: #91d462;">login</span> = <span style="color: #91d462;">Network</span>.<span style="color: #91d462;">Login</span>(aId: <span style="color: #fc6a5d;">"choijh"</span>, aPassword: <span style="color: #fc6a5d;">"a"</span>)</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #91d462;">network</span>.<span style="color: #aef37d;">request</span>(API: <span style="color: #91d462;">Network</span>.<span style="color: #91d462;">API</span>.<span style="color: #aef37d;">Login</span>, delegate: <span style="color: #fc5fa3;"><b>self</b></span>)</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #99e8d5;">wait</span>(for: [<span style="color: #91d462;">expectation</span>], timeout: <span style="color: #9686f5;">10.0</span>)</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #1f1f24; color: #6c7986; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span><i>// 3. then</i></div>
<div style="background-color: #1f1f24; color: #fc6a5d; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span><span style="color: #99e8d5;">XCTAssertEqual</span><span style="color: white;">( </span><span style="color: #fc5fa3;"><b>self</b></span><span style="color: white;">.</span><span style="color: #91d462;">success</span><span style="color: white;">, </span><span style="color: #fc5fa3;"><b>false</b></span><span style="color: white;">, </span>"Login fail wrong password"<span style="color: white;">)</span></div>
<div style="background-color: #1f1f24; font-family: Helvetica; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>func</b></span> onReceiveSuccessFail(<span style="color: #fc5fa3;"><b>_</b></span> success: <span style="color: #7ac8b6;">Bool</span>, api: <span style="color: #91d462;">Network</span>.<span style="color: #91d462;">API</span>) {</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>self</b></span>.<span style="color: #91d462;">success</span> = success</div>
<div style="background-color: #1f1f24; color: #91d462; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span>expectation<span style="color: white;">.</span><span style="color: #99e8d5;">fulfill</span><span style="color: white;">()</span></div>
<br />
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-90944148002727635292018-10-07T08:46:00.001+09:002018-10-07T08:46:56.162+09:00Xcode에서 이미지 없이 둥근 버튼, 원 버튼 디자인 적용 하기1. 다음과 같은 라운드 버튼을 이미지 없이<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfJ0cqNRiHugdZAKJPkZZPqmWVeaI-B1P4pckTrPLjti1FdOLB4fb4wuhgXMl07QqyagQM9m5H8Iqy05OsBLi7WFXgSK2IkL-RMNYrlEdGJ6eopLowQrRRVAWFIgDia3uNPrwd7-SmJ04/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.34.18.png" imageanchor="1"><img border="0" height="87" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfJ0cqNRiHugdZAKJPkZZPqmWVeaI-B1P4pckTrPLjti1FdOLB4fb4wuhgXMl07QqyagQM9m5H8Iqy05OsBLi7WFXgSK2IkL-RMNYrlEdGJ6eopLowQrRRVAWFIgDia3uNPrwd7-SmJ04/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.34.18.png" width="320" /></a><br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7nKL7QPbVtcEJB83CKVohnpLHYF0kw4kf11Q2amI32zqf2MsBS7-nD0zIntcboSxHP_09Z9rFwYhYFVOJrxA0d6iB2NI3SdLNmb-S87kPE7sUlvyfwCjkGf9Bi8n-FQxRso7ZidK0Q_Q/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.34.43.png" imageanchor="1"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7nKL7QPbVtcEJB83CKVohnpLHYF0kw4kf11Q2amI32zqf2MsBS7-nD0zIntcboSxHP_09Z9rFwYhYFVOJrxA0d6iB2NI3SdLNmb-S87kPE7sUlvyfwCjkGf9Bi8n-FQxRso7ZidK0Q_Q/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.34.43.png" width="189" /></a><br />
<br />
zeplin 오른쪽 사이드에 사각형 이라 표시되고 전혀 image asset에 대한 정보가 없다.<br />
디자이너는 그냥 파란색 도형을 디자인 한것이다.<br />
<br />
로그인 버튼은 사각형이며 파란색 도형인데 이미지가 없다?<br />
<br />
이러한 경우는<br />
<br />
UIVew를 상속 받은 UIButton에서 conerRadius를 설정 하여 처리 하면 된다.<br />
결국 코딩으로 해야 한다.<br />
<br />
<br />
2. 이번에는 속이 투명한 완전 원형 버튼<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrPsD7z3MkgqouRze59AFkonEyK9mDnIcwqTDfbzYKflmuPuAEP3wKl8d4siO-eknAEE5n3d9jCRSuKe9RvANNPkFGJmpGBscwO-SDFTAefs59jbjJCymkQtcdwxaHx1ais-mnxH_HFcI/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.37.42.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrPsD7z3MkgqouRze59AFkonEyK9mDnIcwqTDfbzYKflmuPuAEP3wKl8d4siO-eknAEE5n3d9jCRSuKe9RvANNPkFGJmpGBscwO-SDFTAefs59jbjJCymkQtcdwxaHx1ais-mnxH_HFcI/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.37.42.png" /></a><br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga3vsSnHZz2yKvtEeGa6PJWEBMm76_KpA1c2d_1QpjA2nM2-C2_tkAe5a3Bw3v8GDnjAz7UxDn19XTUhAeL9BTzP0DzgW4qRuld-ydKwLOwxZTWoLlL0b1TN_sADB8FKWvrSDPuvMGxag/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.38.07.png" imageanchor="1"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga3vsSnHZz2yKvtEeGa6PJWEBMm76_KpA1c2d_1QpjA2nM2-C2_tkAe5a3Bw3v8GDnjAz7UxDn19XTUhAeL9BTzP0DzgW4qRuld-ydKwLOwxZTWoLlL0b1TN_sADB8FKWvrSDPuvMGxag/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.38.07.png" width="212" /></a><br />
<br />
width / height 값이 동일하게 그리고 conerRadius를 width/2 로 설정 하면 원이 된다.<br />
결국 코딩이다.<br />
<br />
viewDidLoad에 코딩으로 하지 않고 스토리보드 인터페이스 빌더에서 속성으로 처리 하고 싶다면?<br />
<br />
<br />
<div style="background-color: #1f1f24; color: #fc5fa3; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<b>import</b><span style="color: white;"> UIKit</span></div>
<div style="background-color: #1f1f24; font-family: Helvetica; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<div style="background-color: #1f1f24; color: #fc5fa3; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<b>extension</b><span style="color: white;"> </span><span style="color: #7ac8b6;">UIView</span><span style="color: white;"> {</span></div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>@IBInspectable</b></span> <span style="color: #fc5fa3;"><b>var</b></span> cornerRadius: <span style="color: #7ac8b6;">CGFloat</span> {</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>get</b></span> {</div>
<div style="background-color: #1f1f24; color: #7ac8b6; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span><span style="color: #fc5fa3;"><b>return</b></span><span style="color: white;"> </span>layer<span style="color: white;">.</span>cornerRadius</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>set</b></span> {</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #7ac8b6;">layer</span>.<span style="color: #7ac8b6;">cornerRadius</span> = newValue</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #7ac8b6;">layer</span>.<span style="color: #7ac8b6;">masksToBounds</span> = newValue > <span style="color: #9686f5;">0</span></div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>@IBInspectable</b></span> <span style="color: #fc5fa3;"><b>var</b></span> borderWidth: <span style="color: #7ac8b6;">CGFloat</span> {</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>get</b></span> {</div>
<div style="background-color: #1f1f24; color: #7ac8b6; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span><span style="color: #fc5fa3;"><b>return</b></span><span style="color: white;"> </span>layer<span style="color: white;">.</span>borderWidth</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>set</b></span> {</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #7ac8b6;">layer</span>.<span style="color: #7ac8b6;">borderWidth</span> = newValue</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>@IBInspectable</b></span> <span style="color: #fc5fa3;"><b>var</b></span> borderColor: <span style="color: #7ac8b6;">UIColor</span>? {</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>get</b></span> {</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>return</b></span> <span style="color: #7ac8b6;">UIColor</span>(cgColor: <span style="color: #7ac8b6;">layer</span>.<span style="color: #7ac8b6;">borderColor</span>!)</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #fc5fa3;"><b>set</b></span> {</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #7ac8b6;">layer</span>.<span style="color: #7ac8b6;">borderColor</span> = newValue?.<span style="color: #7ac8b6;">cgColor</span></div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<br />
<div style="background-color: #1f1f24; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<br />
<br />
위와 같이 extension을 작성 하면<br />
<br />
@IBInspectable 덕에 IB에 표시된다.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8X15BWrRSI751-LVNX_y7h8JSprehF8gmVm2TSDv76RkiopIUgR1DsJQ0YKUFuR96_cHNKdWNXWL3PChjBIIOzYRnipBjmevQD2XJ8S9hvmYF_SLMQ46BL2FFVaagGgvkYW4HMdzhdG8/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.43.08.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8X15BWrRSI751-LVNX_y7h8JSprehF8gmVm2TSDv76RkiopIUgR1DsJQ0YKUFuR96_cHNKdWNXWL3PChjBIIOzYRnipBjmevQD2XJ8S9hvmYF_SLMQ46BL2FFVaagGgvkYW4HMdzhdG8/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.43.08.png" /></a><br />
<br />
<br />
extension은 @IBDesignable이 적용이 되지 않아 storyboard 랜더링은 그대로 사각형이지만 런타임에서는 훌륭한 타원으로 표출 된다.<br />
<br />
<br />
2번 원 버튼의 경우 배경색을 투명으로 하고 border with 와 border color 를 적용 하고 corner radius를 width에 1/2로 적용 하면 원 버튼이 표현 가능 하다.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-1636092706852675762018-10-07T08:22:00.000+09:002018-10-07T08:22:01.380+09:00Xcode storyboard 리팩토링Main.storyboard에 ViewController를 계속해서 디자인 하다 보면<br />
성능이 별로 좋지 않은 mac에서는 랜더링 속도가 현저하게 떨어진다.<br />
<br />
ViewController에 image등을 올리는 작업이 늘어 나면 늘어 날 수록 더이상 편집 자체가<br />
너무 느려 하기 어려워 질 수도 있다.<br />
<br />
<br />
이렇게 하나의 Main.storyboard에 모든 ViewController를 때려 박지 않고<br />
여러개의 storyboard 파일로 나누어 segue를 연결 할 수 있다.<br />
<br />
<br />
스토리보드 리팩토링 방법<br />
<br />
1. 새로운 스토리 보드 파일을 추가 한다.<br />
2. 기존 Main.storyboard 파일과 새로 만든 스토리 보드 파일을 보기 좋게 그룹으로 생성 하여 추가 한다.<br />
3. Main.storyboard 파일에서 일부 연결된 ViewController들을 선택 하여 Cmd + X로 자른다.<br />
4. 새로 추가된 스토리 보드 파일에 붙여 넣기를 한다.<br />
5. 새로 추가된 스토리 보드에 첫번째 ViewController를 is Initial View Controller로 체크 한다.<br />
6. Main.storyboard 파일에서 새로 추가된 스토리 보드와 segue를 연결 한다.<br />
<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4wYKLGUt2_jS7LPGeYYqT5ukNU5oj5cHfnQeB8Bkqivh_-fKa17Lvay1uN7VJBoAD_RrnSaxZFjzfK9x2PobplOtDwv14wmXy76dey_QH4_7K9RdwX8tfC6ZDLKvasyYv7xT65K1ZWpo/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.14.34.png" imageanchor="1"><img border="0" height="132" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4wYKLGUt2_jS7LPGeYYqT5ukNU5oj5cHfnQeB8Bkqivh_-fKa17Lvay1uN7VJBoAD_RrnSaxZFjzfK9x2PobplOtDwv14wmXy76dey_QH4_7K9RdwX8tfC6ZDLKvasyYv7xT65K1ZWpo/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.14.34.png" width="320" /></a><br />
<br />
Main.storyboard를 간단하게 바꾸고 segue에 연결은 스토리 보드 레퍼런스로 한다.<br />
<br />
<br />
Xcode 10에서는 라이브러리 화면이 팝업으로 나오게 되어 있다. Cmd + Shift + L<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlFll9AiGh770scHyFrM2jS_4nH5MGwO1Hw4Zf2O8i5in8cMAXWPKVxavJifcwLvIWq7em6foBIMXf7Sk0GVTwp-14_SFWtlZoYabWQeDx7_5LC1gGWVKeNnJPkrYY4t54g10Kna3FrUU/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.15.39.png" imageanchor="1"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlFll9AiGh770scHyFrM2jS_4nH5MGwO1Hw4Zf2O8i5in8cMAXWPKVxavJifcwLvIWq7em6foBIMXf7Sk0GVTwp-14_SFWtlZoYabWQeDx7_5LC1gGWVKeNnJPkrYY4t54g10Kna3FrUU/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-10-07+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+8.15.39.png" width="317" /></a><br />
<br />
두번째 항목이 스토리 보드 레퍼런스 이다.<br />
<br />
이런한 과정을 통해 프로젝트 성격에 맡도록 storyboard 파일을 나누면<br />
각각의 스토리 보드에서 적은수의 View Controller를 처리 하도록 하여 Xcode에서 보다 쾌적 하게 작업 할 수 있다.sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-44410942254538014392018-09-20T16:17:00.000+09:002018-09-20T16:19:35.729+09:00iOS ViewController 그라데이션 배경색 적용 하기<h2>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEPZvIjzTCwLrgXjNBP8Eqk_xkTRTSSfMG1mb9xyROCjdqOzcUOL2ABJbfqwdb2GCy9MHmElHWCS9ATQ3Vn7vhkb5Rm2QZBO00XygKvUHXo8XcZqo0jfLg6kxmKmnXSMKLSka-061r-RE/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-09-20+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+4.06.40.png" imageanchor="1"><img border="0" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEPZvIjzTCwLrgXjNBP8Eqk_xkTRTSSfMG1mb9xyROCjdqOzcUOL2ABJbfqwdb2GCy9MHmElHWCS9ATQ3Vn7vhkb5Rm2QZBO00XygKvUHXo8XcZqo0jfLg6kxmKmnXSMKLSka-061r-RE/s320/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-09-20+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+4.06.40.png" width="320" /></a></h2>
<br />
위와 같이 zeplin에서 색상 정보가 표시되고 ViewController의 배경색을 적용 해야 하는 경우<br />
<br />
디자이너님에게 배경 PNG를 주세요! 라고 할 수도 있고<br />
코드로 해결 할 수도 있다.<br />
<br />
위 두점은 그라데이션의 시작점이다.<br />
그리고 두개의 색상 정보가 있다.<br />
<br />
<div style="background-color: #292a30; color: #8ad1c3; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>extension</b></span><span style="color: white;"> </span>CAGradientLayer<span style="color: white;"> {</span></div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>convenience</b></span> <span style="color: #ff7ab2;"><b>init</b></span>(frame: <span style="color: #8ad1c3;">CGRect</span>, colors: [<span style="color: #8ad1c3;">UIColor</span>]) {</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>self</b></span>.<span style="color: #8ad1c3;">init</span>()</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>self</b></span>.<span style="color: #8ad1c3;">frame</span> = frame</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>self</b></span>.<span style="color: #8ad1c3;">colors</span> = []</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>for</b></span> color <span style="color: #ff7ab2;"><b>in</b></span> colors {</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>self</b></span>.<span style="color: #8ad1c3;">colors</span>?.<span style="color: #a7ebdd;">append</span>(color.<span style="color: #8ad1c3;">cgColor</span>)</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #8ad1c3;">startPoint</span> = <span style="color: #8ad1c3;">CGPoint</span>(x: <span style="color: #a79df7;">0</span>, y: <span style="color: #a79df7;">0</span>)</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #8ad1c3;">endPoint</span> = <span style="color: #8ad1c3;">CGPoint</span>(x: <span style="color: #a79df7;">1</span>, y: <span style="color: #a79df7;">1</span>)</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>convenience</b></span> <span style="color: #ff7ab2;"><b>init</b></span>(frame: <span style="color: #8ad1c3;">CGRect</span>, colors: [<span style="color: #8ad1c3;">UIColor</span>], startPoint: <span style="color: #8ad1c3;">CGPoint</span>, endPoint: <span style="color: #8ad1c3;">CGPoint</span>) {</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>self</b></span>.<span style="color: #8ad1c3;">init</span>()</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>self</b></span>.<span style="color: #8ad1c3;">frame</span> = frame</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>self</b></span>.<span style="color: #8ad1c3;">colors</span> = []</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>for</b></span> color <span style="color: #ff7ab2;"><b>in</b></span> colors {</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>self</b></span>.<span style="color: #8ad1c3;">colors</span>?.<span style="color: #a7ebdd;">append</span>(color.<span style="color: #8ad1c3;">cgColor</span>)</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>self</b></span>.<span style="color: #8ad1c3;">startPoint</span> = startPoint</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>self</b></span>.<span style="color: #8ad1c3;">endPoint</span> = endPoint</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>func</b></span> createGradientImage() -> <span style="color: #8ad1c3;">UIImage</span>? {</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>var</b></span> image: <span style="color: #8ad1c3;">UIImage</span>? = <span style="color: #ff7ab2;"><b>nil</b></span></div>
<div style="background-color: #292a30; color: #a7ebdd; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span>UIGraphicsBeginImageContext<span style="color: white;">(</span><span style="color: #8ad1c3;">bounds</span><span style="color: white;">.</span><span style="color: #8ad1c3;">size</span><span style="color: white;">)</span></div>
<div style="background-color: #292a30; color: #a7ebdd; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span><span style="color: #ff7ab2;"><b>if</b></span><span style="color: white;"> </span><span style="color: #ff7ab2;"><b>let</b></span><span style="color: white;"> context = </span>UIGraphicsGetCurrentContext<span style="color: white;">() {</span></div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #a7ebdd;">render</span>(in: context)</div>
<div style="background-color: #292a30; color: #a7ebdd; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> image = </span>UIGraphicsGetImageFromCurrentImageContext<span style="color: white;">()</span></div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: #292a30; color: #a7ebdd; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span>UIGraphicsEndImageContext<span style="color: white;">()</span></div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>return</b></span> image</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<br />
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<br />
위코드에서 첫번째 convenience 초기화는 대각선 즉 0,0 ~ 1,1 로 그라데이션 을 적용 하는 것이고<br />
추가로 두번째 convenience초기화는 startPoint와 endPoint를 파라메터로 전달 할 수 있도록 만든 초기화 이다.<br />
<br />
<br />
위와 같이 extension을 만들고<br />
<br />
실제 ViewController에서 imageView를 전체 영역으로 올리고 다음과 같이 코딩을 한다.<br />
<br />
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>@IBOutlet</b></span> <span style="color: #ff7ab2;"><b>weak</b></span> <span style="color: #ff7ab2;"><b>var</b></span> backgroundImage: <span style="color: #8ad1c3;">UIImageView</span>!</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>override</b></span> <span style="color: #ff7ab2;"><b>func</b></span> viewDidLoad() {</div>
<div style="background-color: #292a30; color: #a7ebdd; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span><span style="color: #ff7ab2;"><b>super</b></span><span style="color: white;">.</span>viewDidLoad<span style="color: white;">()</span></div>
<div style="background-color: #292a30; color: #7f8c98; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span><i>// Do any additional setup after loading the view, typically from a nib.</i></div>
<div style="background-color: #292a30; font-family: Helvetica; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<div style="background-color: #292a30; color: #8ad1c3; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: white;"> </span></div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>var</b></span> colors = [<span style="color: #8ad1c3;">UIColor</span>]()</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
colors.<span style="color: #a7ebdd;">append</span>( colorLiteral(red: 0, green: 0.6941176471, blue: 1, alpha: 1))</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
colors.<span style="color: #a7ebdd;">append</span>( colorLiteral(red: 0.05882352941, green: 0.8392156863, blue: 0.8078431373, alpha: 1))</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ff7ab2;"><b>let</b></span> gradientLayer = <span style="color: #8ad1c3;">CAGradientLayer</span>(frame: <span style="color: #ff7ab2;"><b>self</b></span>.<span style="color: #8ad1c3;">view</span>.<span style="color: #8ad1c3;">frame</span>, colors: colors, startPoint: <span style="color: #8ad1c3;">CGPoint</span>(x: <span style="color: #a79df7;">0.5</span>, y:<span style="color: #a79df7;">0</span>), endPoint: <span style="color: #8ad1c3;">CGPoint</span>(x:<span style="color: #a79df7;">0.5</span>, y:<span style="color: #a79df7;">1</span>))</div>
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #a0d975;">backgroundImage</span>.<span style="color: #8ad1c3;">image</span> = gradientLayer.<span style="color: #baf28f;">createGradientImage</span>()</div>
<div style="background-color: #292a30; font-family: Helvetica; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<br />
<div style="background-color: #292a30; color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div>
<br /></div>
<br />
colorLiteral을 사용해서 숫자로 표시되지만 실제로른 Xcode에서 색상 표를 이용해 hex로 입력 한것이다.<br />
<br />
<br />
CGPoint(x: 0.5, y:0) ~ CGPoint(x:0.5, y:1) 은 중앙 상단에서 중앙 하단을 의미 한다.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-1749159475472370132018-08-17T10:58:00.000+09:002018-08-17T10:58:21.639+09:00네비게이션 컨트롤의 rootViewController 변경하기 <span style="font-family: inherit;">앱 최초 실행시에 intro -> 가입유도 / 또는 로그인</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">로그인 성공이후는 main 으로 실행 되는 앱이 있다고 하면</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">어느 경우는 intro가 navigation controller의 rootViewController 이고</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">어느 경우는 main이 navigation controller의 rootViewCotnorller 가 된다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">main으로 계속 실행되던 앱에서 logout 기능을 이용하면 login viewController가</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">navigationViewController에 rootViewController가 되어 실행된다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">스토리 보드를 이용하고 segue를 잘 쓰려고 하는데 앱 최초 진입점이 다르고</span><br />
<span style="font-family: inherit;">navigation controller를 결국에는 storyboard Embed in 으로 해서 만들 수 도 없고</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">결국 코드로 ViewController를 storyboard에서 찾아다가 push 하고 navigation controller를 초기 화 하고 복잡하게 ... 스파게티...</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">이러한 앱을 개발 할때 다음과 같이 하면 좀 수월 하다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">1. navigation controller 는 storyboard에 만들지 않는다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">2. navigation controller에 root가 될 viewController 들 ( 2개 또는 3개) 는</span><br />
<span style="font-family: inherit;">attribute inspector에서 top bar 항목을 설정 해준다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">그래야 하위 segue가 연결된 viewController들이 네비바가 있는것처럼 디자인 할 수 있다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">3. init viewController 및 navgation controller의 rootController를 appdelegate.swift에서 구현 한다.</span><br />
<br />
<br />
<br />
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
didFinishLaunchingWithOptions 메서드에서 UserDefaults 등으로 구현하여 현재 상황에 맡는 ViewController를 rootViewController로 하여 navigation Controller를 설정 하고 시작 한다.</div>
<br />
<div style="background-color: white; color: #008400; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
//intro</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">let</span> storyboard = <span style="color: #703daa;">UIStoryboard</span>(name: <span style="color: #d12f1b;">"Main"</span>, bundle: <span style="color: #ba2da2;">nil</span>)</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">let</span> root = storyboard.<span style="color: #3e1e81;">instantiateViewController</span>(withIdentifier: <span style="color: #d12f1b;">"IntroViewController"</span>)</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #4f8187;">nvc</span> = <span style="color: #703daa;">UINavigationController</span>(rootViewController: root)</div>
<div style="background-color: white; font-family: Helvetica; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<div style="background-color: white; font-family: Helvetica; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<div style="background-color: white; color: #703daa; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span><span style="color: #4f8187;">window</span><span style="color: black;">?.</span>rootViewController<span style="color: black;"> = </span><span style="color: #4f8187;">nvc</span></div>
<br />
<div style="background-color: white; color: #3e1e81; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span><span style="color: #4f8187;">window</span><span style="color: black;">?.</span>makeKeyAndVisible<span style="color: black;">()</span></div>
<div style="background-color: white; color: #3e1e81; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: black;"><br /></span></div>
<div style="background-color: white; color: #3e1e81; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: black;"><br /></span></div>
<span style="font-family: Menlo;"><span style="background-color: white; font-size: 12px;">로그인 등이 완료되어 main으로 시작 하거나, 또는 로그 아웃으로 인해 다시 intro로 시작 해야 하는 경우를 대비해 </span></span><br />
<span style="font-family: Menlo;"><span style="background-color: white; font-size: 12px;">스위칭 하는 메서드를 appdelegate에 구현 한다.</span></span><br />
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">func</span> switchIntro() {</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">let</span> storyboard = <span style="color: #703daa;">UIStoryboard</span>(name: <span style="color: #d12f1b;">"Main"</span>, bundle: <span style="color: #ba2da2;">nil</span>)</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">let</span> vc = storyboard.<span style="color: #3e1e81;">instantiateViewController</span>(withIdentifier: <span style="color: #d12f1b;">"IntroViewController"</span>)</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #4f8187;">nvc</span> = <span style="color: #703daa;">UINavigationController</span>(rootViewController: vc)</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: white; color: #703daa; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span><span style="color: #ba2da2;">self</span><span style="color: black;">.</span><span style="color: #4f8187;">window</span><span style="color: black;">?.</span>rootViewController<span style="color: black;"> = </span><span style="color: #4f8187;">nvc</span></div>
<div style="background-color: white; color: #3e1e81; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span><span style="color: #4f8187;">window</span><span style="color: black;">?.</span>makeKeyAndVisible<span style="color: black;">()</span></div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">func</span> switchMain() {</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">let</span> storyboard = <span style="color: #703daa;">UIStoryboard</span>(name: <span style="color: #d12f1b;">"Main"</span>, bundle: <span style="color: #ba2da2;">nil</span>)</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">let</span> vc = storyboard.<span style="color: #3e1e81;">instantiateViewController</span>(withIdentifier: <span style="color: #d12f1b;">"MainViewController"</span>)</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #4f8187;">nvc</span> = <span style="color: #703daa;">UINavigationController</span>(rootViewController: vc)</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: white; color: #703daa; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span><span style="color: #ba2da2;">self</span><span style="color: black;">.</span><span style="color: #4f8187;">window</span><span style="color: black;">?.</span>rootViewController<span style="color: black;"> = </span><span style="color: #4f8187;">nvc</span></div>
<div style="background-color: white; color: #3e1e81; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span><span style="color: #4f8187;">window</span><span style="color: black;">?.</span>makeKeyAndVisible<span style="color: black;">()</span></div>
<br />
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
어떠한 ViewController에서 navigaion Controller의 루트를 변경 하고자 하면 다음과 같이 하면 된다.</div>
<div style="background-color: white; color: #703daa; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">let</span><span style="color: black;"> appDelegate = </span>UIApplication<span style="color: black;">.</span>shared<span style="color: black;">.</span>delegate<span style="color: black;"> </span><span style="color: #ba2da2;">as</span><span style="color: black;">! </span><span style="color: #4f8187;">AppDelegate</span></div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
appDelegate.<span style="color: #31595d;">switchIntro</span>()</div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 12px; font-stretch: normal; line-height: normal;">
<br /></div>
<span style="font-family: Menlo;"><span style="background-color: white; font-size: 12px;"><br /></span></span>
<span style="font-family: Menlo;"><span style="background-color: white; font-size: 12px;"><br /></span></span>sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-67363678869546233072018-06-06T22:45:00.001+09:002018-06-06T22:45:18.999+09:00iPhone 6 7 8 plus 에서 상태바가 크게 나오는 앱 올바른 스케일로 나오게 하려면?실제로 오래전에 만들어진 프로젝트에서 코드를 추가하다 보니<br />
<br />
플러스 모델에서 화면 스케일이 업 되어 표출 되는 경우를 발견 했다.<br />
<br />
실제로 아직도 내가 사용하는 iphone 6+ 에서 사용되는 앱중에 이렇게 오래된 프로그램인 듯 보이는 앱들이 존재 한다.<br />
<br />
내가 사용중인 앱중에는 증권통, 키움증권 영웅문 과 같은 앱들이 아직도 상태바가 크게 보인다. 마치 오래전에 만든 앱이 6+에서 그냥 화면이 늘어 나서 보이는 느낌이다.<br />
<br />
대신 증권 앱이나 기업 은행 앱은 최근에 바로 잡힌 듯 하다.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEC65hSkToZ5U_sw42JK8sxeTJI3OJBx0PBRVJoaZ1KuCcMjgjYfZ8eb2AjfTYPSPk9WGG5XeW_knRZQZB0PhvTo-CkgKtEza5Ge0FhrE_I8KeWECW2aW28X4VVPlmbspyyhQcbyeZizM/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-06-06+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.36.07.png" imageanchor="1"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJSWLlHGg_xUyO26frhy0lc7hJCc1hzUIVVbdKskFz86EZuu1AN7lzkNsZgjGtOzSl8wtGf3DzKn1ooz8gI_9b_ZGcs-m5ryO-J1-aYpcFzWAAkF73XGI83irk1CHoetBtusSJ-8NeIWY/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-06-06+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.36.15.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJSWLlHGg_xUyO26frhy0lc7hJCc1hzUIVVbdKskFz86EZuu1AN7lzkNsZgjGtOzSl8wtGf3DzKn1ooz8gI_9b_ZGcs-m5ryO-J1-aYpcFzWAAkF73XGI83irk1CHoetBtusSJ-8NeIWY/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-06-06+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.36.15.png" /></a><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEC65hSkToZ5U_sw42JK8sxeTJI3OJBx0PBRVJoaZ1KuCcMjgjYfZ8eb2AjfTYPSPk9WGG5XeW_knRZQZB0PhvTo-CkgKtEza5Ge0FhrE_I8KeWECW2aW28X4VVPlmbspyyhQcbyeZizM/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-06-06+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.36.07.png" /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI2d8aKg1T_sN5ZUJMBkPLDBg_enlrGJtPRNhn8EHr4-k0l7r-60RcZnLxwrEsXNeHI7l9jCeBWSBBs7UCifl7MjWDOGCTsTmSjDCKHC6pFgKhLwGrYLimZ6XnMq-CgEDTVjAMojyYot8/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-06-06+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.36.25.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI2d8aKg1T_sN5ZUJMBkPLDBg_enlrGJtPRNhn8EHr4-k0l7r-60RcZnLxwrEsXNeHI7l9jCeBWSBBs7UCifl7MjWDOGCTsTmSjDCKHC6pFgKhLwGrYLimZ6XnMq-CgEDTVjAMojyYot8/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-06-06+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.36.25.png" /></a><br />
<br />
위에부터 키움증권, 증권통, facebook 의 iPhone 6 +에서 스크린샷이다.<br />
<br />
왜 이러한 현상이 나타날까?<br />
<br />
실제로 오래전에 만들어진 앱에 코드를 추가하고 유지보수 하다가 이러한 현상을 바로 잡기 위해 프로젝트 설정을 해메고 찾고 하였지만 해답은 의외로 간단 했다.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7uWgeD-eKpogH2B-t8jB8nvBVXxpHxhh5zf2oTAQiWfzNJesWqVDuoAEhjxOTffJNpRbpdVKzx_D7fJLLyGYpKGrzVzXsGEv7cPjY4mZV3p_3D8ryLk-3a_DLF8g5es7AcLiVzvvXJc8/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-06-06+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.39.32.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7uWgeD-eKpogH2B-t8jB8nvBVXxpHxhh5zf2oTAQiWfzNJesWqVDuoAEhjxOTffJNpRbpdVKzx_D7fJLLyGYpKGrzVzXsGEv7cPjY4mZV3p_3D8ryLk-3a_DLF8g5es7AcLiVzvvXJc8/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-06-06+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.39.32.png" /></a><br />
<br />
Launch Screen 스토리 보드르 추가 하여 위와 같이 프로젝트를 설정하면<br />
올바른 크기로 프로그램이 실행 된다.<br />
<br />
다음은 스택오버플로우의 관련 글이다.<br />
<a href="https://stackoverflow.com/questions/25754942/how-to-enable-native-resolution-for-apps-on-iphone-6-and-6-plus">https://stackoverflow.com/questions/25754942/how-to-enable-native-resolution-for-apps-on-iphone-6-and-6-plus</a><br />
<br />
알면 별것 아니고 모르면 개고생이다.<br />
<br />
증권통앱에 이방법을 알려주고 싶다.<br />
<br />sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com1tag:blogger.com,1999:blog-4415536332332135706.post-89088345915730031542018-04-18T22:49:00.001+09:002018-04-18T22:49:37.295+09:00Xcode 9 에서 컬러 리터럴 사용하기<span style="font-family: inherit;">코드에서 색상 값을 UIColor()에 생성자에 RGB 값으로 코딩을 하면 무슨 색인지 코드만 보고는 알수가 없다.</span><br />
<br />
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9FRbJqyDmLR8EhOjnSVKqb91PLiQWYuOs_OncakGXjUTCLrpQEjeD89xgD5hOvBQcyGQUafAMAogd23siZnd5tBxhziMmoIMNYHaCO0BXbU4k6_kpjyxdJAqSEmFTNL8sUXjHVrGFOqM/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-04-18+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.40.51.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9FRbJqyDmLR8EhOjnSVKqb91PLiQWYuOs_OncakGXjUTCLrpQEjeD89xgD5hOvBQcyGQUafAMAogd23siZnd5tBxhziMmoIMNYHaCO0BXbU4k6_kpjyxdJAqSEmFTNL8sUXjHVrGFOqM/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-04-18+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.40.51.png" /></a></span></div>
<div style="background-color: white; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-stretch: normal; line-height: normal;">
Xcode에서는 이러한 점을 고려하여 위와 같이 color literal을 지원하게 되었다.</div>
<div style="background-color: white; font-stretch: normal; line-height: normal;">
색상이 Xcode에디터에서 문자 처럼 표시 된다.</div>
<div style="background-color: white; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-stretch: normal; line-height: normal;">
color lteral을 코드에 적용 하는 방법은 다음과 같다.</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">color literal을 타이핑 하면 다음과 같이 코드 완성이 이루어지려 한다.</span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0m4C98g7CN2qJ9dBkWu5nmGP2KMm-_xfRd9eSgrgJcNy4KiJJdztgU9Bv2zUghXr3rGRS0lK54x6bObW4WJQCPAI1Qf-1fP4s1znEy9Ds2TRk0QumKEFILf2wB2UgINzsxkKM6TCtBJQ/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-04-18+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.42.39.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0m4C98g7CN2qJ9dBkWu5nmGP2KMm-_xfRd9eSgrgJcNy4KiJJdztgU9Bv2zUghXr3rGRS0lK54x6bObW4WJQCPAI1Qf-1fP4s1znEy9Ds2TRk0QumKEFILf2wB2UgINzsxkKM6TCtBJQ/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-04-18+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.42.39.png" /></a></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">에디터에서 색상을 더블클릭 하면 색상 선택 창이 나타난다.</span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfR4ztqAv0nSYgoE1TbgzzdHUbYOMXcYlXjTZVpXC3bD9fC7LBmQ7u-uyhPeiTW6COD5RUnATZQhnDASICcTBoS6u2w-hHXcKys0oIrPuJ7py8NnSmu15aDYAsWnue5ylOjkZhehty6Y4/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-04-18+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.42.58.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfR4ztqAv0nSYgoE1TbgzzdHUbYOMXcYlXjTZVpXC3bD9fC7LBmQ7u-uyhPeiTW6COD5RUnATZQhnDASICcTBoS6u2w-hHXcKys0oIrPuJ7py8NnSmu15aDYAsWnue5ylOjkZhehty6Y4/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-04-18+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.42.58.png" /></a></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">Other를 선택 하여 RGB 및 alpha 값을 적용 하여 원하는 색상 리터럴 문자를 만들수 있다.</span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_C9csM_ut0gYMvnKeknd54RD3lYnO71TYkyEQwb7IO6qQLkpLokGg7mdpj5Kq9MRwE0fWfgo-wOH_E7TlnSGJcu6H1XnpZSw6_2OOMPcDpBOxan_cOiLOYpH72XfJP3Si77GuQkoi2EM/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-04-18+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.43.21.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_C9csM_ut0gYMvnKeknd54RD3lYnO71TYkyEQwb7IO6qQLkpLokGg7mdpj5Kq9MRwE0fWfgo-wOH_E7TlnSGJcu6H1XnpZSw6_2OOMPcDpBOxan_cOiLOYpH72XfJP3Si77GuQkoi2EM/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-04-18+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.43.21.png" /></a></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; font-stretch: normal; line-height: normal;">
<span style="font-family: inherit;">이렇게 코드를 작성하면 실제는 colorLiteral() 로 코딩되어 있고 Xcode editor 상에서는 색상으로 표시되어 가독성이 좋다.</span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-80670744006251356752018-04-12T23:02:00.003+09:002018-04-12T23:02:38.719+09:00Xcode 9 에서 markdown파일을 렌더링 하여 보기 <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihS2PS2Km_En2rQW_03NihdRKd0GukKfaXtm9VHB01F3YgyiLbYSbbzO-d7SLWZkvIkQQ5ig8wu4mt_q-IcbCXTs6ZGgf3Q1njUaVD5t-Oz934Ij2ATY9EMOLiA6PW_GWX7YPRHv_CiMg/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-04-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.52.11.png" imageanchor="1"><img border="0" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihS2PS2Km_En2rQW_03NihdRKd0GukKfaXtm9VHB01F3YgyiLbYSbbzO-d7SLWZkvIkQQ5ig8wu4mt_q-IcbCXTs6ZGgf3Q1njUaVD5t-Oz934Ij2ATY9EMOLiA6PW_GWX7YPRHv_CiMg/s640/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-04-12+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.52.11.png" width="640" /></a><br />
<br />
<br />
Xcode에서 .md 파일을 추가 할수 있다.<br />
하지만 기본은 그냥 편집 할 수 있게만 되고 미리보기라 든지 그런 기능이 없다.<br />
<br />
<div>
<a href="https://dev.to/danielinoa_/rendering-markdown-in-xcode-9">https://dev.to/danielinoa_/rendering-markdown-in-xcode-9</a></div>
<div>
<br /></div>
<div>
위에글은 링크된 파일을 다운로드 받으면 Xcode 프로젝트가 있는데 Xcode로 오픈해 보면 정말 README.md 가 렌더링 되서 보여준다.</div>
<div>
<br /></div>
<div>
아무런 차이도 없는데 해당 프로젝트는 그렇게 보여준다.</div>
<div>
위 리크에서 설명 하듯이 답은 .xcodesamplecode.plist 파일이 프로젝트 (패키지 내용보기) 내부 에 있는 것이다. 파인더에서도 디폴트는 보여지지 않기 때문에 터미널을 이용하여 ls -al 로 확인 하였다.</div>
<div>
<br /></div>
<div>
sparrow-mac-mini:ARKitExample.xcodeproj sparrow$ ls -al</div>
<div>
total 56</div>
<div>
drwxr-xr-x@ 6 sparrow staff 204 4 12 22:18 .</div>
<div>
drwxr-xr-x@ 9 sparrow staff 306 4 12 22:03 ..</div>
<div>
-rw-r--r--@ 1 sparrow staff 182 8 8 2017 .xcodesamplecode.plist</div>
<div>
-rw-r--r-- 1 sparrow staff 24272 4 12 22:07 project.pbxproj</div>
<div>
drwxr-xr-x@ 5 sparrow staff 170 4 12 22:04 project.xcworkspace</div>
<div>
drwxr-xr-x 3 sparrow staff 102 4 12 22:04 xcuserdata</div>
<div>
<br /></div>
<div>
현재 작업중인 프로젝트는 워크스페이스로 구성되어 있었는데 여러 포함된 프로젝트 파일중에 README.md 파일을 추가 했고 렌더링 된 결과가 나올 줄 알았지만 결과는 아무런 변화가 없다.</div>
<div>
<br /></div>
<div>
하여 잘못된 글로 생각 했다.</div>
<div>
<br /></div>
<div>
워크스페이스로 된 프로젝트에서는 .xcodesamplecode.plist 파일을 workspace 디렉토리에 넣어야 된다.</div>
<div>
<br /></div>
<div>
결국 이글은 정확하게 잘된다.</div>
<div>
<br /></div>
<div>
구지 ARKitExample.xcodeproj을 다운 받지 않고도</div>
<div>
<br /></div>
<div>
터미널에서 워크스페이스 파일이나 xcode 프로젝트 파일에 디렉토리에 들어가서 .xcodesamplecode.plist 파일을 생성 하면 될 것으로 보인다.</div>
<div>
<br /></div>
<div>
해당 파일의 냉용은 다음과 같다.</div>
<div>
<br /></div>
<div>
sparrow-mac-mini:ARKitExample.xcodeproj sparrow$ cat .xcodesamplecode.plist </div>
<div>
<?xml version="1.0" encoding="UTF-8"?></div>
<div>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"></div>
<div>
<plist version="1.0"></div>
<div>
<array/></div>
<div>
</plist></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
이파일이 프로젝트 디렉토리 (패키지내용보기) 또는 터미널에서 cd 진입 하여 .xcodesamplecode.plist (ARKitExample.xcodeproj) 에 있는 파일이나 직접 만들어 넣으면 xcode가 markdown 파일을 렌더링 해서 보여준다.</div>
<div>
<br /></div>
<div>
단! 렌더링 되면 수정 xcode에서는 수정이 되지 않는다.</div>
<div>
<br /></div>
<div>
Visual Studio Code로 편집 수정하여 Xcode 프로젝트에 추가하면 멋진 도큐먼트를 포함하는 프로젝트가 될 것이다.</div>
<div>
<br /></div>
<div>
그리고 표문법은 적용 되지 않는다.</div>
<div>
<br /></div>
<div>
그래도 이정도면 쓸만 하다.</div>
sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-66832432350982846062018-03-09T18:56:00.000+09:002018-03-09T18:56:06.725+09:00UIPickerView의 선택된 텍스트 색상 변경, 선택 라인의 색상 변경을 하려면?<div class="separator" style="clear: both; text-align: left;">
어쩔수 없이 UI작업이 디자인 가이드를 우선으로 해야 하는 경우 기본적인 UIPickerView를 변경 해야 하는 경우가 있다.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieNT2F68bun5aEazHUCO0LoyDVK6fiEd3mibTr-yPkr6JPdBH1PrcYNVqJocOXrvowFopJzbwpHVp4745ngsSrzDn1v8C8h2R_gJj3or89ofWFFYJm6mR0aaZ4sjvsffNys5iO2ttHZD8/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-09+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+6.41.42.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieNT2F68bun5aEazHUCO0LoyDVK6fiEd3mibTr-yPkr6JPdBH1PrcYNVqJocOXrvowFopJzbwpHVp4745ngsSrzDn1v8C8h2R_gJj3or89ofWFFYJm6mR0aaZ4sjvsffNys5iO2ttHZD8/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-09+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+6.41.42.png" width="202" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
UIPikckerView를 디폴트로 사용하면 데이터소스로 데이터 값정도를 변경 할 수 있다.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
위와 같이 선택라인의 색상을 변경 시키거나 선택된 텍스트의 컬러를 변경 시키는 작업은 코드를 이용 해야 한다.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
첫번째 선택된 Text의 컬러를 변경 하기 위해서는 AttributeString을 리턴 하는 아래의 메서드를 구현 해야 한다.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">func</span> pickerView(<span style="color: #ba2da2;">_</span> pickerView: <span style="color: #703daa;">UIPickerView</span>, attributedTitleForRow row: <span style="color: #703daa;">Int</span>, forComponent component: <span style="color: #703daa;">Int</span>) -> <span style="color: #703daa;">NSAttributedString</span>?</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
{</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
}</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
선택된 row 일때와 그렇지 않을때의 컬러를 결정 하여 NSAttributedString을 리턴 해야 한다.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
1,2,3,4와 같은 UIPickerView 의 표출될 문자열 스트링 어레이가. pickerData 인 경우 </div>
<div class="separator" style="clear: both; text-align: left;">
아래의 코드는 선택된 텍스트의 색상을 blue, 선택되지 않은 색상은 black으로 표출 하는 코드이다.</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">func</span> pickerView(<span style="color: #ba2da2;">_</span> pickerView: <span style="color: #703daa;">UIPickerView</span>, attributedTitleForRow row: <span style="color: #703daa;">Int</span>, forComponent component: <span style="color: #703daa;">Int</span>) -> <span style="color: #703daa;">NSAttributedString</span>? {</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">var</span> color: <span style="color: #703daa;">UIColor</span>!</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">if</span> pickerView.<span style="color: #3e1e81;">selectedRow</span>(inComponent: component) == row {</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
color = <span style="color: #703daa;">UIColor</span>.<span style="color: #703daa;">blue</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
} <span style="color: #ba2da2;">else</span> {</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
color = <span style="color: #703daa;">UIColor</span>.<span style="color: #703daa;">black</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal; min-height: 13px;">
</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">let</span> attributes: [<span style="color: #703daa;">NSAttributedStringKey</span>: <span style="color: #ba2da2;">Any</span>] = [</div>
<div style="background-color: white; color: #703daa; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span>NSAttributedStringKey<span style="color: black;">(rawValue: </span>NSAttributedStringKey<span style="color: black;">.</span>foregroundColor<span style="color: black;">.</span>rawValue<span style="color: black;">): color,</span></div>
<div style="background-color: white; color: #703daa; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span>NSAttributedStringKey<span style="color: black;">(rawValue: </span>NSAttributedStringKey<span style="color: black;">.</span>font<span style="color: black;">.</span>rawValue<span style="color: black;">): </span>UIFont<span style="color: black;">.</span><span style="color: #3e1e81;">systemFont</span><span style="color: black;">(ofSize: </span><span style="color: #272ad8;">15</span><span style="color: black;">)</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
]</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal; min-height: 13px;">
</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">return</span> <span style="color: #703daa;">NSAttributedString</span>(string: <span style="color: #4f8187;">pickerData</span>[row], attributes: attributes)</div>
<div class="separator" style="clear: both;">
</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
}</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
다음은 선택 라인의 색상을 변경 해야 하는데 기본 UIPickerView는 Property로 제공하지 않는다.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
UIPickerView를 서브클래싱 하여 CustomPickerView class를 생성 한다음 다음의 두 라인이 을 찾아서 색상을 변경 하는 코드를 추가 해야 한다.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
didAddSubview 메서드를 오버라이딩 하여 서브뷰 중에 height가 1인 값의 즉 두선을 찾아 색상을 변경 한다.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
@IBDesignable와 @IBInspectable을 이용하여 스토리보드에서 변경 사항을 확인 까지 가능 하도록 다음과 같이 클래스를 생성 하면 된다.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="background-color: white; color: #008400; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
//</div>
<div style="background-color: white; color: #008400; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
// CustomPickerView.swift</div>
<div style="background-color: white; color: #008400; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
// datetimepickerDemo</div>
<div style="background-color: white; color: #008400; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
//</div>
<div style="background-color: white; color: #008400; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
// Created by sparrow on 2018. 3. 8..</div>
<div style="background-color: white; color: #008400; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
// Copyright © 2018년 sparrow. All rights reserved.</div>
<div style="background-color: white; color: #008400; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
//</div>
<div style="background-color: white; font-family: Helvetica; font-size: 12px; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<div style="background-color: white; color: #ba2da2; font-family: Menlo; font-stretch: normal; line-height: normal;">
import<span style="color: black;"> UIKit</span></div>
<div style="background-color: white; font-family: Helvetica; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<div style="background-color: white; color: #ba2da2; font-family: Menlo; font-stretch: normal; line-height: normal;">
@IBDesignable</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">class</span> CustomPickerView: <span style="color: #703daa;">UIPickerView</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
{</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">@IBInspectable</span> <span style="color: #ba2da2;">var</span> selectorColor: <span style="color: #703daa;">UIColor</span>? = <span style="color: #ba2da2;">nil</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal; min-height: 13px;">
</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">override</span> <span style="color: #ba2da2;">func</span> didAddSubview(<span style="color: #ba2da2;">_</span> subview: <span style="color: #703daa;">UIView</span>) {</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">super</span>.<span style="color: #3e1e81;">didAddSubview</span>(subview)</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">if</span> <span style="color: #ba2da2;">let</span> color = <span style="color: #4f8187;">selectorColor</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
{</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">if</span> subview.<span style="color: #703daa;">bounds</span>.<span style="color: #703daa;">height</span> <= <span style="color: #272ad8;">1.0</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
{</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
subview.<span style="color: #703daa;">backgroundColor</span> = color</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
}</div>
<div class="separator" style="clear: both;">
</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
}</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-xDMjyReM7C5kro4XDlb1H7qNJ3RkOuFoMBC6hZd55-_Uv9PmnFYfQyR3MQtphNlsQV6JBgE_id1h2XWZLKcoU90nHHyZPZ0fzh2miXAsllT7xGubTNT-U2IsE7qNV856Djrv9T2O_94/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-09+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+6.54.02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-xDMjyReM7C5kro4XDlb1H7qNJ3RkOuFoMBC6hZd55-_Uv9PmnFYfQyR3MQtphNlsQV6JBgE_id1h2XWZLKcoU90nHHyZPZ0fzh2miXAsllT7xGubTNT-U2IsE7qNV856Djrv9T2O_94/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-09+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+6.54.02.png" width="257" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
스토리 보드상에서 selectorColor을 설정 하면 바로 색상이 적용된다.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com1tag:blogger.com,1999:blog-4415536332332135706.post-25980011506594423092018-03-08T17:07:00.000+09:002018-03-08T17:07:08.032+09:00가로 모드에서 특정 뷰가 전체 화면이 되는 앱을 autolayout으로 어떻게 구현 하는가?세로 모드에서 컨텐츠가 가운데 표시되고 상단과 하단에는 네비게이션 바 부터 정보를 보여주는 Label 하단에는 각종 버튼이 있다고 하자.<br />
<br />
이러한 상태에서 가로모드로 전환을 하면 가운데 컨텐츠가 전체 화면으로 변경 되는 앱을 만든다고 하면 어찌 하는가?<br />
아래 그림을 참조<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiejrIugT31Vlv6XNFzl_zJ74SVj6yn5daaunjHJ0aAR2gS_uQ3-wbAKowGs7r7zXaFoseQhy2ilSRt2YRU8U7ux9w3w6jsj93QdsrkKXV0IAZUBn6dU-RaZAK9PxcHZQcBj1Tpwmkju9g/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-08+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+4.30.16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiejrIugT31Vlv6XNFzl_zJ74SVj6yn5daaunjHJ0aAR2gS_uQ3-wbAKowGs7r7zXaFoseQhy2ilSRt2YRU8U7ux9w3w6jsj93QdsrkKXV0IAZUBn6dU-RaZAK9PxcHZQcBj1Tpwmkju9g/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-08+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+4.30.16.png" width="197" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfs9ffMRE9HSVqy-sPltlAXQE-0AYWytpz6iKsB-fB_6k7KLLzT9VIuCCihgD5I1aH3FpTQmcH0RCM5D9GXVBZRLpvSxKToxk48biQ3MQlzs-IcJnQs1cBeAt_-je5TUe-EibmG6ptsbI/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-08+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+4.30.26.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfs9ffMRE9HSVqy-sPltlAXQE-0AYWytpz6iKsB-fB_6k7KLLzT9VIuCCihgD5I1aH3FpTQmcH0RCM5D9GXVBZRLpvSxKToxk48biQ3MQlzs-IcJnQs1cBeAt_-je5TUe-EibmG6ptsbI/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-08+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+4.30.26.png" width="400" /></a></div>
<br />
<br />
<br />
화면 전환을 인지 하는 코드는. willTransition() 메서드로 인지 할 수 있다.<br />
<br />
UIDevice.current.orientation.isLandscape 의 값을 확인 하여 현재 landscape 모드인지 확인이 가능 하다.<br />
<br />
이럴때 가운데 컨텐츠의 autolayout constraint 값을 (0)으로 변경 하면 쉽게 해결 할 수 있다.<br />
즉 세로모드로 IB에서 디자인을 하고 autolayout constraint를 적용 할때 Video 라는 글이 있는 검정색 뷰의 부모 뷰에 대한 constraint Align top to:와 Align Bottom to:를 IBOutlet으로 연결하여<br />
코드로 값을 조정 하면된다.<br />
<br />
나머지 나비게이션콘트롤러의 바나, 레이블, 버튼등도 코드로 isHidden 값을 정해 주면 된다.<br />
<br />
하여 완성된 ViewController의 코드는 다음과 같다.<br />
<br />
<div style="background-color: white; color: #ba2da2; font-family: Menlo; font-stretch: normal; line-height: normal;">
import<span style="color: black;"> UIKit</span></div>
<div style="background-color: white; font-family: Helvetica; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">class</span> ViewController: <span style="color: #703daa;">UIViewController</span> {</div>
<div style="background-color: white; font-family: Helvetica; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">@IBOutlet</span> <span style="color: #ba2da2;">weak</span> <span style="color: #ba2da2;">var</span> topContraint: <span style="color: #703daa;">NSLayoutConstraint</span>!</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">@IBOutlet</span> <span style="color: #ba2da2;">weak</span> <span style="color: #ba2da2;">var</span> bottomConstraint: <span style="color: #703daa;">NSLayoutConstraint</span>!</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">@IBOutlet</span> <span style="color: #ba2da2;">weak</span> <span style="color: #ba2da2;">var</span> infoLabel: <span style="color: #703daa;">UILabel</span>!</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">@IBOutlet</span> <span style="color: #ba2da2;">weak</span> <span style="color: #ba2da2;">var</span> controlButton: <span style="color: #703daa;">UIButton</span>!</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal; min-height: 13px;">
</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #ba2da2;">override</span> <span style="color: #ba2da2;">func</span> willTransition(to newCollection: <span style="color: #703daa;">UITraitCollection</span>, with coordinator: <span style="color: #703daa;">UIViewControllerTransitionCoordinator</span>) {</div>
<div style="background-color: white; color: #703daa; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span><span style="color: #ba2da2;">if</span><span style="color: black;"> </span>UIDevice<span style="color: black;">.</span>current<span style="color: black;">.</span>orientation<span style="color: black;">.</span>isLandscape<span style="color: black;"> == </span><span style="color: #ba2da2;">true</span><span style="color: black;"> {</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #4f8187;">topContraint</span>.<span style="color: #703daa;">constant</span> = <span style="color: #272ad8;">0</span></div>
<div style="background-color: white; color: #4f8187; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span>bottomConstraint<span style="color: black;">.</span><span style="color: #703daa;">constant</span><span style="color: black;"> = </span><span style="color: #272ad8;">0</span></div>
<div style="background-color: white; color: #703daa; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span><span style="color: #ba2da2;">self</span><span style="color: black;">.</span>navigationController<span style="color: black;">?.</span>isNavigationBarHidden<span style="color: black;"> = </span><span style="color: #ba2da2;">true</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #4f8187;">infoLabel</span>.<span style="color: #703daa;">isHidden</span> = <span style="color: #ba2da2;">true</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #4f8187;">controlButton</span>.<span style="color: #703daa;">isHidden</span> = <span style="color: #ba2da2;">true</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
} <span style="color: #ba2da2;">else</span> {</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #4f8187;">topContraint</span>.<span style="color: #703daa;">constant</span> = <span style="color: #272ad8;">122</span></div>
<div style="background-color: white; color: #4f8187; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span>bottomConstraint<span style="color: black;">.</span><span style="color: #703daa;">constant</span><span style="color: black;"> = </span><span style="color: #272ad8;">300</span></div>
<div style="background-color: white; color: #703daa; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: black;"> </span><span style="color: #ba2da2;">self</span><span style="color: black;">.</span>navigationController<span style="color: black;">?.</span>isNavigationBarHidden<span style="color: black;"> = </span><span style="color: #ba2da2;">false</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #4f8187;">infoLabel</span>.<span style="color: #703daa;">isHidden</span> = <span style="color: #ba2da2;">false</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="color: #4f8187;">controlButton</span>.<span style="color: #703daa;">isHidden</span> = <span style="color: #ba2da2;">false</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
}</div>
<div style="background-color: white; font-family: Helvetica; font-stretch: normal; line-height: normal; min-height: 14px;">
<br /></div>
<br />
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
}</div>
sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-13512482321442714882018-03-01T21:57:00.000+09:002018-03-02T09:30:04.760+09:00Xcode 9 GitHub 계정 지원 기능 알아 보기xcode 9 이 되면서 Github 계정 연동 기능이 추가 되었다.<br />
기존 버젼도 git을 지원 하기는 하였지만 좀더 많은 기능이 추가되었다.<br />
<br />
<br />
<br />
특히 이번 버젼에는 좌측 Navigator 화면에 Source Control Navigator가 추가 되었고 직관적으로 볼수 있게 되었다.<br />
<br />
<h4>1. github계정 생성</h4><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7vqg-CBD0ThJ6WSFbyHQhlkLwCuKyrgXsqmnLbUrL80osrMF5NYQfsowLvUx3fk3WzL7p4EB6r8FUgFY2SF2DaHd9V44lUKV1i4MEP9VOatOwdVP99mfSUonx4u0PkAPuqr1mPFMOhOI/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-02+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.18.41.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="276" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7vqg-CBD0ThJ6WSFbyHQhlkLwCuKyrgXsqmnLbUrL80osrMF5NYQfsowLvUx3fk3WzL7p4EB6r8FUgFY2SF2DaHd9V44lUKV1i4MEP9VOatOwdVP99mfSUonx4u0PkAPuqr1mPFMOhOI/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-02+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.18.41.png" width="400" /></a></div><br />
메뉴 Xcode -> Preferences -> Accounts<br />
에서 Github 계정을 추가 할 수 있다.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1Lfm4LbOTgASLWiPnxY5TjnrticUCYHYZ3zcY0bFYI1Z4Nh0KLrylPqnnZNKvzCrrG5lnRWQVNkl_DcSP3B-WdqSMtL18Bd6AUaVjcm5nmOcmDEA8y0lA_x_HIAVrXckw7wwC0xzYd7o/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-02+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.25.47.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="223" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1Lfm4LbOTgASLWiPnxY5TjnrticUCYHYZ3zcY0bFYI1Z4Nh0KLrylPqnnZNKvzCrrG5lnRWQVNkl_DcSP3B-WdqSMtL18Bd6AUaVjcm5nmOcmDEA8y0lA_x_HIAVrXckw7wwC0xzYd7o/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-02+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.25.47.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><br />
<br />
메뉴 Xcode -> Preferences -> Source Control -> Git<br />
에서 git 관련 설정을 할 수 있다.<br />
<br />
<br />
<h4>2. Source Control Navigator 활용</h4><div><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7s1WoysGSjC4G_mhTtorm-nLm414jBeL50EArmkF8GiD78VKJFLeYphqrRP0LggAEl03rMv1qGONok60ds3OPyGJMl6H07PqZ5U3JJP7jnLsUMDrQqGWLnPfEJOXzs_BvLOatdRsWWXs/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-02+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.19.32.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7s1WoysGSjC4G_mhTtorm-nLm414jBeL50EArmkF8GiD78VKJFLeYphqrRP0LggAEl03rMv1qGONok60ds3OPyGJMl6H07PqZ5U3JJP7jnLsUMDrQqGWLnPfEJOXzs_BvLOatdRsWWXs/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-02+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.19.32.png" width="400" /></a></div><br />
<br />
<br />
좌측 Source Control Navigator ( Cmd + 2) 화면에서는 브랜치 전환 및 git message를 확인 할 수 있는 기능이 새롭게 추가 되었다.<br />
<br />
<br />
<h4>3. github 계정에 원격 리포지토리 생성</h4><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje1sGy9ZOA0a6hggxKkxRXNlqGB_oCZytiOpgioN7yMwCN5H6V4ZuYHd2-PPtQfjS5nQkJvBCSaLjNJTbrMTcyUJfvTuE5gvqWlIkvC30nsw7TAyglXwN62LT0iZ3ny_3eu0duNWrTbEw/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-02+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.19.55.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="350" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje1sGy9ZOA0a6hggxKkxRXNlqGB_oCZytiOpgioN7yMwCN5H6V4ZuYHd2-PPtQfjS5nQkJvBCSaLjNJTbrMTcyUJfvTuE5gvqWlIkvC30nsw7TAyglXwN62LT0iZ3ny_3eu0duNWrTbEw/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-02+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.19.55.png" width="400" /></a></div><br />
<br />
Source Control Navigator에서. Remotes 마우스 우클릭으로 원격 리포지토리 생성이 가능 하다. 계정 설정에 연결된 GitHub 계정에 원격 리포지토리를 생성 할 수 있다.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
branch 생성 branch 간 전환도 가능 하다.<br />
<br />
<h4>4. 머지</h4><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyOPbN0A08cpohYkTJeceAN6WXbsiIoDXjNW3I_GAJMMuRXAeIejxQRTeKH2GWj3SSqf6sI8mk1mF08bRYnG8EJuHJB3ElCDBOwUxAwtQymaG1IQxWnXw8KZFsLcCzPW6BmHDEKTFEQ24/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-02+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.20.23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="333" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyOPbN0A08cpohYkTJeceAN6WXbsiIoDXjNW3I_GAJMMuRXAeIejxQRTeKH2GWj3SSqf6sI8mk1mF08bRYnG8EJuHJB3ElCDBOwUxAwtQymaG1IQxWnXw8KZFsLcCzPW6BmHDEKTFEQ24/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-02+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.20.23.png" width="400" /></a></div>test브랜치를 만들고 브랜치 전환을 하여 수정한 다음 손쉽게 마스터 브랜치에 머지 할 수 있다.<br />
<br />
<br />
<h4>6. 소스 컨트롤 메뉴</h4><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0rIkTVtor36mIKOBjG5uTScmUfMD-4XNVFOH2-pNcVUGg4faHIxN8FEcCz4jrzyfMh0iZn7_0sll1wnvTyZzrhALOUhi-AdhhF754xdrvhyphenhyphen8Qb3b2iMYk86H81OQ2QHDSJBghX1gpDlI/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-02+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.21.06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="292" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0rIkTVtor36mIKOBjG5uTScmUfMD-4XNVFOH2-pNcVUGg4faHIxN8FEcCz4jrzyfMh0iZn7_0sll1wnvTyZzrhALOUhi-AdhhF754xdrvhyphenhyphen8Qb3b2iMYk86H81OQ2QHDSJBghX1gpDlI/s400/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2018-03-02+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%258C%25E1%2585%25A5%25E1%2586%25AB+9.21.06.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div>상단 메뉴에서 Source Control 메뉴 GitHub 프로젝트에 대한 Clone , Repositores 생성 , Commit, Push, Pull 등 모든 기능을 할 수 있는 메뉴가 존재 한다.<br />
<br />
<br />
<br />
이상으로 간단하게 Xcode 9 에 새롭게 추가된 github 연동 및 git 관련 기능을 살펴 보았다.<br />
<br />
<br />
sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-67741253190464236372018-02-08T13:12:00.001+09:002018-03-01T21:57:43.847+09:00Xcode codesnippets 여러 맥머신에서 동일하게 동기화 하기 with iCloud versionhttps://mtsparrow.blogspot.kr/2016/01/xcode-code-snippets-key-binding-font.html<br />
<br />
이미 드랍박스를 이용하여 코드 스니핏을 동기화 한적이 있다.<br />
<br />
폰트, 단축키도 동기화 가능 하다.<br />
<br />
<br />
이번에는 같은 방법으로 iCloud 드라이브를 이용하는 것으로 동일한 방법이다.<br />
<br />
아이클라우드 도큐먼트 디렉토리에 XcodeDocs를 생성 한다.<br />
<br />
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">$ mkdir ~/Library/Mobile\ Documents/com~apple~CloudDocs/Documents/XcodeDocs</span></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
Xcode의 코드 스니프 디렉토리를 아이클라우드 디렉토리에 이동 한다.</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
$ mv -v ~/Library/Developer/Xcode/UserData/CodeSnippets ~/Library/Mobile\ Documents/com~apple~CloudDocs/Documents/XcodeDocs/</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
링크를 걸어준다. 다른 머신도 아래와 같이 링크를 걸어 주면 된다.</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
$ ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/Documents/XcodeDocs/CodeSnippets/ ~/Library/Developer/Xcode/UserData/CodeSnippets</div>
<div style="background-color: white; font-family: Menlo; font-stretch: normal; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<br />
<div style="background-color: white; font-family: Menlo; font-size: 11px; font-stretch: normal; line-height: normal;">
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-56334956288147198112017-12-19T22:11:00.003+09:002017-12-19T22:14:01.566+09:00macOS High Sierra에서는 이제 한/영 전환을 CapsLock으로 해야 하는게 옳은듯 하다. 프로그래머 라면..http://macnews.tistory.com/4540<br />
<br />
위글은 백투더맥에서 CapsLock 설정에 대한 글이고<br />
<br />
프로그래머 입장인 나로서는 간마에 XCode 9를 열어보고 당황할수 밖에 없었다.<br />
<br />
코드 입력 하는 곳에서 한/영 전환이 충돌이 나서 계속 타이핑이 삐 그덕 거리는 것이다.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis6AA3ujBcR3xFZ5z1624SXNB75H9mIZjJBpmzSDpk0BuQmv1Jwx7sKb63VTXa-dPOsK0Wb6X8fCnLaMjUEd1OVm53SmlqguSvTGCBeY1RTPHlPQYB6ovek_Vs8npPk_l4_sJZy7WpWfI/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2017-12-19+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.07.58.png" imageanchor="1"><img border="0" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis6AA3ujBcR3xFZ5z1624SXNB75H9mIZjJBpmzSDpk0BuQmv1Jwx7sKb63VTXa-dPOsK0Wb6X8fCnLaMjUEd1OVm53SmlqguSvTGCBeY1RTPHlPQYB6ovek_Vs8npPk_l4_sJZy7WpWfI/s640/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2017-12-19+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+10.07.58.png" width="640" /></a><br />
<br />
위와 같이 Xcode 9에서 코드 완성이 디폴트로 ^Space조합으로 되어 있어 한영 전환을 ^Space로 설정 하면 문제가 생기는 것이다.<br />
<br />
eclipse도 디폴트로 비슷한 기능이 ^Space로 설정되어 있고 이제 한영전환 키를 ^Space로는 개발툴에서 사용하기 어렵게 된것 같다.<br />
<br />
처음 mac을 접할때 cmd+space는 맘에 들었느데 중간에 ^Space로 반강제로 갈아 타는 느낌이 었는데..<br />
<br />
이제 CapsLock으로 정착 해야겠다.sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com2tag:blogger.com,1999:blog-4415536332332135706.post-47517883217472824722017-07-13T22:41:00.000+09:002017-07-13T22:41:00.330+09:00Visual Studio 에서 Sublime Text나 Visual Studio Code의 멀티 셀렉트 기능을 하려면? Sublime Text에서 Mac의 경우 CMD + D 윈도우의 경우 Ctrl + D 기능을 아주 좋아 한다.<br />
<br />
코드를 작성 하다가 변수를 쫙 선택 해서 이름을 변경 한다 든지 아주 유용한 기능이다.<br />
<br />
Sublime Text 사이트에서 동영상을 보고 반하지 않을수 없는 기능이었다.<br />
<br />
Visual Studio Code를 가끔 사용하는데 왠지 Sublime Text와 비슷한 느낌이고 역시<br />
기능이나 단축키가 비슷하고 좋다.<br />
<br />
Visual Studio Code 역시 같은 기능이 존재 한다.<br />
<br />
그러나 Visual Studio는 그 기능이 없다.<br />
<br />
요즘 윈도우 어플리케이션 개발을 많이 하기에 Visual Studio도 많이 사용한다.<br />
<br />
Visual Studio에서도 멀티 셀렉트 기능을 사용하고 싶어져서 검색을 해보 았다.<br />
<br />
역쉬 있더라..<br />
<br />
https://marketplace.visualstudio.com/items?itemName=MarcoAlamia-CodingLabs.MixEdit<br />
<br />
위 링크에 플러그인을 설치 해줘야 동일 한 기능을 맛볼 수 있다.<br />
<br />
이 플러그인 역시 Sublime Text 처럼 동작 동영상이 있다.<br />
<br />
<br />
<br />sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-61936989594535616642017-03-08T13:00:00.003+09:002017-03-08T13:01:21.756+09:00Xcode 8.2.1 application building시 크래쉬 발생 <pre style="background-color: #eff0f1; border: 0px; color: #242729; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;">Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
ProductBuildVersion: 8C1002
UNCAUGHT EXCEPTION (NSRangeException): *** -[__NSArrayM objectAtIndex:]: index 3 beyond bounds [0 .. 2]
UserInfo: (null)
Hints:
0: Creation Backtrace for Notification Token:
0 -[_DVTNotificationReceiver initWithBlock:queue:] (in DVTFoundation)
1 -[NSNotificationCenter(DVTNSNotificationCenterAdditions) dvt_addObserverForName:object:queue:usingBlock:] (in DVTFoundation)
2 -[_IDENavigatorOutlineViewDataSource setRootItems:] (in IDEKit)
3 -[IDENavigatorOutlineView _updateRootItems:sortDescriptors:] (in IDEKit)
4 -[IDENavigatorOutlineView setRootItems:] (in IDEKit)
5 -[IDENavigatorOutlineView _updateBoundContentArrayOrSet] (in IDEKit)
6 -[IDENavigatorOutlineView updateBoundContentArray] (in IDEKit)
7 -[NSObject(DVTBindingUtilities) updateBoundValueForBinding:] (in DVTKit)
8 -[DVTBindingHelper observeValueForKeyPath:ofObject:change:context:] (in DVTKit)
9 NSKeyValueNotifyObserver (in Foundation)
10 NSKeyValueDidChange (in Foundation)
11 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] (in Foundation)
12 _NSSetObjectValueAndNotify (in Foundation)
13 -[IDEBatchFindNavigator updateScopeItems:] (in IDEKit)
14 __44-[IDEBatchFindNavigator setupLocationPicker]_block_invoke_2 (in IDEKit)
15 -[NSObject(DVTObservingConvenience) _dvt_newObserverForKeyPath:options:owner:creationBacktrace:withHandlerBlock:] (in DVTFoundation)
16 -[NSObject(DVTObservingConvenience) dvt_newObserverForKeyPath:options:withHandlerBlock:] (in DVTFoundation)
17 -[IDEBatchFindNavigator setupLocationPicker] (in IDEKit)
18 -[IDEBatchFindNavigator viewDidInstall] (in IDEKit)
19 -[DVTViewController _viewDidInstall] (in DVTKit)
20 -[_DVTViewController_ViewLifecycleInterpositions viewDidMoveToWindow] (in DVTKit)
21 -[NSView _setWindow:] (in AppKit)
22 -[NSView addSubview:] (in AppKit)
23 __42-[DVTReplacementView _setupViewController]_block_invoke (in DVTKit)
24 DVTInvokeWithFailureHint (in DVTFoundation)
25 -[DVTReplacementView _setupViewController] (in DVTKit)
26 -[DVTReplacementView installedViewController] (in DVTKit)
27 -[DVTReplacementView layoutTopDown] (in DVTKit)
28 -[DVTLayoutView_ML _reallyLayoutIfNeededTopDown] (in DVTKit)
29 +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
30 +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
31 +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
32 +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
33 +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
34 +[DVTLayoutView_ML _doRecursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:completionCallBackHandlers:currentLayoutPass:needsSecondPass:] (in DVTKit)
35 +[DVTLayoutView_ML _recursivelyLayoutSubviewsOfView:populatingSetWithLaidOutViews:] (in DVTKit)
36 -[DVTLayoutView_ML viewWillDraw] (in DVTKit)
37 -[NSView viewWillDraw] (in AppKit)
38 -[NSView viewWillDraw] (in AppKit)
39 -[NSView viewWillDraw] (in AppKit)
40 -[NSView _sendViewWillDrawInRect:clipRootView:] (in AppKit)
41 -[NSView displayIfNeeded] (in AppKit)
42 -[NSWindow displayIfNeeded] (in AppKit)
43 ___NSWindowGetDisplayCycleObserver_block_invoke6365 (in AppKit)
44 __37+[NSDisplayCycle currentDisplayCycle]_block_invoke (in AppKit)
45 CA::Transaction::run_commit_handlers(CATransactionPhase) (in QuartzCore)
46 CA::Context::commit_transaction(CA::Transaction*) (in QuartzCore)
47 CA::Transaction::commit() (in QuartzCore)
48 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) (in QuartzCore)
49 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ (in CoreFoundation)
50 __CFRunLoopDoObservers (in CoreFoundation)
51 CFRunLoopRunSpecific (in CoreFoundation)
52 RunCurrentEventLoopInMode (in HIToolbox)
53 ReceiveNextEventCommon (in HIToolbox)
54 _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
55 _DPSNextEvent (in AppKit)
56 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit)
57 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
58 -[NSApplication run] (in AppKit)
59 NSApplicationMain (in AppKit)
60 start (in libdyld.dylib)
Backtrace:
0 __exceptionPreprocess (in CoreFoundation)
1 DVTFailureHintExceptionPreprocessor (in DVTFoundation)
2 objc_exception_throw (in libobjc.A.dylib)
3 -[__NSArrayM objectAtIndex:] (in CoreFoundation)
4 -[_IDENavigatorOutlineViewDataSource outlineView:child:ofItem:] (in IDEKit)
5 refreshRowEntryItemAndLevelInfo (in AppKit)
6 -[NSOutlineView reloadItem:reloadChildren:] (in AppKit)
7 -[IDENavigatorOutlineView reloadItem:reloadChildren:] (in IDEKit)
8 __83-[_IDENavigatorOutlineViewDataSource _processNavigableItemGraphChangeNotification:]_block_invoke.735 (in IDEKit)
9 +[NSAnimationContext(DVTNSAnimationContextAdditions) dvt_nonAnimatedBlock:] (in DVTKit)
10 -[IDENavigatorOutlineView suspendEditingWhilePerformingBlock:] (in IDEKit)
11 -[_IDENavigatorOutlineViewDataSource _processNavigableItemGraphChangeNotification:] (in IDEKit)
12 DVTInvokeWithLazyFailureHint (in DVTFoundation)
13 __48-[_DVTNotificationReceiver receiveNotification:]_block_invoke.42 (in DVTFoundation)
14 -[_DVTNotificationReceiver receiveNotification:] (in DVTFoundation)
15 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ (in CoreFoundation)
16 ___CFXRegistrationPost_block_invoke (in CoreFoundation)
17 _CFXRegistrationPost (in CoreFoundation)
18 ___CFXNotificationPost_block_invoke (in CoreFoundation)
19 -[_CFXNotificationRegistrar find:object:observer:enumerator:] (in CoreFoundation)
20 _CFXNotificationPost (in CoreFoundation)
21 -[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation)
22 -[NSNotificationCenter(DVTNSNotificationCenterAdditions) _dvt_postNotificationName:object:userInfo:] (in DVTFoundation)
23 -[IDENavigableItemCoordinator _postNotificationNamed:forChangedItems:] (in IDEKit)
24 -[IDENavigableItemCoordinator _delayedPostGraphAndPropertyChangeNotifications] (in IDEKit)
25 __48-[DVTDelayedInvocation initWithTarget:selector:]_block_invoke (in DVTFoundation)
26 -[DVTDelayedInvocation runBlock:] (in DVTFoundation)
27 __NSFirePerformWithOrder (in Foundation)
28 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ (in CoreFoundation)
29 __CFRunLoopDoObservers (in CoreFoundation)
30 __CFRunLoopRun (in CoreFoundation)
31 CFRunLoopRunSpecific (in CoreFoundation)
32 RunCurrentEventLoopInMode (in HIToolbox)
33 ReceiveNextEventCommon (in HIToolbox)
34 _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox)
35 _DPSNextEvent (in AppKit)
36 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit)
37 -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit)
38 -[NSApplication run] (in AppKit)
39 NSApplicationMain (in AppKit)
40 start (in libdyld.dylib)
abort() called
Application Specific Signatures:
NSRangeException
Application Specific Backtrace 1:
0 CoreFoundation 0x00007fff9993a452 __exceptionPreprocess + 178
1 DVTFoundation 0x0000000106127762 DVTFailureHintExceptionPreprocessor + 194
2 libobjc.A.dylib 0x00007fff882b8f7e objc_exception_throw + 48
3 CoreFoundation 0x00007fff99851725 -[__NSArrayM objectAtIndex:] + 245
4 IDEKit 0x000000010776c830 -[_IDENavigatorOutlineViewDataSource outlineView:child:ofItem:] + 190
5 AppKit 0x00007fff86d092e5 refreshRowEntryItemAndLevelInfo + 327
6 AppKit 0x00007fff86d02f67 -[NSOutlineView reloadItem:reloadChildren:] + 3024
7 IDEKit 0x0000000107767d7b -[IDENavigatorOutlineView reloadItem:reloadChildren:] + 357
8 IDEKit 0x000000010776ac2e __83-[_IDENavigatorOutlineViewDataSource _processNavigableItemGraphChangeNotification:]_block_invoke.735 + 522
9 DVTKit 0x000000010685464f +[NSAnimationContext(DVTNSAnimationContextAdditions) dvt_nonAnimatedBlock:] + 132
10 IDEKit 0x0000000107765441 -[IDENavigatorOutlineView suspendEditingWhilePerformingBlock:] + 101
11 IDEKit 0x000000010776a76d -[_IDENavigatorOutlineViewDataSource _processNavigableItemGraphChangeNotification:] + 2226
12 DVTFoundation 0x0000000106127576 DVTInvokeWithLazyFailureHint + 100
13 DVTFoundation 0x00000001060e1f32 __48-[_DVTNotificationReceiver receiveNotification:]_block_invoke.42 + 149
14 DVTFoundation 0x00000001060e1c7f -[_DVTNotificationReceiver receiveNotification:] + 1054
15 CoreFoundation 0x00007fff998c5b1c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
16 CoreFoundation 0x00007fff998c5aaf ___CFXRegistrationPost_block_invoke + 63
17 CoreFoundation 0x00007fff998c5a27 _CFXRegistrationPost + 407
18 CoreFoundation 0x00007fff998c5792 ___CFXNotificationPost_block_invoke + 50
19 CoreFoundation 0x00007fff99882542 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1922
20 CoreFoundation 0x00007fff99881795 _CFXNotificationPost + 693
21 Foundation 0x00007fff9718e17a -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
22 DVTFoundation 0x00000001060e338a -[NSNotificationCenter(DVTNSNotificationCenterAdditions) _dvt_postNotificationName:object:userInfo:] + 360
23 IDEKit 0x000000010794c00f -[IDENavigableItemCoordinator _postNotificationNamed:forChangedItems:] + 542
24 IDEKit 0x000000010794c35d -[IDENavigableItemCoordinator _delayedPostGraphAndPropertyChangeNotifications] + 713
25 DVTFoundation 0x0000000105ef15a8 __48-[DVTDelayedInvocation initWithTarget:selector:]_block_invoke + 79
26 DVTFoundation 0x0000000105ef298b -[DVTDelayedInvocation runBlock:] + 257
27 Foundation 0x00007fff9726884a __NSFirePerformWithOrder + 339
28 CoreFoundation 0x00007fff998cefc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
29 CoreFoundation 0x00007fff998cef37 __CFRunLoopDoObservers + 391
30 CoreFoundation 0x00007fff998ae408 __CFRunLoopRun + 872
31 CoreFoundation 0x00007fff998ade38 CFRunLoopRunSpecific + 296
32 HIToolbox 0x00007fff87c2b935 RunCurrentEventLoopInMode + 235
33 HIToolbox 0x00007fff87c2b76f ReceiveNextEventCommon + 432
34 HIToolbox 0x00007fff87c2b5af _BlockUntilNextEventMatchingListInModeWithFilter + 71
35 AppKit 0x00007fff869a2df6 _DPSNextEvent + 1067
36 AppKit 0x00007fff869a2226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
37 DVTKit 0x00000001066d1eaf -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 396
38 AppKit 0x00007fff86996d80 -[NSApplication run] + 682
39 AppKit 0x00007fff86960368 NSApplicationMain + 1176
40 libdyld.dylib 0x00007fff94a015ad start + 1
41 ??? 0x0000000000000001 0x0 + 1</code></pre>
<br />
위와 같은 콜스택을 뿜으며 빌 Xcode 서 앱을 빌드 하다가 크래쉬가 발생하면서 비정상 종료 하고 다시 Xcode를 실행 시키면 실행 바로 크래쉬 되어 Xcode 수행이 어려운 경우<br />
<br />
이런 경우<br />
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;">rm -rf ~/Library/Developer/Xcode/DerivedData</span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<span style="font-family: -webkit-standard; font-size: small;">위 명령을 수행하여 Xcode를 수행 가능 하게는 할 수 있으나</span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<span style="font-family: -webkit-standard; font-size: small;">다시 빌드를 하면 또 비정상 종료 되는 경우가 있다.</span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<span style="font-family: -webkit-standard; font-size: small;"><br /></span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<span style="font-family: -webkit-standard; font-size: small;">이런 경우 해결 방법</span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<span style="font-family: -webkit-standard; font-size: small;"><br /></span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<span style="font-family: -webkit-standard; font-size: small;">1. Product -> Scheme -> Manage Scheme </span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<span style="font-family: -webkit-standard; font-size: small;">에서 새로운 빌드 스킴을 만들고 이전 빌드 스킴 대신 사용해본다.</span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<span style="font-family: -webkit-standard; font-size: small;"><br /></span></div>
<div style="background-color: white; line-height: normal;">
위와 같이 해도 크래쉬가 발생하면</div>
<div style="background-color: white; line-height: normal;">
<br /></div>
<div style="background-color: white; line-height: normal;">
Pod 로 서드 파티 라이브러리를 이용하고 .xcworkspace를 사용중이라면</div>
<div style="background-color: white; line-height: normal;">
다음의 절차를 수행 한다.</div>
<div style="background-color: white; line-height: normal;">
<br /></div>
<div style="background-color: white; line-height: normal;">
프로젝트. xcworkspace파일을 과감하게 삭제 하고</div>
<div style="background-color: white; line-height: normal;">
pod install 명령으로 새로 .xcworkspace를 생성 하여 xcode를 새로 생성된 xcworkspace</div>
<div style="background-color: white; line-height: normal;">
파일로 시작 하고 빌드 한다.</div>
<div style="background-color: white; line-height: normal;">
<br /></div>
sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-78521599061695000692016-12-21T23:35:00.000+09:002016-12-21T23:35:00.293+09:00마크다운 편집기로 MS VisualStudio Code가 짱이닷!<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixFLy_9p0qI91K5fRqB-k71SCat_DesmZkxjn4Yg-SoBCTpqoS6QD3kTp_j_xF4NpD4d5AghcefI_4U-Sr7BN9s0sdc9l-8pdQF4cKrDV5Au3-koI3Yp5lQVKQw2ghyphenhyphenVRNmbtcfySwwk4/s1600/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2016-12-21+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+11.31.18.png" imageanchor="1"><img border="0" height="332" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixFLy_9p0qI91K5fRqB-k71SCat_DesmZkxjn4Yg-SoBCTpqoS6QD3kTp_j_xF4NpD4d5AghcefI_4U-Sr7BN9s0sdc9l-8pdQF4cKrDV5Au3-koI3Yp5lQVKQw2ghyphenhyphenVRNmbtcfySwwk4/s640/%25E1%2584%2589%25E1%2585%25B3%25E1%2584%258F%25E1%2585%25B3%25E1%2584%2585%25E1%2585%25B5%25E1%2586%25AB%25E1%2584%2589%25E1%2585%25A3%25E1%2586%25BA+2016-12-21+%25E1%2584%258B%25E1%2585%25A9%25E1%2584%2592%25E1%2585%25AE+11.31.18.png" width="640" /></a><br />
<br />
<br />
마크다운 편집기로서<br />
M$ visual studio code가 최고닷!<br />
<br />
확장자 md로 설정하고 미리보기를 클릭 한 다음 좌우로 화면을 분할 하면<br />
입력과 동시에 미리 보기가 보여주기 때문에 최고의 툴 이라 할 수 있겠다.<br />
<br />
<br />sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-88066388703520216112016-12-10T09:43:00.002+09:002016-12-10T09:43:32.064+09:00XCode 8.x "No such module error"<span style="font-family: inherit;">Xcode 8.x의 버그로 생각 된다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Xcode 8 로 버젼 업이 되면서 swift 2.3 / 3.0으로 컨버팅 개고생을 당하고</span><br />
<span style="font-family: inherit;">이용하는 pod 라이브러리 업데이트 까지 아주 개고생을 시키고</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">하루에 20번 정도에 크래쉬를 경험 하여 짜증이 많이 나는데</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">어느날 갑자기 No such module error가 난다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">계속 참조 하고 있던 모듈인데....</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">이런 경우 아래의 스텝 으로 처리 시도를 하였으나 소용이 없다.</span><br />
<br />
xcode 종료<br />
<br />
<span style="font-family: inherit;">pod cache clean</span><br />
<span style="font-family: inherit;"><br /></span>
<div style="background-color: white; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;">pod deintegrate || rm -rf Pods</span></span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;"><br /></span></span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;"><span style="font-variant-ligatures: no-common-ligatures;"></span></span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;">rm -rf ~/Library/Developer/Xcode/DerivedData</span></span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;"><br /></span></span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;">xcode 재시작</span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;">clean</span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;">build</span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: inherit;"><br /></span></span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;">이렇게 하여도 계속 되는 이유 없는 에러가 속출 된다면</span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;">다음에 방법을 써보는 것도 좋다.</span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;">왼쪽 상단에 New scheme 클릭 또는 Product -> Scheme -> New schem 메뉴</span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;">이렇게 새로운 컴파일 스킴을 추가 한다.</span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;">그리고 새로운 컴파일 스킴으로 build 한다.</span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;">나의 경우는 마법처럼 모든 에러가 사라 졌다.</span></div>
<div style="background-color: white; line-height: normal;">
<span style="font-family: inherit;"><br /></span></div>
<div style="background-color: white; line-height: normal;">
<br /></div>
<div style="background-color: white; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; line-height: normal;">
<br /></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><br /></span></div>
<div style="background-color: white; font-family: Menlo; font-size: 11px; line-height: normal;">
<span style="font-variant-ligatures: no-common-ligatures;"><br /></span></div>
sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com2tag:blogger.com,1999:blog-4415536332332135706.post-65420840153921081002016-10-26T22:21:00.003+09:002016-10-26T22:21:48.610+09:00trobleshooting installation issue with CocoaPods<span style="font-family: inherit;">CocoaPods</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"><a href="http://mtsparrow.blogspot.kr/2016/03/cocoapod.html">http://mtsparrow.blogspot.kr/2016/03/cocoapod.html</a></span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">github에서 좋은 오픈소스를 찾아 iOS프로젝트에 추가 하려고 하면</span><br />
<span style="font-family: inherit;">CocoaPods을 주로 사용 했다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;"> 프로젝트에 프레임워크를 추가 하기 좋긴 한대 가끔 이게 문제가 생기고</span><br />
<span style="font-family: inherit;">이유 없는 빌드 에러를 만들어 내면 남감 하다.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Xcode에서 이유없는 빌드 에러를 만나거나 오동작 할때는 가끔씩</span><br />
<div style="line-height: normal;">
<span style="font-family: inherit;"><span style="-webkit-font-kerning: none;"><span style="background-color: #f7f7f7; color: #777777;">r</span><span style="background-color: white;">m -rf </span></span><span style="background-color: white;"><span style="-webkit-font-kerning: none;">~</span><span style="-webkit-font-kerning: none;">/Library/Developer/Xcode/DerivedData</span></span></span></div>
<div style="line-height: normal;">
<span style="background-color: white;"><span style="font-family: inherit;"><br /></span></span></div>
<div style="line-height: normal;">
<span style="background-color: white;"><span style="font-family: inherit;">여기를 정리 하곤 한다.</span></span></div>
<div style="line-height: normal;">
<span style="background-color: white;"><span style="font-family: inherit;"><br /></span></span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;">CocoaPods 도 무언가 오동작을 하거나 계속되는 이유없는 빌드 에러를 만날때 </span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;">해볼 만한 방법은</span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;"><br /></span></div>
<div style="line-height: normal;">
<span style="-webkit-font-kerning: none; background-color: white;"><span style="font-family: inherit;">pod cache clean frameworkName1</span></span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;"><span style="font-kerning: none;">pod cache clean </span>frameworkName2</span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;"><span style="font-kerning: none;">pod cache clean </span>frameworkName3</span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;"><span style="font-kerning: none;">pod cache clean </span>frameworkName4</span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;"><span style="font-kerning: none;">pod deintegrate </span><span style="-webkit-font-kerning: none;">||</span><span style="font-kerning: none;"> rm -rf Pods</span></span></div>
<div style="line-height: normal;">
<span style="-webkit-font-kerning: none; background-color: white;"><span style="font-family: inherit;">pod install --verbose</span></span></div>
<div style="line-height: normal;">
</div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;"><span style="font-kerning: none;">rm -rf </span><span style="-webkit-font-kerning: none;">~</span><span style="font-kerning: none;">/Library/Developer/Xcode/DerivedData</span></span></div>
<div style="line-height: normal;">
<span style="-webkit-font-kerning: none; background-color: white;"><span style="font-family: inherit;"><br /></span></span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;"><br /></span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;">요즘은 </span><span style="background-color: white; font-family: inherit;">Carthage </span><span style="background-color: white; font-family: inherit;">를 많이 사용하는 것 같다.</span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;"><a href="https://github.com/Carthage/Carthage">https://github.com/Carthage/Carthage</a></span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;"><br /></span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;">하지만 아직 사용방법을 모른다.</span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;"><br /></span></div>
<div style="line-height: normal;">
<span style="background-color: white; font-family: inherit;">나중에 새로운 프로젝트를 시작 할때는 참조 프레임워크를 Carthage로 추가 해봐야 겠다.</span></div>
<div style="background-color: #f7f7f7; color: #777777; font-family: Menlo; font-size: 11.9px; line-height: normal;">
<br /></div>
sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0tag:blogger.com,1999:blog-4415536332332135706.post-59951983156107555202016-10-23T22:11:00.000+09:002016-10-23T22:11:24.754+09:002007 mid mac mini ubuntu install<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwNa30n17SszST6-M6kVrG5GaIMFqo2bEwGRXn7DciPrQ4brdFpY840n0FSnNpQdaChDEcqZ0QGM1n48Gh2hXqJItvBdeNFlhXRojXHriY9FuiovYTKdhjc2f2hqkatCqbnTm7hLcT_sc/s1600/IMG_3387.JPG" imageanchor="1"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwNa30n17SszST6-M6kVrG5GaIMFqo2bEwGRXn7DciPrQ4brdFpY840n0FSnNpQdaChDEcqZ0QGM1n48Gh2hXqJItvBdeNFlhXRojXHriY9FuiovYTKdhjc2f2hqkatCqbnTm7hLcT_sc/s640/IMG_3387.JPG" width="480" /></a><br />
<br />
요약 :<br />
우분투 32비트 설치를 위한 USB부팅 이미지를 만든다.<br />
efi/boot/boot.iso<br />
<br />
우분트 32비트 설치 이미지를 boot.iso로 이름을 변경해서 mac mini에 USB를 꽂은 다음 alt (option) 키로 부팅 하면<br />
부팅 디스크 설정에서 usb선택시 32비트 우분투를 설치 할 수 있다.<br />
<br />
설치 중간에 boot-repair를 이용해서 부트를 수정 하여 이제 옵션 키를 누르지 않고 바로 부팅이 가능하게 만든다.<br />
다시 usb로 부팅해서 파티션을 나눈다. 32비트 우분투는 20기가 정도 설정한다.<br />
<br />
UNetbootin 을 32비트 우분트에 설치해서 64비트 우분트를 내려 받고 설치 한다.<br />
<br />
<br />
아래에 링크를 따라 하면 설치 할 수 있다.<br />
<br />
<a href="http://digiecologist.blogspot.kr/2015/12/installing-ubuntu-on-2007-mac-mini-a1176.html">http://digiecologist.blogspot.kr/2015/12/installing-ubuntu-on-2007-mac-mini-a1176.html</a><br />
<br />
<br />
아래의 내용은 따라 하면 에러가 난다.<br />
sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update<br />
sudo apt-get install -y boot-repair<br />
boot-repair<br />
<br />
이과정에서 key 에러가 나면<br />
http://askubuntu.com/questions/308760/w-gpg-error-http-ppa-launchpad-net-precise-release-the-following-signatures<br />
<br />
The link above provides detailed explanation with screenshots. It also has some other simple methods that could be tried before doing this manually. Since it is not accessible from some regions let me describe the method that worked for me.<br />
<br />
Go to the OpenPGP Public Key Server. There you can enter your key into the Search String field, leaving everything else as is, then click "Search!".<br />
When searching for a key, always prepend 0x to it! This means that, for example, you have to search for 0x6AF0E1940624A220 instead of 6AF0E1940624A220.<br />
Click on the link provided in the pub section. This should take you to page containing the key. The page's heading should be similar to Public Key Server -- Get "0x6AF0E1940624A220"<br />
Copy everything from underneath the title (starting from -----BEGIN PGP PUBLIC KEY BLOCK-----) and save it in a file (e.g. key1).<br />
Once you have the file, run the following command<br />
sudo apt-key add key1<br />
<br />
http://keyserver.ubuntu.com<br />
위 내용으로 처리<br />
<br />
<br />
몇시간 삽질을 하니 이 사이트에 도움되로 잘 설치 된다.<br />
이제 맥미니 2007은 우분트 14.04로 다시 태어 났다.sparrowhttp://www.blogger.com/profile/12004929808282334191noreply@blogger.com0