<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>PROGRAMMING WORLD</title>
    <link>https://trycatching.tistory.com/</link>
    <description>programming 정보</description>
    <language>ko</language>
    <pubDate>Tue, 4 Aug 2026 15:22:26 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>Mind Hacker</managingEditor>
    <image>
      <title>PROGRAMMING WORLD</title>
      <url>https://tistory1.daumcdn.net/tistory/2314171/attach/eb81d68c3bd24d7d8fea28470c7cf470</url>
      <link>https://trycatching.tistory.com</link>
    </image>
    <item>
      <title>[AWS EC2] 서버에 apache 설치하기 (웹서버 설치)</title>
      <link>https://trycatching.tistory.com/46</link>
      <description>&lt;p&gt;&lt;span style=&quot;color: #333333;&quot;&gt;[2021-2-18 updated]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;지난 포스팅에서 AWS EC2 인스턴스를 생성했다.&lt;/p&gt;
&lt;p&gt;여기에 아파치 웹서버를 설치해보자.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;span style=&quot;color: #8a3db6;&quot;&gt;&lt;b&gt;&lt;a style=&quot;color: #8a3db6;&quot; href=&quot;https://trycatching.tistory.com/45&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;[링크]EC2인스턴스 생성후 서버에 접속하는 포스팅 바로가기&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. SSH 툴을 이용해서 내 서버(인스턴스)로 접속한다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. 우선 명령어 sudo apt-get update 를 날려 설치 가능한 리스트를 업데이트 하고&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3. 명령어 sudo apt-get install apache2 를 날려 아파치를 설치하자.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cYPRo4/btqXMe1E1TM/HvEgZRBpgb7XvW1eCVsTU0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cYPRo4/btqXMe1E1TM/HvEgZRBpgb7XvW1eCVsTU0/img.png&quot; data-alt=&quot;아파치 설치 명령어 화면&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cYPRo4/btqXMe1E1TM/HvEgZRBpgb7XvW1eCVsTU0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcYPRo4%2FbtqXMe1E1TM%2FHvEgZRBpgb7XvW1eCVsTU0%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;아파치 설치 명령어 화면&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;4. 설치가 완료되면 명령어 apache2 -version 을 날려서 아래와 같이 버전 정보가 나오는지 확인해보자.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignLeft&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dm4gd8/btqXRvnZLLj/mH5JZkaAHDGwSDtHbeUrN0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dm4gd8/btqXRvnZLLj/mH5JZkaAHDGwSDtHbeUrN0/img.png&quot; data-alt=&quot;아파치 버전 정보 확인&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dm4gd8/btqXRvnZLLj/mH5JZkaAHDGwSDtHbeUrN0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fdm4gd8%2FbtqXRvnZLLj%2FmH5JZkaAHDGwSDtHbeUrN0%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;아파치 버전 정보 확인&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;5. 이제 설치한 나의 웹서버에 브라우저로 접속을 하기 위해 보안그룹에 인바운드 규칙 추가 작업이 필요하다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - AWS 콘솔에 로그인하고 EC2 -&amp;gt; 네트워크 및 보안 탭에서 보안 그룹탭을 선택해준다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 인바운드 규칙 편집에 들어가서 유형에 HTTP, 그리고 소스를 위치무관으로 설정한 후 규칙 저장을 클릭한다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/C570q/btqXMdPfdo4/66pQ51J7iN38dimug2KKY1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/C570q/btqXMdPfdo4/66pQ51J7iN38dimug2KKY1/img.png&quot; data-alt=&quot;AWS 인바운드 규칙 편집 화면&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/C570q/btqXMdPfdo4/66pQ51J7iN38dimug2KKY1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FC570q%2FbtqXMdPfdo4%2F66pQ51J7iN38dimug2KKY1%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;AWS 인바운드 규칙 편집 화면&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;6. 이제 브라우저를 열고 내 퍼블릭 IP를 브라우저에 입력해보자 (퍼블릭 IP는 인스턴스 상세보기에서 확인 가능)&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 아래 화면처럼 아이피를 입력했을때 apache2의 default page가 나오는걸 볼 수 있다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 이제 내 웹서버가 외부에서도 호출 가능하도록 설정이 완료되었다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/7BvZo/btqXQ6owHtk/uFJDpmDMcDL4rOVfNLkLC0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/7BvZo/btqXQ6owHtk/uFJDpmDMcDL4rOVfNLkLC0/img.png&quot; data-alt=&quot;브라우저에서 IP를 통해 웹서버 접근 화면&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/7BvZo/btqXQ6owHtk/uFJDpmDMcDL4rOVfNLkLC0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F7BvZo%2FbtqXQ6owHtk%2FuFJDpmDMcDL4rOVfNLkLC0%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;브라우저에서 IP를 통해 웹서버 접근 화면&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;다음 포스팅은 설치된 웹서버에 국룰인 php와 mysql DB를 설치후 연동하는 테스트를 해보겠다.&lt;/p&gt;</description>
      <category>AWS</category>
      <category>Apache 설치</category>
      <category>AWS</category>
      <category>aws 아파치</category>
      <category>aws 웹서버</category>
      <category>aws 웹서버 설치</category>
      <category>EC2</category>
      <category>ec2 아파치</category>
      <category>ec2 아파치 설치</category>
      <category>ec2 웹서버</category>
      <category>웹서버 설치</category>
      <author>Mind Hacker</author>
      <guid isPermaLink="true">https://trycatching.tistory.com/46</guid>
      <comments>https://trycatching.tistory.com/46#entry46comment</comments>
      <pubDate>Thu, 18 Feb 2021 18:27:27 +0900</pubDate>
    </item>
    <item>
      <title>[AWS EC2] 인스턴스 생성 및 서버 접속 (서버 구축)</title>
      <link>https://trycatching.tistory.com/45</link>
      <description>&lt;p&gt;[2021-2-17 updated]&lt;/p&gt;
&lt;p&gt;AWS에 최초 가입하면 1년간 무료티어의 기본사용이 가능하다.&lt;/p&gt;
&lt;p&gt;(1년 후부터 결재가 되지만 다른아이디로 다시 생성하면 다시 1년 무료가 된다.)&lt;/p&gt;
&lt;p&gt;웹서버 구축을 위한 EC2 인스턴스 생성에 대해 보자.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. 우선 AWS에 접속해 신규 계정을 생성한다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 계정 생성시 유효한 신용/체크 카드 입력을 하지만 프리티어만 사용할 경우 결제되지 않으니 안심하자.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. 계정생성이 완료되었으면 콘솔에 로그인하여 접속하면 아래와 같은 화면이 나온다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 최초 로그인 하면 지역이 한국(서울)로 설정되어있지 않을 수 있다. EC2를 생성하기 전에 지역먼저 변경 해준다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 지역을 아시아 태평양(서울) 로 변경하면 EC2 사용 메뉴를 클릭한다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bIgRV2/btqXBVIyghr/efMmLiOCjRlKkhc3ZublAK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bIgRV2/btqXBVIyghr/efMmLiOCjRlKkhc3ZublAK/img.png&quot; data-alt=&quot;AWS 지역 설정 및 ec2 선택&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bIgRV2/btqXBVIyghr/efMmLiOCjRlKkhc3ZublAK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbIgRV2%2FbtqXBVIyghr%2FefMmLiOCjRlKkhc3ZublAK%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;AWS 지역 설정 및 ec2 선택&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3.&amp;nbsp; 첫번째 단계 서버 종류를 선택하고 다음으로 넘어간다. (난 우분투를 선택하였다)&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bqaEmw/btqXHfsvp9y/9haAK6PCd46f4cdCB6Y5Gk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bqaEmw/btqXHfsvp9y/9haAK6PCd46f4cdCB6Y5Gk/img.png&quot; data-alt=&quot;AWS machine image 선택화면&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bqaEmw/btqXHfsvp9y/9haAK6PCd46f4cdCB6Y5Gk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbqaEmw%2FbtqXHfsvp9y%2F9haAK6PCd46f4cdCB6Y5Gk%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;AWS machine image 선택화면&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;4. 인스턴트 유형(하드웨어 스펙)을 선택하는 화면이다.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 기본으로 선택되어있는 t2.micro 프리티어를 선택하고 검토 및 시작을 한다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bSb062/btqXxdiIkQa/kZWx6TemN3iSUmc2ljtcS1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bSb062/btqXxdiIkQa/kZWx6TemN3iSUmc2ljtcS1/img.png&quot; data-alt=&quot;AWS 하드웨어스팩 선택화면&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bSb062/btqXxdiIkQa/kZWx6TemN3iSUmc2ljtcS1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbSb062%2FbtqXxdiIkQa%2FkZWx6TemN3iSUmc2ljtcS1%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;AWS 하드웨어스팩 선택화면&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;5. 인스턴트 시작 검토 화면에서 보안그룹이 default VPC security group 으로 되어있다면&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 보안그룹구성 탭으로 이동하여 새 보안그룹 생성을 해준다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 이때 유형을 SSH로 선택하고 소스에 내 IP를 선택하면 내 PC에서만 접근이 가능하도록 할 수 있다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/6WWGg/btqXKvBB9ix/BVkOIVDCX5prY0QBzhKQMK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/6WWGg/btqXKvBB9ix/BVkOIVDCX5prY0QBzhKQMK/img.png&quot; data-alt=&quot;AWS 보안그룹 구성 화면&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/6WWGg/btqXKvBB9ix/BVkOIVDCX5prY0QBzhKQMK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F6WWGg%2FbtqXKvBB9ix%2FBVkOIVDCX5prY0QBzhKQMK%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;AWS 보안그룹 구성 화면&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;6. 새로운 보안그룹 설정이 완료되면 우측 하단의 검토 및 시작 버튼을 클릭하여 다시 검토 화면으로 이동한다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 시작버튼을 클릭하면 기존 키페어 성택 혹은 키 페어 생성 팝업이 뜬다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/DJysL/btqXxdiKA3r/pyq7GfhX0qkvGpvsi66VH0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/DJysL/btqXxdiKA3r/pyq7GfhX0qkvGpvsi66VH0/img.png&quot; data-alt=&quot;AWS 인스턴스 검토 최종 화면&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/DJysL/btqXxdiKA3r/pyq7GfhX0qkvGpvsi66VH0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FDJysL%2FbtqXxdiKA3r%2Fpyq7GfhX0qkvGpvsi66VH0%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;AWS 인스턴스 검토 최종 화면&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;7. 처음 사용자라면 새 키 생성에서 이름을 입력하고 키 다운로드를 클릭하면 pem 파일이 내 pc에 다운로드 된다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 처음 생성하는게 아니라면 기존 다운받은 키를 동일하게 사용할 수 있다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 여기서 다운로드 받은 *.pem 키는 서버에 접속할때 인증 수단이므로 잘 보관하도록 한다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 키 다운로드가 완료되었으면 인스턴스 시작버튼을 눌러 모든 단계를 완료한다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bGoFD5/btqXKubEOmR/j0zk3HiNxNZQil4XgdwPH0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bGoFD5/btqXKubEOmR/j0zk3HiNxNZQil4XgdwPH0/img.png&quot; data-alt=&quot;AWS 키 생성 화면&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bGoFD5/btqXKubEOmR/j0zk3HiNxNZQil4XgdwPH0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbGoFD5%2FbtqXKubEOmR%2Fj0zk3HiNxNZQil4XgdwPH0%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;AWS 키 생성 화면&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;8. 아래 완료 화면에서 인스턴스 보기를 누르면 생성된 인스턴스의 상세 정보를 볼 수 있다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/tcRa4/btqXyMFfc98/HO6a9HW8RscOjhgqCkj6M0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/tcRa4/btqXyMFfc98/HO6a9HW8RscOjhgqCkj6M0/img.png&quot; data-alt=&quot;AWS EC2 인스턴스 생성 완료화면&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/tcRa4/btqXyMFfc98/HO6a9HW8RscOjhgqCkj6M0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FtcRa4%2FbtqXyMFfc98%2FHO6a9HW8RscOjhgqCkj6M0%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;AWS EC2 인스턴스 생성 완료화면&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;9. 인스턴스 ID를 클릭하면 인스턴스의 주소 등 상세정보를 볼 수 있다.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/ee2hOG/btqXxeIKNT2/Jzq9mRNejLbEaZcFJUYAc1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/ee2hOG/btqXxeIKNT2/Jzq9mRNejLbEaZcFJUYAc1/img.png&quot; data-alt=&quot;AWS 인스턴스 상세보기 화면&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/ee2hOG/btqXxeIKNT2/Jzq9mRNejLbEaZcFJUYAc1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fee2hOG%2FbtqXxeIKNT2%2FJzq9mRNejLbEaZcFJUYAc1%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;AWS 인스턴스 상세보기 화면&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;10. 이제 putty나 xshell 같은 ssh 툴을 사용해 내 서버에 접속해보자. (여기선 Xshell로 접속해보겠다)&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 새 세션을 생성해 이름을 적고 프로토콜 -&amp;gt; SSH, 호스트에는 위 상세화면에 있는 퍼블리 IPv4 주소를 적는다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 사용자 인증탭으로 이동해서 사용자 이름에 ubuntu 적고 방법에 Public key를 선택한 후 설정으로 들어간다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; - 여기서 아까 인스턴스 생성시 다운받았던 pem키를 가져와서 등록하고 연결하면 끝.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/WoGTh/btqXKuW3EY9/cOHVgLFZDYQvuQ02Z62L3k/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/WoGTh/btqXKuW3EY9/cOHVgLFZDYQvuQ02Z62L3k/img.png&quot; data-alt=&quot;xshell7 에서 ssh로 서버에 접속하는 화면&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/WoGTh/btqXKuW3EY9/cOHVgLFZDYQvuQ02Z62L3k/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FWoGTh%2FbtqXKuW3EY9%2FcOHVgLFZDYQvuQ02Z62L3k%2Fimg.png&quot; data-origin-width=&quot;0&quot; data-origin-height=&quot;0&quot; data-ke-mobilestyle=&quot;widthContent&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot;/&gt;&lt;/span&gt;&lt;figcaption&gt;xshell7 에서 ssh로 서버에 접속하는 화면&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;여기까지 AWS 계정생성 후 EC2 프리티어로 우분투서버를 생성 및 접속하는 방법에 대해 알아봤다.&lt;/p&gt;
&lt;p&gt;다음 포스팅은 해당 인스턴스에 apache 웹서버를 설치하여 웹서버로 사용 할수있도록 해보자.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;a href=&quot;https://trycatching.tistory.com/46&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;&lt;span style=&quot;color: #8a3db6;&quot;&gt;&lt;b&gt;[링크] 생성한 내 서버에 apche 웹서버 설치하기 포스팅 바로가기&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;/u&gt;&lt;/p&gt;</description>
      <category>AWS</category>
      <category>AWS</category>
      <category>AWS EC2</category>
      <category>aws 무료</category>
      <category>aws 서버 구축</category>
      <category>EC2</category>
      <category>EC2인스턴스</category>
      <category>무료 웹서버</category>
      <category>우분투 서버</category>
      <category>웹서버</category>
      <category>웹서버 구축</category>
      <author>Mind Hacker</author>
      <guid isPermaLink="true">https://trycatching.tistory.com/45</guid>
      <comments>https://trycatching.tistory.com/45#entry45comment</comments>
      <pubDate>Wed, 17 Feb 2021 18:18:38 +0900</pubDate>
    </item>
    <item>
      <title>ios custom 앨범 만들어서 사진 저장하기 in swift</title>
      <link>https://trycatching.tistory.com/43</link>
      <description>&lt;p&gt;ios 개발중 사진촬영을 했을때 디폴트 앨범에 저장하지 않고&lt;/p&gt;&lt;p&gt;다른 사진첩을 만들어 그곳에 사진을 저장하고 싶을 때 아래의 코드를 사용해보자.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;우선 swift 파일을 하나 생성하여 아래와 같이 코딩한다.(swift3 반영)&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;&lt;p&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt; Photos&lt;/span&gt;&lt;/p&gt;




&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; min-height: 13.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400}
span.s1 {font-variant-ligatures: no-common-ligatures; color: #ba2da2}
span.s2 {font-variant-ligatures: no-common-ligatures}
span.s3 {font-variant-ligatures: no-common-ligatures; color: #d12f1b}
span.s4 {font-variant-ligatures: no-common-ligatures; color: #703daa}
span.s5 {font-variant-ligatures: no-common-ligatures; color: #000000}
&lt;/style&gt;



&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; CustomPhotoAlbum{&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; albumName = &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&quot;MyCloset&quot;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; sharedInstance = CustomPhotoAlbum()&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; assetCollection: &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;PHAssetCollection&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;!&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;init&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;() {&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; fetchAssetCollectionForAlbum() -&amp;gt; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;PHAssetCollection&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;! {&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; fetchOptions = PHFetchOptions()&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fetchOptions.predicate = NSPredicate(format: &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;&quot;title = %@&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, CustomPhotoAlbum.albumName)&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; collection = PHAssetCollection.fetchAssetCollections(with: .album, subtype: .any, options: fetchOptions)&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;AnyObject&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = collection.firstObject {&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; collection.firstObject! &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;PHAssetCollection&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;nil&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; assetCollection = fetchAssetCollectionForAlbum() {&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.assetCollection = assetCollection&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PHPhotoLibrary.shared().performChanges({&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PHAssetCollectionChangeRequest.creationRequestForAssetCollection(withTitle: CustomPhotoAlbum.albumName)&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }) { success, &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;in&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; success {&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.assetCollection = fetchAssetCollectionForAlbum()&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; saveImage(image: &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;UIImage&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;) {&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; assetCollection == &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; {&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p3&quot;&gt;&lt;span class=&quot;s5&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;// If there was an error upstream, skip the save.&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PHPhotoLibrary.shared().performChanges({&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; assetChangeRequest = PHAssetChangeRequest.creationRequestForAsset(from: image)&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; albumChangeRequest = PHAssetCollectionChangeRequest(for: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.assetCollection)&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; albumChangeRequest?.addAssets([assetChangeRequest.placeholderForCreatedAsset!] &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; NSArray)&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }, completionHandler: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;기본앨범에 저장할때 사용했던&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;




&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400}
span.s1 {font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;


&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;IImageWriteToSavedPhotosAlbum(image, self, #selector(AddClothesViewController.image(image:didFinishSavingWithError:contextInfo:)), nil)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;font color=&quot;#000000&quot; face=&quot;맑은 고딕, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 13px;&quot;&gt;위의 코드 대신 아래의 코드를 사용하여 저장한다.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;font color=&quot;#000000&quot; face=&quot;맑은 고딕, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;




&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #4f8187}
span.s1 {font-variant-ligatures: no-common-ligatures}
span.s2 {font-variant-ligatures: no-common-ligatures; color: #000000}
span.s3 {font-variant-ligatures: no-common-ligatures; color: #31595d}
&lt;/style&gt;


&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;ustomPhotoAlbum&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;sharedInstance&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;saveImage&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(image: image)&lt;/span&gt;&lt;font color=&quot;#000000&quot; face=&quot;맑은 고딕, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;p class=&quot;p1&quot;&gt;&lt;font color=&quot;#000000&quot; face=&quot;맑은 고딕, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;font color=&quot;#000000&quot; face=&quot;맑은 고딕, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 13px;&quot;&gt;swift3 부터 Info.plist 파일에 설정했던 photoLibrary 사용권한을 넣는 것도&amp;nbsp;잊지 않도록 한다.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;</description>
      <category>programming language/swift</category>
      <author>Mind Hacker</author>
      <guid isPermaLink="true">https://trycatching.tistory.com/43</guid>
      <comments>https://trycatching.tistory.com/43#entry43comment</comments>
      <pubDate>Sun, 4 Dec 2016 22:06:32 +0900</pubDate>
    </item>
    <item>
      <title>ios info.plist 권한 설정하기 in swift</title>
      <link>https://trycatching.tistory.com/42</link>
      <description>&lt;p&gt;ios 10 이상의 버전부터는 &amp;nbsp;카메라, 포토라이브러리, 캘린더, 리마인더, 연락처 등등..&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;모든 시스템 권한에 접근하기 위해 info.plist 파일에 아래와 같이 세팅해줘야 한다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Calendar :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Calendars Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) calendar events&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Reminder :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Reminders Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) reminder use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Contact :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Contacts Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) contact use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Photo :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Photo Library Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) photo use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Bluetooth Sharing :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Bluetooth Peripheral Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) Bluetooth Peripheral use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Microphone :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Microphone Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) microphone use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Camera :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Camera Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) camera use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Location :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Location Always Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) location use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Location When In Use Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) location use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Heath :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Health Share Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) heath share use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Health Update Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) heath update use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;HomeKit :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - HomeKit Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) home kit use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Media Library :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Media Library Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) media library use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Motion :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Motion Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) motion use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Speech Recognition :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Speech Recognition Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) speech use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;SiriKit :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - Siri Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) siri use&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;TV Provider :&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Key : Privacy - TV Provider Usage Description&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;Value : $(PRODUCT_NAME) tvProvider use&lt;/span&gt;&lt;/p&gt;</description>
      <category>programming language/swift</category>
      <author>Mind Hacker</author>
      <guid isPermaLink="true">https://trycatching.tistory.com/42</guid>
      <comments>https://trycatching.tistory.com/42#entry42comment</comments>
      <pubDate>Wed, 30 Nov 2016 22:15:43 +0900</pubDate>
    </item>
    <item>
      <title>ios 동적버튼을 사용한 화면 전환 in swift</title>
      <link>https://trycatching.tistory.com/41</link>
      <description>&lt;p&gt;storyboard에서 버튼을 생성하면 다른 뷰로 전환시 segment를 사용하여 쉽게 전환이 가능합니다.&lt;/p&gt;&lt;p&gt;동적으로 버튼을 생성했을 때에는 코드를 작성하여 화면 전환을 해야하는데 이때 아래의 코드를 사용합니다.&lt;/p&gt;&lt;p&gt;presentViewController 가 swift3에서 present 로 변경되었습니다.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;




&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
span.s2 {font-variant-ligatures: no-common-ligatures; color: #3e1e81}
span.s3 {font-variant-ligatures: no-common-ligatures; color: #4f8187}
span.s4 {font-variant-ligatures: no-common-ligatures; color: #ba2da2}
span.s5 {font-variant-ligatures: no-common-ligatures; color: #31595d}
span.s6 {font-variant-ligatures: no-common-ligatures; color: #703daa}
&lt;/style&gt;


&lt;p&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 10pt; color: rgb(31, 218, 17);&quot;&gt;//버튼 생성시 이벤트를 주기위해 addTarget 사용&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;button.&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;addTarget&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;ViewController&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;(), action: &lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;#selector&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;ViewController&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;buttonPressed&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;), for: .&lt;/span&gt;&lt;span class=&quot;s6&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;touchUpInside&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(31, 218, 17);&quot;&gt;//버튼 생성시 설정해준 buttonPressed function에 tag별로 클릭 이벤트를 작성한다.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; buttonPressed(sender : &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;UIButton&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;) {&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;sender.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;번&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;버튼&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;클릭됨&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; sender.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; uvc = &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;storyboard&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;instantiateViewController&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(withIdentifier: &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;addClothesViewController&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s8&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; uvc?.&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;modalTransitionStyle&lt;/span&gt;&lt;span class=&quot;s8&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;UIModalTransitionStyle&lt;/span&gt;&lt;span class=&quot;s8&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;flipHorizontal &lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 10pt; color: rgb(31, 218, 17);&quot;&gt;//페이지 전환시 에니메이션 효과 설정&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;present&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(uvc!, animated: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, completion: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; sender.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; {&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p3&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;....&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p3&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;




&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #703daa}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; min-height: 13.0px}
span.s1 {font-variant-ligatures: no-common-ligatures; color: #ba2da2}
span.s2 {font-variant-ligatures: no-common-ligatures}
span.s3 {font-variant-ligatures: no-common-ligatures; color: #703daa}
span.s4 {font-variant-ligatures: no-common-ligatures; color: #3e1e81}
span.s5 {font-variant-ligatures: no-common-ligatures; color: #d12f1b}
span.s6 {font: 11.0px 'Apple SD Gothic Neo'; font-variant-ligatures: no-common-ligatures; color: #d12f1b}
span.s7 {font-variant-ligatures: no-common-ligatures; color: #272ad8}
span.s8 {font-variant-ligatures: no-common-ligatures; color: #000000}
&lt;/style&gt;


















&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;위의 코드에서&amp;nbsp;&lt;span class=&quot;s2&quot; style=&quot;font-family: Menlo; font-size: 11px; background-color: rgb(254, 254, 184);&quot;&gt;(withIdentifier:&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;font-family: Menlo; font-size: 11px; background-color: rgb(254, 254, 184);&quot;&gt;&quot;addClothesViewController&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: Menlo; font-size: 11px; background-color: rgb(254, 254, 184);&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;identifier는 스토리보드에서 전환할 화면의 storyboard 아이디로 설정한다.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;새로 전환된 화면에서 본래의 화면으로 back할때에는 버튼을하나 만들어주고 버튼 액션에 아래와 같은 코드를 사용한다.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;




&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures; color: #ba2da2}
span.s2 {font-variant-ligatures: no-common-ligatures}
span.s3 {font-variant-ligatures: no-common-ligatures; color: #703daa}
span.s4 {font-variant-ligatures: no-common-ligatures; color: #3e1e81}
&lt;/style&gt;


&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;@IBAction&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; backToMainButton(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; sender: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Any&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;) {&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;presentingViewController&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;?.&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;dismiss&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(animated: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, completion: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: rgb(62, 30, 129); font-variant-ligatures: no-common-ligatures; font-family: Menlo; font-size: 11px;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>programming language/swift</category>
      <author>Mind Hacker</author>
      <guid isPermaLink="true">https://trycatching.tistory.com/41</guid>
      <comments>https://trycatching.tistory.com/41#entry41comment</comments>
      <pubDate>Mon, 28 Nov 2016 22:26:07 +0900</pubDate>
    </item>
    <item>
      <title>ios status bar style 설정하기 in swift</title>
      <link>https://trycatching.tistory.com/40</link>
      <description>&lt;p&gt;아이폰 상단에 시계 배터리 등 표시되는 부분을 statusbar 라고 한다.&lt;/p&gt;&lt;p&gt;swift3 에서 이를 lightContent로 설정해주기 위한 코드는 아래와 같다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;




&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #3e1e81}
span.s1 {font-variant-ligatures: no-common-ligatures; color: #ba2da2}
span.s2 {font-variant-ligatures: no-common-ligatures}
span.s3 {font-variant-ligatures: no-common-ligatures; color: #703daa}
span.s4 {font-variant-ligatures: no-common-ligatures; color: #000000}
&lt;/style&gt;


&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;override&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; preferredStatusBarStyle: &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;UIStatusBarStyle&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; {&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s4&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;lightContent&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-variant-ligatures: no-common-ligatures; font-family: Menlo; font-size: 11px;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>programming language/swift</category>
      <author>Mind Hacker</author>
      <guid isPermaLink="true">https://trycatching.tistory.com/40</guid>
      <comments>https://trycatching.tistory.com/40#entry40comment</comments>
      <pubDate>Sun, 27 Nov 2016 17:46:11 +0900</pubDate>
    </item>
    <item>
      <title>ios 버튼 테두리 주기 및 둥글게 처리하기 in swift</title>
      <link>https://trycatching.tistory.com/39</link>
      <description>&lt;p&gt;storyboard를 사용하여 버튼을 생성시 혹은 동적으로 버튼을 생성시 테두리 border가 들어가지 않는데&lt;/p&gt;&lt;p&gt;이때 아래의 코드를 사용하여 버튼에 테두리를 넣을 수 있다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;




&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #703daa}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #4f8187}
span.s1 {font-variant-ligatures: no-common-ligatures; color: #4f8187}
span.s2 {font-variant-ligatures: no-common-ligatures; color: #000000}
span.s3 {font-variant-ligatures: no-common-ligatures}
span.s4 {font-variant-ligatures: no-common-ligatures; color: #703daa}
span.s5 {font-variant-ligatures: no-common-ligatures; color: #272ad8}
&lt;/style&gt;


&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;addClothesButton&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;layer&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;borderColor&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;UIColor&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;cgColor&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;s3&quot; style=&quot;color: rgb(79, 129, 135); font-family: Menlo; font-size: 11px;&quot;&gt;addClothesButton&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;layer&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;borderWidth&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;2&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;주의할점은 borderWidth 값을 주지 않으면 borderColor를 넣어도 테두리가 보이지 않는다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;




&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #703daa}
span.s1 {font-variant-ligatures: no-common-ligatures; color: #4f8187}
span.s2 {font-variant-ligatures: no-common-ligatures; color: #000000}
span.s3 {font-variant-ligatures: no-common-ligatures}
span.s4 {font-variant-ligatures: no-common-ligatures; color: #272ad8}
&lt;/style&gt;


&lt;p&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;addClothesButton&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: rgb(112, 61, 170); font-family: Menlo; font-size: 11px;&quot;&gt;layer&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;color: rgb(112, 61, 170); font-family: Menlo; font-size: 11px;&quot;&gt;cornerRadius&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s4&quot; style=&quot;font-family: Menlo; font-size: 11px;&quot;&gt;10&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;위의 코드로는 버튼의 모서리 부분을 둥글게 처리 할 수 있다.&lt;/p&gt;</description>
      <category>programming language/swift</category>
      <author>Mind Hacker</author>
      <guid isPermaLink="true">https://trycatching.tistory.com/39</guid>
      <comments>https://trycatching.tistory.com/39#entry39comment</comments>
      <pubDate>Sun, 27 Nov 2016 17:08:47 +0900</pubDate>
    </item>
    <item>
      <title>ios 다국어 localize 사용하기 in swift</title>
      <link>https://trycatching.tistory.com/38</link>
      <description>&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;swift로 다국어를 사용하는 방법.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;1. 아래의 화면처럼 프로젝트를 선택하고 Info 탭 안의 localizations 부분에 언어를 추가한다.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;(English 가 기본으로 되어있어 korean을 추가하였다.)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;한국어를 추가하고 나면 기본적으로 만들어진 Main.storyboard 파일 하위에 Main.strings(Korean) 이라는 파일이 만들어지며&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;파일 안에는&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;&lt;p&gt;&lt;span style=&quot;font-variant-ligatures: no-common-ligatures; color: rgb(0, 132, 0); font-family: Menlo; font-size: 11px;&quot;&gt;/* Class = &quot;UIButton&quot;; normalTitle = &quot;Button&quot;; ObjectID = &quot;95Z-0t-cRz&quot;; */&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&quot;95Z-0t-cRz.normalTitle&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&quot;&lt;font face=&quot;Apple SD Gothic Neo&quot;&gt;button&lt;/font&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p3&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;/* Class = &quot;UILabel&quot;; text = &quot;Label&quot;; ObjectID = &quot;zw3-Ke-qxS&quot;; */&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&quot;zw3-Ke-qxS.text&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;label&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);&quot;&gt;위와 같은 코드가 자동으로 작성되는데 이는 기존에 만들어진 label과 button 등의 UI 컴포넌트들의 Object ID 값에 매핑되는 이름들이다.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;font color=&quot;#000000&quot; face=&quot;맑은 고딕, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;위의 button, label 텍스트를 원하는 한국어로 바꾸어 작성하면 된다.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;font color=&quot;#000000&quot; face=&quot;맑은 고딕, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;스토리보드 파일에 UI컴포넌트들이 하나도 없다면 이 파일은 빈 파일로 생성될 것이다.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;font color=&quot;#000000&quot; face=&quot;맑은 고딕, sans-serif&quot;&gt;&lt;span style=&quot;font-size: 13.3333px;&quot;&gt;또한 Main.storyboard 파일을 클릭하고 file inspector 를 보면 Localization 이라는 메뉴가 있는데 여기서 언어를 추가하거나 지울 수 있다.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: center; clear: none; float: none;&quot;&gt;&lt;span class=&quot;imageblock&quot; style=&quot;display: inline-block; width: 900px;  height: auto; max-width: 100%;&quot;&gt;&lt;img src=&quot;https://t1.daumcdn.net/cfile/tistory/223684465836DC1E01&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Ft1.daumcdn.net%2Fcfile%2Ftistory%2F223684465836DC1E01&quot; width=&quot;900&quot; height=&quot;446&quot; filename=&quot;Screen Shot 2016-11-24 at 9.24.37 PM.png&quot; filemime=&quot;image/jpeg&quot; style=&quot;&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;2. 위 사진의 프로젝트 네비게이터에 보이는 것 처럼 InfoPlist.strings 파일과 Localizable.strings 파일을 만든다. (&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;b&gt;파일 이름 틀리지 않게 주의&lt;/b&gt;&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;파일을 생성하고나면 file inspector 탭에서 localization 을 활성화하고 해당 언어를 클릭하면 InfoPlist.strings 와 Localizable.strings 파일의 하위 카테고리에 언어별로 파일들이 나누어 만들어진다.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt;&quot;&gt;InfoPlist.strings 파일에는 아래와 같이 작성하면 언어 설정에 따라 앱의 이름이 다르게 표시된다.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt;&quot;&gt;(english 파일)&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;background-color: rgb(255, 255, 255); font-size: 11pt;&quot;&gt;CFBundleDisplayName =&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&quot;my app&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;background-color: rgb(255, 255, 255); font-size: 11pt;&quot;&gt;;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt;&quot;&gt;
&lt;/span&gt;&lt;style type=&quot;text/css&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt;&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
span.s2 {font-variant-ligatures: no-common-ligatures; color: #d12f1b}
&lt;/span&gt;&lt;/style&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt;&quot;&gt;


&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 14.6667px;&quot;&gt;(korean&amp;nbsp;파일)&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;color: rgb(0, 0, 0); font-size: 11pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;background-color: rgb(255, 255, 255); font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;CFBundleDisplayName =&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(0, 0, 0);&quot;&gt;&quot;나의 어플&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(0, 0, 0);&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;background-color: rgb(255, 255, 255); font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;color: rgb(0, 0, 0); font-size: 11pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(0, 0, 0);&quot;&gt;위와같은 방법으로 localizable.strings 파일도 언어 파일별로 코드를 작성한다.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;




&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12f1b}
span.s1 {font-variant-ligatures: no-common-ligatures}
span.s2 {font-variant-ligatures: no-common-ligatures; color: #000000}
span.s3 {font: 11.0px 'Apple SD Gothic Neo'; font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;


&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;&quot;text code&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;테스트&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;코드&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;
&lt;/span&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;&quot;result code&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;한국어&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;입니다&lt;/span&gt;&lt;span class=&quot;s1&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;.&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p class=&quot;p1&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;컨트롤러 파일에서 해당 코드들을 넣을땐&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;




&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12f1b}
span.s1 {font-variant-ligatures: no-common-ligatures; color: #4f8187}
span.s2 {font-variant-ligatures: no-common-ligatures; color: #000000}
span.s3 {font-variant-ligatures: no-common-ligatures; color: #703daa}
span.s4 {font-variant-ligatures: no-common-ligatures; color: #3e1e81}
span.s5 {font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;


&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;resultLabel&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;NSLocalizedString&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: rgb(0, 132, 0);&quot;&gt;&quot;result code&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, comment: &lt;/span&gt;&lt;span class=&quot;s5&quot; style=&quot;color: rgb(0, 132, 0);&quot;&gt;&quot;result code...&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 11pt; font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);&quot;&gt;위와같은 방법으로 코드를 넣으면 언어가 한국어일때 result code 에 매핑되어있는 &quot;한국어 입니다.&quot; 텍스트가 표시된다.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12f1b}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; min-height: 13.0px}
span.s1 {font-variant-ligatures: no-common-ligatures}
span.s2 {font-variant-ligatures: no-common-ligatures; color: #000000}
span.s3 {font: 11.0px 'Apple SD Gothic Neo'; font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>programming language/swift</category>
      <author>Mind Hacker</author>
      <guid isPermaLink="true">https://trycatching.tistory.com/38</guid>
      <comments>https://trycatching.tistory.com/38#entry38comment</comments>
      <pubDate>Thu, 24 Nov 2016 21:43:26 +0900</pubDate>
    </item>
    <item>
      <title>ios 동적 button , switch 사용하기 in swift</title>
      <link>https://trycatching.tistory.com/37</link>
      <description>&lt;p&gt;siwft3 에서 동적버튼을 만드는 예제&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;







&lt;p class=&quot;p1&quot; style=&quot;margin-left: 2em;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&amp;nbsp; &amp;nbsp; let&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; button : &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;UIButton&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;UIButton&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(frame: &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;CGRect&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(x: &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, y: &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;buttonY&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, width: &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, height: &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;))&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button.&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;setTitle&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s8&quot;&gt;삭제&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, for: &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;UIControlState&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;normal&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s9&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button.&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;showsTouchWhenHighlighted&lt;/span&gt;&lt;span class=&quot;s9&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;true&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button.&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;setTitleColor&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;UIColor&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, for: &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;UIControlState&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;normal&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;buttonTag&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; button.&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;addTarget&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, action: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;#selector&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s10&quot;&gt;deleteButtonAction&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;), for: .&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;touchUpInside&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;mainScrollVeiw&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;addSubview&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(button)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;buttonTag&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; += &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;1 // 태그값은 기본을1로주고 버튼생성시마다 1씩 증가시켰다.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;buttonY&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; += &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;50 // 버튼 생성시마다 위치를 다르게 하기 위해 y값을 증가시킨다.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;위크 코드를 보면 addTarget을 사용해서 액션 메소드를 만들어주었다.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;color: rgb(255, 0, 0); font-size: 12pt;&quot;&gt;UITextField 와 다르게 UIButton 과 UISwitch는 delegate 프로토콜이 없어 액션을 주기위해 위와 같이 addTarget을 사용해야한다.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;액션 메소드 코드&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; deleteButtonAction(sender: &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;UIButton&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;!) {&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;&quot;deleted &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;sender.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;)&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;











&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;위와 비슷하게 label, textfield 등도 동적으로 생성이 가능하다.&lt;/p&gt;</description>
      <category>programming language/swift</category>
      <author>Mind Hacker</author>
      <guid isPermaLink="true">https://trycatching.tistory.com/37</guid>
      <comments>https://trycatching.tistory.com/37#entry37comment</comments>
      <pubDate>Sun, 25 Sep 2016 11:57:30 +0900</pubDate>
    </item>
    <item>
      <title>ios segue 사용하기 in swift</title>
      <link>https://trycatching.tistory.com/36</link>
      <description>&lt;p&gt;UIStoryboardSegue 를 사용해 보자.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;보통 button을 클릭하여 화면을 전환할때 버튼의 IBAction 을 사용하지만&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;세개의 버튼이 모두 하나의 UI로 이동하고 이동할때 특정 구분값만 넘기기 위해 IBAction 대신 segue를 사용하였다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: solid; border-width: 1px; border-color: rgb(243, 197, 52); background-color: rgb(254, 254, 184); padding: 10px;&quot;&gt;







&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;override&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;func&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; prepare(for segue: &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;UIStoryboardSegue&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;, sender: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Any&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;?) {&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; segue.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;identifier&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;! {&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;segue1&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;tempText&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;그룹&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;1&quot;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;case&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;segue2&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;tempText&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;그룹&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;2&quot;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;tempText&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;그룹&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;3&quot;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;p2&quot;&gt;&lt;span class=&quot;s7&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (segue.&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;destination&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;? &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;DetailViewController&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;)?.&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;headerTitle&lt;/span&gt;&lt;span class=&quot;s7&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;tempText&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;위의 코드와 같이 각 segue 에 identifier를 주고 identifier 별로 그룹1, 그룹2, 그룹3 으로 나눴다.&lt;/p&gt;&lt;p&gt;마지막 줄의 코드는 이 구분값을 destination 컨트롤러로 전달하는 &amp;nbsp;코드이다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;전환되는 화면의 컨트롤러의 타이틀 값을 곧바로 바꾸려고 시도하였으나 되지 않는다. (위의 코드처럼 변수를 만들어 놓고 전달해야한다.)&lt;/p&gt;&lt;p&gt;headerTitle 은 tempText 의 값을&amp;nbsp;전달하기 위해 전환되는 화면의 컨트롤러 안에 만든 변수이다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>programming language/swift</category>
      <author>Mind Hacker</author>
      <guid isPermaLink="true">https://trycatching.tistory.com/36</guid>
      <comments>https://trycatching.tistory.com/36#entry36comment</comments>
      <pubDate>Tue, 20 Sep 2016 20:32:08 +0900</pubDate>
    </item>
  </channel>
</rss>