<?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 Boby Ficher on Medium]]></title>
        <description><![CDATA[Stories by Boby Ficher on Medium]]></description>
        <link>https://medium.com/@bobyficsher14?source=rss-894a65297526------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lCpI94V04J3gogYZs2CvNg.jpeg</url>
            <title>Stories by Boby Ficher on Medium</title>
            <link>https://medium.com/@bobyficsher14?source=rss-894a65297526------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 08:53:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bobyficsher14/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[Understanding the iOS Keychain: Secure Storage for Sensitive Data ]]></title>
            <link>https://medium.com/@bobyficsher14/understanding-the-ios-keychain-secure-storage-for-sensitive-data-1f53056a1094?source=rss-894a65297526------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f53056a1094</guid>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[keychain]]></category>
            <dc:creator><![CDATA[Boby Ficher]]></dc:creator>
            <pubDate>Sun, 22 Jun 2025 06:32:42 GMT</pubDate>
            <atom:updated>2025-06-22T06:32:42.659Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*ScgEMKGKiWrrb0_OPwez6A.jpeg" /><figcaption>keychain for security</figcaption></figure><p>The <strong>iOS Keychain</strong> is a powerful and secure storage system provided by Apple for safeguarding sensitive data like passwords, tokens, and cryptographic keys. Whether you’re a developer building secure apps or a user curious about how your credentials are stored, understanding the Keychain is essential. In this post, we’ll dive into how the Keychain stores, retrieves, and persists data, when it gets deleted, and the key differences between <strong>cloud-connected (iCloud Keychain)</strong> and <strong>non-cloud-connected (local Keychain)</strong> storage</p><h3>🤔 What is the iOS Keychain?</h3><p>The iOS Keychain is an encrypted database designed to securely store small pieces of sensitive information, such as login credentials, encryption keys, or credit card details. It leverages <strong>AES-256-GCM encryption</strong> and the <strong>Secure Enclave</strong> (a hardware-based security component) to ensure data remains protected, even if a device is compromised. Apps can only access their own Keychain items unless explicitly configured to share data with other apps via access groups.</p><h3>🔒How the Keychain Stores Data</h3><p>The Keychain uses the <strong>Keychain Services API</strong> to store data as <strong>keychain items</strong>, which are key-value pairs with attributes like:</p><ul><li><strong>kSecClass</strong>: Defines the item type (e.g., passwords, keys, certificates).</li><li><strong>kSecAttrAccount</strong>: Identifies the account (e.g., a username).</li><li><strong>kSecValueData</strong>: The sensitive data (e.g., a password).</li><li><strong>kSecAttrService</strong>: A unique identifier for the app or service.</li><li><strong>kSecAttrAccessible</strong>: Controls when the data can be accessed (e.g., only when the device is unlocked).</li></ul><p>Here’s an example of storing a password in Swift:</p><pre>import Security<br><br>func saveToKeychain(account: String, password: String) {<br>    let query: [String: Any] = [<br>        kSecClass as String: kSecClassGenericPassword,<br>        kSecAttrAccount as String: account,<br>        kSecAttrService as String: &quot;MyAppService&quot;,<br>        kSecValueData as String: password.data(using: .utf8)!<br>    ]<br>    let status = SecItemAdd(query as CFDictionary, nil)<br>    if status == errSecSuccess {<br>        print(&quot;Password saved to Keychain&quot;)<br>    } else {<br>        print(&quot;Error: \(status)&quot;)<br>    }<br>}</pre><p>The Keychain encrypts data using the device’s hardware and passcode, ensuring robust security. It’s thread-safe and optimized for small data, not large files.</p><h3>🔓How the Keychain Retrieves Data</h3><p>Apps retrieve Keychain items by querying specific attributes (e.g., account and service). Only the creating app (or apps in the same access group) can access the data. Here’s an example of retrieving a password:</p><pre>func retrieveFromKeychain(account: String) -&gt; String? {<br>    let query: [String: Any] = [<br>        kSecClass as String: kSecClassGenericPassword,<br>        kSecAttrAccount as String: account,<br>        kSecAttrService as String: &quot;MyAppService&quot;,<br>        kSecReturnData as String: true<br>    ]<br>    var item: CFTypeRef?<br>    let status = SecItemCopyMatching(query as CFDictionary, &amp;item)<br>    if status == errSecSuccess, let data = item as? Data {<br>        return String(data: data, encoding: .utf8)<br>    }<br>    return nil<br>}</pre><p>Access is restricted by the <strong>accessibility attribute</strong> set during storage, ensuring data is only available under specific conditions (e.g., when the device is unlocked).</p><h3>💿 How Keychain Data Persists</h3><p>Keychain data persistence depends on whether it’s stored locally or synced via iCloud Keychain:</p><p><strong>Local Keychain</strong>:</p><ul><li>Stored in an encrypted SQLite database on the device.</li><li>Persists even after an app is uninstalled and reinstalled, as items are tied to the app’s provisioning profile. This allows seamless credential restoration but can raise privacy concerns.</li><li>Included in encrypted iTunes/iCloud backups unless marked `ThisDeviceOnly`.</li></ul><p><strong>iCloud Keychain</strong>:</p><ul><li>Syncs data across devices signed into the same Apple ID with iCloud Keychain enabled.</li><li>Uses <strong>end-to-end encryption</strong> (256-bit AES) for secure cloud storage.</li><li>Persists in iCloud until explicitly deleted or the user signs out with the delete option.</li></ul><h3>🗑️ When Does Keychain Data Get Deleted?</h3><p>Keychain data is highly persistent, but there are scenarios where it can be removed:</p><ul><li><strong>App Uninstall</strong>: Keychain items persist after uninstallation, which can surprise users expecting a full data wipe. Developers can clear Keychain data on reinstall by checking for a fresh install:</li></ul><pre>func clearKeychainIfReinstalled() {<br>    let freshInstall = !UserDefaults.standard.bool(forKey: &quot;alreadyInstalled&quot;)<br>    if freshInstall {<br>        // Delete Keychain items<br>        let query: [String: Any] = [kSecClass as String: kSecClassGenericPassword]<br>        SecItemDelete(query as CFDictionary)<br>        UserDefaults.standard.set(true, forKey: &quot;alreadyInstalled&quot;)<br>    }<br>}</pre><ul><li><strong>Manual Deletion</strong>: Apps can delete their own Keychain items using `SecItemDelete`.</li><li><strong>iCloud Keychain</strong>: Turning off iCloud Keychain prompts users to keep or delete data. Choosing “delete” removes it from the device and, if no other devices retain it, from iCloud.</li><li><strong>Factory Reset</strong>: Erases all local Keychain data. iCloud Keychain data can be restored upon signing back in, but `ThisDeviceOnly` items are lost forever.</li><li><strong>User-Initiated</strong>: On a Mac, users can delete iCloud Keychain data via the Keychain Access app. iOS lacks a native interface for viewing/deleting local Keychain data.</li></ul><h3>🆚 Cloud-Connected vs. Non-Cloud-Connected Keychain</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CN615su5XLKm9fgNbR3Mvg.png" /><figcaption>quick comparison</figcaption></figure><p><strong>iCloud Keychain</strong> is ideal for syncing passwords across your iPhone, iPad, and Mac, but requires two-factor authentication for security. <strong>Local Keychain</strong> is better for sensitive data that should never leave the device.</p><h3>Key Takeaways for Developers and Users 🗣️</h3><p><strong>Developers</strong>:</p><ul><li>Use Keychain for sensitive data instead of UserDefaults or unencrypted files.</li><li>Consider libraries like SwiftKeychainWrapper for easier Keychain management.</li><li>Mitigate privacy concerns by clearing Keychain data on app reinstall.</li><li>Use DeviceCheck for device-specific tracking instead of relying solely on Keychain.</li></ul><p><strong>Users</strong>:</p><ul><li>Enable iCloud Keychain for seamless password syncing, but understand it stores data in iCloud.</li><li>To fully remove Keychain data, sign out of iCloud (delete option) or reset your device.</li><li>Be aware that local Keychain data persists after app uninstalls, which may affect privacy.</li></ul><h3>👀 Conclusion:</h3><p>The iOS Keychain is a robust tool for secure data storage, balancing convenience and security. Whether you’re leveraging iCloud Keychain for cross-device access or local Keychain for device-specific data, understanding its mechanics helps you make informed decisions about your app’s security and privacy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f53056a1094" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“App Thinning in iOS — The Interview Question That Opened My Eyes ”]]></title>
            <link>https://medium.com/@bobyficsher14/app-thinning-in-ios-the-interview-question-that-opened-my-eyes-9c01eeca751d?source=rss-894a65297526------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c01eeca751d</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[memories]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Boby Ficher]]></dc:creator>
            <pubDate>Tue, 17 Jun 2025 18:14:34 GMT</pubDate>
            <atom:updated>2025-06-17T18:14:34.623Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*SEcD_JwY6Mj3F4ItJMlZ4w.png" /><figcaption>Wish i Could know this!</figcaption></figure><h3>“App Thinning in iOS — The Interview Question That Opened My Eyes 👀”</h3><p>I had an interview recently, and somewhere in the middle of our technical chat, the interviewer casually asked,<br> <strong>“What do you know about App Thinning in iOS?”</strong></p><p>And I froze.<br> I had heard the term before, sure, but I didn’t have a solid answer. I stumbled through something vague, but it didn’t feel right.</p><p>Later that evening, I sat down to really understand what App Thinning is.<br> And once I got it, I couldn’t help but think:<br> <strong>“Why isn’t this talked about more? Why don’t more iOS devs actively use this?”</strong></p><p>So if you’re building iOS apps, especially with size or performance in mind, this post is for you.</p><h3>🍏 What is App Thinning?</h3><p>App Thinning is Apple’s strategy to optimize how apps are delivered to users on their devices. It ensures users get <strong>only the parts of your app they need</strong>, nothing more.</p><p>There are <strong>3 key components</strong> of App Thinning:</p><h3>1. Slicing</h3><p>Imagine you built a universal app that supports iPhones, iPads, and different screen sizes.</p><p>With <strong>Slicing</strong>, the App Store automatically creates device-specific versions of your app.<br> That means:</p><ul><li>Only the assets needed for a specific device resolution or architecture are downloaded.</li><li>No bloated image sets for non-relevant screen sizes.</li><li>Smaller initial app size for the end-user.</li></ul><p>📦 For example:<br> You have @1x, @2x, @3x images in your asset catalog. A user with an iPhone SE (2nd gen) only gets @2x. The rest are excluded.</p><h3>2. Bitcode</h3><p>Bitcode is like an intermediate form of your compiled app.</p><p>When you upload your app with Bitcode enabled, Apple compiles it further on their servers to make it more optimized for each specific device.</p><p>This lets Apple:</p><ul><li>Retarget the app without needing your source code.</li><li>Future-proof the app for upcoming architectures (e.g., new Apple chips).</li></ul><p>⚠️ Note: As of recent updates, Bitcode is deprecated for iOS apps — but understanding it helps with legacy projects and overall context.</p><h3>3. On-Demand Resources (ODR)</h3><p>Have assets or levels in your app that aren’t needed upfront?</p><p>With <strong>ODR</strong>, you can separate and download resources <em>only when needed</em>.</p><p>🎮 For example: A game with 20 levels can ship with only the first 5. The rest are downloaded dynamically as the user progresses.</p><p>Benefits:</p><ul><li>Faster app install time.</li><li>Reduced initial download size.</li><li>Smarter memory management.</li></ul><p><strong>And let’s be honest — when was the last time we looked at our app size from the user’s point of view?</strong></p><h3>📺 Want to See It in Action?</h3><p>If you’re curious about how App Thinning actually works in a real project, I highly recommend checking out YouTube — there are plenty of high-quality walkthroughs and demos that show slicing, ODR, and more in action.</p><p>This article is limited to just the <em>core idea</em> of what App Thinning is and why it matters.<br> <strong>Sorry for that!</strong> I just wanted to keep things simple and beginner-friendly — but if you’re ready to dive deeper, the video resources out there will definitely help.</p><h3>💡 Final Thoughts</h3><p>That one interview question pushed me to dig deeper, and now I realize App Thinning is not just a buzzword — it’s a <em>must-know</em> optimization.</p><p>So if you’re shipping your next iOS app or preparing for an interview — <br> <strong>Take a moment to explore App Thinning. Your future self (and your users) will thank you.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c01eeca751d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Day 1/100: Brushing Up C — From printf to Pointers to struct]]></title>
            <link>https://medium.com/@bobyficsher14/day-1-100-brushing-up-c-from-printf-to-pointers-to-struct-72476354ffb5?source=rss-894a65297526------2</link>
            <guid isPermaLink="false">https://medium.com/p/72476354ffb5</guid>
            <category><![CDATA[100daychallenge]]></category>
            <category><![CDATA[boby]]></category>
            <dc:creator><![CDATA[Boby Ficher]]></dc:creator>
            <pubDate>Sat, 14 Jun 2025 18:16:17 GMT</pubDate>
            <atom:updated>2025-06-14T18:16:17.765Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="c as the king" src="https://cdn-images-1.medium.com/max/1024/1*AdYGRAR1UlZiS9R9W1MvDA.png" /><figcaption>Long live the King</figcaption></figure><h3>🚀 Day 1/100: Brushing Up C — From printf to Pointers to struct</h3><p>Today marks Day 1 of my 100-day journey to create a programming language from scratch using C.<br> Before diving into lexers, parsers, and ASTs, I needed to warm up and dust off some core C concepts — especially the ones I’ll lean on heavily over the next few weeks.</p><h3>✅ What I Did Today</h3><p>I walked through <strong>“Learn C in Y Minutes”</strong>, a concise but rich overview of C syntax, features, and idioms.</p><p>It reminded me how simple — and sharp — C really is. There’s no fluff. You’re close to the metal, and everything is your responsibility: memory, types, behavior.</p><p>In one sitting, I skimmed through:</p><ul><li>printf, variables, and types</li><li>Conditionals and loops</li><li>Functions and scope</li><li>Pointers and memory access</li><li>Structs and how they let you build composite data</li></ul><h3>💡 What I Relearned</h3><ul><li><strong>Pointers are power tools</strong> — they’re essential for anything non-trivial, especially when I start building tokens and AST nodes.</li><li><strong>Structs are my best friends</strong> for modeling language components like expressions, statements, and environments.</li><li><strong>Memory management is manual</strong> — no smart pointers, no garbage collection, just malloc and free.</li><li><strong>Arrays and strings</strong> are… basically just fancy pointers with no protection.</li></ul><h3>😂 C Quirks That Still Haunt Me</h3><p><strong>(a.k.a. “</strong><strong>scanf and The Circles of Pointer Hell”)</strong></p><p>Let’s talk about scanf with multi-level pointers — a journey that starts with innocence and ends with existential dread(just for fun):</p><pre>int x;<br>scanf(&quot;%d&quot;, &amp;x);       // ✅ Simple. Clean. You&#39;re safe.<br><br>int *ptr = &amp;x;<br>scanf(&quot;%d&quot;, ptr);      // ✅ Okay. You’re still grounded.<br><br>int **ptr2 = &amp;ptr;<br>scanf(&quot;%d&quot;, *ptr2);    // ✅ Hmm. Slightly weird. You&#39;re still breathing.<br><br>int ***ptr3 = &amp;ptr2;<br>scanf(&quot;%d&quot;, **ptr3);   // ✅ You did it. But your soul feels lighter.<br><br>int ****ptr4 = &amp;ptr3;<br>scanf(&quot;%d&quot;, ***ptr4);  // ✅ Why are you doing this? Call an ambulance.<br><br>int *****ptr5 = &amp;ptr4;<br>scanf(&quot;%d&quot;, ****ptr5); // ✅ Technically valid. Okay, inform my family I&#39;m dead.<br><br>int ******ptr6 = &amp;ptr5;<br>scanf(&quot;%d&quot;, *****ptr6); // ✅ WHY IS THIS LEGAL. I&#39;m seeing a white light.<br><br>int *******ptr7 = &amp;ptr6;<br>scanf(&quot;%d&quot;, ******ptr7); // ✅ I have transcended the C standard. Please delete my browser history.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BOVUxZIBya6ZmIBlKPdrdw.png" /></figure><blockquote>In C, the deeper the pointer, the closer you are to either writing a compiler — or becoming one with the void.</blockquote><h3>📓 Reflection</h3><ul><li>✔️ Revisited the C toolkit</li><li>🔄 Felt old muscles waking up</li><li>💪 No more waiting — Day 1 is done</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72476354ffb5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UICollectionView for Impatient People — Basics to Custom Animated Layout ]]></title>
            <link>https://medium.com/@bobyficsher14/uicollectionview-for-impatient-people-basics-to-custom-animated-layout-18c901286a18?source=rss-894a65297526------2</link>
            <guid isPermaLink="false">https://medium.com/p/18c901286a18</guid>
            <category><![CDATA[uicollectionview]]></category>
            <category><![CDATA[uicollectionviewlayout]]></category>
            <category><![CDATA[uikit]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Boby Ficher]]></dc:creator>
            <pubDate>Sat, 24 May 2025 17:41:10 GMT</pubDate>
            <atom:updated>2025-05-24T17:41:10.675Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x0U-OFnmfFRbTH_DeW0UHA.png" /><figcaption>Custom card layout</figcaption></figure><h3>UICollectionView for Impatient People — Basics to Custom Animated Layout 🚀</h3><blockquote><strong><em>Don’t want to watch another 20-minute YouTube video to “finally get it”?</em></strong><em><br> This post is for you. Quick, clear, and ends with a cool animated custom layout you can drop into your app today.</em></blockquote><h3>🙋 What the heck is UICollectionView?</h3><p>If you’ve used UITableView, think of UICollectionView as its cooler, more flexible cousin. Where UITableView gives you a list, UICollectionView gives you a <strong>grid, a carousel, a Pinterest wall, or whatever layout you imagine</strong>. Whether you’re building a photo gallery, a carousel, or a dynamic list with complex layouts, UICollectionView is your best friend.</p><h3>So, what does it do?</h3><p>It <strong>displays a bunch of views (cells) in a scrollable area</strong>, arranged by rules you define.</p><h3>🧠 How does it work?</h3><p>Here’s what you <em>need to know</em> (no theory dump):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*agQoHzS-vRUC7wLyQQ1gFg.png" /></figure><h3>⚙️ Minimal Working Example</h3><p>Want to see it work right now? Copy–paste this into a ViewController:</p><pre>class ViewController: UIViewController, UICollectionViewDataSource {<br>    var collectionView: UICollectionView!<br><br>    override func viewDidLoad() {<br>        super.viewDidLoad()<br><br>        let layout = UICollectionViewFlowLayout()<br>        layout.itemSize = CGSize(width: 150, height: 300)<br><br>        collectionView = UICollectionView(frame: view.bounds, collectionViewLayout: layout)<br>        collectionView.dataSource = self<br>        collectionView.backgroundColor = .white<br>        collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: &quot;cell&quot;)<br><br>        view.addSubview(collectionView)<br>    }<br><br>    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {<br>        return 20<br>    }<br><br>    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {<br>        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: &quot;cell&quot;, for: indexPath)<br>        cell.backgroundColor = .systemBlue<br>        return cell<br>    }<br>}</pre><blockquote>note* : you can change the size of the item dynamically to fit in. By using <br>CGSize(width: collectionView.frame.width * 0.4, height: collectionView.frame.height * 0.7)</blockquote><p>Boom — you have a scrolling grid of blue boxes. You can stop here if all you needed was a grid.</p><h3>💥 Let’s Do Something Cool — Custom Animated Layout</h3><p>Tired of boring layouts? Let’s build a layout that makes the center item <strong>pop out</strong> as you scroll — like a <strong>carousel with zooming</strong>.</p><p>✅ Step 1: Create AnimatedFlowLayout.swift</p><pre>class AnimatedFlowLayout: UICollectionViewFlowLayout {<br>    let animationDistance: CGFloat = 200<br><br>    override func layoutAttributesForElements(in rect: CGRect) -&gt; [UICollectionViewLayoutAttributes]? {<br>        guard let attributesArray = super.layoutAttributesForElements(in: rect),<br>              let collectionView = self.collectionView else { return nil }<br><br>        let centerX = collectionView.bounds.midX<br><br>        for attributes in attributesArray {<br>            let distance = abs(attributes.center.x - centerX)<br>            let normalized = min(distance / animationDistance, 1)<br>            let scale = 1 - normalized * 0.2 // Scale down to 0.8<br><br>            attributes.transform = CGAffineTransform(scaleX: scale, y: scale)<br>            attributes.alpha = scale // Optional: fade based on scale<br>        }<br><br>        return attributesArray<br>    }<br><br>    override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -&gt; Bool {<br>        return true<br>    }<br>}</pre><h3>✅ Step 2: Use It</h3><p>Update your layout in view controller like this:</p><pre>let layout = AnimatedFlowLayout()</pre><h3>🧪 What You Just Learned</h3><ul><li>UICollectionView isn’t scary. It&#39;s just a scrollable list of views.</li><li>UICollectionViewLayout gives you full control.</li><li>You can animate the layout by modifying layoutAttributes.</li><li>You don’t need YouTube to learn this stuff.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18c901286a18" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>