<?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 Basam on Medium]]></title>
        <description><![CDATA[Stories by Basam on Medium]]></description>
        <link>https://medium.com/@basamalasaly?source=rss-807482a18a18------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*iYWaUnKP7csOTRL1eAOQyQ.png</url>
            <title>Stories by Basam on Medium</title>
            <link>https://medium.com/@basamalasaly?source=rss-807482a18a18------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 09:09:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@basamalasaly/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[iOS App Development: From Idea to First Sale]]></title>
            <link>https://medium.com/cracking-swift/ios-app-development-from-idea-to-first-sale-794cef002fa2?source=rss-807482a18a18------2</link>
            <guid isPermaLink="false">https://medium.com/p/794cef002fa2</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Basam]]></dc:creator>
            <pubDate>Tue, 24 Oct 2023 01:31:23 GMT</pubDate>
            <atom:updated>2023-10-24T01:31:23.417Z</atom:updated>
            <content:encoded><![CDATA[<h3>App Development: From Idea to First Sale</h3><h4>Best Practices and Lessons from the Past 7 Years</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TBeGSfnIU8AaFwYsGy2vrA.png" /><figcaption>Photo by <a href="https://www.shutterstock.com/g/TarikVision"><em>TarikVision</em></a></figcaption></figure><p>Today’s business world revolves around mobile technology. The number of smartphone users only continues to rise, and the growth has proven to be exponential. In this article, I’ll take you through planning, designing, and marketing an app to go from idea to your first sale and discuss some lessons I learned. This article assumes that you are the developer, but if you want to pass it on to developers, this guide also has some tips for you.</p><h3>👨🏻‍💻 Why I personally like iOS development</h3><h4>📚 Ease of Learning</h4><p>Many find iOS a much easier operating system to develop, especially with free or highly affordable resources such as <a href="https://medium.com/u/76b0105a5cfb">Paul Hudson’s</a> <a href="https://www.hackingwithswift.com/learn"><em>Hacking with Swift</em></a>, Apple’s<em> </em><a href="https://developer.apple.com/tutorials/swiftui"><em>tutorials</em></a>, and <a href="https://kavsoft.dev/"><em>kavsoft’s</em></a><em> </em>awesome templates. I would recommend learning and utilizing those three in that order if you want to tackle development on your own.</p><ol><li><a href="https://medium.com/u/76b0105a5cfb">Paul Hudson</a> provides incredibly easy-to-follow content for all types of coding levels: beginner, intermediate, and advanced. If you are starting with no background, Paul recommends you start with <a href="https://www.hackingwithswift.com/100/swiftui"><em>100 Days of SwiftUI</em></a>, then move on to <a href="https://www.hackingwithswift.com/100"><em>100 Days of Swift</em></a>. A close friend of mine with little to no coding experience was able to get through the first 50 days of <a href="https://www.hackingwithswift.com/100/swiftui"><em>100 Days of SwiftUI</em></a> in about two weeks, and you can do it too. Best of all, they’re both free.</li><li>After that, <a href="https://medium.com/r?url=https%3A%2F%2Fdeveloper.apple.com%2Ftutorials%2Fswiftui"><em>Apple’s free tutorials</em></a> will be a breeze, but they are beneficial for learning some of the best design practices and human guidelines. If you come from a coding background, you could start here, and it would be a great place to get a quick advanced overview, but if you want to learn the ins and outs, <a href="https://www.hackingwithswift.com/100/swiftui"><em>100 Days of SwiftUI</em></a><em> and </em><a href="https://www.hackingwithswift.com/100"><em>100 Days of Swift</em></a><em> </em>are still the way to go.</li><li>Lastly, kavsoft has some of the most innovative user interface templates that amaze me with their concise and clean code. Each template has its own <a href="https://www.youtube.com/c/Kavsoft?app=desktop"><em>YouTube video</em></a>, and you can access the code bases by subscribing to their <a href="https://www.patreon.com/kavsoft"><em>Patreon</em></a>.</li></ol><h4>📊 Market Share</h4><p>iOS is a solid place to start considering the operating system’s market share in its highest-paying countries, Japan, Australia, and the U.S. This chart from <a href="https://statista.com/"><em>Statista</em></a>, based on data collected from <a href="https://sensortower.com/"><em>SensorTower</em></a>, shows how much each person spends on average in the Apple App Store.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*ZKO9uqBb5sG4y3nUtlM5Vg.png" /><figcaption>Japan, Australia, and the U.S. Were the Top Spending Countries in a Spending Analysis Between 2012 and 2017</figcaption></figure><p>Below are stats provided by <a href="https://gs.statcounter.com/os-market-share/mobile/australia"><em>statcounter</em></a> that display the iOS market share in these countries (in gray) compared to Android (in orange) and the rest of the operating systems, which are nowhere near adoption.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n_AkGJCnNV51jL5IaYCCAg.png" /><figcaption>Mobile Operating System Market Share for Japan, Australia, and the United States</figcaption></figure><h3>💡 How do you know if your idea is possible?</h3><p>If you plan on building a mobile app, it’s a good idea first to consider what technology and reliable data you need to bring your idea to life. For example, let’s say you wanted to make an iOS app to help users track their daily intake of calories via scanned packaging bar codes and provide them with analytics comparing to the number of calories burned, assuming they have a tracking device like the Apple Watch. You would need data for many products, which seems almost impossible to complete. Luckily, after you do a Google search for “Food tracking API,” you find that <a href="https://platform.fatsecret.com/api/?gclid=Cj0KCQjwma6TBhDIARIsAOKuANyc9WHztChktrVxm4zzrvpr2YDNACDhTRR5SUncEprQRckurbrmfwEaAtEUEALw_wcB"><em>fatsecretplatformAPI</em></a><em> </em>does precisely what you’re looking for. You can send a bar code number, and it sends you back nutritional data on the food. Perfect. (I have not checked the reliability of <a href="https://platform.fatsecret.com/api/?gclid=Cj0KCQjwma6TBhDIARIsAOKuANyc9WHztChktrVxm4zzrvpr2YDNACDhTRR5SUncEprQRckurbrmfwEaAtEUEALw_wcB"><em>fatsecretplatformAPI</em></a>, but at first glance, it is good enough for this example.) Next, we need the calorie data from the watch. After a few Google searches and browsing through Apple’s documentation, we can see that it is indeed possible.</p><h3>🔎 Researching your Target Audience Market</h3><p>After ensuring the tools you need exist, it’s time to start identifying your audience demographic, see what they are actively looking for, and research any competitors in the space. Acting on these details will help your app gain organic traction without you having to spend a dime on marketing. Every professional application should have an accompanying website. A handy and accessible tool for finding keyword or phrase search trends worldwide is <a href="https://trends.google.com/trends/?geo=US"><em>Google Trends</em></a>. You can then use the keywords you find to have high traction on your website. I use <a href="https://www.wix.com/seo"><em>Wix</em></a> or <a href="https://webflow.com/dashboard?r=1"><em>Webflow</em></a><em> </em>for all my websites because they make the SEO process simple and are easy to update without wasting a ton of time.</p><p>The more critical sector of tools for the app store is <a href="https://incipiagabe.medium.com/our-full-list-of-app-store-optimization-tools-b77f17e052dd"><em>ASO Keyword trackers</em></a><em>. </em>These tools help you research keyword popularity and ranking difficulties on the app store when people search directly for terms related to your app. This is one of the best ways to find out what successful competitors are using to get their organic downloads and start putting together a list of your own that you monitor and improve over time so it’s ready by the time you’re prepared for release.</p><h3>✨ Design</h3><ol><li>What splash screen do you want users to see when they open your app?</li><li>Will you have educational onboarding material?</li><li>Do you need your users to sign in?</li><li>What do you want your users to see immediately after being authenticated?</li><li>What user workflows must be implemented to get yourself a minimum viable product (MVP)?</li><li>What will the main views contain? What views will they link to?</li></ol><p>My favorite tool is <a href="https://www.figma.com/prototyping/"><em>Figma</em></a>, which allows you to create a live prototype of a fully functional app. You could also use <a href="https://www.lucidchart.com/pages/templates/bank-app-wireflow-example"><em>Lucidchart</em></a> if you prefer to make a simple wireframe to help outline the specifics of your app and then hand it off to a <a href="https://www.upwork.com/ab/profiles/search/?q=figma%20developer"><em>Figma developer</em></a>. This sketch will become the blueprint of your application that you can then hand off to developers without worrying about any miscommunications.</p><h3>🎬 In Conclusion</h3><p>Thorough research, understanding your target audience, and impeccable design are paramount to ensuring your app’s success. As you embark on this journey, remember to leverage the tools and insights available, always keeping the end-user in mind. The world of iOS app development is vast and full of opportunities; with the right approach, your idea can transform into a successful venture.</p><p>Last but not least, your feedback and insights are invaluable. If this article resonated with you or sparked an idea, please share it in the comments below. Every clap, comment, and share supports my work and enriches our community’s dialogue. Let’s continue the conversation and keep “Cracking Swift” together! 👏📱💬</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=794cef002fa2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cracking-swift/ios-app-development-from-idea-to-first-sale-794cef002fa2">iOS App Development: From Idea to First Sale</a> was originally published in <a href="https://medium.com/cracking-swift">Cracking Swift</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Submission Guidelines for Cracking Swift]]></title>
            <link>https://medium.com/cracking-swift/cracking-swift-submission-guidelines-8b0a9b1f655?source=rss-807482a18a18------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b0a9b1f655</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Basam]]></dc:creator>
            <pubDate>Wed, 11 Aug 2021 03:17:47 GMT</pubDate>
            <atom:updated>2021-08-11T03:22:18.113Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JlITjiIu5zA9GiQj.jpeg" /><figcaption>Photo by Nejron on <a href="https://1.envato.market/DVbr2d"><strong>Envato</strong></a></figcaption></figure><p>Coding is an important skill in the tech world, one that will help you land a lucrative job and get work done efficiently. It can be hard to learn, but it doesn’t have to be hard if you have the right resources. Cracking Swift’s goal is to become an archive of simplified and very well-explained tips and tricks using Swift/SwiftUI that are not so easy to figure out or find with a simple online search.</p><p>Do you have an article that you think would fit this publication? We want you to share! We are now accepting submission requests to publish your stories in <a href="https://medium.com/cracking-swift"><em>Cracking Swift</em></a>.</p><h3>If you would like to submit a story to Cracking Swift, follow these easy steps.</h3><ol><li>Leave a comment below, and we can add you as a writer.</li><li>Once we have added you as a writer, click “<em>Edit</em>” on a story you’d like to submit, select “Add to Publication,” and click “Cracking Swift.”</li><li>We will either accept the story, make some edits, or let you know if the story does not fit.</li></ol><p>Please also include a brief introduction and describe why you would like to write for Cracking Swift.</p><h3>Common Rejections</h3><ul><li>Short stories. If your story is under 3 minutes read, we are unlikely to accept it. Our readers expect in-depth posts.</li><li>Poor grammar. We often receive submissions that are not up to the standard of writing quality our editors expect.</li><li>Stories that are clickbait; With content not fulfilling to the title.</li><li>Self-promotion or abusive marketing and stories.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D0JAj0EVZirTKX6l.jpeg" /><figcaption>Photo by twenty20photos on <a href="https://1.envato.market/DVbr2d"><strong>Envato</strong></a></figcaption></figure><p>Please do not take it personally if your story is rejected. This simply means it does not fit with what we’re going for at the moment. Keep trying and send us back your next draft, you are most certainly bound to get published with a well-written topic of interest.</p><h3>Thank You</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cenJzGvtSz7hHfNT.jpeg" /><figcaption>Photo by RuthBlack on <a href="https://1.envato.market/DVbr2d"><strong>Envato</strong></a></figcaption></figure><p>Finally, we would like to thank all of our current writers and everyone who takes the time to share their hard work with Cracking Swift. We have great respect for you and for your willingness to share your knowledge and/or experiences!</p><p>Best,</p><p>Basam</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b0a9b1f655" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cracking-swift/cracking-swift-submission-guidelines-8b0a9b1f655">Submission Guidelines for Cracking Swift</a> was originally published in <a href="https://medium.com/cracking-swift">Cracking Swift</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parsing Remote XML Using Swift]]></title>
            <link>https://medium.com/cracking-swift/parsing-remote-xml-using-swift-bfa9701fff84?source=rss-807482a18a18------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfa9701fff84</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[xml]]></category>
            <dc:creator><![CDATA[Basam]]></dc:creator>
            <pubDate>Wed, 11 Aug 2021 01:12:43 GMT</pubDate>
            <atom:updated>2022-05-09T19:18:41.113Z</atom:updated>
            <content:encoded><![CDATA[<h3>Parsing XML Using Swift</h3><h4>A complete tutorial to guide you through parsing XML in your iOS app using <a href="https://github.com/drmohundro/SWXMLHash"><strong>SWXMLHash</strong></a>,<strong><em> including a remote XML demo project</em></strong></h4><figure><img alt="Closeup of programming code and language" src="https://cdn-images-1.medium.com/max/1024/1*GxgpJvLoqg_q7aIA5WkYuQ.jpeg" /><figcaption>Photo by Rawpixel<strong> </strong>on <a href="https://1.envato.market/DVbr2d"><strong>Envato</strong></a></figcaption></figure><p>XML is a great way to store data in a standardized format. It can be used for a variety of different purposes, such as RSS feeds or storing information online that you want to be easily searchable. However, even though XML is typically user-friendly, the process of parsing it can sometimes be tedious and confusing. In this tutorial, I’ll show you how to parse XML files with Swift from start to finish. We’re going to cover everything from setting up your project and importing the necessary libraries, to iterating through each node. There’s no need to sweat! By the end of this tutorial, you’ll have an app that parses XML files with ease!</p><h3>Getting Started</h3><blockquote>If you already have CocoaPods installed, skip step 1.</blockquote><ol><li>You will need <a href="https://cocoapods.org/"><strong><em>CocoaPods</em></strong></a> on your Mac for this to work, if you don’t already, type the following command to install it from your Mac terminal with Xcode installed: sudo gem install cocoapods.</li><li>Initiate your project by navigating to its root directory in terminal and running the “<em>pod init” </em>command as shown in this <a href="https://www.youtube.com/watch?v=iv3qMYaHzi0"><strong><em>video</em></strong></a>.</li><li>The library we will be using today, <a href="https://github.com/drmohundro/SWXMLHash"><strong><em>SWXMLHash</em></strong></a><em>, </em>provides us with a translation from XML to a hash (dictionary of arrays) and makes them easy to extract into our code or objects. Modify your newly created “<em>Podfile</em>,” in your project’s root directory to add this library— pod &#39;SWXMLHash&#39;, &#39;~&gt; 5.0.0&#39; as shown here:</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed7a963b9ddd79cd2f05bdadf2be2dc6/href">https://medium.com/media/ed7a963b9ddd79cd2f05bdadf2be2dc6/href</a></iframe><p>4. Save the file and run the command pod install on the same directory.</p><p>5. Use the new <em>.xcworkspace</em> file in the project’s root folder to launch it.</p><h3>Creating the Data Model</h3><p>For our XML data, we will be using a live public RSS feed from the <a href="https://www.nytimes.com/svc/collections/v1/publish/https://www.nytimes.com/section/world/rss.xml"><strong><em>New York Times World News</em></strong></a>. This data model consists of an enclosing &lt;rss&gt; tag, followed by a &lt;channel&gt; tag that contains RSS feed general information and a list of news &lt;item&gt; tags.</p><p>For a simple demonstration, we’ll create an object with a title, url, and a pubDate (publication date).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f749da7d36af7af4e18289d92a53e73/href">https://medium.com/media/0f749da7d36af7af4e18289d92a53e73/href</a></iframe><p>In the ContentView’s struct, we can create an array to store the news items and some other variables to store general information about the RSS feed channel.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d26d9c789c4fb2a767b432bd2f77a129/href">https://medium.com/media/d26d9c789c4fb2a767b432bd2f77a129/href</a></iframe><h3>Retrieving and Parsing the XML Data</h3><p>To retrieve and parse the XML data we will be using <a href="https://developer.apple.com/documentation/foundation/urlsession"><strong><em>URLSession</em></strong></a> in combination with <a href="https://github.com/drmohundro/SWXMLHash"><strong><em>SWXMLHash</em></strong></a><strong><em> </em></strong>as demonstrated below<em>.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f9fad542ec0fade9bd5de61ceda64dd7/href">https://medium.com/media/f9fad542ec0fade9bd5de61ceda64dd7/href</a></iframe><p>We initialize <a href="https://github.com/drmohundro/SWXMLHash"><strong><em>SWXMLHash</em></strong></a> with the following code: let xml = SWXMLHash.parse(feed) and then use the xml variable in combination with the tag names, that we know exist in the XML file, to obtain our data.</p><p>Since our <a href="https://www.nytimes.com/svc/collections/v1/publish/https://www.nytimes.com/section/world/rss.xml"><strong><em>RSS feed</em></strong></a> channel’s general information is structured starting with the &lt;rss&gt; tag then the&lt;channel&gt; tag, we can reach the data under it by using xml[&quot;rss&quot;][&quot;channel&quot;].</p><p>For example, if we wanted the channel title, which is directly branched under the &lt;channel&gt; tag, it would be xml[&quot;rss&quot;][&quot;channel&quot;][&quot;title&quot;]and so on for the rest of the elements. By adding .element!.text at the end, we tell Swift that this value definitely exists and to read it as a string type.</p><p>Since there are multiple news &lt;item&gt; tags, we need to iterate through them like an array, and we can do this using a for loop with the .all extension. We can then parse the data for each item similar to the method we used in parsing our channel information.</p><p>I strongly recommend you reference <a href="https://github.com/drmohundro/SWXMLHash"><strong><em>this repository</em></strong></a> for more complicated parsing situations you may come across. There are some great complex examples provided.</p><p>Below is a simplified structure of the XML data provided by the URL, containing only the data we used in today’s example, for reference.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5cec2b2cab856a5f2f5589db50554286/href">https://medium.com/media/5cec2b2cab856a5f2f5589db50554286/href</a></iframe><h4>Reading the Publication Date</h4><p>Making the date readable might seem like a tedious task, especially when the date looks something like this: Sat, 07 Aug 2021 06:00:08 +0000, but it’s actually very easy! Referencing the website <a href="https://nsdateformatter.com/"><strong><em>NSDateFormatter</em></strong></a> makes this task a lot easier. Under their examples section on the homepage you can see the format we need is: E, d MMM yyyy HH:mm:ss Z. You can also click on the <em>Reference </em>tab to see what each one of these letters means.</p><p>Using <a href="https://developer.apple.com/documentation/foundation/dateformatter"><strong><em>DateFormatter</em></strong></a> in the code below we can create a reusable function to read our date as a string and return a Date type format to store in our data model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6424b42bff84d3aee0ffb5ac999b6b17/href">https://medium.com/media/6424b42bff84d3aee0ffb5ac999b6b17/href</a></iframe><p>We can then create another function that makes this date more user-friendly. In this case, I will use the <a href="https://developer.apple.com/documentation/foundation/dateformatter"><strong><em>DateFormatter</em></strong></a> format of: EEEE, MMM d, yyyy HH:mm to provide us with a date with a military time that looks like this: Saturday, Aug 7, 2021 13:19.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/10db526dd2cb1a8a2bf80a816d086f0c/href">https://medium.com/media/10db526dd2cb1a8a2bf80a816d086f0c/href</a></iframe><h3>Displaying the Data</h3><p>Now that we have everything stored, we can start building our user interface. For a simple user interface that demonstrates this example, we can create a VStack containing the channel name, URL, and image, along with a list containing another VStack of all the news items’ titles and publication date.</p><p>We also want to make each news item tappable and have it activate Safari, given the proper URL. We can do this using .onTapGesture on the stack in our List and then call UIApplication.shared.open(URL(string: imageURL)), with <em>item.url</em> being the URL we are passing in.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d94677487c5109861e94a17e203fad6/href">https://medium.com/media/1d94677487c5109861e94a17e203fad6/href</a></iframe><blockquote>Note: AsyncImage is only available for iOS 15; This is used for image display. Comment lines 9 &amp; 10 to run with no errors on iOS 14, without the image.</blockquote><h3>Wrapping Up</h3><p>Your final result will look like this:</p><figure><img alt="Birds eye view of an iPhone on a newspaper." src="https://cdn-images-1.medium.com/max/1024/1*NQJuTOQrPsPiLe6dG5hU5A.png" /><figcaption>Photo by Rawpixel<strong> </strong>on <a href="https://1.envato.market/DVbr2d"><strong>Envato</strong></a>, edited using <a href="https://www.adobe.com/products/photoshop.html"><strong>Photoshop</strong></a></figcaption></figure><p>But if it doesn’t, don’t worry! The source code for the app pictured above is hosted <a href="https://github.com/BasamAlasaly/Swift-XML-RSS-Reader-iOS15.0/tree/main"><strong><em>here</em></strong></a> on GitHub.</p><blockquote>Note: The Xcode project above has been compiled using XCode v13.0 Beta, if you need a working version for iOS14.0 and XCode v12.x, use <a href="https://github.com/BasamAlasaly/Swift-XML-RSS-Reader-iOS14.0/tree/main"><strong><em>this repository</em></strong></a>.</blockquote><p>Remember to install the <a href="https://github.com/drmohundro/SWXMLHash"><strong><em>SWXMLHash</em></strong></a><strong><em> </em></strong>dependency after downloading these repositories to avoid error messages trying to compile the project.</p><h3>That’s It!</h3><p>Get to parsing that XML and building more cool apps! If you have any questions, please reach out to me in the comments.</p><h3>Resources</h3><ul><li><a href="https://github.com/drmohundro/SWXMLHash">SWXMLHash</a></li><li><a href="https://github.com/BasamAlasaly/Swift-XML-RSS-Reader-iOS14.0/tree/main">iOS 14 Demo App Github Repository</a></li><li><a href="https://github.com/BasamAlasaly/Swift-XML-RSS-Reader-iOS15.0/tree/main">iOS 15 Demo App Github Repository</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfa9701fff84" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cracking-swift/parsing-remote-xml-using-swift-bfa9701fff84">Parsing Remote XML Using Swift</a> was originally published in <a href="https://medium.com/cracking-swift">Cracking Swift</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How (And When) To Use Haptic Feedback for a Better User Experience]]></title>
            <link>https://medium.com/cracking-swift/how-and-when-to-use-haptic-feedback-for-a-better-ios-app-9bcfcc97393a?source=rss-807482a18a18------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bcfcc97393a</guid>
            <category><![CDATA[usability]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[haptic-feedback]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Basam]]></dc:creator>
            <pubDate>Sat, 24 Jul 2021 05:37:57 GMT</pubDate>
            <atom:updated>2022-05-14T19:32:26.273Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lt1JEHrGAIHKeZLcGvHXfg.jpeg" /><figcaption><em>Photo by leungchopan</em><strong><em> </em></strong><em>on </em><a href="https://1.envato.market/DVbr2d"><strong><em>Envato</em></strong></a></figcaption></figure><p>Haptic feedback is very important when it comes to improving overall usability and creating an engaging user experience (UX).</p><p>Although you may not find a huge difference between the different types of vibrations coming from your phone as a developer, according to Apple’s documentation:</p><blockquote>People recognize the system-defined haptics, so it’s important to use them according to their documented meanings.</blockquote><p>The class I will be describing in this post is <a href="https://developer.apple.com/documentation/uikit/uifeedbackgenerator"><strong>UIFeedbackGenerator</strong></a>. This class contains three types of haptic feedback subclasses that are useful for all your app haptic feedback needs.</p><p>The three subclasses of <a href="https://developer.apple.com/documentation/uikit/uifeedbackgenerator"><strong>UIFeedbackGenerator</strong></a> are:</p><ul><li><a href="https://developer.apple.com/documentation/uikit/uiselectionfeedbackgenerator"><strong>UISelectionFeedbackGenerator</strong></a></li><li><a href="https://developer.apple.com/documentation/uikit/uiimpactfeedbackgenerator"><strong>UIImpactFeedbackGenerator</strong></a></li><li><a href="https://developer.apple.com/documentation/uikit/uinotificationfeedbackgenerator"><strong>UINotificationFeedbackGenerator</strong></a></li></ul><p>You can click on any of the classes above to view Apple’s documentation and learn more about the purpose behind each one, although we will be discussing that in a much simpler form next.</p><p>Below are the declarations for each one of the <a href="https://developer.apple.com/documentation/uikit/uifeedbackgenerator"><strong>UIFeedbackGenerator</strong></a> subclasses, all their accompanying haptic feedback styles, and when you should use them in your application.</p><h4>When Changing Selections on a Screen, Use UISelectionFeedbackGenerator</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a88000c0487b0b5cc42775783de89fdf/href">https://medium.com/media/a88000c0487b0b5cc42775783de89fdf/href</a></iframe><p>A great example of this is Apple’s Clock application, which calls the UISelectionFeedbackGenerator class every time a selection changes when setting a timer in the picker view.</p><h4>For General Light, Medium, and Heavy Effects, Use UIImpactFeedbackGenerator</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5984acb74501cd8ed28637c0b008431/href">https://medium.com/media/e5984acb74501cd8ed28637c0b008431/href</a></iframe><p>This type of haptic feedback is great to simulate the physical impacts of objects on the user interface or for changing application</p><p>views.</p><h4>For Successes, Warnings, and Errors, Use UINotificationFeedbackGenerator</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7567b261a3dc44f5f94cca689189bac2/href">https://medium.com/media/7567b261a3dc44f5f94cca689189bac2/href</a></iframe><p>As you may have already guessed, these feedback types are somewhat self-explanatory. The success haptic should be used when something successful happens such as a successful refreshing of the user interface initiated by the user or successful login.</p><p>The warning haptic can apply to scenarios such as a user’s password and password confirmation not matching on the signup page or a blank required field when saving a form for an object; This is typically accompanied by a reason behind the warning on the user interface (UI).</p><p>Last but not least, the error haptic should be used when your app cannot process the user’s request. A good example of this is a user adding an RSS feed to your custom feed app, and your app not being able to parse its publication date from the XML.</p><h3>Use Haptic Feedback From Anywhere in Your App</h3><p>You can create an extension to the View protocol with functions to call any type of these haptic feedbacks as shown below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62b863ff992c61c1d1db6266363177f8/href">https://medium.com/media/62b863ff992c61c1d1db6266363177f8/href</a></iframe><p>You only need to place this code in one file for your app and it will be neatly available everywhere with no need for function redeclaration.</p><h3>That’s it!</h3><p>You can download the Xcode project I created in the image below, <a href="https://github.com/BasamAlasaly/HapticFeedbackwithSwiftandSwiftUI"><strong><em>here</em></strong></a>,<strong><em> </em></strong>for a version you can test out on your iPhone or visit <a href="https://developer.apple.com/design/human-interface-guidelines/ios/user-interaction/haptics/"><strong><em>this link</em></strong></a> by Apple to hear and visualize the audio representation of the different types of haptic feedback.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jUEITnnXFMy0iRXtb1zmoA.png" /><figcaption>Photo by Prostock-studio <em>on </em><a href="https://1.envato.market/DVbr2d"><strong><em>Envato</em></strong></a><strong><em> </em></strong>(Edited in <a href="https://photoshop.com/"><strong>Photoshop</strong></a>)</figcaption></figure><h3>Resources</h3><ul><li>Xcode Demo Project: <a href="https://github.com/BasamAlasaly/HapticFeedbackwithSwiftandSwiftUI">https://github.com/BasamAlasaly/HapticFeedbackwithSwiftandSwiftUI</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bcfcc97393a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cracking-swift/how-and-when-to-use-haptic-feedback-for-a-better-ios-app-9bcfcc97393a">How (And When) To Use Haptic Feedback for a Better User Experience</a> was originally published in <a href="https://medium.com/cracking-swift">Cracking Swift</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making SwiftUI Buttons or Labels Pop-Out Using Custom Colors, Without Shadows]]></title>
            <link>https://medium.com/cracking-swift/swiftpoppingbuttonsandlabels-23409d4df29a?source=rss-807482a18a18------2</link>
            <guid isPermaLink="false">https://medium.com/p/23409d4df29a</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[better-programming]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Basam]]></dc:creator>
            <pubDate>Wed, 07 Jul 2021 09:36:32 GMT</pubDate>
            <atom:updated>2021-08-11T00:54:06.973Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y4AaIdK_SKLN3xibo-uKsw.png" /><figcaption>Photo by lzf <em>on </em><a href="https://1.envato.market/DVbr2d"><strong><em>Envato</em></strong></a> (Edited in <a href="https://photoshop.com/"><strong>Photoshop</strong></a>)</figcaption></figure><p>Plenty of tutorials exist online to show you how to create a shadow or a pop-out button using predefined colors, but what if you want to make and use your own custom colors? What if you don’t have enough space for shadows?</p><p>In this post, I’m going to show you a simple trick I use that I found super helpful for this situation.</p><h3>Let’s get started!</h3><h4>Step 1: Define Your Main Color in HEX Format</h4><p>We will be using a green shade for the main button color that I picked off of a color palette from the website <a href="https://htmlcolorcodes.com/"><strong><em>htmlcolorcodes.com</em></strong></a>. Choose your own color from the website to follow along.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6zr6a1_TgcolVzTYRohvnA.png" /><figcaption>Color Picker from <a href="https://htmlcolorcodes.com/"><strong>htmlcolorcodes.com</strong></a></figcaption></figure><p>If you already have your own color in RGB, you can use a website such as <a href="https://www.rapidtables.com/convert/color/rgb-to-hex.html"><strong><em>rapidtables.com</em></strong></a> to easily convert it to HEX format for our next step.</p><h4>Step 2: Get a 20% Darker Shade From Your Color</h4><p>For this task, I found an amazing <a href="https://maketintsandshades.com/"><strong><em>website</em></strong></a> named <a href="https://maketintsandshades.com/"><strong><em>maketintsandshades.com</em></strong></a> that allows you to past in comma-separated HEX colors (if you have more than one) and generates different shades for you, providing you their HEX values. Using our HEX value from above, we can see below the shades that are generated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HJu7lQ6sQeA_FX_WZRgLeA.png" /><figcaption>Color Shades from <a href="https://maketintsandshades.com/"><strong><em>maketintsandshades.com</em></strong></a></figcaption></figure><p>In our case, the HEX code 20904F is 20% darker than our chosen color, so we will be using that code.</p><h4>Step 3: Convert Your HEX Color to RGB Format</h4><p>Using <a href="https://www.rapidtables.com/convert/color/hex-to-rgb.html"><strong><em>rapidtables.com</em></strong></a><strong><em> </em></strong>we can past in our HEX color and get the RGB values we need to start our coding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*HPX-BVpnHKqMdwge83eGZQ.png" /><figcaption>HEX to RGB Converter from <a href="https://www.rapidtables.com/convert/color/hex-to-rgb.html"><strong>rapidtables.com</strong></a></figcaption></figure><h4>Step 4: Create Your Color Variables in Swift</h4><p>Create an extension to color and define your colors, so you can access them anywhere in your app.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0a368738efa3491051212c3da11246d/href">https://medium.com/media/d0a368738efa3491051212c3da11246d/href</a></iframe><h4>Step 5: Create a ZStack with Two Rectangles and Your Button Text</h4><p>We will be creating a view consisting of two rectangles. The top rectangle will be our original color and the bottom rectangle will be our darker shade.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e19878e03c63fc247687f87eb1b6fe2/href">https://medium.com/media/2e19878e03c63fc247687f87eb1b6fe2/href</a></iframe><p>Now we have our button text and our rectangles with both shades in our ZStack, but there’s one issue in this code. Our button doesn’t pop yet…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*C14Kyb8l4IsUeOmH0XRPXQ.png" /></figure><p>You can’t see the bottom rectangle because the top rectangle completely overlays it. Here’s where the magic comes in.</p><p><strong>Step 6: Add Padding and Blur to Your Top Rectangle</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3b036b1b20a2694bfd9d476c0383230/href">https://medium.com/media/a3b036b1b20a2694bfd9d476c0383230/href</a></iframe><p>By giving our top rectangle with the lighter shade some padding, in this case, 4, and a blur radius of 3, we can now visually see a transformation that makes our rectangles pop out!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*UVQvgHqcP2UsqpRQzY1e4A.png" /></figure><p>The padding and blur radius values might be different, depending on the size of your rectangle, in some smaller rectangles, I typically set the padding to 2 with a blur radius of 1.</p><h3>Congrats, You Did It!</h3><p>You can download the playground file <a href="https://github.com/BasamAlasaly/SwiftUI-Pop-Out-Label-or-Button"><strong><em>here</em></strong></a><strong><em> </em></strong>for the complete source code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23409d4df29a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cracking-swift/swiftpoppingbuttonsandlabels-23409d4df29a">Making SwiftUI Buttons or Labels Pop-Out Using Custom Colors, Without Shadows</a> was originally published in <a href="https://medium.com/cracking-swift">Cracking Swift</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>