<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Seung-il Chun on Medium]]></title>
        <description><![CDATA[Stories by Seung-il Chun on Medium]]></description>
        <link>https://medium.com/@seungil.chun?source=rss-6ce8f7dbc8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JcsXUkCIKOZIHp3-EXqKcQ.png</url>
            <title>Stories by Seung-il Chun on Medium</title>
            <link>https://medium.com/@seungil.chun?source=rss-6ce8f7dbc8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 01:02:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@seungil.chun/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[WKWebView Cookie 관리는 WKHTTPCookieStore? HTTPCookieStorage?]]></title>
            <link>https://medium.com/@seungil.chun/wkwebview%EC%97%90%EC%84%9C-cookie-%EA%B4%80%EB%A6%AC-b222299bd125?source=rss-6ce8f7dbc8------2</link>
            <guid isPermaLink="false">https://medium.com/p/b222299bd125</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[wkwebview]]></category>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[webkit]]></category>
            <dc:creator><![CDATA[Seung-il Chun]]></dc:creator>
            <pubDate>Sat, 27 May 2023 18:18:57 GMT</pubDate>
            <atom:updated>2023-06-02T15:38:01.707Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TBaFV7UltV2JA_gw" /><figcaption>Photo by <a href="https://unsplash.com/ja/@bycindys?utm_source=medium&amp;utm_medium=referral">cindy fernandez</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><a href="https://developer.apple.com/documentation/webkit/wkwebview">WKWebView</a>에서 페이지 주소를 통하여 웹페이지가 열렸을 때 웹에서 생성된 cookie와 앱에서 <a href="https://developer.apple.com/documentation/foundation/httpcookie">HTTPCookie</a>로 생성된 cookie는 expired date가 없는 session cookie가 아니면 <a href="https://developer.apple.com/documentation/foundation/httpcookiestorage">HTTPCookieStorage</a>와 각<a href="https://developer.apple.com/documentation/webkit/wkwebview">WKWebView</a>의WKWebView.configuration.websiteDataStore.httpCookieStore에 저장된다.</p><p>따라서 이 두 저장소에 대하여 헷갈릴 수 있는데 두 저장소의 특징은 다음과 같다.</p><h4><a href="https://developer.apple.com/documentation/foundation/httpcookiestorage"><strong>HTTPCookieStorage</strong></a></h4><ul><li>앱내에서 <a href="https://developer.apple.com/documentation/webkit/wkwebview">WKWebView</a> 생성 여부와 상관없이 HTTPCookieStorage.shared를 통하여 앱에서 생성한 cookie를 추가, 삭제 할 수 있음</li><li>싱글톤이기 때문에 앱내 어디서든 공유 가능</li></ul><h4><a href="https://developer.apple.com/documentation/webkit/wkhttpcookiestore">WKHTTPCookieStore</a></h4><ul><li>각각의 <a href="https://developer.apple.com/documentation/webkit/wkwebview">WKWebView</a> 내 configuration.websiteDataStore.httpCookieStore 에서만 공유 가능</li><li>기본적으로 <a href="https://developer.apple.com/documentation/webkit/wkwebview">WKWebView</a>간 cookie 공유가 가능하지 않기 때문에 공용 <a href="https://developer.apple.com/documentation/webkit/wkprocesspool">WKProcessPool</a>을 생성한 후 <a href="https://developer.apple.com/documentation/webkit/wkwebview">WKWebView</a> 생성시 설정하여 cookie 공유를 가능하게 할 수 있음</li><li><a href="https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532937-default">WKWebsiteDataStore.default()</a> : default 설정. expired date가 지나지 않은 cookie들은 앱내 disk에 저장</li><li><a href="https://developer.apple.com/documentation/webkit/wkwebsitedatastore/1532934-nonpersistent">WKWebsiteDataStore.nonPersistent()</a> : 앱내 cache로 저장. new data store object를 생성하기 때문에 다른 <a href="https://developer.apple.com/documentation/webkit/wkwebview">WKWebView</a>와 cookie 공유 불가능</li><li>iOS 15.4에서 <a href="https://developer.apple.com/documentation/webkit/wkprocesspool">WKProcessPool</a>을 공유하지 않아도 <a href="https://developer.apple.com/documentation/webkit/wkwebview">WKWebView</a>간 cookie 공유 가능한 오류가 발생됨</li></ul><p>HTTPCookieStorage내 변경된 cookie data observing</p><pre>@objc func handleCookiesChanged(notification: Notification) {<br>    HTTPCookieStorage.shared.cookies.map {<br>        print($0)<br>    }<br>}<br><br>NotificationCenter.default.addObserver(self, selector: #selector(self.handleCookiesChanged), name: .NSHTTPCookieManagerCookiesChanged, object: nil)</pre><p>WKHTTPCookieStore내 변경된 cookie data observing</p><pre>extension WebViewController: WKHTTPCookieStoreObserver {<br>    func cookiesDidChange(in cookieStore: WKHTTPCookieStore) {<br>        cookieStore.getAllCookies {<br>            print($0)<br>        }<br>    }<br>}<br><br>self.webView.configuration.websiteDataStore.httpCookieStore.add(self)</pre><h4>두 저장소의 동기화 처리</h4><p>WKHTTPCookieStore -&gt; HTTPCookieStorage</p><pre>func syncHTTPCookieStorage(_ cookieStore: WKHTTPCookieStore) {<br>    cookieStore.getAllCookies { cookies in<br>        for cookie: HTTPCookie in cookies {<br>            HTTPCookieStorage.shared.setCookie(cookie)<br>        }<br>    }<br>}<br><br>self.syncHTTPCookieStorage(webView.configuration.websiteDataStore.httpCookieStore)</pre><p>HTTPCookieStorage -&gt; WKHTTPCookieStore</p><pre>func syncWKHTTPCookieStore(_ path: String) {<br>    guard let url: URL = .init(string: path) else { return }<br>    if let cookies: [HTTPCookie] = HTTPCookieStorage.shared.cookies {<br>        let group: DispatchGroup = .init()<br>        cookies.forEach({ cookie in<br>            group.enter()<br>            self.webView.configuration.websiteDataStore.httpCookieStore.setCookie(cookie) {<br>                group.leave()<br>            }<br>        })<br>        group.notify(queue: .main) { [unowned self] in<br>            self.webView.load(URLRequest(url: url))<br>        }<br>    } else {<br>        self.webView.load(URLRequest(url: url))<br>    }<br>}<br><br>self.syncWKHTTPCookieStore(path)</pre><h4>마치며</h4><ul><li><a href="https://developer.apple.com/documentation/webkit/wkwebview">WKWebView</a>에서 <a href="https://developer.apple.com/documentation/webkit/wkwebsitedatastore">WKHTTPCookieStore</a>만으로 cookie를 관리하는데 문제 없음(다만 저장소내에 cookie data가 커질수록 <a href="https://developer.apple.com/documentation/webkit/wkwebview">WKWebView</a> 생성시 cookie를 가져오는데 매우 약간의 delay가 발생됨)</li><li><a href="https://developer.apple.com/documentation/webkit/wkwebview">WKWebView</a>를 통해 웹에서 생성된 cookie들이 <a href="https://developer.apple.com/documentation/foundation/httpcookiestorage">HTTPCookieStorage</a>에 자동적으로 쌓이기 때문에 <a href="https://developer.apple.com/documentation/webkit/wkwebview">WKWebView</a>생성시마다 <a href="https://developer.apple.com/documentation/foundation/httpcookiestorage">HTTPCookieStorage</a>에 저장된 모든 cookie들을 <a href="https://developer.apple.com/documentation/webkit/wkwebsitedatastore">WKHTTPCookieStore</a>에 동기화 한다면 웹페이지 주소 load를 main thread에서 실행시켜야 하기 때문에 웹페이지 load 속도가 느려질 수 있음</li><li>특별한 이유가 없다면 <a href="https://developer.apple.com/documentation/foundation/httpcookiestorage">HTTPCookieStorage</a>에서 <a href="https://developer.apple.com/documentation/webkit/wkwebsitedatastore">WKHTTPCookieStore</a>로 동기화 하는 것보다는 <a href="https://developer.apple.com/documentation/webkit/wkwebsitedatastore">WKHTTPCookieStore</a>만으로 관리하는게 성능면에서 더 효율적임</li></ul><p>읽어주셔서 감사합니다. 😀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b222299bd125" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UILabel에서 HTML을 이용하여 NSAttributedString시 performance 이슈]]></title>
            <link>https://medium.com/@seungil.chun/uilabel%EC%97%90%EC%84%9C-html%EC%9D%84-%EC%9D%B4%EC%9A%A9%ED%95%98%EC%97%AC-nsattributedstring%EC%8B%9C-performance-%EC%9D%B4%EC%8A%88-3f3c4180152?source=rss-6ce8f7dbc8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f3c4180152</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[nsattributedstring]]></category>
            <dc:creator><![CDATA[Seung-il Chun]]></dc:creator>
            <pubDate>Mon, 26 Oct 2020 15:58:33 GMT</pubDate>
            <atom:updated>2020-10-26T15:58:33.200Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PBo393Ck1Up6zYVS" /><figcaption>Photo by <a href="https://unsplash.com/@pankajpatel?utm_source=medium&amp;utm_medium=referral">Pankaj Patel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>UILabel에서 HTML 형식에 맞춰 문자열을 표시하는 방법은 다음과 같다.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d9f9001dd52480ad368e61bcb41574f/href">https://medium.com/media/9d9f9001dd52480ad368e61bcb41574f/href</a></iframe><p>여기서 문제는 이 방법으로 UILabel에 attributedText를 했을 경우 HTML 형식을 적용하면서 performance가 상당히 떨어지게 된다.</p><p>HTML이 아닌 attributedText를 적용 했을 때 Thread 상태는 다음과 같다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*YQM1mMdgVxZqZVM40XSpHw.png" /></figure><p>하지만 HTML 형식으로 attributedText를 적용 했을 때 Thread 상태는 다음과 같다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*N7aktJcnJDOKOy8k2PHPyQ.png" /></figure><p>iOS에서 HTML 형식의 문자열을 분석하기 위해 메모리에 JavaScriptCore 엔진과 WebKit 전체를 load 해온다. 따라서 HTML 형식으로 attributedText를 적용하는 경우 performance가 떨어질 수 밖에 없다.</p><p>하지만 어쩔 수 없이 HTML 형식을 써야한다면 NSAttributedString을 캐시로 만들어 놓고 사용하는 것을 권장 한다. 캐시화 했을 경우 성능 차이는 다음과 같다.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd42d141f75f6b8f50607f2fe0810d82/href">https://medium.com/media/cd42d141f75f6b8f50607f2fe0810d82/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*n5s7tk9fWxqEl433ZvX6rw.png" /></figure><p>그리고 최초 적용시만 JavaScriptCore 엔진과 WebKit을 load 하느라 performance가 제일 떨어지고 그 다음부터는 최초 적용시 보다는 좀더 나아진다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*UiP0ae0A7VdFzxiVVBjkeA.png" /><figcaption>역순으로 호출 했을 경우</figcaption></figure><p>비교해보면 JavaScriptCore 엔진과 WebKit을 load 하는데 지체된 시간이 67ms 정도 되는 것을 알 수 있다.</p><p>만약에 UITableView나 UICollectionView 내의 cell에서 HTML 형식의 UILabel가 노출 될 때 reloadData를 할 경우 performance 상의 문제로 전체 뷰가 안 보일 수 있다. 이럴 경우엔 다음과 같이 HTML 형식의 attributedString으로 컨버팅하는 부분을 Main Thread로 async 처리를 해주면 해결 된다.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/959cb71fdfe9de114077ea5027838291/href">https://medium.com/media/959cb71fdfe9de114077ea5027838291/href</a></iframe><p>추가 테스트로 string을 data로 변환할 때 unicode 와 utf8 방식에 대한 performance 테스트를 진행 해보니 unicode가 더 좋았다.</p><p>이상으로 UILabel에서 HTML을 이용하여 NSAttributedString시 performance 이슈에 대해 적어보았다.</p><p>읽어주셔서 감사합니다. 😀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f3c4180152" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[실제 디바이스와 시뮬레이터의 차이점]]></title>
            <link>https://medium.com/@seungil.chun/%EC%8B%A4%EC%A0%9C-%EB%94%94%EB%B0%94%EC%9D%B4%EC%8A%A4%EC%99%80-%EC%8B%9C%EB%AE%AC%EB%A0%88%EC%9D%B4%ED%84%B0%EC%9D%98-%EC%B0%A8%EC%9D%B4%EC%A0%90-9d418df24ea?source=rss-6ce8f7dbc8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d418df24ea</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[simulator]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Seung-il Chun]]></dc:creator>
            <pubDate>Mon, 24 Aug 2020 15:34:22 GMT</pubDate>
            <atom:updated>2020-08-25T15:01:22.311Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*idWHdS97_0YgvOsO" /><figcaption>Photo by <a href="https://unsplash.com/@alvarordesign?utm_source=medium&amp;utm_medium=referral">Alvaro Reyes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>실제 디바이스와 시뮬레이터의 차이점에 대해 알아보자.</p><h4>일반적인 차이점</h4><ul><li>프로세싱, 그래픽, 네트워크에 대한 성능 테스트에 대하여 정확한 결과들을 얻기 위해서는 실제 디바이스를 사용 해야한다. 시뮬레이터는 Mac에서 CPU, 메모리, 네트워크 커넥션을 포함한 컴퓨터의 자원들을 사용하여 구동 되는 앱이다. 그렇기 때문에 시뮬레이터는 앱의 성능, 메모리 사용량, 네트워크 속도의 정확한 테스트를 할 수 없다. 시물레이터에서 성능 테스트의 결과들은 앱 기능의 상대적인 차이들만 확인 할 수 있다.</li><li>실제 결과가 필요한 경우 실제 디바이스에서 사용자 테스트를 수행 해야한다. 포인터와 키보드를 사용한 사용자 상호작용은 iOS와 watchOS에서 손가락을 사용하거나 tvOS에서 모델 기반 포커스와는 차이가 있다.</li></ul><h4>화면적인 차이점</h4><ul><li>해상도 또는 포인트 당 픽셀수는 실제 디바이스와 Mac이 다를 수 있다. 이 때문에 텍스트와 이미지들은 들쭉날쭉하게 표시 되며 특히 작은 텍스트들이 그렇게 보인다. 시뮬레이터 화면의 크기를 키우면 텍스트와 이미지들이 더 선명하게 보이도록 할 수 있다.</li><li>Mac 화면의 색상 영역이 다를 수 있어서 실제 색상과 부정확 할 수 있다.</li></ul><h4>시스템적인 차이점</h4><ul><li>시뮬레이터는 iOS11 이상, tvOS11 이상, watchOS4 이상에서 백그라운드의 앱들과 프로세스들을 일시 중단 시키나 디버거에 의해 다시 재개 시킬 수 있다.</li><li>시뮬레이터는 HFS+와 APFS 포멧으로 된 볼륨에서 대소문자를 구분하는 파일시스템으로 처리 한다.</li></ul><h4>하드웨어적인 차이점</h4><p>시뮬레이션된 watchOS와 iOS 기기들은 시뮬레이터 내에서 양쪽 모두 동작하기 때문에 안정적으로 연결된다.</p><p>다음 하드웨어는 시뮬레이터에서 지원 되지 않는다.</p><ol><li>주변 광 센서</li><li>오디오 입력 (‘하드웨어 &gt; Siri’를 선택하여 Siri를 사용하는 경우 제외.)</li><li>기압계</li><li>블루투스</li><li>카메라</li><li>모션 지원 (가속도계와 자이로스코프)</li><li>근접 센서</li></ol><h4>API에서의 차이점</h4><p>다음 frameworks은 시뮬레이터에서 지원 하지 않는다.</p><ol><li>ARKit</li><li>External Accessory</li><li>HomeKit</li><li>IOSurface</li><li>Media Player</li><li>Message UI</li></ol><p>다음 API 기능들은 시뮬레이터에서 사용 할 수 없다.</p><ol><li>UIBackgroundModes 키</li><li>UIKit의 UIVideoEditorController 클래스</li><li>Handoff 지원</li></ol><p>Metal, MetaKit 및 Metal Performance Shaders frameworks는 샘플로써만 제공 된다. 이러한 frameworks의 함수 호출은 효과가 없다.</p><h4>Metal에서의 차이점</h4><p>시뮬레이터는 앱 개발을 시작하면서 사용 할 수 있는 Metal 구현이 포함 되어있다. 하드웨어 프로세서와의 차이에 대한 더 자세한 내용은 <a href="https://developer.apple.com/documentation/metal/using_metal_with_simulator">Using Metal with Simulator</a> 에서 확인 할 수 있다.</p><h4>OpenGL ES에서의 차이점</h4><p>시뮬레이터는 앱 개발을 시작하면서 사용 할 수 있는 OpenGL ES 1.1, 2.0, 3.0의 완전한 구현이 포함 되어있다. 시뮬레이터의 기능은 A7 GPU의 기능과 유사하다. 시뮬레이터는 몇가지 면에서 하드웨어 프로세서와 차이가 있다.</p><ul><li>시뮬레이터는 타일 기반 지연 렌더러를 사용하지 않는다.</li><li>시뮬레이터는 그래픽 하드웨어에서 픽셀로 정확한 매치를 제공하지 않는다.</li></ul><blockquote>중요 : 시뮬레이터에서 OpenGL ES 지원은 OpenGL ES 앱을 제작하는데 도움이 된다. 시뮬레이터가 실제 성능이나 iOS 디바이스들에서 사용된 그래픽 프로세서의 정확한 기능을 반영 한다고 가정하지 말라. 항상 실제 디바이스에서 개발한 코드들로 확인 하고 최적화 하라.</blockquote><p>이상으로 Simulator에서 ‘Help &gt; Simulator Help’에 있는 내용을 나름대로 번역 해 보았다.</p><p>원문 링크는 다음과 같다.</p><ul><li><a href="https://www.notion.so/shockw/Differences-between-simulated-and-physical-devices-6ae40e5a599d44eface71e4351f5c0f1">Differences between simulated and physical devices</a></li></ul><p>읽어주셔서 감사합니다. 😀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d418df24ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[frame과 bounds의 차이점]]></title>
            <link>https://medium.com/@seungil.chun/frame%EA%B3%BC-bounds%EC%9D%98-%EC%B0%A8%EC%9D%B4%EC%A0%90-5f1c057d604a?source=rss-6ce8f7dbc8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f1c057d604a</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Seung-il Chun]]></dc:creator>
            <pubDate>Sat, 22 Aug 2020 16:10:59 GMT</pubDate>
            <atom:updated>2020-08-23T02:33:41.749Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h5D2XuTO6U2w2VxS" /><figcaption>Photo by <a href="https://unsplash.com/@stevenerixon?utm_source=medium&amp;utm_medium=referral">Steven Erixon</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>frame에 대해 애플 개발자 문서에서는 다음과 같이 설명 하고 있다.</p><h3>frame</h3><p>The frame rectangle, which describes the view’s location and size in its superview’s coordinate system.</p><h4>Declaration</h4><pre>var frame: <a href="https://developer.apple.com/documentation/coregraphics/cgrect">CGRect</a> { get set }</pre><p>부모뷰의 좌표 시스템을 기준으로 해당 뷰의 위치와 크기를 설명하는 사각형(CGRect)이다. 이 속성을 설정 하면 설정 내 사각형의 중심이 <a href="https://developer.apple.com/documentation/uikit/uiview/1622627-center">center</a>로 변경 되고 width, height 값에 따라 사각형의 크기가 변경 된다. 단위는 point 이다.</p><p>bound는 애플 개발자 문서에서는 다음과 같이 설명 하고 있다.</p><h3>bounds</h3><p>The bounds rectangle, which describes the view’s location and size in its own coordinate system.</p><h4>Declaration</h4><pre>var bounds: <a href="https://developer.apple.com/documentation/coregraphics/cgrect">CGRect</a> { get set }</pre><p>자기 자신의 좌표 시스템을 기준으로 뷰의 위치와 크기를 설명하는 사각형(CGRect)이다. 기본 x, y 값은 (0, 0)이고 기본 width, height 값은 frame의 크기 값과 동일 하다. 크기 값을 수정 하면 중심점을 기준으로 뷰의 크기가 변경 된다. 또한 frame의 크기 값도 일치 하도록 변경 된다. 단위는 point 이다.</p><p>예제를 보자.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/87fe97ff3b54d9f94810c7edef7ab200/href">https://medium.com/media/87fe97ff3b54d9f94810c7edef7ab200/href</a></iframe><p>이 경우, 화면에는 다음과 같이 보인다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*MVm7B7K7Gg4AQ3ArmiWi8Q.png" /></figure><p>그리고 print 값은 다음과 같이 나온다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*Ax2Xl-xeWaQuqVQggPpBLQ.png" /></figure><p>imageView에 처음 설정된 frame 값은</p><pre>imageView.frame = CGRect(x: 20, y: 40, width: 200, height: 150)</pre><p>이기 때문에 파란색의 형태로 그려졌다. 그리고 다음줄에</p><pre>imageView.bounds = CGRect(x: 0, y: 0, width: 160, height: 120)</pre><p>가 적용되어 imageView를 print 해보면 frame 값의 크기는 bounds 값과 일치하게 되고 imageView의 중심을 기준으로 크기가 줄어들어서 x, y 좌표값은 변경 된 것을 확인 할 수 있다.</p><p>이상으로 frame과 bounds의 차이점에 대해 적어보았다.</p><p>읽어주셔서 감사합니다. 😀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f1c057d604a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>