<?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 Mahmoud Aoata on Medium]]></title>
        <description><![CDATA[Stories by Mahmoud Aoata on Medium]]></description>
        <link>https://medium.com/@mahmutaoata?source=rss-1e44f165a9b4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rUIXOJqttIXGdVVwz6Npjw.png</url>
            <title>Stories by Mahmoud Aoata on Medium</title>
            <link>https://medium.com/@mahmutaoata?source=rss-1e44f165a9b4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 18:10:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mahmutaoata/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 built an open-source macOS app so App Store Connect stops rejecting my preview videos.]]></title>
            <link>https://mahmutaoata.medium.com/i-built-an-open-source-macos-app-so-app-store-connect-stops-rejecting-my-preview-videos-b7d497643697?source=rss-1e44f165a9b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7d497643697</guid>
            <category><![CDATA[app-store]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[ios-development]]></category>
            <dc:creator><![CDATA[Mahmoud Aoata]]></dc:creator>
            <pubDate>Tue, 05 May 2026 04:25:13 GMT</pubDate>
            <atom:updated>2026-05-05T04:25:13.186Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j881WqXscSvJ60E9fJVypA.png" /></figure><p>There’s a moment every indie iOS developer knows 👨🏻‍💻.</p><p>You finish the feature. You record a clean demo. You open App Store Connect, upload your preview, and you feel… done.</p><p>Then Connect says no 🤷🏻‍♂️.</p><p>Sometimes the error is blunt. Sometimes it’s vague. Sometimes it sounds like it’s complaining about “size,” but what it really means is rules: duration windows, bitrate targets, H.264 profile/level constraints, audio expectations, square pixels, container details — the invisible checklist behind the word “preview.”</p><p>I created this macOS app that solves this problem, and it’s open source, you can use it and download it.</p><p>It’s called App Store Preview Converter. In plain language, it takes the kind of screen recording you already have (often a QuickTime .mov) and converts it into an .mp4 that’s intentionally shaped closer to what App Store previews expect: the right kind of H.264 settings, AAC audio, consistent framing for a common iPhone preview layout, sane duration handling (so you’re less likely to trip minimum/maximum constraints), and export behavior that respects macOS sandbox realities (because saving beside a dropped file can be surprisingly fragile on Desktop).</p><p>It’s not magic 🪄, and it’s not a promise that Apple will never change a rule. It’s a tool meant to remove a whole category of “encoding guesswork” so you can get back to shipping.</p><p>If you want the code, issues, and updates, the GitHub repo is here 👇🏻😊:</p><p><a href="https://github.com/mdo91/video-preview-appstore">https://github.com/mdo91/video-preview-appstore</a></p><p>If you just want to install it quickly, these are direct downloads from the repo’s v1.0.0 folder 🔥:</p><p><a href="https://github.com/mdo91/video-preview-appstore/raw/refs/heads/main/releases/v1.0.0/AppStorePreviewConverter-macOS.dmg">https://github.com/mdo91/video-preview-appstore/raw/refs/heads/main/releases/v1.0.0/AppStorePreviewConverter-macOS.dmg</a></p><p><a href="https://github.com/mdo91/video-preview-appstore/raw/refs/heads/main/releases/v1.0.0/AppStorePreviewConverter-macOS.zip">https://github.com/mdo91/video-preview-appstore/raw/refs/heads/main/releases/v1.0.0/AppStorePreviewConverter-macOS.zip</a></p><p>If this saves you even one night of re-encoding loops, it did its job ✅.</p><p>Download it 🚀, try it on a real recording (iOS apps), and if it helps tell me what still hurts in your workflow. That’s how open source gets better: not as a manifesto, but as a conversation between people who’d rather be building products than fighting upload validators.</p><p><strong>Note</strong>: This app is intended for <strong>iOS</strong> app screen recordings and produces outputs that meet the required App Store preview compatibility constraints.</p><p>Feel free to 👏 if you find this app helpful</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7d497643697" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Run Lottie on macOS: A Tiny Tool That Saves a Lot of Time]]></title>
            <link>https://mahmutaoata.medium.com/run-lottie-on-macos-a-tiny-tool-that-saves-a-lot-of-time-5a843d7c1aef?source=rss-1e44f165a9b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a843d7c1aef</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[lottie-animation]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swiftui-animation]]></category>
            <category><![CDATA[macos]]></category>
            <dc:creator><![CDATA[Mahmoud Aoata]]></dc:creator>
            <pubDate>Mon, 27 Apr 2026 13:11:36 GMT</pubDate>
            <atom:updated>2026-05-02T18:00:57.153Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Run Lottie on macOS: A Tiny Tool That Saves a Lot of Time</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mpoLCYSgNKS16NQ7zbZ93Q.png" /></figure><p>If you work with UI animations, you probably know this pain:</p><p>You download a Lottie file, want to preview it quickly, and suddenly you’re opening a big design tool, setting up a test app, or uploading files to random web previewers.</p><p>I built <strong>Run Lottie</strong> to remove that friction.</p><p>It’s a lightweight macOS app where you can drag and drop `.json` or `.lottie` files and instantly preview animations with simple playback controls.</p><p><strong>GitHub repo</strong>: <a href="https://github.com/mdo91/macos-run-lottie">https://github.com/mdo91/macos-run-lottie</a></p><p>— -</p><p><strong>Why I Built It</strong></p><p>I wanted a <strong>local, fast, no-nonsense</strong> way to test animations during development.</p><p>Most teams using Lottie (designers, iOS devs, frontend devs, product folks) just need answers to basic questions quickly:</p><p>- Does this animation load correctly?<br>- Is looping smooth?<br>- Should playback speed be slower/faster?<br>- Is this file even a valid Lottie file?</p><p>Run Lottie focuses exactly on that workflow.</p><p>— -</p><p><strong>What the App Does</strong></p><p>Run Lottie is intentionally minimal:</p><p>- Drag &amp; drop support for `.json` and `.lottie`<br>- Import button if you prefer file picker<br>- Play/Pause<br>- Loop toggle<br>- Speed slider (`0.1x` to `3.0x`)<br>- Quick reveal in Finder<br>- Error handling for invalid/non-Lottie JSON files</p><p>No account, no cloud upload, no extra setup once installed.</p><p>— -</p><p><strong>Benefits for Users</strong></p><p>1) Faster feedback loop<br>You can check animations in seconds instead of context-switching between tools.</p><p>2) Better collaboration<br>Designers and developers can review the same source files locally and discuss real behavior quickly.</p><p>3) Fewer surprises in production<br>Early validation catches broken or unsupported animation data before integration.</p><p>4) Privacy-friendly workflow<br>Files stay on your machine. No need to upload internal assets to third-party websites.</p><p>5) Lightweight and focused<br>It does one job well: preview Lottie animations on macOS without clutter.</p><p>— -</p><p>A Practical Example</p><p>Imagine your designer sends three versions of an onboarding animation right before release.</p><p>With Run Lottie, you can:</p><p>1. Drop all files in the app<br>2. Switch between them from the sidebar<br>3. Compare speed/loop behavior instantly<br>4. Pick the final asset with confidence</p><p>That small workflow improvement saves real time in fast-moving teams.</p><p>— -</p><p>### Distribution Outside the App Store</p><p>The app is set up for direct distribution using:</p><p>-<strong> Developer ID signing</strong><br>- <strong>Apple notarization</strong><br>- Installable <strong>DMG</strong> and <strong>ZIP</strong> builds</p><p>That means users can install it safely without needing App Store publishing.</p><p>— -</p><p><strong>Who This Is For</strong></p><p>- iOS/macOS developers using Lottie<br>- Frontend/mobile teams validating animation payloads<br>- Designers who want quick local playback checks<br>- Product teams reviewing motion behavior before release</p><p>— -</p><p><strong>Final Thoughts</strong></p><p>Run Lottie is a small utility, but it removes a surprisingly common bottleneck.</p><p>If your team works with Lottie files regularly, this kind of tiny helper can improve your daily workflow more than big “all-in-one” tools.</p><p>If you’d like to try it, check out the repo here:</p><p>👉 <a href="https://github.com/mdo91/macos-run-lottie">https://github.com/mdo91/macos-run-lottie</a></p><p>Please 👏 if you find it helpful</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a843d7c1aef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to integrate Hand Pose Classification Machine Learning Model with iOS apps]]></title>
            <link>https://mahmutaoata.medium.com/how-to-integrate-hand-pose-classification-machine-learning-model-with-ios-apps-90afedb76879?source=rss-1e44f165a9b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/90afedb76879</guid>
            <category><![CDATA[hand-gesture-recognition]]></category>
            <category><![CDATA[coreml]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mls]]></category>
            <dc:creator><![CDATA[Mahmoud Aoata]]></dc:creator>
            <pubDate>Thu, 03 Oct 2024 08:42:06 GMT</pubDate>
            <atom:updated>2024-10-05T05:58:41.513Z</atom:updated>
            <content:encoded><![CDATA[<p>In WWDC 2021 Apple introduced new classification machine learning model that can train and classify wide range of hand gestures based on visual dataset.</p><p><strong>MLHandPoseClassifier</strong> model leverages Apple vision framework in order to detect the location of hand joints and their key points from camera frames. Therefore, the model is able to classify hand poses into particular gestures such as ✌️ and more based on ML model we train.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/1*7gOMW1nlOR1JCS91J3h_0w.gif" /><figcaption>Screen recording of the sample app</figcaption></figure><p>This article will demonstrate how to train and integrate Hand Pose Classification ML model into a sample app and use camera via AR session to detect and classify Three different hand gesture such as ✌️, ✋ and random hand pose.</p><p><strong>We will break down Hand Pose Classification ML model into several steps:</strong></p><ul><li>How does detecting hand gesture work.</li><li>How to train ML model for hand gesture classification using Machine Learning app.</li><li>How to integrate ML hand pose classification model with iOS apps</li></ul><p>Before diving right into the code and illustrate the magic behind the demo app, let’s define several aspects of Hand Pose Classification Machine Learning Model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BfvpbST0GeO_6j55tI1BGw.png" /><figcaption>Source: WWDC 2021 hand pose classification video</figcaption></figure><p>Apple previously introduced vision framework which detects if hands exists within a video session or an image in a detailed manner. As shown in the illustration above each circle represents a landmark, and vision framework can track down 21 landmarks for each hand which means four land marks are distributed for each finger including the thumb and one for the wrist.</p><p>Additionally, the request of detecting the hand via <strong>Vision</strong> framework is of type <strong>VNDetectHumanHandPoseRequest </strong>and each of the five fingers is included within <strong>Joints Groups </strong>in which<strong> </strong>defined in <strong>Vision</strong> framework as Joints Group names:</p><ul><li>.thumb</li><li>.indexFinger</li><li>.middleFinger</li><li>.ringFinger</li><li>.littleFinger</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JUpDF904Ra8RW7oHbwiQcQ.png" /><figcaption>Source: WWDC 2020 Detect Body and Hand Pose with Vision</figcaption></figure><p>Moreover, every joint group includes names of each individual joint:</p><ul><li>TIP: The tip of the finger</li><li>DIP: Distal interphalangeal joint or the first joint after the finger tip</li><li>PIP: Proximal interphalangeal joint or the middle joint</li><li>MIP: the metacarpopalangeal joint where it’s at the bottom of the finger where it joins the palm.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kgne9YhClJMrrQ4-eQ0mWQ.png" /><figcaption>Source: WWDC 2020 Detect Body and Hand Pose with Vision</figcaption></figure><p>Nevertheless, the thumb is slightly different, as the image above shows that although it has a TIP but the other joints have different names as following:</p><ul><li>TIP: the tip of the thumb.</li><li>IP: Interphalanegeal joint to the first joint after the tip of the thumb.</li><li>MP: The metacarpophalangeal joint is at the bottom of the thumb where it joints the palm</li><li>CMC: The carpometacarpal joint is near the wrist.</li></ul><p>At this stage, the anatomy of hand poses and their detection using the Vision framework has been discussed. However, processing these joint groups and detecting individual fingertips only with the Vision framework is beyond the scope of this article.</p><p>In the sample app, <strong>VNDetectHumanHandPoseRequest</strong> is used to integrate hand poses with the ML model. Therefore, providing an overview of hand pose anatomy can help in getting a better understanding of how the Hand Pose Classification Machine Learning Model works behind the scenes.</p><p>Now let’s define steps needed for training Hand Pose Classifier ML model.</p><ul><li><strong>Collecting dataset</strong>:<br> which includes images with specific hand poses that serve our app needs, for our sample app it’s going to be Peace hand gesture ✌️, Open Palm hand gesture ✋ and Background (random hand poses) to be ignored and focus only on the proceeding hand poses.<br> <br>As illustrated in the image below, while collecting dataset, it’s really important to name the folder of a particular hand pose in a way that label the hand gesture that ML model will classify.<br> <br>For our demo app, there is going to be three different folders “Background”, “Two” and “Open”, each folder contains corresponding hand gesture images that ML model will be trained on.<br> <br>Another key point to consider is that each hand pose dataset should include a wide range of hand positions, alignments, skin tones, and sizes. For instance, the image below illustrates how the “One” hand pose dataset contains a variety of skin tones, genders, and hand positions, which allows the ML model to more effectively classify and estimate the “One” hand gesture. Moreover, image size should be consistent across all images as recommended by Apple.<br> <br>The inclusion of a “Background” folder is essential for the Hand Pose Classification ML model, as it contains random hand poses or transitional hand positions leading to a specific hand pose. This helps the ML model accurately classify clear hand poses. In other words, the model needs to distinguish between transitional positions of an “Open Palm” hand pose and the final “Open Palm” position while processing camera frames and feeding them into the model. As a result, the “Open Palm” gesture will be classified accurately once the model identifies a match. The images below illustrates “Background” dataset.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o9QXQORcraXifn38wwqlBg.png" /><figcaption>Source: WWDC2021 Classify hand poses and actions with Create ML</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rdZ4grkJfp_jCZzdC3d6Tg.png" /><figcaption>Source: WWDC2021 Classify hand poses and actions with Create ML</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S5qZqMoPx7nSgU9vVBIPrQ.png" /></figure><ul><li><strong>Training ML model:</strong> there are two different approaches for training ML model, either using Create <strong>ML App or Create ML framework, in this article we will focus on Create ML App.</strong></li></ul><p>let’s train a ML model to eventually be able to classify “✌️” and “✋” hand pose with taking into consideration any other random handpose to be ignored and classified as a Background.</p><p>Now go to Xcode -&gt; Open Developer Tool -&gt; Create ML.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9-VQvlSt5ubsehY4jY3tHw.png" /></figure><p>Then from Create ML app select File-&gt; New Project. Choose a Template -&gt; Hand Pose Classification -&gt; Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ef5x4gjpSX8qfzf5YNbpOw.png" /></figure><p>Determine Project name then click Next -&gt; Create. Then new widow will be show in order to select the Dataset and start training the model.</p><p>The image below illustrates what are the steps needed to train the ML model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jTcWdtIVndC2ZcAvLWR3Xg.png" /></figure><p>After training the model, the screenshot below displays both the validation accuracy and training accuracy. The closer the validation accuracy is to the training accuracy, the more accurate the ML hand pose classification model is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8B2hMlvucRABjDpwRHTwKA.png" /></figure><p>Lastly, the ML model is ready to be integrated within the iOS app, as shown below the image shows we switch to Output tap and click on “Get” button to extract it afterwards we drag and drop the model (“handpose.mlmodel”) into our Xcode project under main files of the iOS app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dUMSu-T7k46sHen0AUJnAA.png" /></figure><p>Now let’s jump into the code and see how the integration ML is done with the sample app. In iOS, capturing frames from camera, can be done using different APIs based on different needs.</p><ul><li>Use “AVCaptureVideoDataOutput” if we need granular control over each frame in real-time.</li><li>Use “ARKit” is dedicated for AR-Based projects where we need to capture frames as a part of more extensive AR experience.</li><li>Use “UIImagePickerController” for simpler cases where capturing a single frame or photo is sufficient.</li></ul><p>In order to keep the sample app simple in terms of code implementation and follow WWDC example of <strong>MLHandPoseClassifier </strong>we’ll consider using ARKit framework.</p><p>As an initial step we need to import ARKit framework and implement “ARSessionDelegate” <strong>MLHandPoseClassifier.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff5111b76436a676777edefb5237f7fc/href">https://medium.com/media/ff5111b76436a676777edefb5237f7fc/href</a></iframe><ul><li><strong>frameCounter</strong> is used to track the number of frames processed by AR session, in the session delegate method, this counter is incremented for each frame updates. Additionally, it allows to perform certain operations at regular intervals rather than on every single frame, which can be resource intensive.</li><li><strong>handPosePredictionInterval </strong>is a constant that specifies how the hand pose prediction showed be performed (e.g every 10 frames). By comparing FrameCounter % handPosePredictionInterva == 0, the code ensures that the prediction code only runs every handPosePredictionInterval frames, where it reduces the computation load.</li></ul><p>Now let’s break down the magic behind the scenes by going through the main code of the sample app:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47d9d94128889aac8bac374cb3423cca/href">https://medium.com/media/47d9d94128889aac8bac374cb3423cca/href</a></iframe><ul><li><strong>ARSession Delegate:</strong> <em>session(_:didUpdate:) </em>delegate function is triggered every time the AR session updates, in our case each time camera frame updates. It handles updating the current AR frame and passing it to Vision for processing.</li><li><strong>VNDetectHumanHandPoseRequest:</strong> it’s an essential part of the vision framework to detect hand poses in the frame, the request collects keypoints of the hand that are later passed into a CoreML model for classification.</li><li><strong>Core ML Mode (HandyModel10): </strong>the trained core ML model that is responsible for classifying particular handposes using the keypoints provided by Vision framework.</li></ul><p>in order to process the fame we call, the camera frame (ARFrame) which is captured as a CVPixelBuffer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6ca497c3e0a3eeea773970f48174f857/href">https://medium.com/media/6ca497c3e0a3eeea773970f48174f857/href</a></iframe><p>for detecting human hand poses we create VNDetectHumanHandPoseRequest and limiting the detection to one hand maximumHandCount = 1</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d2a822f7261e83f95b03da6842c3b70/href">https://medium.com/media/8d2a822f7261e83f95b03da6842c3b70/href</a></iframe><p>Then we create VNImageRequestHandler that processes the image buffer CVPixelBuffer to detect human hand poses. The image hander performs the hand pose request on the current frame. In case it’s successful, it retrieves the hand pose results (handposes).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/78cb4f3334d180f6197e9814804ba19f/href">https://medium.com/media/78cb4f3334d180f6197e9814804ba19f/href</a></iframe><p>The Code below ensures that hand poses were detected just before proceeding to classification:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/341501d55c4cd632282958b997c47f3f/href">https://medium.com/media/341501d55c4cd632282958b997c47f3f/href</a></iframe><p>Afterwards we convert Hand keypoints extracted by Vision as input for the ML model. Moreover, the detected hand landmarks are converted into a multi-dimensional array (keypointsMultiArray). Therefore, it can be passed into the core ML model for hand pose classification:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0897c1620ebbf99cca874d0b8e1033a/href">https://medium.com/media/d0897c1620ebbf99cca874d0b8e1033a/href</a></iframe><p>for Core ML model prediction, we initialise HandyModel10 in order to be use to predict the hand pose based on the keypoints, the model returns a label that includes the predicted hand pose, labelProbabilities in other words, the confidence value of each label:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/429e4eb7e84f05c57cdca2f9c8d7136d/href">https://medium.com/media/429e4eb7e84f05c57cdca2f9c8d7136d/href</a></iframe><p>Then we render the detected handpose, if the model’s confidence in the predicted pose above 90%, it renders the matching emoji using the function <strong>renderHandPose(name:), </strong>otherwise, it clears any displayed emoji <strong>cleanEmojii():</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3941cc416d0b67dbce7f65e5c30a2823/href">https://medium.com/media/3941cc416d0b67dbce7f65e5c30a2823/href</a></iframe><p>Lastly, we show the confidence score of the detected hand pose by CoreML and update on the UI:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/28044b414adb328b5dfe5d66f0a3128b/href">https://medium.com/media/28044b414adb328b5dfe5d66f0a3128b/href</a></iframe><p><strong>Summary</strong><br>The sample app captures frames from ARKit camera session, then it detects hand landmarks using vision and classifies the hand pose using Core ML model. The corresponding hand gesture emoji can be rendered if the model is confident in its classification. This is a demonstration of hand gesture recognition in real-time using AR within iOS.</p><p>Feel free to <strong>follow</strong> me on<strong> </strong><a href="https://x.com/Mahmoudaoata"><strong>X</strong></a><strong> </strong>and<strong> </strong><a href="https://www.linkedin.com/in/mahmoud-aoata-7341b488/"><strong>LinkedIn</strong></a><strong> </strong>to keep up-to-date with my recent articles.</p><p>You can <strong>download</strong> the Sample app via <a href="https://github.com/mdo91/HandPoseML"><strong>Github</strong></a><br>Don’t forget to 👏 if you find this article helpful for your projects 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90afedb76879" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Implement Custom Animated Segmented Control With Collection View Instagram-like App…]]></title>
            <link>https://medium.com/swlh/how-to-implement-custom-animated-segmented-buttons-with-collection-view-instagram-like-app-e2f7ee0c7af3?source=rss-1e44f165a9b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2f7ee0c7af3</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[instagram]]></category>
            <category><![CDATA[scrollview]]></category>
            <category><![CDATA[collectionview]]></category>
            <category><![CDATA[segmentedcontrol]]></category>
            <dc:creator><![CDATA[Mahmoud Aoata]]></dc:creator>
            <pubDate>Wed, 24 Feb 2021 06:26:21 GMT</pubDate>
            <atom:updated>2021-06-30T13:41:33.276Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>How to Implement Custom Animated Segmented Control With Collection View Instagram-like App (Followers/Following) Screen — Swift</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*cpLj9j_MbOHGqB8yUvIgTg.gif" /></figure><p>With no doubts social media UX/UI designers of twitter, Instagram, or Facebook or any popular social media apps are very talented to come up with UI designs that are not only ease to use by us users but also attract users’ attention by its beauty. However, it can be challenging for mobile engineers to implement those sophisticated UI designs since they are given custom UI component to implement using UI frameworks such as UIKit or SwiftUI that might not include those UI components.</p><p>In this article 📝 we will have a look of how to implement one of Instagram’s UI components (followers/following segmented buttons) using UIKit basic components with swift:</p><p><strong>Let’s break down the following UI components and dive into it to understand how its operating </strong>🤔<strong>:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*K4BgI_eGDQzTOb0f7UjHew.png" /><figcaption>animated segmented button instagram-like</figcaption></figure><p>The UI above includes the following UI components:</p><ul><li><strong>Custom view segmented buttons(Labels): <br></strong>it has <strong>bottom border</strong> moves backward or forward as the user clicks/swipes to the left or right, if we take a look carefully at this component, the colour of button title’s changes to black as long as the border’s moving x value is less / greater than or equal buttons’ centre-width at x-axis for first button’s and second’s button respectively.</li><li><strong>Collection view (horizontal scrolling)</strong>: <br>its integrated with the custom segmented buttons in a way that as the user scrolls to the left/right not only the bottom border moves forward/backward but also the buttons’ title colour changes.</li><li><strong>Table view</strong>: <br>serves as a custom cell for the collection view, it holds followers/following info such as profile image, username.</li></ul><p>So far the magic behind the functionality becomes easy to implement using swift and IOS framework.</p><p><strong>let’s have a look at the code of this simple app</strong>, at the end of this article you will see Github link of the project, if you want to follow along please download the project.</p><p>In the project there are two main classes ‘SegmentedButtonsView.swift’ and ‘MainViewController’, these classes have the core functionality of the app.</p><p><strong>Let’s start with SegmentedButtonsView.swift:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8759a87388c5fe7b7bb3ea85b587160b/href">https://medium.com/media/8759a87388c5fe7b7bb3ea85b587160b/href</a></iframe><p>The code above shows two different protocols, the first one is responsible for following up x value of scrollview’s contentOffSet, so the bottom border can move backward/forward as we scroll. The same concept is for the second protocol, as we click the buttons, the delegate notifies us where ever we implement it, for instance we need to know if the user clicks on which button in order to scroll the collection view backward or forward.</p><p><strong>Now let’s have a quick overview about the code behind the creation of segmentedButtonsView:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8fe909246f0f19adfa55bd8665886d4a/href">https://medium.com/media/8fe909246f0f19adfa55bd8665886d4a/href</a></iframe><p>Firstly as we can see ‘<strong>CollectionViewDidScrollDelegate</strong>’ protocol is implemented in order to follow up with x value of <strong>scrollview’s</strong> contentOffSet as I mentioned earlier, for triggering bottom border of the <strong>labels</strong> . Then, two view components is defined; one is for the <strong>selector view</strong> (bottom border) the other one for the <strong>labels</strong> to be selected inside the <strong>segmented view </strong>.</p><p>In addition, a delegate of <strong>SegmentedControlDelegate</strong> is defined for notifying other classes about the selected index of the <strong>segmented buttons view</strong>.</p><p><strong>Now lets have another quick overview of how the UI components are configured:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89103e5b01924e290032bdc7bde2bdaf/href">https://medium.com/media/89103e5b01924e290032bdc7bde2bdaf/href</a></iframe><p>As shown in the code section above<strong> configSelectedTap </strong>method<strong> </strong>is responsible for creating a border at the bottom of the view with a specific height and width, the width shall be same as the width of one segment.</p><p><strong>createLabels</strong> method is responsible for creating an array of labels based on the number of given <strong>titles</strong> while creating an instance of <strong>SegmentedButtonsView.</strong></p><p>In order to place the <strong>labels</strong> we have created in an organised way we need to put them in a horizontal stackView, therefor here comes <strong>configStackView </strong>method, its created for that purpose.</p><p>In the creation process one last thing to mention, as we track x-value of the <strong>scrollview</strong> from the <strong>protocol</strong> we implemented, we need to update the view(bottom border) for the user so here we override <strong>draw</strong> method from UIView class and we call <strong>createLabels</strong>, <strong>configStackView</strong> and <strong>configSelectedTap </strong>inside it.</p><p>Now what about the actions, how the selection functionality is managed, in other words, how the bottom border position changes as we select one label. Further more, how the collectionView is notified about the border position.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/13f1471226486c4cb3e241460d1b97c4/href">https://medium.com/media/13f1471226486c4cb3e241460d1b97c4/href</a></iframe><p>The method inside the code above has all the answers. Let’s have a deep look at this method, so as we click on each label, this method is called, we iterate each label in the array to check which label is selected by the user then, the position of the bottom border is changed accordingly. In addition, the index of selected label is passed through segmentedControlDelegate.</p><p><strong>Congrats </strong>👏🏻 🎉<strong> you have made it to the final part of this article, now few more important methods left to be clarified:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e3916cf544bc2a795dd224c1e63e98ae/href">https://medium.com/media/e3916cf544bc2a795dd224c1e63e98ae/href</a></iframe><p>So here comes the last method of ‘SegmentedButtonsView.swift’ class, we need to change the bottom border position as we scroll to the left/right as well as the background colour of each title in case the bottom border approaches the centre of title width, ‘<strong>collectionViewDidScroll’ </strong>delegate<strong> </strong>function takes a full responsibility of this requirement.</p><p><strong>Keep it up, you have almost made it to the end </strong>👏🏻, <strong>only three methods left.</strong></p><p>Now let’s move to ‘MainViewController.swift’ class:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a48cae60b4df0ced683c247c4ff933c/href">https://medium.com/media/1a48cae60b4df0ced683c247c4ff933c/href</a></iframe><p>In the MainViewController.swift class, an instance of S<strong>egmentedButtonsView</strong> is created to be pined to the top of the <strong>MainViewController</strong>, and a delegate of <strong>CollectionViewDidScrollDelegate </strong>protocol is created as well to keep up with the <strong>scrollView</strong> changes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9fc0c13cd392c309b6303b4b45a41e88/href">https://medium.com/media/9fc0c13cd392c309b6303b4b45a41e88/href</a></iframe><p>The method above “Tells the delegate when the user scrolls the content view within the receiver”. Inside <strong>scrollViewDidScroll </strong>method<strong> CollectionViewDidScrollDelegate </strong>is<strong> </strong>set to SegmentedButtonsView instance, to notify SegmentedButtonsView about contentOffset’s x value changes, as a result the bottom border’s value on x-axis updates accordingly.</p><p>One last important feature left to explain, is that how <strong>collectionView</strong> scrolls as we click on the buttons whether ‘following’ or ‘follower’.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dcee5d45b242486a81f3e765196a6cbd/href">https://medium.com/media/dcee5d45b242486a81f3e765196a6cbd/href</a></iframe><p>Well, in the code above there ‘<strong>SegmentedControlDelegate’ </strong>takes part, since ‘<strong>SegmentedControlDelegate’ </strong>protocol<strong> </strong>is implemented, ‘MainViewController.swift’ class will be notified about buttons selection status, based on the selected index the collectionView moves backward/forward.</p><p><strong>That’s it you’ve made it to the end of this article </strong>🥳<strong>, click on </strong><a href="https://github.com/mdo91/instagarm-followers"><strong>GitHub link</strong></a><strong> to fork it into you repository, I hope it will help you to add something new to your projects.</strong></p><h3>👏👏 if you find it helpful !</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2f7ee0c7af3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/how-to-implement-custom-animated-segmented-buttons-with-collection-view-instagram-like-app-e2f7ee0c7af3">How to Implement Custom Animated Segmented Control With Collection View Instagram-like App…</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>