<?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 Meet Patel on Medium]]></title>
        <description><![CDATA[Stories by Meet Patel on Medium]]></description>
        <link>https://medium.com/@meet237?source=rss-f4398f9c12f9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5Q5nY8cJgjak3WIK</url>
            <title>Stories by Meet Patel on Medium</title>
            <link>https://medium.com/@meet237?source=rss-f4398f9c12f9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 16:55:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@meet237/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 Data Flows and Derived Columns in Azure Data Factory]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.stackademic.com/understanding-data-flows-and-derived-columns-in-azure-data-factory-9d8d1b49e684?source=rss-f4398f9c12f9------2"><img src="https://cdn-images-1.medium.com/max/648/1*r5YmouXIMO0JT-_f6i-dJw.png" width="648"></a></p><p class="medium-feed-snippet">Access this blog for&#x2026;</p><p class="medium-feed-link"><a href="https://blog.stackademic.com/understanding-data-flows-and-derived-columns-in-azure-data-factory-9d8d1b49e684?source=rss-f4398f9c12f9------2">Continue reading on Stackademic »</a></p></div>]]></description>
            <link>https://blog.stackademic.com/understanding-data-flows-and-derived-columns-in-azure-data-factory-9d8d1b49e684?source=rss-f4398f9c12f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d8d1b49e684</guid>
            <category><![CDATA[data-cleaning]]></category>
            <category><![CDATA[azure-data-factory]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[dataflow]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Meet Patel]]></dc:creator>
            <pubDate>Thu, 26 Dec 2024 18:17:15 GMT</pubDate>
            <atom:updated>2025-01-06T06:21:42.516Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Build an Efficient Incremental Data Load Pipeline in Azure Data Factory]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.stackademic.com/how-to-build-an-efficient-incremental-data-load-pipeline-in-azure-data-factory-cd665764c48f?source=rss-f4398f9c12f9------2"><img src="https://cdn-images-1.medium.com/max/956/1*Crxo_O_7f0-3eieIm1AMDg.png" width="956"></a></p><p class="medium-feed-snippet">Access this blog for free&#x2026;</p><p class="medium-feed-link"><a href="https://blog.stackademic.com/how-to-build-an-efficient-incremental-data-load-pipeline-in-azure-data-factory-cd665764c48f?source=rss-f4398f9c12f9------2">Continue reading on Stackademic »</a></p></div>]]></description>
            <link>https://blog.stackademic.com/how-to-build-an-efficient-incremental-data-load-pipeline-in-azure-data-factory-cd665764c48f?source=rss-f4398f9c12f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd665764c48f</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <category><![CDATA[azure-data-factory]]></category>
            <category><![CDATA[incremental-data-loading]]></category>
            <category><![CDATA[data-migration]]></category>
            <dc:creator><![CDATA[Meet Patel]]></dc:creator>
            <pubDate>Tue, 24 Dec 2024 03:32:44 GMT</pubDate>
            <atom:updated>2025-01-06T06:22:29.209Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Understanding Apache Spark Deployment Modes: Client Mode, Cluster Mode, and Local Mode]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.stackademic.com/understanding-apache-spark-deployment-modes-client-mode-cluster-mode-and-local-mode-bbfd1c7612fa?source=rss-f4398f9c12f9------2"><img src="https://cdn-images-1.medium.com/max/1759/1*RGGrczf15PMjl8wQWddTmA.png" width="1759"></a></p><p class="medium-feed-snippet">Access this blog for free&#x2026;</p><p class="medium-feed-link"><a href="https://blog.stackademic.com/understanding-apache-spark-deployment-modes-client-mode-cluster-mode-and-local-mode-bbfd1c7612fa?source=rss-f4398f9c12f9------2">Continue reading on Stackademic »</a></p></div>]]></description>
            <link>https://blog.stackademic.com/understanding-apache-spark-deployment-modes-client-mode-cluster-mode-and-local-mode-bbfd1c7612fa?source=rss-f4398f9c12f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbfd1c7612fa</guid>
            <category><![CDATA[spark-deployment-modes]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[spark-architecture]]></category>
            <dc:creator><![CDATA[Meet Patel]]></dc:creator>
            <pubDate>Mon, 21 Oct 2024 21:08:55 GMT</pubDate>
            <atom:updated>2024-10-23T03:19:48.595Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[What I Learned About Apache Spark’s Execution Flow]]></title>
            <link>https://blog.stackademic.com/what-i-learned-about-apache-sparks-execution-flow-ff0916c4c192?source=rss-f4398f9c12f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff0916c4c192</guid>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[spark-architecture]]></category>
            <category><![CDATA[spark]]></category>
            <dc:creator><![CDATA[Meet Patel]]></dc:creator>
            <pubDate>Sun, 20 Oct 2024 19:08:53 GMT</pubDate>
            <atom:updated>2024-10-22T02:14:00.584Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, I explored how Apache Spark processes a job from the moment it is submitted to the completion of tasks by workers. I found it interesting how <strong>different components</strong> work together to efficiently process large datasets. Below is a <strong>step-by-step description</strong> of the entire flow and a <strong>visual representation</strong> of what I learned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*a67ilBXR-e9Za94s-9zP_w.png" /></figure><h3><strong>How Spark Processes a Job</strong></h3><p>When you submit a job to Spark (for example, using the spark-submit command), the <strong>Cluster Manager</strong> receives the request and starts the entire process. This <strong>Cluster Manager</strong> plays the role of an organizer, ensuring that there are enough resources (like memory and CPUs) to run the job. It also makes sure the <strong>driver program</strong> is started properly.</p><blockquote>Note: I’ll explore spark’s DAG in upcoming article</blockquote><p>Once the Cluster Manager starts the driver program, the <strong>driver</strong> begins by <strong>creating a plan</strong> for executing the job. This involves <strong>breaking down the logic</strong> of your code and preparing it to be executed efficiently. The driver also <strong>contacts the Cluster Manager again</strong> to request some workers, called <strong>executors</strong>. Executors are responsible for data processing, so having enough executors is crucial.</p><p>At this point, the <strong>Cluster Manager assigns executors</strong> to the job. These executors are launched on different machines in the cluster to perform their tasks. The driver then sends <strong>small units of work (tasks)</strong> to each executor. Each executor works on a <strong>portion of the data (called a partition)</strong>. These tasks can run <strong>in parallel</strong>, which makes Spark very fast and efficient, especially for large datasets.</p><p>As the executors finish their tasks, they <strong>return the results to the driver</strong>. If the job involves multiple steps, the driver waits for one step to finish before it moves to the next. Once all the tasks are complete, the driver combines the results and presents them to the user. If any task fails along the way, Spark can <strong>automatically retry</strong> it or assign it to a different executor. This ensures the job is completed successfully, even if some workers face issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DqtqC5puJZkjsEuN70qAlA.png" /></figure><h3>Apache Spark Job Execution Flow: Explained with Fun Example</h3><p>Imagine running a restaurant kitchen where a head chef coordinates with a team of cooks to prepare a complex meal. That’s how <strong>Apache Spark</strong> processes data — it divides a big job into smaller tasks, assigns them to workers, and ensures everything runs smoothly. Let’s walk through how Spark handles a job from start to finish, guided by the diagram.</p><h3>1. Job Submission</h3><p>Everything begins when the user submits a job, usually by running the spark-submit command. This request goes to the <strong>Cluster Manager (CM)</strong>, who acts like the restaurant’s general manager, ensuring enough resources to run the kitchen. The Cluster Manager organizes everything and launches the necessary components to get the job done.</p><h3>2. Starting the Driver Program</h3><p>Once the Cluster Manager receives the job, it launches the <strong>Driver Program</strong>, which serves as the head chef. The driver doesn’t do the cooking but is responsible for overseeing the entire process. It creates a plan for how the job will run, ensuring every step is well-coordinated.</p><h3>3. Requesting Executors</h3><p>The driver program can’t work alone, so it asks the Cluster Manager for help in the form of <strong>executors</strong>. These executors are like line cooks in the kitchen, responsible for doing the actual heavy lifting. The more executors there are, the faster the job can be completed since each one will handle part of the work.</p><h3>4. Assigning Executors</h3><p>The Cluster Manager assigns the required executors across different machines in the cluster. Think of it like spreading the line cooks across different stations in the kitchen, each focusing on a specific part of the meal. This distribution ensures all tasks are handled efficiently.</p><h3>5. Sending Tasks to Executors</h3><p>With the executors in place, the driver sends them their tasks. Just like the head chef delegates chopping, grilling, and preparing sauce to different cooks, the driver breaks the job into smaller pieces called <strong>tasks</strong>. Each executor works on a data partition independently, without waiting for others to finish.</p><h3>6. Processing Tasks and Returning Results</h3><p>The executors get to work on their assigned tasks in parallel. They report their results back to the driver as soon as they finish. If one of them fails or encounters a problem, Spark will reassign the task to another executor, ensuring the job doesn’t get stuck.</p><h3>7. Final Output</h3><p>When all the executors have completed their tasks, the driver combines the results to create the final output. Just like a well-prepared meal comes together with every element in place, the driver gathers the results and returns them to the user or stores them in a database or file.</p><h3>Why Spark Works So Well</h3><p>Spark is fast because it breaks large jobs into smaller tasks and runs them in parallel across many machines. And because it’s fault-tolerant, the job will still be completed successfully even if one executor fails. This combination of <strong>parallel execution and fault tolerance</strong> makes Spark a favorite tool for processing big data. Summary of the Flow</p><p>Here’s the summary of the entire process:</p><ol><li><strong>Submit the Job</strong>: The job is submitted to the <strong>cluster manager</strong>.</li><li><strong>Cluster Manager Starts the Driver</strong>: The cluster manager <strong>starts the driver program</strong> if it isn’t already running.</li><li><strong>Driver Creates a Plan and Asks for Executors</strong>: The driver reads the code, creates a <strong>plan for the job</strong>, and sends a request for <strong>executors</strong> to the cluster manager.</li><li><strong>Cluster Manager Assigns Executors</strong>: The cluster manager assigns <strong>executors</strong> on worker nodes based on available resources.</li><li><strong>Executors Process Data and Report to Driver</strong>: The executors <strong>run their tasks</strong> in parallel and <strong>send results back to the driver</strong>.</li><li><strong>Driver Gathers Results</strong>: Once all tasks are complete, the driver combines the results and presents them to the user.</li></ol><h3>Wrapping It Up</h3><p>That’s a quick look at how <strong>Apache Spark handles job execution</strong> from start to finish. I hope this gave you a clear idea of how the <strong>driver, cluster manager, and executors</strong> work together to do the job efficiently. Once you get familiar with these core pieces, working with Spark becomes much easier — even if it initially seems complicated.</p><p>If you have any thoughts or questions or just want to chat more about Spark, feel free to connect with me! I’d love to hear from you.</p><h3>Connect with Me on LinkedIn:</h3><p><a href="https://www.linkedin.com/in/meet-patel-sn/"><strong>LinkedIn</strong></a></p><h3>Where I Got My Ideas From</h3><ul><li><strong>YouTube Channels</strong> — I found some helpful videos that made complex topics easier to understand.</li><li><strong>Official Apache Spark Documentation</strong> — A great resource for detailed information.</li><li><strong>Google</strong> — It’s my go-to tool whenever I hit a roadblock or need quick answers.</li><li><strong>Personal Experience</strong> — Working on Spark projects myself has helped me learn by doing.</li><li><strong>Grammarly</strong> — To ensure my writing is clear and easy to read.</li></ul><p>Thanks for reading! Let’s keep learning and growing — there’s always more to explore in the world of data.</p><h3>Stackademic 🎓</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a> | <a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a> | <a href="https://open.spotify.com/show/7qxylRWKhvZwMz2WuEoua0"><strong>Podcast</strong></a></li><li><a href="https://differ.blog/"><strong>Create a free AI-powered blog on Differ.</strong></a></li><li>More content at <a href="https://stackademic.com/"><strong>Stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff0916c4c192" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/what-i-learned-about-apache-sparks-execution-flow-ff0916c4c192">What I Learned About Apache Spark’s Execution Flow</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Displaying current location on Map using CoreLocation and MapKit in SwiftUI]]></title>
            <link>https://medium.com/@meet237/displaying-current-location-on-map-using-cllocationmanager-and-mapkit-in-swiftui-f42ea94391ed?source=rss-f4398f9c12f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f42ea94391ed</guid>
            <category><![CDATA[maps]]></category>
            <category><![CDATA[gps]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swiftui]]></category>
            <dc:creator><![CDATA[Meet Patel]]></dc:creator>
            <pubDate>Wed, 15 Nov 2023 03:55:29 GMT</pubDate>
            <atom:updated>2023-11-15T03:58:24.077Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UILdJFLoEz5Bkij1hi7vcA.jpeg" /></figure><blockquote>Full Code is uploaded on my <a href="https://github.com/meet74/MapKitApp-SwiftUI">Github</a></blockquote><p>Apple’s MapKit framework, designed for embedding maps into iOS apps, has effortlessly integrated into SwiftUI, Apple’s declarative UI framework. This blog post will take you through the process of incorporating MapKit into your SwiftUI apps, allowing you to create MapView and display current location of User.</p><h3><strong>Importing MapKit and Setting a Map Region</strong></h3><p>Before diving into the map display, we’ll start by importing the MapKit framework and establishing a map region. This map region defines the initial area that will be shown on the map.</p><pre>import SwiftUI<br>import MapKit<br></pre><p>mapRegion variable using MapKit in Swift. It defines a geographic region with a center at latitude 37.785834 and longitude -122.406417. The visible span of the map is set to 0.2 in both latitude and longitude, creating a rectangular area focused on a specific location, often used as an initial view for a map.</p><pre>@State var mapRegion = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 37.785834, longitude: -122.406417), span: MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2))</pre><p><strong>Bringing the Map to Life with User Location Tracking</strong></p><p>To display the map within your SwiftUI view, simply add a Map element and pass the defined map region as a parameter. To enable user location tracking, simply set the showsUserLocation property to true.</p><pre>Map(coordinateRegion: $mapRegion, showsUserLocation: true)</pre><p><strong>Enhancing the Map Experience with User Tracking Modes</strong></p><p>MapKit provides a variety of user tracking modes to improve the map experience. The userTrackingMode property allows you to specify the desired tracking mode, such as .follow to keep the user&#39;s location centered on the map.</p><pre>Map(coordinateRegion: $mapRegion, showsUserLocation: true, userTrackingMode: .constant(.follow))</pre><pre>import SwiftUI<br>import MapKit<br><br>struct ContentView: View {<br>    <br>  @State var mapRegion = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 37.785834, longitude: -122.406417), span: MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2))<br><br>    var body: some View {<br>        VStack {<br>            Map(coordinateRegion: viewModel.binding,showsUserLocation: true,userTrackingMode: .constant(.follow))<br>                .edgesIgnoringSafeArea(.all)<br>            <br>        }<br>        <br>    }<br>}</pre><h3><strong>Managing Location Authorization and Updates</strong></h3><h4>How It Works</h4><p>This app begins by creating an instance of the ContentViewModel, which handles the logic for managing location services. The ContentView uses the Map view from SwiftUI, and its coordinateRegion is bound to the mapRegion property of the ViewModel. This enables the map to dynamically update based on the user&#39;s location.</p><p>Create ContentViewModel class with CLLocationManagerDelegate</p><pre>final class ContentViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {<br>    var locationManager: CLLocationManager?<br>}</pre><h4>Location Authorization</h4><p>We have to allow the privacy property. So navigate to your root directory then <em>target-&gt;info</em> and then click on any property and press enter. It will create a new one for you and now write as shown in picture</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHnkYxAopDTEPyt7o45BsA.png" /></figure><p>Now inside the ContentViewModel checks if location services are enabled and requests the necessary authorization. It responds to changes in authorization status and updates the map accordingly.</p><pre>final class ContentViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {<br>    var locationManager: CLLocationManager?<br><br>func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {<br>    // Handle changes in location authorization<br>    let previousAuthorizationStatus = manager.authorizationStatus<br>    manager.requestWhenInUseAuthorization()<br>    if manager.authorizationStatus != previousAuthorizationStatus {<br>        checkLocationAuthorization()<br>    }<br>  }<br>}</pre><p><strong>Setting Up Location Services</strong></p><p>The checkIfLocationIsEnabled inside ContentViewModel is a crucial step in setting up location services within your app. It first checks if location services are enabled on the device using CLLocationManager.locationServicesEnabled(). If enabled, it initializes a CLLocationManager instance, a key component for handling location-related tasks. The desired accuracy is set to kCLLocationAccuracyBest to ensure high precision.</p><pre>func checkIfLocationIsEnabled() {<br>        if CLLocationManager.locationServicesEnabled() {<br>            locationManager = CLLocationManager()<br>            locationManager?.desiredAccuracy = kCLLocationAccuracyBest<br>            locationManager!.delegate = self<br>        } else {<br>            print(&quot;Show an alert letting them know this is off&quot;)<br>        }<br>    }</pre><p>By designating the current object as the delegate (locationManager!.delegate = self), the app can respond to location-related events. If location services are not enabled, it prints a message to the console. In a complete app, this message would typically trigger an alert to inform the user that enabling location services is necessary for optimal app functionality.</p><h4>Example</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mjy9SLDOKNCAt3w2g9wPeQ.png" /></figure><h4>Updating Map Region</h4><p>When location authorization is granted, the ViewModel updates the mapRegion property, centring the map on the user&#39;s location.</p><pre>private func checkLocationAuthorization() {<br>    // Check location authorization status<br>    guard let location = locationManager else {<br>        return<br>    }<br>switch location.authorizationStatus {<br>    case .notDetermined:<br>        print(&quot;Location authorization is not determined.&quot;)<br>    case .restricted:<br>        print(&quot;Location is restricted.&quot;)<br>    case .denied:<br>        print(&quot;Location permission denied.&quot;)<br>    case .authorizedAlways, .authorizedWhenInUse:<br>        // Update map region with user&#39;s location<br>        if let location = location.location {<br>            mapRegion = MKCoordinateRegion(<br>                center: location.coordinate,<br>                span: MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2)<br>            )<br>        }<br>    default:<br>        break<br>    }<br></pre><p>Here’s the full code</p><p>You all are wondering what is @ Published doing here. So main task of publish is to update the app when current location of user changes. For example when a person drives a car so location of use is updated automatically.</p><pre>//<br>//  ContentView.swift<br>//  MapKitApp<br>//<br>//  Created by Meet Patel on 2023-11-14.<br>//<br><br>import SwiftUI<br>import MapKit<br><br>struct ContentView: View {<br>    <br>    @StateObject var viewModel = ContentViewModel()<br>    <br>    var body: some View {<br>        VStack {<br>            Map(coordinateRegion: viewModel.binding,showsUserLocation: true,userTrackingMode: .constant(.follow))<br>                .edgesIgnoringSafeArea(.all)<br>                .onAppear(perform: {<br>                    viewModel.checkIfLocationIsEnabled()<br>                })<br>            <br>        }<br>        <br>    }<br>}<br><br><br>final class ContentViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {<br>    var locationManager: CLLocationManager?<br><br>    @Published var mapRegion = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 43.457105, longitude: -80.508361), span: MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2))<br><br>    var binding: Binding&lt;MKCoordinateRegion&gt; {<br>        Binding {<br>            self.mapRegion<br>        } set: { newRegion in<br>            self.mapRegion = newRegion<br>        }<br>    }<br><br>    func checkIfLocationIsEnabled() {<br>        if CLLocationManager.locationServicesEnabled() {<br>            locationManager = CLLocationManager()<br>            locationManager?.desiredAccuracy = kCLLocationAccuracyBest<br>            locationManager!.delegate = self<br>        } else {<br>            print(&quot;Show an alert letting them know this is off&quot;)<br>        }<br>    }<br><br>    func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {<br>        let previousAuthorizationStatus = manager.authorizationStatus<br>        manager.requestWhenInUseAuthorization()<br>        if manager.authorizationStatus != previousAuthorizationStatus {<br>            checkLocationAuthorization()<br>        }<br>    }<br><br>    private func checkLocationAuthorization() {<br>        guard let location = locationManager else {<br>            return<br>        }<br><br>        switch location.authorizationStatus {<br>        case .notDetermined:<br>            print(&quot;Location authorization is not determined.&quot;)<br>        case .restricted:<br>            print(&quot;Location is restricted.&quot;)<br>        case .denied:<br>            print(&quot;Location permission denied.&quot;)<br>        case .authorizedAlways, .authorizedWhenInUse:<br>            if let location = location.location {<br>                mapRegion = MKCoordinateRegion(center: location.coordinate, span: MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2))<br>            }<br><br>        default:<br>            break<br>        }<br>    }<br>}<br><br><br>struct ContentView_Previews: PreviewProvider {<br>    static var previews: some View {<br>        ContentView()<br>    }<br>}</pre><p><strong>Demo Example</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*CsrMG9ba44TzTbMizlS9mw.gif" /><figcaption>Demo</figcaption></figure><h3>Conclusion</h3><p>By following these steps, you’ve acquired the essential knowledge to integrate MapKit into your SwiftUI applications.</p><p>MapKit in SwiftUI offers a powerful and versatile toolset for crafting visually appealing and interactive map experiences. By leveraging SwiftUI’s declarative nature, you can seamlessly incorporate maps into your applications while maintaining clean and maintainable code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f42ea94391ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create Beautiful Sliding OnBoarding Flow using App Storage and PageTabViewStyle in SwiftUI]]></title>
            <link>https://medium.com/@meet237/create-beautiful-sliding-onboarding-flow-using-app-storage-and-pagetabviewstyle-in-swiftui-d733b84d6199?source=rss-f4398f9c12f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d733b84d6199</guid>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[tabview]]></category>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Meet Patel]]></dc:creator>
            <pubDate>Tue, 14 Nov 2023 06:50:57 GMT</pubDate>
            <atom:updated>2023-11-14T06:53:42.451Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Thumbnail" src="https://cdn-images-1.medium.com/max/1024/1*c28BQnGGuND9yBgfTl3z4w.jpeg" /></figure><p>Full code is on my Github :</p><p><a href="https://github.com/meet74/OnBoardingApp-SwiftUI">https://github.com/meet74/OnBoardingApp-SwiftUI</a></p><p>OnboardingApp is a simple SwiftUI app that demonstrates how to create a swiping carousel of onboarding views. The app uses an @AppStorage property to track whether the user has completed the onboarding process. If the user has not completed the onboarding process, the app will display a swiping carousel of onboarding views . There will also be a button on the last onboarding view that the user can tap to complete the onboarding process and go to the home screen.</p><h3>Creating a swiping carousel of onboarding views</h3><p>To create a swiping carousel of onboarding views, we can use a TabView with a PageTabViewStyle. The TabView will allow us to switch between different views, and the PageTabViewStyle will create a swiping carousel.</p><pre>TabView{<br>    ForEach(outdoorActivitiesData){<br>        item in<br>        OnBoardingView(outDoorActivity: item)<br>    }<br>}.tabViewStyle(PageTabViewStyle())</pre><p><strong>First create the OnBoardingActivity model</strong></p><pre>struct OutdoorActivity: Identifiable{<br>    var id = UUID()<br>    var title:String<br>    var headline:String<br>    var image: String<br>    var gradientColors:[Color]<br>}</pre><p>The Identifiable protocol is used to give the OutdoorActivity struct a unique identifier. This is necessary because the ForEach loop in the ContentView struct needs to be able to identify each outdoor activity in the outdoorActivitiesData array.</p><p>The OutdoorActivity struct is used to create the onboarding views in the OnboardingApp. Each onboarding view will have an image, title, headline, and gradient background. The OutdoorActivity struct provides all of the data that is needed to create an onboarding view.</p><p>Here is an example of how to use the OutdoorActivity struct to create an onboarding view:</p><pre>struct OnBoardingView: View {<br>    <br>    var outDoorActivity: OutdoorActivity<br>    <br>    @AppStorage(&quot;isOnBoarding&quot;) var isOnBoarding:Bool = true<br>    <br>    <br>    var body: some View {<br>        ZStack {<br>            VStack(spacing:20){<br>                Image(outDoorActivity.image)<br>                    .resizable()<br>                    .scaledToFit()<br>                    .shadow(color: Color(red: 0, green: 0, blue: 0), radius: 3,x:2,y:2)<br>                Text(outDoorActivity.title)<br>                    .fontWeight(.heavy)<br>                    .font(.system(size: 50))<br>                    .foregroundColor(.white)<br>                Text(outDoorActivity.headline)<br>                    .fontWeight(.light)<br>                    .font(.system(size: 18))<br>                    .foregroundColor(.white)<br>                    .padding(.bottom,15)<br>                    .multilineTextAlignment(.center)<br>                <br>                ButtonView(onPress: {<br>                    isOnBoarding = false<br>                })<br>            }<br>            .padding(.horizontal,15)<br>            .frame(maxWidth: .infinity, maxHeight: .infinity,alignment: .center)<br>            .background(<br>                LinearGradient(colors: outDoorActivity.gradientColors, startPoint: .top, endPoint: .bottom)<br>            )<br>        }<br>    }<br>}</pre><p>The OnBoardingView struct will create an onboarding view with the image, title, headline, and gradient background from the OutdoorActivity struct.</p><p>The ButtonView struct is a simple but effective way to create a button in SwiftUI. It provides a number of customization options, so you can create a button that looks and feels the way you want it to.</p><p>Hers is the ButtonView example</p><pre>struct ButtonView: View {<br>    <br>    var onPress: ()-&gt;()<br>    <br>    <br>    var body: some View {<br>        Button{<br>            print(&quot;Button Pressed&quot;)<br>            onPress()<br>        }label: {<br>            HStack{<br>                Text(&quot;Start&quot;)<br>                Image(systemName: &quot;arrow.forward.circle&quot;)<br>            }<br>            .padding(.horizontal,25)<br>            .padding(.vertical,12)<br>            .background(<br>                Capsule().strokeBorder(lineWidth: 2)<br>            )<br>            .foregroundColor(.white)<br>            <br>        }.buttonStyle(.plain)<br>            .accentColor(.white)<br>    }<br>}</pre><h3>Screens</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/0*gUAxyKwzZ7C4qw23.png" /><figcaption>First Screen</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sdCG8P63qKLXU8q0.png" /><figcaption>Second Screen</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N2GCCQWQW5hi9-eh.png" /><figcaption>Third Screen</figcaption></figure><h3>App Storage in SwiftUI</h3><p>Using an @AppStorage property to track the onboarding progress</p><p>We can use an @AppStorage property to track whether the user has completed the onboarding process. The @AppStorage property will store the onboarding progress in the app&#39;s user defaults.</p><pre>@AppStorage(&quot;isOnBoarding&quot;) var isOnBoarding:Bool = true</pre><p><strong>Displaying the onboarding views</strong></p><p>If the user has not completed the onboarding process, the app will display the swiping carousel of onboarding views.</p><pre>if isOnBoarding {<br>    TabView{<br>        ForEach(outdoorActivitiesData){<br>            item in<br>            OnBoardingView(outDoorActivity: item)<br>        }<br>    }.tabViewStyle(PageTabViewStyle())<br>}else{<br>     HomeScreen()<br>}</pre><p><strong>Completing the onboarding process</strong></p><p>When the user taps the button on the last onboarding view, the app will set the isOnBoarding property to false. This will cause the app to go to the home screen.</p><pre>ButtonView(onPress: {<br>    isOnBoarding = false<br>})</pre><p>Looks like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*mnX0niJx6XMLfWlN.gif" /><figcaption>Demo Example</figcaption></figure><h3>Youtube Tutorial</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3kkGnKJhjzo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3kkGnKJhjzo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F3kkGnKJhjzo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0c3094eed093c29f74cfa31c9bebf4f2/href">https://medium.com/media/0c3094eed093c29f74cfa31c9bebf4f2/href</a></iframe><p>Full Tutorial is uploaded on my YouTube Channel. Please Like and Subscribe.</p><h3>Conclusion</h3><p>OnboardingApp is a simple SwiftUI app that demonstrates how to create a swiping carousel of onboarding views. The app uses an @AppStorage property to track whether the user has completed the onboarding process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d733b84d6199" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>