<?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 uğur on Medium]]></title>
        <description><![CDATA[Stories by uğur on Medium]]></description>
        <link>https://medium.com/@uguboz?source=rss-e398f42c72e3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*r6H7lf85KYA_i4HlkQl3dw.png</url>
            <title>Stories by uğur on Medium</title>
            <link>https://medium.com/@uguboz?source=rss-e398f42c72e3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 23:20:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@uguboz/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[I Made Xcode Cloud Submit My App to the App Store Automatically]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@uguboz/i-made-xcode-cloud-submit-my-app-to-the-app-store-automatically-6a887a44c3ee?source=rss-e398f42c72e3------2"><img src="https://cdn-images-1.medium.com/max/1774/1*SScQj-_PFiQR9JsTPm2XcQ.png" width="1774"></a></p><p class="medium-feed-snippet">Two Xcode Cloud workflows: one to build the app, another to submit it for review.</p><p class="medium-feed-link"><a href="https://medium.com/@uguboz/i-made-xcode-cloud-submit-my-app-to-the-app-store-automatically-6a887a44c3ee?source=rss-e398f42c72e3------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@uguboz/i-made-xcode-cloud-submit-my-app-to-the-app-store-automatically-6a887a44c3ee?source=rss-e398f42c72e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a887a44c3ee</guid>
            <category><![CDATA[xcode-cloud]]></category>
            <category><![CDATA[app-store]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[uğur]]></dc:creator>
            <pubDate>Sun, 18 Oct 2026 00:44:50 GMT</pubDate>
            <atom:updated>2026-10-18T00:44:50.964Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Data Storage in Kotlin Multiplatform]]></title>
            <link>https://medium.com/@uguboz/unlock-seamless-cross-platform-data-storage-in-kotlin-multiplatform-your-app-deserves-it-30c4851decff?source=rss-e398f42c72e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/30c4851decff</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[jetpack-datastore]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[uğur]]></dc:creator>
            <pubDate>Sun, 23 Feb 2025 22:12:13 GMT</pubDate>
            <atom:updated>2025-03-11T17:01:52.298Z</atom:updated>
            <content:encoded><![CDATA[<p>Storing user preferences in a Kotlin Multiplatform (KMP) app doesn’t have to feel like juggling chainsaws. With <strong>AndroidX DataStore</strong> and Koin dependency injection, we’ve cracked the code for a seamless, platform-agnostic solution. Here’s how to wield this power like a pro.</p><h3>The Magic Sauce: Shared Module Setup</h3><p>We use DataStore&lt;Preferences&gt; to create a unified preferences manager that works on <strong>Android</strong>, <strong>iOS</strong>, and beyond. The secret? Platform-specific implementations hidden behind expect/actual declarations.</p><h4>Key Components</h4><p><strong>Common Logic</strong> (shared/commonMain):</p><pre>// Create DataStore with a dynamic path resolver  <br>fun createDataStore(producePath: () -&gt; String): DataStore&lt;Preferences&gt; =  <br>    PreferenceDataStoreFactory.createWithPath(  <br>        produceFile = { producePath().toPath() }  <br>    )<br><br>internal const val dataStoreFileName = &quot;settings.preferences_pb&quot;</pre><p><strong>Platform-Specific Paths</strong>:</p><ul><li><strong>Android</strong> (shared/androidMain):</li></ul><pre>fun dataStore(context: Context): DataStore&lt;Preferences&gt; =  <br>    createDataStore(  <br>        producePath = { context.filesDir.resolve(dataStoreFileName).absolutePath }  <br>    )  <br><br>// Android Koin module<br>actual fun platformDataStoreModule() = module {  <br>    single { dataStore(get()) }  <br>}  </pre><ul><li><strong>iOS</strong> (shared/iosMain):</li></ul><pre>fun dataStore(): DataStore&lt;Preferences&gt; = createDataStore(  <br>    producePath = {  <br>        val documentDirectory: NSURL? = NSFileManager.defaultManager.URLForDirectory(  <br>            directory = NSDocumentDirectory,  <br>            inDomain = NSUserDomainMask,  <br>            appropriateForURL = null,  <br>            create = false,  <br>            error = null,  <br>        )  <br>        requireNotNull(documentDirectory).path + &quot;/$dataStoreFileName&quot;  <br>    }  <br>)  <br><br>// iOS Koin module<br>actual fun platformDataStoreModule(): Module = module {  <br>    single { dataStore() }  <br>}  </pre><p><strong>Dependency Injection (Koin)</strong>:</p><pre>// Shared Koin module  <br>val dataStoreModule = module {  <br>    single { LocalDataStore(get()) }  <br>    includes(platformDataStoreModule()) // Adds platform-specific DataStore  <br>}  </pre><h3>Using the Injected DataStore (🔥 Pro Tip Inside)</h3><p>Inject LocalDataStore anywhere in your shared codebase and <strong>watch the magic unfold</strong>:</p><pre>// In shared/commonMain  <br>class SettingsViewModel(  <br>    private val localDataStore: LocalDataStore  <br>) : ViewModel() {  <br><br>    // Observe premium status  <br>    val isPremium: Flow&lt;Boolean&gt; = localDataStore.isPremium  <br><br>    // Update premium status  <br>    fun upgradeToPremium() {  <br>        viewModelScope.launch {  <br>            localDataStore.saveIsPremium(true)  <br>        }  <br>    }  <br>}  </pre><h4>Injecting in Your App:</h4><pre>// In your Koin setup (shared module):  <br>val appModule = module {  <br>    viewModel { SettingsViewModel(get()) }  <br>}</pre><p>On Android/iOS, just inject the platform-specific DataStore via Koin, and boom – <strong>your preferences work everywhere</strong>.</p><h3>Why This Rocks</h3><ul><li>🚀 <strong>Zero platform-specific code</strong> in your business logic.</li><li>🔄 Shared Flow for reactive updates across Android/iOS.</li><li>💡 Testable, clean, and scalable.</li></ul><p><strong>Go forth and conquer cross-platform storage!</strong> Your users (and your sanity) will thank you.</p><p><em>Got questions? Drop them below — let’s geek out!</em> 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30c4851decff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing iOS 18+ Bug: Extended Styles Over List Markers in NSAttributedString]]></title>
            <link>https://medium.com/@uguboz/fixing-ios-18-bug-extended-styles-over-list-markers-in-nsattributedstring-0a92529a85f2?source=rss-e398f42c72e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a92529a85f2</guid>
            <category><![CDATA[nsattributedstring]]></category>
            <category><![CDATA[uitextview]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[uikit]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[uğur]]></dc:creator>
            <pubDate>Fri, 24 Jan 2025 17:29:21 GMT</pubDate>
            <atom:updated>2025-02-15T15:59:02.847Z</atom:updated>
            <content:encoded><![CDATA[<p>In iOS 18 and later, when rendering HTML content using NSAttributedString, you may encounter a bug where various styles (such as text decorations or font styles) incorrectly extend over the list markers (bullets or numbers). This issue typically occurs when styling &lt;li&gt; tags, causing the list marker to unintentionally inherit styles like font changes, colours, or text decorations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*sNfhdvp1k1jDBEUbVarWng.png" /><figcaption>The extended list marker styling issue on iOS 18+</figcaption></figure><h3>The Issue:</h3><p>Suppose you have HTML content like this:</p><pre>&lt;ul&gt;<br> &lt;li&gt;<br>  &lt;del&gt;<br>   &lt;em style=&#39;color: rgb(255, 45, 85); background-color: rgb(255, 255, 0); text-decoration: underline&#39;&gt;First item&lt;/em&gt;<br>  &lt;/del&gt;<br> &lt;/li&gt;<br> &lt;li&gt;Second item&lt;/li&gt;<br> &lt;li&gt;Third item&lt;/li&gt;<br>&lt;/ul&gt;</pre><p>When rendered as NSAttributedString in iOS 18+, the style properties such as underline, color, and strikethroughcan incorrectly apply to the list markers (the bullets or numbers), which is undesirable.</p><p>This bug arises because NSAttributedString doesn&#39;t correctly separate the list marker from the text content when applying styles, causing the list marker to inherit unintended styles.</p><h3>The Solution:</h3><p>To fix this issue in iOS 18+, a simple workaround is to modify the HTML by adding a zero-width non-joiner (&amp;zwnj;) immediately after each opening &lt;li&gt; tag. This ensures that the list marker is unaffected by any styles applied to the content, such as colour, font weight, or text decoration.</p><p>By inserting &amp;zwnj;, you create a separation between the list marker and the list item content, preventing the style from spilling over to the marker.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a92529a85f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Xcode “Error: the replacement path doesn’t exist” and “Error: module importing failed: invalid…]]></title>
            <link>https://medium.com/@uguboz/xcode-error-the-replacement-path-doesnt-exist-and-error-module-importing-failed-invalid-2f00cd6d854b?source=rss-e398f42c72e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f00cd6d854b</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[bazel]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[lldb]]></category>
            <dc:creator><![CDATA[uğur]]></dc:creator>
            <pubDate>Fri, 10 Jan 2025 17:51:24 GMT</pubDate>
            <atom:updated>2025-01-10T17:51:24.481Z</atom:updated>
            <content:encoded><![CDATA[<h3>Xcode “Error: the replacement path doesn’t exist” and “Error: module importing failed: invalid pathname”</h3><h3>Problem</h3><p>XCode lldb error appeared after compiling Telegram-iOS project with bazel.</p><pre>error: the replacement path doesn&#39;t exist: &quot;/var/tmp/_bazel_ugur/fb65e78b2b0fb83a316fdab5e858309a/rules_xcodeproj.noindex/build_output_base/execroot/__main__/bazel-out&quot;<br>error: the replacement path doesn&#39;t exist: &quot;/var/tmp/_bazel_ugur/fb65e78b2b0fb83a316fdab5e858309a/rules_xcodeproj.noindex/build_output_base/external&quot;<br>error: the replacement path doesn&#39;t exist: &quot;/var/tmp/_bazel_ugur/fb65e78b2b0fb83a316fdab5e858309a/rules_xcodeproj.noindex/build_output_base/execroot/__main__/external&quot;<br>error: the replacement path doesn&#39;t exist: &quot;/Users/ugur/XcodeProjects/Telegram-iOS&quot;<br>error: module importing failed: invalid pathname &#39;/Users/ugur/Library/Developer/Xcode/DerivedData/Telegram-giyshabnyrxonebkeonanvfivxff/Build/Intermediates.noindex/Debug/swift_debug_settings.py&#39;</pre><h3>Solution</h3><p>Remove below files and rerun your project from Xcode.</p><pre>/Users/YOUR_USER_NAME/.lldbinit-Xcode <br>/Users/YOUR_USER_NAME/.lldbinit-rules_xcodeproj</pre><p>It seems bazel created .lldbinit* files under /Users/{user}/ path which causes Xcode produce above error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5PhLz7d-kJSYkpYiDdxMAg.png" /><figcaption>.lldbinit-* files to be removed from /Users/{YOUR_USER_NAME}/ path</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDj2Opr0KmjwEW_qF2gfhg.png" /><figcaption>What is inside the files.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f00cd6d854b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure Pipeline Xcode 16 Support]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">Selecting latest available Xcode in Azure Pipeline for iOS apps</p><p class="medium-feed-link"><a href="https://medium.com/@uguboz/azure-pipeline-xcode16-support-0c5264cf9640?source=rss-e398f42c72e3------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@uguboz/azure-pipeline-xcode16-support-0c5264cf9640?source=rss-e398f42c72e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c5264cf9640</guid>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[azure-pipelines]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[uğur]]></dc:creator>
            <pubDate>Thu, 05 Dec 2024 14:23:21 GMT</pubDate>
            <atom:updated>2024-12-16T15:33:39.843Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Hacking Orthogonal Scrolling in UIKit’s Compositional Layout]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@uguboz/hacking-orthogonal-scrolling-in-uikits-compositional-layout-ad90e8320189?source=rss-e398f42c72e3------2"><img src="https://cdn-images-1.medium.com/max/2288/1*8EuHlcBIoYiuy1cvUYZhXw.png" width="2288"></a></p><p class="medium-feed-snippet">UIKit&#x2019;s Compositional Layout has been a great tool to provide vertical and horizontal scrolling out of the box. Now we are gonna explore&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@uguboz/hacking-orthogonal-scrolling-in-uikits-compositional-layout-ad90e8320189?source=rss-e398f42c72e3------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@uguboz/hacking-orthogonal-scrolling-in-uikits-compositional-layout-ad90e8320189?source=rss-e398f42c72e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad90e8320189</guid>
            <category><![CDATA[carousel]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[uikit]]></category>
            <category><![CDATA[banners]]></category>
            <category><![CDATA[compositional-layout]]></category>
            <dc:creator><![CDATA[uğur]]></dc:creator>
            <pubDate>Wed, 12 Jun 2024 18:25:32 GMT</pubDate>
            <atom:updated>2025-07-30T02:51:22.849Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Unboxing Tinder and Bumble iOS Apps]]></title>
            <link>https://medium.com/@uguboz/unveiling-the-secret-sauce-a-look-at-third-party-dependencies-in-dating-apps-8baf4bebdaf4?source=rss-e398f42c72e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/8baf4bebdaf4</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[dating]]></category>
            <category><![CDATA[tinder]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[uğur]]></dc:creator>
            <pubDate>Sat, 25 May 2024 18:07:16 GMT</pubDate>
            <atom:updated>2024-06-26T19:05:36.350Z</atom:updated>
            <content:encoded><![CDATA[<h4>Demystifying dependencies of most popular dating apps.</h4><p>Dating apps have become a prominent force in the modern world, facilitating connections and fostering romance. But beneath the swipes and profiles lies a complex ecosystem of technologies that power these experiences. This article delves into the world of third-party dependencies, the hidden building blocks that dating apps rely on to function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*Vs6ECRGOyHHgc8joGfySuw.jpeg" /><figcaption><a href="https://www.simplilearn.com/ice9/free_resources_article_thumb/The-Five-Phases-of-Ethical-Hacking.jpg">Generic image</a></figcaption></figure><h4>Prerequisites</h4><ul><li>ipatool (<a href="https://github.com/majd/ipatool">https://github.com/majd/ipatool</a>)</li><li>otool (<a href="https://www.unix.com/man-page/osx/1/otool/">https://www.unix.com/man-page/osx/1/otool/</a>)</li><li>Mac Terminal</li></ul><h4>Obtaining the IPA from App Store</h4><p>Before diving into dependencies, let’s address how we’ll analyse them. Ethical considerations prevent directly accessing ipa files. However, tools like ipatool can be used for educational purposes to extract the application package file (IPA) from the App Store.</p><pre># Dowload Tinder ipa file from App Store<br>ipatool purchase --bundle-identifier com.cardify.tinder (The app is free but required to get a licence)<br>ipatool download --bundle-identifier com.cardify.tinder (Downloads the ipa file)</pre><pre># Dowload Bumble ipa file from App Store<br>ipatool purchase --bundle-identifier com.moxco.bumble<br>ipatool download --bundle-identifier com.moxco.bumble</pre><p>Replace .ipa with .zip and unzip it. Folder structure will look like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HMPUX4yd35CSIk-Q_bhU3Q.png" /><figcaption>Folder structure of unzipped Bumble.ipa</figcaption></figure><p><strong>Dependency Deep Dive: A Look Under the Hood</strong></p><p>Once we have the ipa, we can use the otool -L command to identify its dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1JtAuZ9_jkpJ4ibzL6Akpg.png" /><figcaption><a href="https://www.unix.com/man-page/osx/1/otool/">otool command info</a></figcaption></figure><h3>Case Study: Tinder</h3><p>Let’s take Tinder as an example. Analysing its dependencies with otool -L reveals a mix of system frameworks provided by Apple (like Core Graphics and Core Location) and third-party frameworks.</p><p>Running the following otool command from the Terminal will reveal the 3rd parties used by Tinder iOS app.</p><pre>otool -L com.cardify.tinder_547702041_15.9.0/Payload/Tinder.app/Tinder | grep rpath</pre><pre>@rpath/FaceTecSDK.framework/FaceTecSDK (compatibility version 1.0.0, current version 9.6.84)<br> @rpath/LineSDK.framework/LineSDK (compatibility version 1.0.0, current version 1129.0.0)<br> @rpath/NimbusCoreKit.framework/NimbusCoreKit (compatibility version 1.0.0, current version 62.0.0)<br> @rpath/OMSDK_Adsbynimbus.framework/OMSDK_Adsbynimbus (compatibility version 0.0.0, current version 0.0.0)<br> @rpath/NimbusRenderKit.framework/NimbusRenderKit (compatibility version 1.0.0, current version 62.0.0)<br> @rpath/NimbusRequestKit.framework/NimbusRequestKit (compatibility version 1.0.0, current version 62.0.0)<br> @rpath/NimbusKit.framework/NimbusKit (compatibility version 1.0.0, current version 62.0.0)<br> @rpath/NimbusRenderStaticKit.framework/NimbusRenderStaticKit (compatibility version 1.0.0, current version 62.0.0)<br> @rpath/GoogleInteractiveMediaAds.framework/GoogleInteractiveMediaAds (compatibility version 0.0.0, current version 0.0.0)<br> @rpath/NimbusRenderVideoKit.framework/NimbusRenderVideoKit (compatibility version 1.0.0, current version 62.0.0)<br> @rpath/NimbusRenderExtensionsKit.framework/NimbusRenderExtensionsKit (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/FaceMeSDK.framework/FaceMeSDK (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/SpotifyiOS.framework/SpotifyiOS (compatibility version 1.0.0, current version 1.0.0)</pre><p>Here are some key third-party dependencies we found:</p><ul><li><strong>FaceTecSDK &amp; FaceMeSDK:</strong> This suggests Tinder utilises facial recognition technology, potentially for user verification or security measures.</li><li><strong>LineSDK:</strong> This might be an integration with the Line services such as messaging or login etc.</li><li><strong>NimbusKit:</strong> A suite of tools for managing user interface elements, networking, or other functionalities within the app.</li><li><strong>SpotifyiOS:</strong> This reveals potential integration with Spotify, allowing users to share their musical preferences or connect their accounts.</li><li><strong>OMSDK (iabtechlab — Open Measurement SDK): </strong>This seems to be anad performance measurement tool.</li></ul><p>Also we can filter the System libraries with the same command.</p><pre>otool -L com.cardify.tinder_547702041_15.9.0/Payload/Tinder.app/Tinder | grep /System</pre><pre>/System/Library/Frameworks/Accelerate.framework/Accelerate (compatibility version 1.0.0, current version 4.0.0)<br> /System/Library/Frameworks/CoreServices.framework/CoreServices (compatibility version 1.0.0, current version 1226.0.0)<br> /System/Library/Frameworks/ImageIO.framework/ImageIO (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics (compatibility version 64.0.0, current version 1774.2.3)<br> /System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 2202.0.0)<br> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration (compatibility version 1.0.0, current version 1296.60.3)<br> /System/Library/Frameworks/Security.framework/Security (compatibility version 1.0.0, current version 61040.62.1)<br> /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)<br> /System/Library/Frameworks/AVFoundation.framework/AVFoundation (compatibility version 1.0.0, current version 2.0.0)<br> /System/Library/Frameworks/CFNetwork.framework/CFNetwork (compatibility version 1.0.0, current version 1490.0.4)<br> /System/Library/Frameworks/CoreMedia.framework/CoreMedia (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony (compatibility version 1.0.0, current version 0.0.0)<br> /System/Library/Frameworks/CoreVideo.framework/CoreVideo (compatibility version 1.2.0, current version 1.5.0)<br> /System/Library/Frameworks/MediaPlayer.framework/MediaPlayer (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/MessageUI.framework/MessageUI (compatibility version 1.0.0, current version 3774.255.61)<br> /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices (compatibility version 1.0.0, current version 1226.0.0)<br> /System/Library/Frameworks/QuartzCore.framework/QuartzCore (compatibility version 1.2.0, current version 1.11.0)<br> /System/Library/Frameworks/StoreKit.framework/StoreKit (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/AdSupport.framework/AdSupport (compatibility version 1.0.0, current version 1.0.0, weak)<br> /System/Library/Frameworks/iAd.framework/iAd (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation (compatibility version 150.0.0, current version 2202.0.0)<br> /System/Library/Frameworks/GLKit.framework/GLKit (compatibility version 1.0.0, current version 126.0.0)<br> /System/Library/Frameworks/OpenGLES.framework/OpenGLES (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/UIKit.framework/UIKit (compatibility version 1.0.0, current version 7209.1.102)<br> /System/Library/Frameworks/VideoToolbox.framework/VideoToolbox (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore (compatibility version 1.0.0, current version 617.1.17, weak)<br> /System/Library/Frameworks/SafariServices.framework/SafariServices (compatibility version 1.0.0, current version 1.0.0, weak)<br> /System/Library/Frameworks/WebKit.framework/WebKit (compatibility version 1.0.0, current version 617.1.17, weak)<br> /System/Library/Frameworks/AVFAudio.framework/AVFAudio (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/ActivityKit.framework/ActivityKit (compatibility version 1.0.0, current version 1.0.0, weak)<br> /System/Library/Frameworks/AdServices.framework/AdServices (compatibility version 1.0.0, current version 1.0.0, weak)<br> /System/Library/Frameworks/AppTrackingTransparency.framework/AppTrackingTransparency (compatibility version 1.0.0, current version 1.0.0, weak)<br> /System/Library/Frameworks/AuthenticationServices.framework/AuthenticationServices (compatibility version 1.0.0, current version 617.1.17)<br> /System/Library/Frameworks/Combine.framework/Combine (compatibility version 1.0.0, current version 311.0.0)<br> /System/Library/Frameworks/Contacts.framework/Contacts (compatibility version 0.0.0, current version 3630.0.0)<br> /System/Library/Frameworks/ContactsUI.framework/ContactsUI (compatibility version 1.0.0, current version 1238.0.0)<br> /System/Library/Frameworks/CoreData.framework/CoreData (compatibility version 1.0.0, current version 1338.0.0)<br> /System/Library/Frameworks/CoreHaptics.framework/CoreHaptics (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/CoreImage.framework/CoreImage (compatibility version 1.0.0, current version 6.0.0)<br> /System/Library/Frameworks/CoreLocation.framework/CoreLocation (compatibility version 1.0.0, current version 2890.4.12)<br> /System/Library/Frameworks/CoreML.framework/CoreML (compatibility version 1.0.0, current version 1.0.0, weak)<br> /System/Library/Frameworks/CoreMotion.framework/CoreMotion (compatibility version 1.0.0, current version 2890.4.12)<br> /System/Library/Frameworks/CoreSpotlight.framework/CoreSpotlight (compatibility version 1.0.0, current version 2274.8.0)<br> /System/Library/Frameworks/CoreText.framework/CoreText (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/CryptoKit.framework/CryptoKit (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/DeviceCheck.framework/DeviceCheck (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/EventKit.framework/EventKit (compatibility version 1.0.0, current version 1870.2.1)<br> /System/Library/Frameworks/EventKitUI.framework/EventKitUI (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/GameplayKit.framework/GameplayKit (compatibility version 1.0.0, current version 99.0.3)<br> /System/Library/Frameworks/LinkPresentation.framework/LinkPresentation (compatibility version 1.0.0, current version 240.3.5)<br> /System/Library/Frameworks/LocalAuthentication.framework/LocalAuthentication (compatibility version 1.0.0, current version 1394.62.1)<br> /System/Library/Frameworks/MapKit.framework/MapKit (compatibility version 1.0.0, current version 14.0.0)<br> /System/Library/Frameworks/Metal.framework/Metal (compatibility version 1.0.0, current version 341.35.0)<br> /System/Library/Frameworks/MetalKit.framework/MetalKit (compatibility version 1.0.0, current version 161.0.0)<br> /System/Library/Frameworks/MetalPerformanceShaders.framework/MetalPerformanceShaders (compatibility version 1.0.0, current version 127.1.3)<br> /System/Library/Frameworks/MetricKit.framework/MetricKit (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/Photos.framework/Photos (compatibility version 1.0.0, current version 622.0.110)<br> /System/Library/Frameworks/SpriteKit.framework/SpriteKit (compatibility version 1.0.0, current version 50.0.6)<br> /System/Library/Frameworks/SwiftUI.framework/SwiftUI (compatibility version 1.0.0, current version 5.2.12)<br> /System/Library/Frameworks/UniformTypeIdentifiers.framework/UniformTypeIdentifiers (compatibility version 1.0.0, current version 709.0.0, weak)<br> /System/Library/Frameworks/UserNotifications.framework/UserNotifications (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/Vision.framework/Vision (compatibility version 1.0.0, current version 7.0.53)</pre><p>And some key system frameworks:</p><ul><li><strong>UIKit and SwiftUI</strong></li><li><strong>Metal, SpriteKit</strong>: This might be for rendering complex graphics and animations.</li><li><strong>CoreData</strong> for managing the data locally.</li><li><strong>CoreML</strong>: Probably running some machine learning code or model. Maybe training the model on-device.</li><li><strong>Vision: </strong>It seems Tinder supports new Vision OS or preparing for it.</li></ul><h3>Case Study: Bumble</h3><p>Bumble, the popular dating app known for its women-make-the-first-move approach, also relies on a network of third-party dependencies to function. By analyzing these dependencies, we can gain insights into the features and functionalities offered by the app.</p><h4>Analyzing Bumble’s Dependencies</h4><p>Similar to the approach used for Tinder, we can analyze Bumble’s dependencies using the otool -L command on the extracted IPA file.</p><p><strong>Third party dependencies:</strong></p><pre>otool -L com.moxco.bumble_930441707_5.364.1/Payload/Bumble.app/Bumble | grep rpath   <br> @rpath/Bolts.framework/Bolts (compatibility version 1.0.0, current version 0.0.0)<br> @rpath/Chatto.framework/Chatto (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/ChattoAdditions.framework/ChattoAdditions (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/CocoaLumberjack.framework/CocoaLumberjack (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/CocoaLumberjackSwift.framework/CocoaLumberjackSwift (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/ConsentViewController.framework/ConsentViewController (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/FBAEMKit.framework/FBAEMKit (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/FBSDKCoreKit.framework/FBSDKCoreKit (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/FBSDKLoginKit.framework/FBSDKLoginKit (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/FBSDKShareKit.framework/FBSDKShareKit (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/HKCircularProgressView_Carthage.framework/HKCircularProgressView_Carthage (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/HyperLabel.framework/HyperLabel (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/KVOController.framework/KVOController (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/KeychainAccess.framework/KeychainAccess (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/Lottie.framework/Lottie (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/NeedleFoundation.framework/NeedleFoundation (compatibility version 0.0.0, current version 0.0.0)<br> @rpath/PINCache.framework/PINCache (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/PINOperation.framework/PINOperation (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/SwiftProtobuf.framework/SwiftProtobuf (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/YapDatabase.framework/YapDatabase (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/Au10DetectorManager.framework/Au10DetectorManager (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/Au10tixBEKit.framework/Au10tixBEKit (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/Au10tixBaseUI.framework/Au10tixBaseUI (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/Au10tixCore.framework/Au10tixCore (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/Au10tixPassiveFaceLivenessKit.framework/Au10tixPassiveFaceLivenessKit (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/Au10tixPassiveFaceLivenessUI.framework/Au10tixPassiveFaceLivenessUI (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/Au10tixProofOfAddressKit.framework/Au10tixProofOfAddressKit (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/Au10tixProofOfAddressUI.framework/Au10tixProofOfAddressUI (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/Au10tixSmartDocumentCaptureKit.framework/Au10tixSmartDocumentCaptureKit (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/Au10tixSmartDocumentCaptureUI.framework/Au10tixSmartDocumentCaptureUI (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/Au10tixSourceManager.framework/Au10tixSourceManager (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/WebRTC.framework/WebRTC (compatibility version 0.0.0, current version 0.0.0)<br> @rpath/OpenTok.framework/OpenTok (compatibility version 1.0.0, current version 1.0.0)<br> @rpath/libswift_Concurrency.dylib (compatibility version 1.0.0, current version 5.9.2, weak)</pre><p>Here’s a breakdown of some key third-party dependencies we might encounter in Bumble:</p><ul><li><strong>Chatto:</strong> As we know Badoo is acquired by Bumble and it seems Bumble uses Badoo’s chat framework Chat.</li><li><strong>KeychainAccess:</strong> This framework likely allows Bumble to securely store user credentials like access tokens on the device’s keychain.</li><li><strong>Lottie:</strong> This framework is commonly used for integrating animations into mobile apps. Bumble might utilise Lottie for interactive elements or visual effects.</li><li><strong>YapDatabase: </strong>A sqlite wrapper for iOS.</li><li><strong>WebRTC:</strong> This framework enables real-time communication features, and its presence suggests Bumble might offer video or voice chat functionalities.</li><li><strong>OpenTok:</strong> This dependency could be related to video calling or chat functionalities within the app, potentially another real-time communication solution.</li><li><a href="https://www.au10tix.com/"><strong>Au10tix</strong></a>: Identity verification for fraud detection.</li><li><strong>SwiftProtobuf: </strong>Bumble might be using protocol buffers instead of json to communicate with backend.</li><li><strong>NeedleFoundation: </strong>Uber’s dependency injection framework for Swift.</li></ul><p><strong>System dependencies:</strong></p><pre>otool -L com.moxco.bumble_930441707_5.364.1/Payload/Bumble.app/Bumble | grep /System<br> /System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 2202.0.0)<br> /System/Library/Frameworks/AVFoundation.framework/AVFoundation (compatibility version 1.0.0, current version 2.0.0)<br> /System/Library/Frameworks/Accelerate.framework/Accelerate (compatibility version 1.0.0, current version 4.0.0)<br> /System/Library/Frameworks/Accessibility.framework/Accessibility (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/AdServices.framework/AdServices (compatibility version 1.0.0, current version 1.0.0, weak)<br> /System/Library/Frameworks/AdSupport.framework/AdSupport (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/AppTrackingTransparency.framework/AppTrackingTransparency (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)<br> /System/Library/Frameworks/AuthenticationServices.framework/AuthenticationServices (compatibility version 1.0.0, current version 617.1.17)<br> /System/Library/Frameworks/BackgroundTasks.framework/BackgroundTasks (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/CFNetwork.framework/CFNetwork (compatibility version 1.0.0, current version 1490.0.4)<br> /System/Library/Frameworks/CallKit.framework/CallKit (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/Combine.framework/Combine (compatibility version 1.0.0, current version 311.0.0)<br> /System/Library/Frameworks/Contacts.framework/Contacts (compatibility version 0.0.0, current version 3630.0.0)<br> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation (compatibility version 150.0.0, current version 2202.0.0)<br> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics (compatibility version 64.0.0, current version 1774.2.3)<br> /System/Library/Frameworks/CoreImage.framework/CoreImage (compatibility version 1.0.0, current version 6.0.0)<br> /System/Library/Frameworks/CoreLocation.framework/CoreLocation (compatibility version 1.0.0, current version 2890.4.12)<br> /System/Library/Frameworks/CoreMedia.framework/CoreMedia (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/CoreMotion.framework/CoreMotion (compatibility version 1.0.0, current version 2890.4.12)<br> /System/Library/Frameworks/CoreServices.framework/CoreServices (compatibility version 1.0.0, current version 1226.0.0)<br> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony (compatibility version 1.0.0, current version 0.0.0)<br> /System/Library/Frameworks/CoreText.framework/CoreText (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/CoreVideo.framework/CoreVideo (compatibility version 1.2.0, current version 1.5.0)<br> /System/Library/Frameworks/CryptoKit.framework/CryptoKit (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/EventKit.framework/EventKit (compatibility version 1.0.0, current version 1870.2.1)<br> /System/Library/Frameworks/EventKitUI.framework/EventKitUI (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore (compatibility version 1.0.0, current version 617.1.17)<br> /System/Library/Frameworks/LinkPresentation.framework/LinkPresentation (compatibility version 1.0.0, current version 240.3.5)<br> /System/Library/Frameworks/LocalAuthentication.framework/LocalAuthentication (compatibility version 1.0.0, current version 1394.62.1)<br> /System/Library/Frameworks/MapKit.framework/MapKit (compatibility version 1.0.0, current version 14.0.0)<br> /System/Library/Frameworks/MessageUI.framework/MessageUI (compatibility version 1.0.0, current version 3774.255.61)<br> /System/Library/Frameworks/Photos.framework/Photos (compatibility version 1.0.0, current version 622.0.110)<br> /System/Library/Frameworks/PushKit.framework/PushKit (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/QuartzCore.framework/QuartzCore (compatibility version 1.2.0, current version 1.11.0)<br> /System/Library/Frameworks/SafariServices.framework/SafariServices (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/Security.framework/Security (compatibility version 1.0.0, current version 61040.62.1)<br> /System/Library/Frameworks/StoreKit.framework/StoreKit (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/SwiftUI.framework/SwiftUI (compatibility version 1.0.0, current version 5.2.12)<br> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration (compatibility version 1.0.0, current version 1296.60.3)<br> /System/Library/Frameworks/UIKit.framework/UIKit (compatibility version 1.0.0, current version 7209.1.102)<br> /System/Library/Frameworks/UserNotifications.framework/UserNotifications (compatibility version 1.0.0, current version 1.0.0)<br> /System/Library/Frameworks/Vision.framework/Vision (compatibility version 1.0.0, current version 7.0.53)<br> /System/Library/Frameworks/WebKit.framework/WebKit (compatibility version 1.0.0, current version 617.1.17)<br> /System/Library/Frameworks/iAd.framework/iAd (compatibility version 1.0.0, current version 1.0.0)</pre><p>Here is the highlights of the system frameworks used by Bumble:</p><ul><li><strong>UIKit and SwiftUI</strong></li><li><strong>Combine: </strong>A declarative Swift API for processing values over time</li><li><strong>Vision: </strong>To support Vision OS.</li></ul><h3>Key Findings:</h3><ul><li><strong>Shared Security Focus:</strong> Both Tinder and Bumble prioritize user safety by integrating advanced security and identity verification tools.</li><li><strong>Future-Proofing Efforts:</strong> Evidence suggests potential groundwork for future development, such as preparation for Apple’s Vision OS or the transition from UIKit to SwiftUI.</li><li><strong>Dependency Differences:</strong> Bumble appears to have a greater reliance on open-source libraries, while Tinder prioritises in-house development for complex UI elements and animations. Or Tinder might be using static libraries (SPM packages are static by default) which makes it almost improssible to track with this method.</li><li><strong>Database Divergence:</strong> Interestingly, Bumble utilises a third party database solution instead of the commonly used Core Data framework.</li><li><strong>Machine Learning Exploration:</strong> There might be indications of Tinder experimenting with on-device training of machine learning models.</li></ul><p>What surprised you most about the tech behind these apps?</p><p>Hit <strong>clap</strong> 👏 if you found this interesting &amp; <strong>share your thoughts</strong> below 👇!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8baf4bebdaf4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swift Closures That Leak: Let’s Fix Them in Xcode!]]></title>
            <link>https://medium.com/@uguboz/lesser-known-most-common-retain-cycles-in-your-ios-app-0daddb9652ad?source=rss-e398f42c72e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/0daddb9652ad</guid>
            <category><![CDATA[memory-management]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[reference-type]]></category>
            <dc:creator><![CDATA[uğur]]></dc:creator>
            <pubDate>Sat, 18 May 2024 01:00:03 GMT</pubDate>
            <atom:updated>2024-06-14T15:26:50.759Z</atom:updated>
            <content:encoded><![CDATA[<h4>Demystifying Retain Cycles Caused by Closures</h4><h3><strong>Problem Definition</strong></h3><p>See below code. There is a class with a callback which is supposed to trigger when there is a change in data. Below DetailVC observes DataRefresher by referencing to didRefresh.</p><pre>class DataRefresher {<br>    var callback: (() -&gt; Void)?<br>}<br><br>class DetailVC: UIViewController {<br><br>    deinit {<br>        // This will not be called<br>        print(&quot;deinit:: no reference cycle&quot;)<br>    }<br><br>   var dataRefresher = DataRefresher()<br><br>    override func viewDidLoad() {<br>        super.viewDidLoad()<br>        // Implicit self that creates retain cycle<br>        dataRefresher.callback = self.didRefresh<br>    }<br><br>    func didRefresh() {<br><br>    } <br>}</pre><p>I opened DetailVC from the parent 3 times, deinit is never called and as it can bee seen below, 3 instances of DetailVC and DataRefresher is created. Also we can reveal the retain cycle from below view. It is callback closure from DataRefresher.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZjQBzX_tklK81Jx1gbJBQ.png" /><figcaption>func callback() causes a retain cycle</figcaption></figure><p>Now lets’ remove the reference and try again.</p><pre>override func viewDidLoad() {<br>    super.viewDidLoad()<br>    // No Retain cycle<br>    // dataRefresher.callback = didRefresh<br>}</pre><p>Reopened DetailVC 3 times again and this time deinit is called 3 times and only 1 instance is created becuase others are deallocated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jNjFZ0IC5uIBwreKlWp9Rw.png" /><figcaption>No retain cycle</figcaption></figure><h3>Solutions</h3><h4>1. Use lazy initializer</h4><pre>private lazy var dataRefresher: DataRefresher = {<br>    let dataRefresher = DataRefresher()<br>    dataRefresher.callback = didRefresh // No retain cycle<br>    return dataRefresher<br>}()</pre><h4>2. Use closure property instead of function</h4><pre>override func viewDidLoad() {<br>    super.viewDidLoad()<br>    // No retain cycle<br>    dataRefresher.callback = didRefresh<br>}<br><br>private var didRefresh = {<br><br>}</pre><h4>3. Use delegate pattern with weak reference</h4><pre>class DataRefresher {<br>    weak var delegate: DataRefresherDelegate?<br>}<br><br>class DetailVC: UIViewController {<br>    override func viewDidLoad() {<br>        super.viewDidLoad()<br>        // No Retain Cycle<br>        dataRefresher.delegate = self<br>    }<br>}<br><br>extension DetailVC: DataRefresherDelegate {<br>    func didRefresh() {<br><br>    }<br>}</pre><h4>4. Use explicit self with weak reference</h4><pre>override func viewDidLoad() {<br>    super.viewDidLoad()<br>    // No retain cycle<br>    dataRefresher.callback = { [weak self] in<br>      /// do some work<br>    }<br>}</pre><h3>Takeaways</h3><ul><li>Proper implementation and verification of deinit help ensure effective memory management.</li><li>Regular use of Xcode’s Memory Graph Debugger can prevent and identify issues related to multiple references of an object.</li><li>Xcode’s Instruments Profiler is essential for detecting and resolving retain cycles, thus improving application performance and stability.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0daddb9652ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Xcode Git SSH Fix: Clear Cache]]></title>
            <link>https://medium.com/@uguboz/xcode-git-ssh-fix-clear-cache-9f62e569918c?source=rss-e398f42c72e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f62e569918c</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[mac]]></category>
            <dc:creator><![CDATA[uğur]]></dc:creator>
            <pubDate>Tue, 07 May 2024 17:34:42 GMT</pubDate>
            <atom:updated>2024-05-07T17:34:42.618Z</atom:updated>
            <content:encoded><![CDATA[<p>Updated SSH key messing with Xcode’s Git? Here’s the fix:</p><ol><li>Quit Xcode.</li><li>Find ~/Library/Preferences/com.apple.dt.Xcode.plist (use a plist editor).</li><li>Delete “IDESourceControlKnownSSHHostsDefaultsKey” (key &amp; data).</li><li>Save, reboot &amp; relaunch Xcode.</li></ol><p>Xcode will prompt for new SSH credentials, restoring your Git connection.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f62e569918c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advanced Compositional Layout]]></title>
            <link>https://medium.com/@uguboz/introducing-anylayout-dealing-with-massive-enums-in-compositional-layouts-bf3a9e00e839?source=rss-e398f42c72e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf3a9e00e839</guid>
            <category><![CDATA[type-erasure]]></category>
            <category><![CDATA[diffable-data-sources]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[compositional-layout]]></category>
            <dc:creator><![CDATA[uğur]]></dc:creator>
            <pubDate>Fri, 03 May 2024 16:15:35 GMT</pubDate>
            <atom:updated>2024-07-15T13:35:06.524Z</atom:updated>
            <content:encoded><![CDATA[<p>Create dynamic and modern collections effortlessly without relying on enums with AnyLayout.</p><h3>Introduction</h3><p>In iOS13.0 Apple has introduced <strong><em>UICollectionViewCompositionalLayout</em></strong> and <strong><em>UICollectionViewDiffableDataSource</em></strong> to build flexible and performant UI with minimal effort. It has been a great framework so far and loved by many but there was a problem when we need to manage multiple cell types. Our only resort was using “<strong>enums with associated types</strong>”.</p><h3>The Problem</h3><p>Once I am given with a legacy code with a base view controller where all the logic lies and a massive enum to handle all the cell types from the base view controller. I was looking for a solution to support struct types along with enums so i could refactor the code gradually. After a bit of search, I found out “Type Erasure” was the solution.</p><h4><strong>Challenges with Type Erasures</strong></h4><ol><li><em>UICollectionViewDiffableDataSource</em><strong><em> </em></strong>only supports concrete Hashable types.</li><li>Erased types are not Hashable by default.</li><li>Remembering the erased types when dequeuing the cells.</li></ol><h3>Redefining Models with Type Erasures</h3><p>Implement AnySection and AnyItem models with type erasure conforming to Hashable.</p><pre>public struct AnySection: Hashable {<br>    public static func == (lhs: AnySection, rhs: AnySection) -&gt; Bool {<br>        lhs.base == rhs.base<br>    }<br><br>    public func hash(into hasher: inout Hasher) {<br>        hasher.combine(base)<br>    }<br><br>    private let base: AnyHashable<br>    <br>    public let layout: (_ sectionIndex: Int, _ layoutEnvironment: NSCollectionLayoutEnvironment) -&gt; NSCollectionLayoutSection<br><br>    public init&lt;Section: SectionProviding&gt;(_ base: Section) {<br>        self.base = base<br>        self.layout = base.layout<br>    }<br><br>    public func resolve&lt;Section: SectionProviding&gt;() -&gt; Section? {<br>        guard let base = base as? Section else { return nil }<br>        return base<br>    }<br>}<br><br>public struct AnyItem: Hashable {<br>    public static func == (lhs: AnyItem, rhs: AnyItem) -&gt; Bool {<br>        lhs.base == rhs.base<br>    }<br><br>    public func hash(into hasher: inout Hasher) {<br>        hasher.combine(base)<br>    }<br><br>    private let base: AnyHashable<br>    public let reusableIdentifier: String<br><br>    public init&lt;Item: ItemProviding&gt;(_ base: Item) {<br>        self.base = base<br>        self.reusableIdentifier = base.reuseIdentifier<br>    }<br><br>    public func resolve&lt;Item: ItemProviding&gt;() -&gt; Item {<br>        guard let base = base as? Item else { fatalError(&quot;Could not cast to \(String(reflecting: Item.self)). Expected \(reusableIdentifier).&quot;) }<br>        return base<br>    }<br>}</pre><p>Now we can define our data source with erased types.</p><pre>var dataSource: UICollectionViewDiffableDataSource&lt;AnySection, AnyItem&gt;</pre><p>Now we can define struct or enum types and erase them to any types.</p><pre>struct Section: SectionProviding {<br>    let id = UUID()<br>    /// Add more fields here if needed<br><br>    func layout(_ sectionIndex: Int, _ layoutEnvironment: NSCollectionLayoutEnvironment) -&gt; NSCollectionLayoutSection {<br>        /// Implement section layout <br>    }<br>}<br><br>struct Item: ItemProviding {<br>    let id = UUID()<br>    /// Add more fields here if needed<br>}<br><br>enum ItemTypes: ItemProviding {<br>    case text(String)<br>}<br><br>/**<br><br> Erase struct, enum or any hashable models to Any types:<br><br> - AnySection(Section()) or Section().eraseToAnySection<br> - AnyItem(Item()) or Item().eraseToAnyItem<br> - ItemTypes.text(&quot;Row 1&quot;).eraseToAnyItem<br>*/<br></pre><p>Use Any types in the snapshot.</p><pre>var snapshot = NSDiffableDataSourceSnapshot&lt;AnySection, AnyItem&gt;()<br>snapshot.appendSections([section.eraseToAnySection])<br>snapshot.appendItems(item.eraseToAnyItem)<br>dataSource.apply(snapshot)</pre><h3>Final Code</h3><p><a href="https://github.com/OfTheWolf/AnyLayout">https://github.com/OfTheWolf/AnyLayout</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf3a9e00e839" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>