<?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 Cinda on Medium]]></title>
        <description><![CDATA[Stories by Cinda on Medium]]></description>
        <link>https://medium.com/@cindaarta16?source=rss-8f45baafaa3f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Is9N2OcYaibj8cA1</url>
            <title>Stories by Cinda on Medium</title>
            <link>https://medium.com/@cindaarta16?source=rss-8f45baafaa3f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:00:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cindaarta16/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[Trabell: Navigate Your Daily Commute (comfortable, fast, safe)!]]></title>
            <link>https://medium.com/@cindaarta16/trabell-navigate-your-daily-commute-comfortable-fast-safe-f5d6be152e5d?source=rss-8f45baafaa3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5d6be152e5d</guid>
            <category><![CDATA[searchbar]]></category>
            <category><![CDATA[reminder]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[notifications]]></category>
            <dc:creator><![CDATA[Cinda]]></dc:creator>
            <pubDate>Tue, 29 Oct 2024 09:18:11 GMT</pubDate>
            <atom:updated>2024-10-29T09:18:11.874Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bLX1lDuDhWOBmczp-DIbiQ.png" /><figcaption>Trabell Overview</figcaption></figure><blockquote>Stay ahead of your journey with Trabell — your smart travel companion that ensures you never miss a stop with timely, effortless alerts.</blockquote><p>Trabell is a project designed to make commuting stress-free by addressing the common fear of missing your stop. My focus with Trabell is to help commuters stay on track, providing timely alerts that ensure they reach their destination without worry.</p><h3>Problem</h3><p>Our interviews revealed that many commuters inadvertently fall asleep on the train due to insufficient rest. This fatigue is often a result of late work hours and early morning starts, leading to unintentional naps during their journey. As a consequence, these commuters face the risk of missing their intended stop, which adds stress to their daily routine.</p><p>In addition, commuters are frequently distracted by their phones, which further complicates the issue. Engaging with their devices can lead them to lose track of their current location and become less aware of their destination. To address this, it’s crucial to find a solution that helps them stay alert and ensures they won’t miss their stop, despite their fatigue and distractions.</p><h3>Ideation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hehWxj0Q4QP41WIuzTnr2Q.png" /></figure><p>Based on our research, we developed Trabell — a smart application designed to keep commuters on track and ensure they never miss their stop. Trabell sends timely notifications and reminders when users are approaching their destination station. Users simply input their destination and press the “Set Reminder” button. The app will alert them when they are one station away, starting with a vibration notification. If the user doesn’t dismiss the alert and continues to their stop, Trabell escalates to a ringing alarm to ensure they stay aware, even if they’re asleep or distracted.</p><h4><strong>Key features of Trabell include:</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*deALYXOHdw5f7j2fCHEUjw.png" /><figcaption>Set Route as Favorite</figcaption></figure><p><strong>Set Route as Favorite: </strong>Recognizing that many commuters travel the same route daily, Trabell allows users to save their routes as favorites. This feature provides a convenient shortcut for quickly setting up their journey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9AQu9O4nZmPO_opdm9Os6A.png" /><figcaption>Track Distance to Destination</figcaption></figure><p><strong>Track Distance to Destination</strong>: While a route is active, Trabell’s home screen displays real-time information about the remaining distance to the user’s stop, keeping them informed throughout their journey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t7L6RnteIJSJG-GooXA3Zg.png" /><figcaption>Smooth Alert System</figcaption></figure><p><strong>Smooth Alert System</strong>: When users are one station away from their destination, they receive a vibration notification. If they don’t turn off the alert, Trabell escalates to a ringing alarm combined with vibrations, ensuring users are fully aware of their impending stop.</p><h3>Code Process</h3><p>In this project, we leverage technologies like Core Location to track the user’s current location, notifications for alerts, and sound for alarms. Since this is my very first project, my responsibilities include building the search page’s UI and implementing the search logic.</p><h4>Swift UI Interface</h4><p>For the interface design, I primarily used basic SwiftUI components like ZStack, VStack, and HStack to structure the layout. However, since this was my first experience coding in Swift, I initially struggled with SwiftUI. To overcome these challenges, I turned to various learning resources such as YouTube tutorials, official documentation, and hands-on practice. By experimenting with different syntax and components, I gradually built a deeper understanding of how they work and how to effectively apply them in my project.</p><h4>Search Bar Filter</h4><p>For the search result filtering logic, I implemented a series of conditional checks using the if statement. The logic is structured as follows:</p><ul><li>If the search bar is empty, the app will display an empty search result, ensuring that no irrelevant data is shown.</li><li>If the user types fewer than three characters, the app will display all available models in the search results, providing a broad view without overly restrictive filtering.</li><li>Once the user enters three or more characters, the app dynamically filters the search results to match the text entered in the search bar. This ensures that only relevant results are shown, improving the search experience and helping users quickly find what they’re looking for.</li></ul><p>This approach balances usability and performance by adjusting the search results based on the input length, making the search feature both responsive and user-friendly.</p><p>Since all the coding I’ve done is within a single page, here’s how I built the UI and implemented the logic:</p><pre>import SwiftUI<br>import Combine<br><br>struct SearchSheetView: View {<br>    @Environment(\.dismiss) private var dismiss<br>    @State var searchTerm = &quot;&quot;<br>    @FocusState private var isSearchFocused: Bool<br>    @State var isNavigateToReminder = false<br>    @State var searchResults: [StationModel] = []<br>    @State var selectedStation: StationModel? = nil<br>    <br>    func navigateToReminder()  {<br>        isNavigateToReminder.toggle()<br>    }<br><br>    var body: some View {<br>        NavigationView {<br>            ScrollView {<br>                VStack {<br>                    HStack {<br>                        HStack {<br>                            Image(systemName: &quot;magnifyingglass&quot;)<br>                                .foregroundColor(Color(hex: &quot;8E8E83&quot;))<br>                                .padding(.trailing, -10)<br>                            TextField(&quot;Search for your destination station&quot;, text: $searchTerm)<br>                                .onReceive(Just(searchTerm)) { newText in<br>                                    withAnimation {<br>                                        if (newText.count == 0){<br>                                            searchResults = []<br>                                        } else if(newText.count &lt; 3) {<br>                                            searchResults = stationModels<br>                                        } else {<br>                                            searchResults = stationModels.filter {$0.stationName.lowercased().contains(searchTerm.lowercased())}<br>                                        }<br>                                    }<br>                                }<br>                                .font(.subheadline)<br>                                .font(.body)<br>                                .focused($isSearchFocused)<br>                                .padding(.horizontal, 12)<br>                                .padding(.vertical, 12)<br>                                .fontWeight(.medium)<br>                                .foregroundColor(Color(hex: &quot;8E8E83&quot;))<br>                            <br>                            if isSearchFocused {<br>                                Button(action: {<br>                                    isSearchFocused = false<br>                                    searchTerm = &quot;&quot;<br>                                }) {<br>                                    Image(systemName: &quot;xmark&quot;)<br>                                        .foregroundColor(Color(hex: &quot;8E8E83&quot;))<br>                                }<br>                            }<br>                        }<br>                        .padding(.horizontal)<br>                        .background(Color(hex: &quot;F5F5F0&quot;))<br>                        .cornerRadius(12)<br>                        .overlay(RoundedRectangle(cornerRadius: 12).stroke(Color.gray, lineWidth: 1))<br>                    }<br>                    .frame(alignment: .top)<br>                    .padding(.top, 40)<br>                    .padding(.horizontal)<br>                    <br>                    if searchTerm.isEmpty {<br>                        VStack {<br>                            Text(&quot;Popular Station&quot;)<br>                                .font(.headline)<br>                                .fontWeight(.bold)<br>                                .font(.system(size: 16))<br>                                .frame(maxWidth: .infinity, alignment: .topLeading)<br>                                .padding(.leading, 20)<br>                                .padding(.top, 21)<br>                            <br>                            VStack(alignment: .leading) {<br>                                HStack {<br>                                    ButtonPopulerStationComponent(buttonTitle: &quot;Tanah Abang&quot;, callback: {<br>                                        selectedStation = stationModels.first { $0.stationName.contains(&quot;Tanah Abang&quot;) }<br>                                        navigateToReminder()<br>                                    })<br>                                    <br>                                    ButtonPopulerStationComponent(buttonTitle: &quot;Duri&quot;, callback: {})<br>                                    ButtonPopulerStationComponent(buttonTitle: &quot;Tangerang&quot;, callback: {})<br>                                }<br>                                HStack {<br>                                    ButtonPopulerStationComponent(buttonTitle: &quot;Jatinegara&quot;, callback: {})<br>                                    ButtonPopulerStationComponent(buttonTitle: &quot;Rawa Buntu&quot;, callback: {<br>                                        selectedStation = stationModels.first { $0.stationName.contains(&quot;Rawa Buntu&quot;) }<br>                                        navigateToReminder()<br>                                    })<br>                                    <br>                                    ButtonPopulerStationComponent(buttonTitle: &quot;Manggarai&quot;, callback: {})<br>                                }<br>                            }<br>                            .frame(maxWidth:  .infinity, minHeight: 0)<br>                            .padding(.top, 3)<br>                            .padding(.leading, -55)<br>                        }<br>                    }<br>                    <br>                    if searchResults.isEmpty || searchTerm.isEmpty {<br>                        VStack(alignment:  .center) {<br>                            Spacer()<br>                                .frame(height: 80)<br>                            Image(&quot;Search Illust&quot;)<br>                                .resizable().aspectRatio(contentMode: .fit)<br>                                .frame(width: 204.98, height: 168.83)<br>                                .rotationEffect(.degrees(-10))<br>                                .padding(.bottom, 31)<br>                            <br>                            Text(&quot;Navigate the rails with ease, your journey starts with a search.&quot;)<br>                                .foregroundColor(Color(hex: &quot;44443D&quot;))<br>                                .font(.caption)<br>                                .fontWeight(.regular)<br>                                .multilineTextAlignment(.center)<br>                                .fixedSize(horizontal: false, vertical: true)<br>                                .frame(width: 190)<br>                                .opacity(0.7)<br>                        }<br>                        .padding(50)<br>                        Spacer()<br>                    } else {<br>                        VStack {<br>                            ForEach(searchResults, id: \.id) { item in<br>                                VStack {<br>                                    Button(action: {<br>                                        selectedStation = item<br>                                        <br>                                    }) {<br>                                        SearchItemComponent(station: item)<br>                                    }<br>                                    Divider()<br>                                        .padding(.vertical, 12)<br>                                }<br>                            }<br>                        }<br>                        .padding(.horizontal, 20)<br>                        .padding(.top, 16)<br>                    }<br>                }<br>            }<br>            .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)<br>            .background(Color(&quot;ColorBackground&quot;))<br>            .background(NavigationLink(<br>                destination: ReminderSheetView(destinationStation: $selectedStation), isActive: $isNavigateToReminder,<br>                label: { EmptyView() }<br>            ))<br>        }<br>        .navigationBarHidden(true)<br>    }<br>}</pre><h3>Last but not least</h3><p>This is my first project using Swift to build an app, and I want to give some encouragement to anyone new to coding who might feel unsure about getting started.</p><blockquote>You’ll never know what you’re capable of until you take the leap and actually do it.</blockquote><h3>Thank You All!! 💫🫶🏻</h3><p>© 2024 Lucinda Artahni. All Rights Reserved.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5d6be152e5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Discover Your Fortune: Dive into Lucky Meter — The Ultimate Luck Test Game!]]></title>
            <link>https://medium.com/@cindaarta16/discover-your-fortune-dive-into-lucky-meter-the-ultimate-luck-test-game-2c3ee9e7993f?source=rss-8f45baafaa3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c3ee9e7993f</guid>
            <category><![CDATA[games]]></category>
            <category><![CDATA[accelerometer]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[lottie-animation]]></category>
            <category><![CDATA[swiftui]]></category>
            <dc:creator><![CDATA[Cinda]]></dc:creator>
            <pubDate>Tue, 29 Oct 2024 09:16:17 GMT</pubDate>
            <atom:updated>2024-10-29T09:16:17.925Z</atom:updated>
            <content:encoded><![CDATA[<h3>Discover Your Fortune: Dive into Lucky Meter — The Ultimate Luck Test Game!</h3><blockquote>Have you ever felt lucky? Test your luck and see just how fortunate you are with Lucky Meter! Give it a try and find out if today is your lucky day!</blockquote><h3>App Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rOPggz3LimENCeNByDXbiQ.jpeg" /><figcaption>Home Page</figcaption></figure><p><strong>Lucky Meter</strong> is a game app designed to test your luck based on your choices. Developed in one and a half weeks by one coder and two designers, this app challenges players to select between two objects in each game scene, with one choice being the “lucky” correct answer. Players start with three lives, and incorrect choices reduce their lives by one. The game ends when all lives are lost, displaying a result that represents their luckiness.</p><h4>Game Flow</h4><p>Here’s the game flow of the Lucky Meter:</p><p><strong>1. Game Start:</strong></p><ul><li>Player begins with 3 lives.</li></ul><p><strong>2. Selecting an Option:</strong></p><ul><li>Player chooses between left or right objects in each game scene.</li><li>One option is correct, indicating luckiness.</li></ul><p><strong>3. Correct Answer:</strong></p><ul><li>Player’s life remains unchanged.</li><li>Proceed to the next game scene.</li></ul><p><strong>4. Incorrect Answer:</strong></p><ul><li>Player loses 1 life.</li><li>Proceed to the next game scene.</li></ul><p><strong>5. Game Continuation:</strong></p><ul><li>Game continues as long as the player has at least 1 life left.</li></ul><p><strong>6. Game Over:</strong></p><ul><li>When all 3 lives are lost, the game ends.</li><li>Player is directed to the game over page.</li></ul><p><strong>7. Game Over Page:</strong></p><ul><li>Displays an animal representing the player’s luck based on their correct answers score.</li></ul><h4>Game Scene Varieties:</h4><p>In Lucky Meter, we designed three distinct game scenes, each utilizing different input methods and randomized throughout gameplay. Here’s a breakdown of how to play each scene:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44smSH5KjDnoEqfmwQnmnQ.jpeg" /><figcaption>Choosing the Right Bench</figcaption></figure><ul><li><strong>Choosing the Right Bench:</strong> In this scene, users must select one of the benches by long-pressing it. The outcome depends on whether they choose the correct bench.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ey9NjnM7Llv3scAkNCSFCw.jpeg" /><figcaption>Step on the Right Path</figcaption></figure><ul><li><strong>Step on the Right Path:</strong> Users tilt their phone left or right to move a leg on the screen until it reaches the edge. Success or failure is determined by correctly aligning the leg.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zJhhwQQNl8xDtqyEZH6Lmg.jpeg" /><figcaption>Drag Items from Pocket</figcaption></figure><ul><li><strong>Drag Items from Pocket:</strong> Users drag items from the inner pocket to the upper outer pocket. The result depends on successfully performing the drag action.</li></ul><p>Each scene’s input is randomized to add variety to the gameplay experience.</p><h4>Input Used</h4><p>In building this app, we incorporated several user input methods for gameplay:</p><ul><li><strong>Long Press:</strong> Used to select the bench.</li><li><strong>Accelerometer:</strong> Detects tilt gestures for choosing the left or right path to step on.</li><li><strong>Drag Gestures:</strong> Allows users to drag items out of their pocket for interactive actions.</li></ul><h4><strong>Tech Stack Used:</strong></h4><ul><li>Swift for programming language</li><li>SwiftUI for user interface</li><li>Animation for interactive elements</li><li>Lottie for enhanced animations</li><li>Sound for background music and effects</li></ul><h3>Coding Process</h3><p>As the sole coder for this project, I took on the responsibility of developing the gameplay mechanics for the app. My coding journey involved several key phases, each crucial to bringing the gameplay to life. Here’s an overview of the process and the various stages of development:</p><h4>Randomized Game Scene Mechanism</h4><p>For the gameplay experience, we chose to incorporate a randomized sequence of scenes to ensure a dynamic and engaging game flow. This approach prevents the gameplay from following a fixed order, enhancing replayability and keeping the player on their toes. The only exception to this randomness is the initial scene, which always starts with the “Choosing the Bench” scenario.</p><p>To manage the sequence, we implemented a code that determines the next scene to display. This code ensures a varied gameplay experience by randomly selecting subsequent scenes while maintaining the consistent start. Here’s how the code handles scene selection and guarantees an engaging gameplay experience:</p><pre>import SwiftUI<br><br>struct ContentView: View {<br>    let globalLogic = GlobalLogic()<br>    @State private var randomIndex = 0//Int.random(in: 0...1)<br>    @State var mainViewDisplay = true<br>        <br>    var body: some View {<br>        NavigationView{<br>            ZStack{<br>                <br>                if mainViewDisplay {<br>                    MainView(mainViewDisplay: $mainViewDisplay)<br>                } else{<br>                    <br>                    if randomIndex == 0 {<br>                        Park_Bench(buttonAction: changeView)<br>                            .environmentObject(globalLogic)<br>                            <br>                        <br>                    } else if randomIndex == 1 {<br>                        Foot_Step(buttonAction: changeView)<br>                            .environmentObject(globalLogic)<br>                        <br>                    } else if randomIndex == 2 {<br>                        Money_Pocket(buttonAction: changeView)<br>                            .environmentObject(globalLogic)<br>                    } else{<br>                        gameOver(resetAction: resetApp)<br>                            .environmentObject(globalLogic)<br>                    }<br>                }<br>                    <br>            }.navigationBarHidden(true)<br>            <br>        }<br>    }<br><br>    func changeView() {<br>        if globalLogic.life == 0 {<br>            SoundManager.shared.stopSound()<br>            randomIndex = -1<br>            print(randomIndex)<br>        } else{<br>            randomIndex = Int.random(in: 0...2)<br>            print(&quot;\(randomIndex) else&quot;)<br>        }<br>    }<br><br>    <br>    func resetApp() {<br>            randomIndex = 0<br>            mainViewDisplay = true<br>            globalLogic.reset()<br>        }<br><br>    <br>}</pre><h4>Input Mechanism (Long Press, Accelerometer, and Drag Gesture)</h4><p><strong>LongPress<br></strong>To implement the long press input functionality, I utilized the onLongPressGesture modifier. This modifier initiates the process by triggering a function that checks the user&#39;s answer. Based on whether the user&#39;s selection is correct or incorrect, the function determines which animation should be displayed. This approach not only enhances the interactivity of the game but also provides immediate feedback to the user, making the gameplay more engaging and intuitive. Here&#39;s a closer look at how the onLongPressGesture is effectively integrated to handle user input and deliver a responsive gaming experience:</p><pre>Image(&quot;bench&quot;)<br>                        .resizable()<br>                        .aspectRatio(contentMode: .fit)<br>                        .frame(height: 150)<br>                        .onLongPressGesture {<br>                            let randomBool = Bool.random()<br>                            globalLogic.checkAnswer(randomBool)<br>                            <br>                            if globalLogic.lastAnswerCorrect{<br>                                animation = &quot;ParkBenchLucky&quot;<br>                            } else{<br>                                animation = &quot;ParkBenchUnlucky&quot;<br>                            }<br>                            <br>                            animationVisible = true<br><br>                        }</pre><p><strong>Accelerometer</strong></p><p>To enable leg movement in the game, I used tilt gestures by leveraging the accelerometer sensor. By calling startAccelerometerUpdates(), I captured changes along the horizontal axis. Although the original axis for horizontal movement is the x-axis, since the game is played in landscape mode, the accelerometer interprets the phone&#39;s orientation in portrait position, making the y-axis the horizontal axis for landscape mode. Therefore, we track the acceleration along the y-axis and apply these changes to shapePosition.x, which represents the horizontal axis for the leg&#39;s position in landscape</p><p>If the acceleration is below 0, the leg moves to the right, and if it is above 0, the leg moves to the left. When the leg (represented by shapePosition.x) reaches the minimum or maximum position, the accelerometer updates stop, and the function to check the answer is triggered. This method ensures smooth and intuitive leg movements based on the device&#39;s tilt, enhancing the game&#39;s interactivity.</p><pre><br>func startAccelerometerUpdates() {<br>        if motionManager.isAccelerometerAvailable {<br>                   motionManager.accelerometerUpdateInterval = 0.1<br>                   motionManager.startAccelerometerUpdates(to: .main) { accelerometerData, error in<br>                       guard let acceleration = accelerometerData?.acceleration else { return }<br>                       <br>                       let direction: CGFloat = acceleration.y &lt; 0 ? 1 : -1<br>                       <br>                       if acceleration.y &gt; 0.2 || acceleration.y &lt; -0.2 {<br>                           let newPositionX = shapePosition.x + (CGFloat(direction) * CGFloat(abs(acceleration.y) * 100))<br>                           <br>                           <br>                        let screenWidth = UIScreen.main.bounds.width<br>                        let maxPositionX = screenWidth - 125<br><br>                        shapePosition.x = max(150, min(newPositionX, maxPositionX))<br>                           <br>                        if acceleration.y &lt; 0{<br>                               selectedButton = &quot;Right&quot;<br>                            <br>                        } else{<br>                               selectedButton = &quot;Left&quot;<br>                        }<br>                           <br>                        if shapePosition.x == 150 { <br>                            stopAccelerometerUpdates()<br><br>                            let randomBool = Bool.random()<br>                            globalLogic.checkAnswer(randomBool)<br>                            <br>                            if globalLogic.lastAnswerCorrect &amp;&amp; selectedButton == &quot;Left&quot; {<br>                                animation = &quot;FootLucky&quot;<br>                            } else{<br>                                animation = &quot;FootUnlucky&quot;<br>                            }<br>                            <br>                            animationVisible = true<br><br>                            <br>                        } else if shapePosition.x == maxPositionX{ <br>                            stopAccelerometerUpdates()<br><br>                            let randomBool = Bool.random()<br>                            globalLogic.checkAnswer(randomBool)<br>                            <br>                            if globalLogic.lastAnswerCorrect &amp;&amp; selectedButton == &quot;Right&quot; {<br>                                animation = &quot;FootLucky&quot;<br>                            } else{<br>                                animation = &quot;FootUnlucky&quot;<br>                            }<br>                            <br>                            animationVisible = true<br><br>                        }<br>                           <br>                       }<br>                   }<br>               }<br>        <br>        }<br><br>    func stopAccelerometerUpdates() {<br>            motionManager.stopAccelerometerUpdates()<br>        }<br><br></pre><p><strong>Drag Gesture<br></strong>To implement the drag gesture, I utilized the gesture modifier with a DragGesture that triggers the function to check the answer and determine the appropriate animation based on the user&#39;s input. This drag gesture is created using a clear rectangle positioned over the left and right pockets, allowing each pocket to be selected individually. Here&#39;s an example of the code:</p><pre>Rectangle()<br>                            .frame(width: 90, height: 200)<br>                            .foregroundColor(.clear)<br>                            .contentShape(Rectangle())<br>                            .rotationEffect(.degrees(135))<br>                            .gesture(<br>                                DragGesture()<br>                                    .onEnded({value in<br>                                    let randomBool = Bool.random()<br>                                    globalLogic.checkAnswer(randomBool)<br>                                        <br>                                        if globalLogic.lastAnswerCorrect{<br>                                            animation = &quot;MoneyLucky&quot;<br>                                        } else{<br>                                            animation = &quot;MoneyUnlucky&quot;<br>                                        }<br>                                        <br>                                    animationVisible = true<br><br>                                    })<br>                                    <br>                        )</pre><h4>Logic</h4><p>The core logic for the gameplay involves checking the user’s answer. I implemented the checkAnswer function, which takes a Boolean parameter to determine if the user&#39;s choice is correct. If the answer is correct, the score is incremented by 1; if it&#39;s wrong, the life is reduced by 1. Additionally, the total number of turns played is tracked by incrementing totalPlay by 1.</p><pre>func checkAnswer(_ option: Bool) {<br>        let rdmBool = Bool.random()<br>        if option == true &amp;&amp; rdmBool == true {<br>                    totalRight += 1<br>                    lastAnswerCorrect = true<br>                    <br>                    <br>                } else {<br>                    print(&quot;Wrong Answer!&quot;)<br>                    life -= 1<br>                    lastAnswerCorrect = false<br>            }<br>        totalPlay += 1<br><br>    }</pre><h4>Add Lottie</h4><p>Adding a Lottie animation to your project can be a bit tricky, but it’s manageable with the right steps. First, you need to add the Lottie package to your project. Here’s how:</p><ol><li>Go to File &gt; Add Package Dependencies.</li><li>Enter the package URL.</li><li>Set the version you want to add.</li><li>Click Add Package.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*VzoQWLaXzeCiKBM7C_C1eQ.png" /><figcaption>Step to add Lottie Package</figcaption></figure><p>While the latest version of the package is 4.5.0, I opted for version 3.2.3 because it supports animationView, which I use in my code. Here’s the code snippet for integrating a Lottie animation using the 3.2.3 version of the Lottie package:</p><pre>import SwiftUI<br>import Lottie<br><br>struct LottieView: UIViewRepresentable {<br>    let animationView = AnimationView()<br><br>    var animationName: String<br><br>    func makeUIView(context: Context) -&gt; UIView {<br>        let view = UIView()<br>        animationView.animation = Animation.named(animationName)<br>        animationView.contentMode = .scaleAspectFit<br>        animationView.play()<br>        animationView.loopMode = .loop<br>        animationView.translatesAutoresizingMaskIntoConstraints = false<br>        view.addSubview(animationView)<br>        <br>        NSLayoutConstraint.activate([<br>            animationView.widthAnchor.constraint(equalTo: view.widthAnchor),<br>            animationView.heightAnchor.constraint(equalTo: view.heightAnchor),<br>        ])<br><br>        return view<br>    }<br><br>    func updateUIView(_ uiView: UIView, context: Context) {<br>        animationView.animation = Animation.named(animationName)<br>        animationView.play()<br>    }<br>}</pre><p>To use Lottie animations in your project, you can simply call the LottieView struct and provide the name of your animation. This streamlines the process and makes it easy to integrate animations into your app.</p><pre>import SwiftUI<br><br>struct TryLottie: View {<br>    var body: some View {<br>        LottieView(animationName: &quot;star&quot;)<br>    }<br>}</pre><h4>Add Sound</h4><p>To add sound to Lucky Meter game, I created a file named SoundManager and used the AVFoundation framework to utilize AVAudioPlayer for playing sounds. Here’s the code for SoundManager:</p><pre>import Foundation<br>import AVFoundation<br><br>class SoundManager {<br>    static let shared = SoundManager()<br><br>    private var audioPlayer: AVAudioPlayer?<br><br>    func playSound(named name: String) {<br>        guard let soundURL = Bundle.main.url(/service/forresource: name, withExtension: &quot;mp3&quot;) else {<br>            print(&quot;Sound file not found.&quot;)<br>            return<br>        }<br><br>        do {<br>            audioPlayer = try AVAudioPlayer(contentsOf: soundURL)<br>            audioPlayer?.play()<br>        } catch {<br>            print(&quot;Error playing sound: \(error.localizedDescription)&quot;)<br>        }<br>        <br>        print(&quot;the song is \(name)&quot;)<br>    }<br><br>    func stopSound() {<br>        audioPlayer?.stop()<br>    }<br>}</pre><p>To play audio in your app, you can use the SoundManager class. Simply call the playSound method and provide the name of the sound file . Here’s an example:</p><pre>SoundManager.shared.playSound(named: &quot;gameSound&quot;)</pre><p>If you need to stop the audio playback, you can use the stopSound method:</p><pre>SoundManager.shared.stopSound()</pre><h4>To Wrap Things Up…</h4><p>I’d like to share an important takeaway that could benefit your own app development journey:</p><blockquote>“Being the only coder on this project presented a significant challenge. Initially, I felt anxious about meeting the designers’ expectations, but I was determined to give it my all. Through dedication and perseverance, I was able to deliver the app successfully. I’m thrilled with the outcome and deeply proud of both my individual contributions and the support from my team.”</blockquote><h4>Thank You All!! 💫🫶🏻</h4><p>© 2024 Lucinda Artahni. All Rights Reserved.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c3ee9e7993f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making a Better Life for a Woman Who Walking Through Pedestrian]]></title>
            <link>https://medium.com/@cindaarta16/making-a-better-life-for-a-woman-who-walking-through-pedestrian-610accf170cc?source=rss-8f45baafaa3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/610accf170cc</guid>
            <category><![CDATA[cloudkit]]></category>
            <category><![CDATA[geofencing]]></category>
            <category><![CDATA[notifications]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[woman-empowerment]]></category>
            <dc:creator><![CDATA[Cinda]]></dc:creator>
            <pubDate>Fri, 30 Aug 2024 01:43:05 GMT</pubDate>
            <atom:updated>2024-08-30T01:43:05.563Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j80M1Iyaui_7Ahpi9rwjqg.png" /></figure><blockquote>As a woman, I believe many of us have experienced catcalling at least once in our lives, leaving us feeling uncomfortable and vulnerable.</blockquote><p>My project is a collaborative effort aimed at empowering women and reducing the anxiety they may feel when walking alone in public spaces due to the threat of catcalling. Through this initiative, we strive to create a safer environment and provide women with tools to feel more confident and secure in their daily lives.</p><h3>Problem</h3><p>Here are some challenges women face when dealing with catcalling:</p><ul><li><strong>Victimization</strong>: A significant majority of catcalling incidents target women, making them the primary victims of this form of harassment. This reality contributes to a pervasive sense of vulnerability and fear when navigating public spaces.</li><li><strong>Avoidance Behavior</strong>: Women often feel compelled to quickly pass by the catcaller to minimize discomfort. This reaction is driven by a desire to avoid further interaction and escape the situation as quickly as possible, even though it often leaves them feeling powerless and frustrated.</li><li><strong>Fear of Escalation</strong>: The potential for catcalling to escalate into physical sexual harassment is a significant concern. Many women avoid confronting catcallers, fearing that any response could provoke a more dangerous situation, such as physical assault or continued harassment.</li><li><strong>Reporting Difficulties</strong>: Reporting catcalling incidents to authorities is fraught with challenges. These incidents typically happen in the blink of an eye, leaving no tangible evidence. As a result, women often feel that their complaints may not be taken seriously, which discourages them from seeking justice or support.</li><li><strong>Normalization</strong>: Catcalling is frequently dismissed as a minor offense compared to other forms of sexual harassment. This normalization trivializes the impact of catcalling and perpetuates a culture in which women’s experiences of verbal abuse are not fully recognized or addressed.</li><li><strong>Preference for Anonymous Reporting</strong>: Women express a strong preference for anonymous reporting options when dealing with catcalling. This desire stems from the fear of potential backlash or further harassment if their identity becomes known, as well as the societal stigma that can be attached to speaking out about such incidents.</li><li><strong>Companionship and Safety</strong>: Women generally feel safer and less burdened when walking with friends. The presence of companions provides a buffer against the threat of catcalling, offering emotional support and a sense of security. This collective experience can mitigate the anxiety and stress associated with navigating public spaces where catcalling is prevalent.</li></ul><h3>Process</h3><p>After identifying the problem, we created a user persona to outline the key traits, behaviors, challenges, and goals of our target users. This process helped us better understand their needs and frustrations, especially when they experience catcalling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OuqvIqP-PXjoWgH27XeSfg.png" /><figcaption>User Persona</figcaption></figure><p>Next, we developed a detailed user journey to depict the steps a woman takes when walking home from the office, emphasizing the discomfort caused by catcalling encountered along the way. This journey map also compared the user’s experience before and after using our app, showing how our solution helps reduce these pain points and enhances their sense of safety and comfort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oiOQXFOEALWK8YgaqK2rag.png" /><figcaption>Customer Journey Map (Current State)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z8BTxA9Q1dy68b9cPd_j-A.png" /><figcaption>Customer Journey Map (Ideal State)</figcaption></figure><p>Once we gathered information about the users, we began creating a Value Proposition Canvas (VPC) to map out the value of the product we are developing. By using the VPC, we can assess whether the product we offer aligns with the users’ pain points and gains, ensuring that it addresses their needs and expectations effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pNT2Iem9dL7b2HZwgudQgw.png" /><figcaption>VPC</figcaption></figure><p>Next, we created a user story mapping that outlines the flow of user activities within our application. From this user story mapping, my team and I were able to define the scope of the Minimum Viable Product (MVP) that we will develop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-StIg_ixh1vqPzD3toJhQg.png" /><figcaption>User Story Mapping</figcaption></figure><p>To ensure complete coverage, we also designed an information architecture that details the required information and actions for every page of the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HlmvYt0_RKkqT82MpsRLYQ.png" /><figcaption>Information Architecture</figcaption></figure><h3>Ideation</h3><p>Based on our research and documentation, we developed an app called Dandenion to support individuals who experience catcalling. The app allows users to record and report incidents of catcalling, which are then used to create a heatmap of high-risk areas. This heatmap helps other users by notifying them if they enter a high-risk area, prompting them to activate voice recording.</p><p>Here are the features of the Dandenion app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZEInYKWzmIA_DwobM-WwWQ.png" /><figcaption>Voice Recording Companion</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f2UR8bbxKyGCO1hvWKyK-A.png" /><figcaption>Recording in Progress</figcaption></figure><p><strong>Voice Recording Companion:</strong> This feature prepares users to handle catcalling encounters. It offers two modes: manual and automatic. In manual mode, users must press the start and stop record buttons to begin and end recording. In automatic mode, users receive a notification to start recording when entering a heatmap area, and recording will automatically stop when they leave the area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HSw5LNoWKr6tWQ3lrd1KRw.png" /><figcaption>Report for Community</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VvmazxRtbaAM5BxRtcAVfA.png" /><figcaption>Report Flow</figcaption></figure><p><strong>Report for Community:</strong> Users can submit reports based on their recordings, which are processed into a heatmap. This heatmap informs and protects other users, particularly women, by highlighting areas with frequent catcalling incidents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vOCjYjNC12VfLkJ0r0IQuQ.png" /><figcaption>Notifications &amp; Widget</figcaption></figure><p><strong>Notifications &amp; Widget:</strong> When users enter a high-risk area, they will receive a notification to start recording. The app also includes a widget and is available on the watch, offering greater flexibility and easy access to recording features, allowing users to quickly start or stop recording.</p><h3>Code Process</h3><p>In this app, we leverage a range of advanced technologies to deliver a comprehensive, user-centric experience. These include a voice recorder for capturing incidents, WatchKit for seamless smartwatch integration, widgets for quick access, geofencing to monitor and respond to user locations in real-time, and notifications to alert users when they enter high-risk areas. We use CloudKit for secure data storage, MapKit for pinpointing locations where catcalling incidents have occurred, and CoreLocation for precise location tracking. Additionally, we utilize Sign in with Apple for a streamlined and secure login experience.</p><p>My primary responsibilities in this project include managing data storage with CloudKit, implementing geofencing to monitor and trigger location-based events, configuring notifications to keep users informed and protected, and handling user authentication through Sign in with Apple. This combination of technologies ensures that our app not only meets user needs but also provides a powerful tool to enhance their safety by enabling them to report incidents and avoid high-risk areas.</p><h4>CloudKit for Data Storage</h4><p>In this project, I use CloudKit to store user data and reports, allowing each user to have one or multiple reports. Setting up CloudKit in the app involves enabling iCloud capabilities and creating a container in the Apple Developer account, with an identifier that matches the project’s bundle identifier. Once configured, the container identifier is integrated into the code, establishing a connection between the project and iCloud.</p><p>Here’s my code for Create, Read, and Delete for report entity</p><pre>import Foundation<br>import CloudKit<br>import Combine<br>import CoreLocation<br><br>class ReportManager: CloudKitConnection, ObservableObject {<br>    @Published var reports: [Report] = []<br>    @Published var reportsNearby: [Report] = []<br>    private var geofencingManager = GeofencingManager()<br>    <br>    func createReport(report: Report, completion: @escaping (Result&lt;CKRecord?, Error&gt;) -&gt; Void) {<br>        let record = CKRecord(recordType: &quot;Report&quot;)<br>        record[&quot;reportDate&quot;] = report.reportDate as CKRecordValue<br>        record[&quot;reportKronologi&quot;] = report.reportKronologi as CKRecordValue<br>        record[&quot;location&quot;] = report.location<br>        record[&quot;userID&quot;] = CKRecord.Reference(recordID: report.userID, action: .none)<br>        <br>        <br>        publicDatabase.save(record) { savedRecord, error in<br>            if let error = error {<br>                completion(.failure(error))<br>            } else {<br>                report.reportID = savedRecord!.recordID<br>                self.reports.append(report)<br>                completion(.success(savedRecord))<br>            }<br>        }<br>    }<br>    <br>    func fetchReports() {<br>            let predicate = NSPredicate(value: true)<br>            let query = CKQuery(recordType: &quot;Report&quot;, predicate: predicate)<br>            <br>            publicDatabase.perform(query, inZoneWith: nil) { results, error in<br>                if let error = error {<br>                    DispatchQueue.main.async {<br>                        print(&quot;Error fetching reports: \(error.localizedDescription)&quot;)<br>                    }<br>                } else {<br>                    DispatchQueue.main.async {<br>                        self.reports = results?.compactMap { record in<br>                            guard let reportDate = record[&quot;reportDate&quot;] as? Date,<br>                                  let reportKronologi = record[&quot;reportKronologi&quot;] as? String,<br>                                  let location = record[&quot;location&quot;] as? CLLocation,<br>                                  let userIDRef = record[&quot;userID&quot;] as? CKRecord.Reference else {<br>                                return nil<br>                            }<br>                            <br>                            let report = Report(reportDate: reportDate, reportKronologi: reportKronologi, location: location, userID: userIDRef.recordID)<br>                            report.reportID = record.recordID<br>                            return report<br>                        } ?? []<br>                    }<br>                }<br>            }<br>        }<br>    <br>    func fetchReportsNearUserLocation(userLocation: CLLocation) {<br>            // Define a circular region with a 1 km (1000 meters) radius<br>            let region = CLCircularRegion(center: userLocation.coordinate, radius: 1000, identifier: &quot;NearbyRegion&quot;)<br>            <br>            <br>            let predicate = NSPredicate(value: true)<br>            let query = CKQuery(recordType: &quot;Report&quot;, predicate: predicate)<br>        <br>            publicDatabase.perform(query, inZoneWith: nil) { results, error in<br>                if let error = error {<br>                    DispatchQueue.main.async {<br>                        print(&quot;Error fetching reports: \(error.localizedDescription)&quot;)<br>                    }<br>                } else {<br>                    DispatchQueue.main.async {<br>                        self.reportsNearby.removeAll()<br>                       <br>                       <br>                        self.reportsNearby = results?.compactMap { record in<br>                            guard let reportDate = record[&quot;reportDate&quot;] as? Date,<br>                                  let reportKronologi = record[&quot;reportKronologi&quot;] as? String,<br>                                  let location = record[&quot;location&quot;] as? CLLocation,<br>                                  let userIDRef = record[&quot;userID&quot;] as? CKRecord.Reference else {<br>                                return nil<br>                            }<br>                            <br>                            <br>                          <br>                            if region.contains(location.coordinate) {<br>                                let report = Report(reportDate: reportDate, reportKronologi: reportKronologi, location: location, userID: userIDRef.recordID)<br>                                report.reportID = record.recordID<br>                                return report<br>                            }<br>                            <br>                            return nil<br>                        } ?? []<br>                        <br>                        self.geofencingManager.startMonitoringForReports(self.reportsNearby)<br>                     <br>                        <br>                    }<br>                }<br>            }<br>        }<br>    <br>    <br>    <br>    <br>    <br>    func deleteReport(report: Report, completion: @escaping (Result&lt;Void, Error&gt;) -&gt; Void) {<br>        guard let recordID = report.reportID else {<br>            completion(.failure(NSError(domain: &quot;&quot;, code: -1, userInfo: [NSLocalizedDescriptionKey: &quot;Invalid Record ID&quot;])))<br>            return<br>        }<br>        <br>        publicDatabase.delete(withRecordID: recordID) { deletedRecordID, error in<br>            if let error = error {<br>                completion(.failure(error))<br>            } else {<br>                DispatchQueue.main.async {<br>                    self.reports.removeAll { $0.reportID == recordID }<br>                }<br>                completion(.success(()))<br>            }<br>        }<br>    }<br><br>    <br>}<br><br><br><br></pre><h4>Geofencing</h4><p>Geofencing plays a crucial role in this project by marking locations reported by users as high-risk areas for catcalling. Each reported location is defined as a geofenced region with a radius of 10 meters, identifying it as a potentially dangerous zone.</p><p>In the implementation, the app continuously monitors the user’s surroundings by fetching reports from nearby locations. These locations are then converted into geofencing regions that the app actively monitors. When a user approaches or enters one of these geofenced areas, the app can trigger alerts, such as sending a notification to remind the user to activate the voice recording feature. This real-time monitoring helps users stay vigilant and avoid areas where they might be at risk</p><pre>import Foundation<br>import CoreLocation<br>import CloudKit<br><br>class GeofencingManager:  NSObject, ObservableObject, CLLocationManagerDelegate{<br>    private var locationManager: CLLocationManager<br>    var monitoredRegions: [CLCircularRegion] = []<br>    @Published var currentLocation: CLLocation?<br>    <br>    <br>    override init() {<br>        locationManager = CLLocationManager()<br>        super.init()<br>        locationManager.delegate = self<br><br>    }<br>    <br>    func updateLocation(){<br>        DispatchQueue.main.asyncAfter(deadline: .now() + 15){<br>            self.locationManager.startUpdatingLocation()<br>        }<br>    }<br>    <br>    func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {<br>        switch CLLocationManager.authorizationStatus() {<br>        case .notDetermined:<br>            //            manager.requestLocation()<br>            manager.requestWhenInUseAuthorization()<br>            manager.requestAlwaysAuthorization()<br>        case .authorizedWhenInUse, .authorizedAlways:<br>            manager.requestLocation()<br>            manager.requestAlwaysAuthorization()<br>        case .restricted, .denied:<br>            print(&quot;Location services are denied or restricted.&quot;)<br>        @unknown default:<br>            fatalError(&quot;Unknown authorization status.&quot;)<br>        }<br>    }<br>    <br>    <br>    <br>    func startMonitoringForReports(_ reports: [Report]) {<br>        NotifManager.instance.cancelNotification()<br>        <br>        for region in monitoredRegions {<br>            locationManager.stopMonitoring(for: region)<br>        }<br>        monitoredRegions.removeAll()<br>        <br>        for report in reports {<br>            let location = report.location<br>            <br>            let identifier = report.reportKronologi /*report.reportID?.recordName ?? UUID().uuidString*/<br>            <br>            // Check if this region is already being monitored<br>            if monitoredRegions.contains(where: { $0.identifier == identifier }) {<br>                continue // Skip if already monitoring this region<br>            }<br>            <br>            let region = CLCircularRegion(<br>                center: location.coordinate,<br>                radius: 10,<br>                identifier: identifier /*report.reportID?.recordName ?? UUID().uuidString*/<br>            )<br>            region.notifyOnEntry = true<br>            region.notifyOnExit = true<br>            locationManager.startMonitoring(for: region)<br>            monitoredRegions.append(region)<br>        }<br>        <br>        for region in monitoredRegions {<br>            NotifManager.instance.scheduleNotification(for: region)<br>                   <br>        }<br>        <br>        print(monitoredRegions)<br>    }<br>    <br>   <br>    <br>    func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {<br>        guard let latestLocation = locations.last else { return }<br>        currentLocation = latestLocation<br>       <br>    }<br>    <br>    func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) {<br>        if let circularRegion = region as? CLCircularRegion {<br>            print(&quot;Entered geofence at location: \(circularRegion.center)&quot;)<br>            print(&quot;\(region.identifier)&quot;)<br>            <br>        }<br>    }<br>    <br>    func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) {<br>        if let circularRegion = region as? CLCircularRegion {<br>            print(&quot;Exited geofence at location: \(circularRegion.center)&quot;)<br>            <br>        }<br>    }<br>    <br>    func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {<br>        print(&quot;Location Manager failed with error: \(error.localizedDescription)&quot;)<br>        if let clError = error as? CLError {<br>            switch clError.code {<br>            case .denied:<br>                print(&quot;Location services denied.&quot;)<br>            case .network:<br>                print(&quot;Network error.&quot;)<br>            case .locationUnknown:<br>                print(&quot;Location unknown error.&quot;)<br>            case .headingFailure:<br>                print(&quot;Heading failure error.&quot;)<br>            case .regionMonitoringDenied:<br>                print(&quot;Region monitoring denied.&quot;)<br>            case .regionMonitoringFailure:<br>                print(&quot;Region monitoring failure.&quot;)<br>            case .rangingFailure:<br>                print(&quot;Ranging failure error.&quot;)<br>            default:<br>                print(&quot;Other error: \(clError.code.rawValue)&quot;)<br>            }<br>        }<br>    }<br>}<br><br></pre><p>While geofencing typically provides triggers for when a user enters or exits a defined region, in this project, I opted to use notifications as the primary trigger instead. This is because notifications come with their own built-in triggering mechanisms, allowing for more precise and reliable alerts when users enter monitored areas. This approach ensures that the notifications are fully aligned with the app’s geofencing logic while taking advantage of the robust triggering capabilities that notifications offer.</p><h4>Notifications</h4><p>Notifications are an integral part of this project, ensuring that users are promptly alerted when they enter high-risk areas identified by the app. Each time the app fetches reports from nearby locations, it defines monitored regions based on these reports. These regions are then used as input to schedule notifications.</p><p>When a user enters one of these monitored locations, the app automatically triggers a notification, alerting the user to be cautious and suggesting that they activate the voice recording feature. This proactive approach enhances user safety by providing real-time alerts tailored to their current location, helping them avoid dangerous situations.</p><pre>import Foundation<br>import UserNotifications<br>import CoreLocation<br><br>class NotifManager{<br>    static let instance = NotifManager()<br>    <br>    func requestAuthorization() {<br>        let options: UNAuthorizationOptions = [.alert, .sound, .badge]<br>        UNUserNotificationCenter.current().requestAuthorization(options: options) { (success, error) in<br>            if let error = error {<br>                print(&quot;Error: \(error)&quot;)<br>            } else {<br>                print(&quot;Success&quot;)<br>            }<br>        }<br>    }<br><br>    <br>    func scheduleNotification(for region: CLCircularRegion) {<br>        let content = UNMutableNotificationContent()<br>        content.title = &quot;This is notification&quot;<br>        content.body = &quot;This is body&quot;<br>        content.sound = .default<br>        content.badge = 1<br>        <br>        let trigger = UNLocationNotificationTrigger(region: region, repeats: true)<br>        let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: trigger)<br>        <br>        UNUserNotificationCenter.current().add(request) { error in<br>            if let error = error {<br>                print(&quot;Error adding notification: \(error.localizedDescription)&quot;)<br>            }<br>        }<br>        <br>        print(&quot;Notification added&quot;)<br>    }<br>    <br>    <br>    <br>    func cancelNotification() {<br>        UNUserNotificationCenter.current().removeAllPendingNotificationRequests()<br>        UNUserNotificationCenter.current().removeAllDeliveredNotifications()<br>    }<br>}</pre><h4>Sign In With Apple</h4><p>By using Sign in with Apple, we can seamlessly collect user data with a single click on the Sign in with Apple button. This data is initially stored in the app’s local storage, but since we’re leveraging CloudKit for data management, the collected user data is also uploaded to CloudKit for secure storage and synchronization across devices. To implement this sign-in method, it’s essential to enable the Sign in with Apple capability in the project’s settings. This ensures that the authentication process is integrated smoothly and securely within the app.</p><pre>import SwiftUI<br>import AuthenticationServices<br><br>struct SignInWithAppleComponent: View {<br>    @Environment(\.colorScheme) var colorScheme<br>    <br>    @AppStorage(&quot;email&quot;) var email : String = &quot;&quot;<br>    @AppStorage(&quot;firstName&quot;) var firstName : String = &quot;&quot;<br>    @AppStorage(&quot;lastName&quot;) var lastName : String = &quot;&quot;<br>    @AppStorage(&quot;userId&quot;) var userId : String = &quot;&quot;<br>    <br>    @Binding var showLoginPage: Bool<br>    <br>    @StateObject var userVm: UserAppManager<br>    <br>    init(userVm: UserAppManager, showLoginPage: Binding&lt;Bool&gt;) {<br>           _userVm = StateObject(wrappedValue: userVm)<br>           _showLoginPage = showLoginPage<br>       }<br>    <br>    var body: some View {<br>        VStack{<br>            SignInWithAppleButton(.continue) { request in<br>                request.requestedScopes = [.email, .fullName]<br>                <br>            } onCompletion: { result in<br>                switch result{<br>                case .success(let auth):<br>                    switch auth.credential{<br>                    case let credential as ASAuthorizationAppleIDCredential:<br>                        let userId = credential.user<br>                        let email = credential.email<br>                        let firstName = credential.fullName?.givenName<br>                        let lastName = credential.fullName?.familyName<br>                        <br>                        self.email = email ?? &quot;&quot;<br>                        self.firstName = firstName ?? &quot;&quot;<br>                        self.lastName = lastName ?? &quot;&quot;<br>                        self.userId = userId ?? &quot;&quot;<br>                        <br>                        <br>                        let newUser = UserApp(firstName: firstName ?? &quot;&quot;, lastName: lastName ?? &quot;&quot;, email: email ?? &quot;&quot;)<br>                        userVm.createUser(user: newUser) { result in<br>                            switch result {<br>                            case .success(let record):<br>                                print(&quot;User created: \(String(describing: record))&quot;)<br>                            case .failure(let error):<br>                                print(&quot;Error creating user: \(error.localizedDescription)&quot;)<br>                            }<br>                            <br>                            userVm.fetchUsers()<br>                            <br>                            showLoginPage = false<br>                            <br>                        }<br>                        <br>                        <br>                    default:<br>                        break<br>                    }<br>                    <br>                case .failure(let error):<br>                    print(error)<br>                }<br>                <br>                <br>            }<br>            .signInWithAppleButtonStyle(colorScheme == .dark ?  .white : .black)<br>            .frame(width: 330, height:45)<br>            .padding()<br>            .cornerRadius(8)<br>        }<br>    }<br>}</pre><h3>Last but not least</h3><p>As we conclude this project, I’d like to share an important lesson that could be valuable for your own app development:</p><blockquote>When encountering something unfamiliar, dive in and learn it! You have nothing to lose, and the experience will provide valuable insights and knowledge.</blockquote><h3>Thank You All!! 💫🫶🏻</h3><p>© 2024 Lucinda Artahni. All Rights Reserved.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=610accf170cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reimagine: the way housewife use Weather app]]></title>
            <link>https://medium.com/@cindaarta16/reimagine-the-way-housewife-use-weather-app-a9cf3a95e943?source=rss-8f45baafaa3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9cf3a95e943</guid>
            <category><![CDATA[swiftui-4]]></category>
            <category><![CDATA[localization]]></category>
            <category><![CDATA[weatherkit]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Cinda]]></dc:creator>
            <pubDate>Fri, 26 Jul 2024 05:48:59 GMT</pubDate>
            <atom:updated>2024-07-26T05:48:59.921Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NrsO7UZV9DIVFH8c-XfDBg.png" /></figure><blockquote>While we may often be aware of the weather around us, sudden heavy rain can catch us off guard, making it too late to order food online and leaving us with regrets</blockquote><p>My latest project is a group project that focused on helping people determine the optimal time to order food before it starts raining. This initiative aimed to address several issues that arise when ordering food during inclement weather.</p><h3>Problem</h3><p>Here’s some problems experienced by user when they order food in a rainy weather:</p><p>Firstly, when it rains, many delivery drivers tend to seek shelter to avoid getting wet. As a result, fewer drivers are available to pick up and deliver orders, leading to longer wait times and a significant increase in delivery costs. The reduced availability of drivers can cause delays, leaving customers frustrated and hungry for extended periods.i</p><p>Moreover, rainy weather often results in food packages getting wet during transit. Even with the best efforts to protect the food, water can seep through the packaging, leading to soggy and unappetizing meals. This not only affects the quality of the food but also irritates customers who expect their orders to arrive in good condition.</p><h3>Process</h3><p>After identifying the problem, we developed a user persona to map out the characteristics, behaviors, pain points, and goals of our target users. This helped us understand their needs and frustrations, especially during rainy weather.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Xiy9Mq3H0IvxuT7_oiRaQ.png" /><figcaption>User Persona</figcaption></figure><p>We created a detailed user journey to illustrate the steps involved in ordering food online, highlighting how rainy days exacerbate user irritation. This journey map also compared the experience before and after using our app, demonstrating how our solution alleviates these pain points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kaafv13skVmZ8Gsfb-jEvg.png" /><figcaption>User Journey — Current State</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QoamRA6-EPD7Rkc63YDxAA.png" /><figcaption>User Journey — Ideal State</figcaption></figure><p>Additionally, we designed an app flow to visualize the user’s interaction with our app, ensuring a seamless experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*Ec-P47Ii81UmiRlMhBRhsA.png" /><figcaption>App User Flow</figcaption></figure><p>We also crafted user story descriptions to outline user goals and the actions they can perform with our app’s features, providing a clear narrative of the user experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*40CwcUOGoOO8SaOkPqDroA.png" /><figcaption>User Story Description</figcaption></figure><p>To ensure comprehensive coverage, we also developed an information architecture that maps out the necessary information and actions available on each page of the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwnQnlWgP3KShSeAOEv5MA.png" /><figcaption>Information Architecture</figcaption></figure><p>Throughout the project, we followed a structured process using two sprint iterations and managed tasks with a Kanban board. This approach allowed us to track what needed to be done, what was in progress, and what had been completed, ensuring efficient workflow and timely delivery of the project.</p><h3>Ideation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v9fQbgOKRYcn0j9otb3LnQ.png" /></figure><p>Based on our research and documentation, we developed an application named Weatherly to give the users the best times to order food and avoid weather-related issues. Weatherly provides detailed information on the <strong>optimal times </strong>to place food orders for today and tomorrow, allowing users to plan their deliveries in advance. This helps users avoid complications such as delayed deliveries or wet food packages during heavy rain.</p><p>To enhance convenience, we also created a <strong>widget </strong>that serves as a reminder for users to order their food. This widget integrates seamlessly with the app, displaying real-time data on the best times to order directly on the user’s home screen. By providing quick access to the most favorable ordering times, the widget helps users make informed decisions without needing to open the app.</p><p>Overall, Weatherly offers a comprehensive solution for managing food deliveries more effectively, regardless of weather conditions. By using both the app and its accompanying widget, users can ensure a smoother and more reliable food delivery experience, minimizing the common pitfalls associated with ordering food during bad weather.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Li52w57vYScHtYe10NTH_g.png" /></figure><p>Since we are aware of the importance of users’ local languages, we also made <strong>Weatherly available in both English and Indonesian</strong>. This ensures that more users can comfortably use the app in their preferred language, enhancing accessibility and user experience.</p><h3><strong>Code Process</strong></h3><p>In developing this app, we utilized several technologies to enhance its functionality and user experience. We used WeatherKit to gather necessary weather data, and CoreLocation to obtain the user’s current location for accurate weather detection. WidgetKit and App Groups were employed to integrate the widget seamlessly, while localization was implemented to support both English and Indonesian languages. Additionally, the app supports both light and dark modes for a comfortable visual experience. We also implement the MVVM and SOLID: Interface Segregation.</p><p>In this project, I was played as a coder and responsible for displaying the optimal times for ordering food and implementing localization.</p><h4>Optimal Time Logic</h4><p>The app covers various scenarios to provide detailed descriptions of the optimal ordering times, including:</p><ol><li>When there is no rain forecasted for today.</li><li>When the current time falls within the optimal ordering time range.</li><li>When the current time is before the optimal start time, and the start time is later today.</li><li>When the current time is before the optimal start time, and the start time is tomorrow.</li><li>If data retrieval fails or no safe time is available, the app displays “We haven’t found the optimal time yet.”</li></ol><p>This comprehensive approach ensures users receive accurate and timely information to plan their food deliveries effectively, regardless of weather conditions.</p><p>Here’s a logic code for this cases:</p><pre>if !timeList.isEmpty{<br>            let timeRange = timeList[0]<br>            <br>            let adjustedEndTime = timeRange.endTime.addingTimeInterval(1)<br>            <br>            if currentTime &gt;= timeRange.startTime &amp;&amp; currentTime &lt;= timeRange.endTime &amp;&amp; adjustedEndTime &gt;= calendar.startOfDay(for: startOfTomorrow) &amp;&amp; calendar.isDate(timeRange.startTime, inSameDayAs: startOfToday){<br>                desc = LocalizedStringKey(&quot;Enjoy standard delivery all day&quot;)<br>                timeDesc = LocalizedStringKey(&quot;No increasing delivery fee for today&quot;)<br>                <br>            }else if currentTime &gt;= timeRange.startTime &amp;&amp; currentTime &lt;= timeRange.endTime {<br>                desc = LocalizedStringKey(&quot;Order now and save on delivery&quot;)<br>                timeDesc = LocalizedStringKey(&quot;Save on delivery fee before  \(timeFormatter.string(from: adjustedEndTime))&quot;)<br>                <br>            } else if currentTime &lt; timeRange.startTime &amp;&amp; calendar.isDate(timeRange.startTime, inSameDayAs: startOfTomorrow) {<br>                desc = LocalizedStringKey(&quot;Expect higher delivery fee today&quot;)<br>                timeDesc = LocalizedStringKey(&quot;Save on delivery fee starts at \(timeFormatter.string(from: timeRange.startTime)) tomorrow&quot;)<br>                <br>            } else if currentTime &lt; timeRange.startTime &amp;&amp; calendar.isDate(timeRange.startTime, inSameDayAs: startOfToday){<br>                desc = LocalizedStringKey(&quot;It&#39;s rainy, delivery fees might go up&quot;)<br>                timeDesc = LocalizedStringKey(&quot;Save on delivery fee starts at  \(timeFormatter.string(from: timeRange.startTime))&quot;)<br>                <br>            }<br>            else {<br>                desc = LocalizedStringKey(&quot;We haven&#39;t found the optimal time yet&quot;)<br>            }<br>        } else {<br>            desc = LocalizedStringKey(&quot;We haven&#39;t found the optimal time yet&quot;)<br>            <br>        }</pre><h4>Localization</h4><p>For localization, I utilized the String Catalog to efficiently manage and organize localized strings. This approach ensures that all translatable content is centrally maintained, simplifying updates and translations. This localization can be done by:</p><p>adding a new file to project &gt; choose string catalog &gt; give name to the file &gt; build the code &gt; add language by pressing the + button &gt; build the code again &gt; add the string translation in the selected language.</p><p>For variables and strings that are not included in the String Catalog, I used LocalizedStringKey to ensure they are properly localized within the app. This method guarantees that all text, regardless of its source or context, appears correctly in the selected languages, providing a seamless and consistent user experience across different locales.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2rGjgYKXb93qxLsnytuOQ.png" /><figcaption>Localization in our App</figcaption></figure><p>To localize the content of the widget, it is essential to <strong>add target membership to the Widget Extension</strong>. This step ensures that the widget can access and display the localized strings appropriately, maintaining consistency across both the main app and its widget.</p><p>Additionally, for localizing the Info.plist file, we create a dedicated String Catalog file named InfoPlist. This file contains all the strings that need to be localized within the Info.plist, such as descriptive text, alerts, or other informational content. When the app is built, the localization system will reference this catalog and include the available strings in the localized versions of the Info.plist file, ensuring that all information is presented in the appropriate language. This comprehensive approach allows for a unified localization process across the entire app and its associated widget, enhancing the overall user experience for diverse audiences.</p><h4>Last but not least</h4><p>As we wrap up this project, I want to share a key lesson that might help with your own app development:</p><blockquote>“When starting a new project and feeling overwhelmed, don’t let doubt stop you. Jump in and tackle each challenge as a chance to learn. You’ll often find that what seemed hard at first is actually manageable, and you’re more capable than you think.”</blockquote><h4>Thank You All!! 💫🫶🏻</h4><p>© 2024 Lucinda Artahni. All Rights Reserved.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9cf3a95e943" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Share Your Perfect Workspace: Cooworka’s Engaging Review System — Part 1]]></title>
            <link>https://medium.com/@cindaarta16/share-your-perfect-workspace-cooworkas-engaging-review-system-part-1-8bc381d59f7d?source=rss-8f45baafaa3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bc381d59f7d</guid>
            <category><![CDATA[mobile-application]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[ui-ux-design]]></category>
            <category><![CDATA[gamification]]></category>
            <dc:creator><![CDATA[Cinda]]></dc:creator>
            <pubDate>Fri, 05 Jul 2024 04:18:21 GMT</pubDate>
            <atom:updated>2024-07-05T04:18:21.966Z</atom:updated>
            <content:encoded><![CDATA[<h3>Share Your Perfect Workspace: Cooworka’s Engaging Review System — Part 1</h3><h3>Cooworka Overview</h3><p>Cooworka is an application that encourages people to share their experiences of working from cafes by writing reviews through an engaging gamified app experience.</p><h3>Role</h3><p><a href="http://www.linkedin.com/in/lucinda-artahni">Lucinda Artahni — IOS Developer</a><br><a href="https://www.linkedin.com/in/natasha-hartanti-winata/">Natasha Hartanti Winata — IOS Developer</a><br><a href="https://www.linkedin.com/in/sherly-phangestu/">Sherly Phangestu — IOS Developer</a><br><a href="http://www.linkedin.com/in/aileenchalinawijaya/">Aileen Chalina Wijaya — UI/UX Designer, Illustrator</a><br><a href="https://www.linkedin.com/in/shazkiaaulia/">Shazkia Aulia Shafira Dewi — UI/UX Designer</a></p><h3>My role &amp; responsibility</h3><p>Hi, I am Lucinda! In this project I worked as a IOS Developer and UX Researcher, some of my responsibility are:</p><ul><li>Conduct user research and validate problems with the users</li><li>Prioritize features that will be implemented to the application for the first iteration</li><li>Create an ERD &amp; Class diagram for modeling the data needs in App</li><li>Build an animation &amp; micro-interactions in coding with Swift</li><li>Create the Front end of the app</li></ul><p>It’s impossible to create an app without doing research, right? Before developing a mobile app, we conduct research to enhance our ability to solve problems, understand the target audience, and provide a better user experience.</p><h3>Identifying Problem</h3><p>We begin with the brainstorming ideas. We looked for some interesting topics, and we considered several options such as finances, daily work, and travel. We agree that travel has the potential to incorporate gamified concepts. So, the important question is: How do we enhance enthusiasm for traveling through a gamified app? After exploring the possibilities, we initially decided to make an app for exploring Indonesia. But our research doesn’t end there. Due to several considerations during this process, we revised our goals multiple times.</p><p>In the next steps, we created guiding questions to deepen our understanding of the topic. This was followed by desk research and interviews to identify the problems people face when exploring tourism in Indonesia. After conducting several interviews, we found that there are no significant pain points for exploring tourism in Indonesia. Some people are not interested in traveling due to external factors, such as the condition of tourist attractions, and internal factors, such as money and time. Therefore, we concluded that this topic cannot be used for a gamified application.</p><p>After doing some research, we found that many people face difficulties when searching for suitable cafes to work from due to a lack of detailed information about essential facilities. Key aspects such as the availability of power sockets, the quality of the wifi, and the comfort of chairs and tables are crucial for remote workers but are often not readily available. Without this information, finding a work-friendly cafe can be frustrating.</p><p>To understand where this information could come from, we looked into common sources and discovered that most individuals rely on online reviews to get an idea about a cafe’s amenities and overall environment. Reviews often contain valuable insights from other patrons, making them a potential goldmine for the specific details needed by those working remotely. Realizing this opportunity, we saw that leveraging these reviews could provide remote workers with the detailed information they need. However, we also identified a significant barrier: many people are reluctant to write reviews due to the lack of rewards or incentives, the long process of review, and a general feeling of unappreciation. Therefore, our problem statement is this:</p><blockquote>We aim to create <strong>an app that encourages people to share their experiences of working from cafes by writing reviews through an engaging gamified experience.</strong></blockquote><p>By seamlessly integrating exploration and review processes, our app not only makes it easier for users to find the best cafes but also motivates them to contribute valuable insights in a fun and rewarding way.</p><p>To overcome these challenges, we explored the concept of gamification as a means to motivate people to contribute reviews. Gamification involves adding game-like elements such as points, badges, and leaderboards to non-game contexts, which can make the process more engaging and rewarding. By incorporating these elements, we aim to encourage more users to share their experiences. Additionally, we designed a review form that is straightforward and easy to complete, ensuring it captures all the essential information needed for working from cafes without being overly time-consuming.</p><blockquote>Our solution is an <strong>app that motivates people to share their work-from-cafe experiences by writing a review in a gamified app, simplifying the review process and creating a community-driven resource to help remote workers find the best cafes for their needs.</strong></blockquote><h3>Our Process</h3><h4>User Persona</h4><p>We’ve developed a user persona for our potential users, Max, A remote worker who enjoys helping others, easily gets bored, prefers working outside the home, and likes exploring new places. He has pain points such as crowded cafes, unreliable Wi-Fi, limited power outlets, incomplete information on cafe facilities for working, low motivation to leave reviews, time-consuming cafe research, and complicated review processes. On the other hand, he also has a gain points such as looking for comfortable and productive work environments, reliable cafe information, an easy method to find suitable places to work, discovering inspiring locations, sharing their experiences, and providing feedback.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XOgU1Hl2aJDnhg_qZgd42Q.jpeg" /><figcaption>User Persona</figcaption></figure><h4>Customer Journey Map</h4><p>After defining our persona, we moved on to creating a <strong>Customer Journey Map</strong>. The customer journey map is divided into two parts: <strong>the current state</strong>, which shows the user’s journey with the current solutions, highlighting the pain points in each phase, and <strong>the ideal state</strong>, which illustrates the user’s journey when using our app, Cooworka.</p><p><strong>Current State</strong><br>The current state consists of four phases: researching cafes, activities at the destination, writing reviews, and retention. The existing solutions for the phases of researching cafes and activities at the destination involve using social media and search engines. However, the pain points for users lie in the phases of writing reviews and retention, with the existing solution being Google Maps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GGL06lodbO2_e2xw" /><figcaption>Customer Journey Map — Current State</figcaption></figure><p><strong>Writing Reviews Phase:</strong><br>Users face several lengthy actions:</p><ul><li>After finding the cafe name, they must scroll down to find the text box for writing a review.</li><li>They need to rate overall experience, food, atmosphere, and provide detailed experience, photos, and food details.</li></ul><p>Despite the lengthy questions, there are no questions related to WFC (Working From Cafe), such as WiFi quality, the number of power outlets, and seating comfort. Additionally, users do not receive tangible rewards, leading to disappointment and a feeling that writing reviews is not beneficial. This extends into the retention phase, where users feel demotivated to write reviews due to a lack of personal benefits.</p><p><strong>Ideal State<br></strong>This issue can be addressed through gamification to motivate users to complete reviews, especially those related to WFC aspects like WiFi quality, the number of power outlets, and seating comfort. In the ideal state, we focus on motivating users during the review-writing and retention phases using Cooworka.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KRUHJByXsGrjEClV" /><figcaption>Customer Journey Map — Ideal State</figcaption></figure><p><strong>Addressing the Core Issues<br></strong>Upon deeper analysis, we realized that exploration and reviews are inseparable. The act of exploring cafes and writing reviews is a continuous cycle where each phase influences the other. Solving the core issue starts from the research cafe phase and extends to the activities at the destination.</p><p>Initially at the research cafe phase, users look for recommendations and read detailed information about cafes to decide where to work. They seek specific details that support WFC (Working From Cafe) activities, such as:</p><ul><li><strong>WiFi Quality:</strong> Users need reliable and fast internet to work efficiently.</li><li><strong>Number of Power Outlets:</strong> Availability of power outlets is crucial for charging devices and ensuring uninterrupted work sessions.</li><li><strong>Seating Comfort:</strong> Comfortable seating is important for long working hours.</li><li><strong>Other Facilities:</strong> Additional facilities like quiet ambiance, and available refreshments also play a significant role.</li></ul><p>Currently, finding this detailed information can be cumbersome and scattered across different platforms, making it difficult for users to get a comprehensive view of the best cafes for WFC.</p><p><strong>Gamification Process<br></strong>The gamification process starts at the activities at the destination phase, making the user journey more engaging and rewarding.</p><p><strong>1. Seamless Check-In:<br></strong>When users arrive at the cafe, our app makes the check-in process engaging by allowing them to seamlessly check in by claiming a mystery chest upon arrival, which remains locked initially. Users then choose a seat near a power outlet and begin their WFC activities. The excitement of unlocking the chest by writing a review adds an element of fun and motivation.</p><p><strong>2. Writing Reviews:<br></strong>To unlock the mystery chest, users must write a review. While writing reviews with our app, users receive notifications to leave a review. The review form is easy to fill out and focuses on WFC details like WiFi quality, number of power outlets, seating comfort, and other supportive WFC information. The more detailed the review, the more XP the user earns!</p><p><strong>3. Rewards and Retention:<br></strong>Users not only earn XP, they also collect cute accessories and collectible items that can be used to customize their avatars. This leads to increased motivation to write reviews and collect rewards, enhancing user retention.</p><p>By integrating gamification, we aim to solve the pain points in the review-writing and retention phases, transforming the user experience into an engaging and rewarding journey. This experience motivates them to write reviews, which in turn helps others in the research phase, creating a virtuous cycle.</p><h4>Competitor Analysis</h4><p>Beside conducting interviews, we undertook a comprehensive investigation to identify our competitors that offer similar features to those in our app. We analyzed these competitor apps to determine what specific attributes and functionalities make them popular and widely used by people seeking cafes. This involved comparing several leading applications commonly used by people when searching for a cafe to visit.</p><p>Furthermore, our analysis extended beyond identifying strengths; we also focused on uncovering the pain points and drawbacks users experience with these competing apps. By pinpointing areas where these apps fall short, we aimed to gain critical insights that would allow us to address and improve these issues in our own app. Our goal was to not only match but exceed the user experience provided by our competitors, ensuring our app stands out as the superior choice for cafe enthusiasts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9lwkCXTs5YqF6yw6" /><figcaption>Competitor Analysis</figcaption></figure><h4>Determine Gamification Elements Using Octalysis</h4><p>Octalysis, developed by Yu-kai Chou, is a comprehensive framework for understanding and designing engaging user experiences through gamification. It breaks down the concept of gamification into eight core drives: Epic Meaning &amp; Calling, Development &amp; Accomplishment, Empowerment of Creativity &amp; Feedback, Ownership &amp; Possession, Social Influence &amp; Relatedness, Scarcity &amp; Impatience, Unpredictability &amp; Curiosity, and Loss &amp; Avoidance. Each drive addresses a different aspect of human motivation, providing a balanced approach to designing activities that are not only enjoyable but also intrinsically motivating.</p><p>We brainstormed a variety of gamification elements that we believed would enhance the user experience in our app. The first element we focused on is Development &amp; Accomplishment. To bring this to life, we decided to implement a level system where users can earn experience points (XPs) through their activities. As users accumulate XPs, they can level up, providing a clear and rewarding sense of progression and achievement. Additionally, we planned to introduce a competitive edge by incorporating a leaderboard. This feature will allow users to compete with one another for the top rank, fostering a healthy competitive spirit and encouraging ongoing engagement.</p><p>The second element we explored is Ownership &amp; Possession, which we plan to execute by offering a collection of virtual items that users can acquire. These items will be obtained through a mysterious process, where users won’t know in advance which item they will receive. This element of surprise not only taps into the Ownership &amp; Possession drive but also integrates the Unpredictability &amp; Curiosity aspect of gamification. By keeping the item acquisition process unpredictable, we aim to maintain a high level of excitement and anticipation among users, motivating them to continue using the app and discovering new items.</p><h4>Gamification Analysis</h4><p>Based on the research and gamification elements we have defined, we have compiled our findings and detailed them in this gamification design template. This template helps us clearly outline our objectives, user persona, desired actions, feedback mechanisms, and the rewards provided through our gamification strategy. By creating this template, we aim to seamlessly integrate our research findings, ensuring that we can more precisely define the gamification aspects of our solution. Additionally, it allows us to better articulate the rewards system, making the gamification elements clearer and more impactful for our users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R8ZzhYxZKAekZLbb.png" /><figcaption>Gamification Analysis</figcaption></figure><h3>Introducing Our Solution Concept: Cooworka! 🎊</h3><p>After an extensive research journey, we’re excited to present Cooworka — an innovative app that revolutionizes the way people share their experiences of working from cafes through an engaging gamified approach.</p><p><strong>Explore What Cooworka Offers:</strong></p><ol><li><strong>Find Your Ideal Cafe </strong><br>Discover nearby cafes tailored to your work preferences with Cooworka’s comprehensive search feature. Whether you need strong wifi, ergonomic seating, meeting rooms, smoking areas, parking facilities, places of worship, or reliable electricity, Cooworka helps you find the perfect spot to work.</li><li><strong>Detailed Cafe Insights </strong><br>Dive into comprehensive details about cafes, including ratings, electricity availability, wifi quality, pricing, exact location, operating hours, and amenities like ergonomic furniture, meeting rooms, smoking area, and parking facilities.</li><li><strong>Earn Rewards by Sharing<br></strong> Engage with Cooworka’s rewarding gamification system where each review unlocks mysterious rewards stored in chests. Receive reminders to claim rewards, motivating ongoing participation and enhancing your cafe exploration.</li><li><strong>Streamlined Review Process</strong><br>Simplify your experience with Cooworka’s intuitive review form. Rate and provide detailed feedback on wifi strength, power outlets, comfort levels, and more. Earn XP for thorough reviews and improved interaction.</li><li><strong>Valuing User Feedback</strong><br>At Cooworka, user reviews are invaluable guides that inform others. Each review uncovers top cafes and highlights amenities like reliable wifi, comfortable seating, parking availability, and more. As reviews accumulate, they dynamically capture evolving experiences, offering real-time insights that enrich cafe exploration. User feedback drives visible improvements, empowering users to make informed choices and contribute to our vibrant cafe community.</li><li><strong>Personalize Your Avatar</strong><br>Customize your digital presence with rewards from Cooworka. Unlock accessories and outfits by writing reviews and leveling up with earned XP, creating a unique digital persona that grows with your contributions.</li></ol><h3>Visualization Process 🎨</h3><h4>Brand design</h4><p>Cooworka exists to help users easily share their reviews and insights about cafes. Designed to foster a sense of community, productivity, and trustworthiness, Cooworka thrives on human insight. The Cooworka logo features a chat bubble and a parrot, symbolizing the community we build and the sharing of valuable information. The blue in the logo signifies trustworthiness, and the Sans-Serif font is chosen to convey a friendly, enjoyable, and minimalist feel. We use Nunito for title and sub title, and SF Pro for the body text. We have develop a design system to ensure efficient and consistent design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GsM3bUEizPHXwUE9HUK3pg.gif" /><figcaption>Cooworka App Logo</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RZFC4SYm74imYtYLFAHs9g.png" /><figcaption>Font and Color Palette</figcaption></figure><h4>Design (Lo-Fi &amp; Hi-Fi)</h4><p>After finalizing the brand design, we proceeded to design the user flow and create the low-fidelity and high-fidelity versions of the app. Our goals for this application are:</p><p>1. Minimize fake reviews by implementing a “check-in process.” Users can review cafes only if they open the app and press the check-in button, which is active only when they are in the cafe.</p><p>2. Motivate users to complete the review fields by adding an XP counter to increase user engagement.</p><p>3. Avoid confusion when users enter the application by providing cafe recommendations based on categories.</p><p>This goal helps us to determine the UI/UX design that will be created. We start with brainstorming and sketching, and once we believe it’s sufficient, we proceed to develop it into a high-fidelity design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CwIR1ywEgg6cgzCZtNI-3g.gif" /><figcaption>Lo-Fi &amp; Hi-Fi Comparison</figcaption></figure><p>Cooworka relies heavily on user feedback. We aim to create an application that is easy to use and enjoyable. Therefore, we conduct user testing with our target audience. Check out the next part to see how users feel about Cooworka!</p><h4><a href="https://medium.com/@cindaarta16/share-your-perfect-workspace-cooworkas-engaging-review-system-part-2-36b21db072cc">Click here to read Part 2!!</a></h4><p>© 2024 Aileen Chalina Wijaya, Lucinda Artahni, Natasha Hartanti Winata, Shazkia Aulia Shafira Dewi, Sherly Phangestu. All Rights Reserved.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bc381d59f7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Share Your Perfect Workspace: Cooworka’s Engaging Review System — Part 2]]></title>
            <link>https://medium.com/@cindaarta16/share-your-perfect-workspace-cooworkas-engaging-review-system-part-2-36b21db072cc?source=rss-8f45baafaa3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/36b21db072cc</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ui-ux-design]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[mobile-application]]></category>
            <category><![CDATA[gamification]]></category>
            <dc:creator><![CDATA[Cinda]]></dc:creator>
            <pubDate>Fri, 05 Jul 2024 04:17:24 GMT</pubDate>
            <atom:updated>2024-07-05T04:18:50.546Z</atom:updated>
            <content:encoded><![CDATA[<h3>Share Your Perfect Workspace: Cooworka’s Engaging Review System — Part 2</h3><h3>User Usability Testing</h3><p>Exciting Phase! The User Testing Phase.<br>We create a user testing sheet that includes scenarios, success factors, and an observation checklist.</p><blockquote>Our scenario is: “Write a review and submit to see what happens!”</blockquote><p>Our success criteria are :</p><p>1. Writing and submitting a review should increase the user’s level. Users understand this because when a review is submitted, the XP points on the progress bar increase.</p><p>2. Writing and submitting a review should help users level up faster. Users understand this because the more comprehensive the review, the more XP points they earn.</p><p>3. Writing five reviews on the same topic should earn users a badge. Users understand this because after writing five reviews on the same topic, the badge unlocks on their profile.</p><p>After that, we meet with our target users and show them our prototype, observing whether the scenarios unfold as expected. All the scenarios do occur. Based on the feedback, most of the comments were about minor issues such as design consistency, copywriting, and the efficiency of the displayed information.</p><h3>What’s Changed?</h3><p>Not only from user testing, but we also sought the expertise of our design mentors to further refine the user flow and enhance the overall user experience. Their feedback was invaluable, providing a fresh perspective and professional guidance that helped us make informed decisions. Here are the key highlights of the significant changes we have implemented:</p><p><strong>Less Tab Bar<br></strong>We merged the review and explore pages into a single interface to eliminate redundant functionalities. Now, the explore page greets users every time they open the app, allowing them to check in at nearby cafes or search for specific cafes in one convenient location. We also recognized that not all of our ideas could be implemented in this phase, so we decided to develop the leaderboard feature in the next phase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VIW3_tzJaG3yMwL6" /><figcaption>Before &amp; After — Tab Bar</figcaption></figure><p><strong>Engaging User To Review<br></strong>Instead of giving users a direct reward, we introduced a mysterious chest! This decision aims to increase users’ curiosity and encourage them to reopen our app after checking in, as well as motivate them to write reviews.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_PuWykMrm65scH5n" /><figcaption>Before &amp; After — Engagement for Reviewing</figcaption></figure><p><strong>Dress Your Avatar<br></strong>To make our app more engaging as a gamification platform, we introduced a virtual pet feature. Users can dress their avatars with collected items, which they earn through writing reviews. This addition aims to encourage users to write more reviews and unlock additional items, enhancing their overall experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E9AWWAJlZLycwb6g" /><figcaption>Before &amp; After — Profile</figcaption></figure><h3>Final User Interface</h3><p>And here you go, a glimpse of our final app design!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*orS1qFkOyDNUETXs" /><figcaption>Final UI of Cooworka App</figcaption></figure><h3>Highlight Features</h3><p><strong>Minimize Fake Reviews<br></strong>To minimize fake reviews, our app uses Core Location to ensure authenticity. Users are required to visit the cafe before they can write a review. The GPS will confirm their location, allowing them to write a review only after a visit. This process ensures that the reviews are genuine and trustworthy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L6T0mhD5nAOhbma_UWvsSA.png" /><figcaption>Minimize Fake Reviews</figcaption></figure><p><strong>Offer Reward<br></strong>As part of our gamification strategy, we use a reward system to encourage users to write reviews. Users receive a mysterious reward inside a chest, which can only be unlocked by writing a review. For those who prefer to write a review later, the app provides a reminder notification about the locked chest, encouraging them to complete the review to claim their reward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RNaSTCYFi8eADzpy4bjKgA.png" /><figcaption>Offer Reward</figcaption></figure><p><strong>Engaging Review Form<br></strong>Understanding that some users might find writing reviews tedious or challenging, we designed an engaging and easy-to-fill review form. This form covers essential information about the cafe, such as wifi connection, power outlets, comfortable furniture, and other facilities. Additionally, users earn XPs for completing each section of the form, motivating them to provide comprehensive reviews to gain maximum XPs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ppNQoWJ1BxdHZM3Oxlc7g.png" /><figcaption>Engaging Review Form</figcaption></figure><p><strong>Dress Your Avatar<br></strong>To further incentivize reviews, we introduced a feature where users can dress up their avatars with items earned through reviews. Users can collect a variety of accessories, encouraging them to write more reviews to unlock these items one by one. By collecting XPs to level up, users can unlock cool accessories, turning their avatars into a reflection of their review activity. It’s like having a digital wardrobe that expands with each review you write.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qqzNPaMHGuSzrCiVf0HFFw.png" /><figcaption>Dress Your Avatar</figcaption></figure><h3>Technical Coding Process</h3><h4>ERD &amp; Class Diagram</h4><p>We also developed a detailed class diagram and ERD documentation to clearly define the components of our system: the entities (similar to objects), their attributes (specific details about each entity), and their relationships. The class diagram visually represented each entity and its attributes. Meanwhile, the ERD demonstrated how these entities interact, emphasizing connections and utilizing foreign keys to establish links across our data. These documents enhanced our understanding of the system, facilitated discussions with others, and provided a blueprint for structuring data within CloudKit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/0*hxUtYPwQShhA2kQf" /><figcaption>Class Diagram</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/0*eQtxbQOtHupmzXWI" /><figcaption>ERD</figcaption></figure><h3>Technical Frameworks in Cooworka</h3><p>On the technical side, Cooworka leverages several powerful frameworks to create a seamless and engaging user experience. Let’s dive into the details:</p><p><strong>1. AuthenticationServices</strong><br>We use AuthenticationServices to allow users to sign in with Apple. This not only provides a secure and convenient way for users to access the app but also integrates smoothly with other Apple services. By simplifying the sign-in process, we ensure that users can quickly get started with exploring and reviewing cafes without any hassle. Sign In with Apple is particularly crucial for Cooworka because it provides a User ID that serves as a unique identifier within our database. This unique User ID is then utilized in CloudKit to synchronize and manage user-posted reviews effectively. By leveraging this feature, we can maintain the integrity and accuracy of user data across the app.</p><p><strong>2. MapKit</strong><br>MapKit is employed to fetch location data and display cafe addresses. With MapKit, users can easily find cafes nearby or explore new ones on the map. This integration makes it simple for users to navigate and discover the best spots for working from cafes (WFC). MapKit allows us to fetch detailed cafe data, including the cafe’s name, address, coordinates, and distance from the user’s location. This information is used to display nearby cafes, enhancing the user’s ability to find suitable workspaces quickly.</p><ul><li><strong>Displaying Nearby Cafes:</strong> When users open the app, MapKit retrieves the location data and displays a list of nearby cafes based on their current location. This helps users quickly find cafes in their vicinity without having to search manually.</li><li><strong>Search Bar Integration:</strong> The search bar leverages MapKit to fetch and display cafes that match the user’s query. As users type, the search results dynamically update to show the most relevant cafes, making it easy to find specific locations or discover new options.</li><li><strong>Explore Page:</strong> On the Explore page, users can select a location, and MapKit updates the list to show cafes around the chosen area. This feature is particularly useful for users planning to visit a different part of town or exploring cafes in a new city.</li><li><strong>Apple Maps Data:</strong> By integrating with Apple Maps, MapKit provides accurate and up-to-date information about cafes. This ensures that users have reliable data, including the latest addresses and coordinates, enhancing their overall experience.</li></ul><p>MapKit’s robust features and seamless integration with Apple Maps enable Cooworka to provide detailed and reliable cafe information, making it easy for users to find and explore the best cafes for working.</p><p><strong>3. CoreLocation<br></strong>CoreLocation plays a crucial role in verifying user locations. To minimize fake reviews, we use CoreLocation to confirm that users are physically present at a cafe before they can leave a review. This ensures the authenticity of reviews and enhances trust within the community.</p><ul><li><strong>Location Verification:</strong> Before a user can submit a review, CoreLocation checks their current GPS coordinates. If the user is within the predefined radius of the cafe’s coordinates, they are allowed to write and submit their review. This step ensures that reviews are genuine and based on actual visits. In Cooworka, we set a tolerance of 50 meters between the user’s location and the cafe coordinates. This allows users to seamlessly check-in and claim rewards like mystery chests.</li><li><strong>Location-Based Features:</strong> CoreLocation also powers several other location-based features within the app. For example, when users open the app, it automatically detects their location and suggests nearby cafes. This personalized experience makes it easier for users to discover new places to work from.</li><li><strong>Privacy and Permissions:</strong> We prioritize user privacy by requesting location permissions only when necessary. Users are prompted to grant location access when they first attempt to leave a review or when they want to discover nearby cafes.</li><li><strong>Enhanced User Experience:</strong> By verifying user locations and providing accurate suggestions based on their proximity, CoreLocation significantly enhances the overall user experience. Users can trust that the reviews they read are genuine and can easily find cafes that are conveniently located.</li></ul><p>CoreLocation is integral to maintaining the authenticity of reviews on Cooworka, providing users with a trustworthy and seamless experience. By leveraging precise location data, we ensure that every review is credible and valuable to the community.</p><p><strong>4. CloudKit<br></strong>CloudKit is used to synchronize user-posted reviews across devices. This cloud-based solution allows users to access their reviews anytime, anywhere. It also ensures that all reviews are up-to-date and available to the entire community, fostering a rich and reliable resource of cafe information.</p><ul><li><strong>Real-Time Updates:</strong> CloudKit supports real-time data updates. When a user posts a new review or updates an existing one, the changes are instantly reflected across all devices and visible to the entire community. This real-time capability ensures that the latest information is always available to users, enhancing the app’s reliability and user engagement.</li><li><strong>User Authentication and Security:</strong> CloudKit works seamlessly with AuthenticationServices, particularly Sign In with Apple. This integration ensures that each user’s data is secure and tied to their unique User ID. Only authenticated users can access their data, providing a high level of security and privacy.</li><li><strong>Data Organization:</strong> Reviews and other user-generated content are organized efficiently within CloudKit. Each review is linked to the user’s unique ID, making it easy to manage and retrieve data. This organization also supports advanced querying capabilities, allowing users to search and filter reviews based on various criteria such as location, rating, and date.</li><li><strong>Collaboration Features:</strong> CloudKit also supports collaborative features. Users can rate each other’s reviews as helpful, fostering a community-driven environment. These interactions are also synchronized in real-time, enhancing community engagement and making the app more interactive.</li></ul><p>By leveraging CloudKit, Cooworka ensures that user-generated content is reliably stored, synchronized, and accessible, providing a robust foundation for the app’s review-based features. This cloud-based solution is crucial for maintaining data integrity, security, and scalability, ensuring a smooth and engaging user experience.</p><p><strong>5. PhotosUI<br></strong>We incorporate PhotosUI for photo picking from the gallery. Users can easily add photos to their reviews, providing visual context and making the reviews more informative and engaging. PhotosUI simplifies the process of selecting and uploading images, enhancing the overall user experience.</p><p><strong>6. Combine<br></strong>Combine is used for handling asynchronous events and data streams. This powerful framework allows us to manage real-time updates and interactions smoothly, ensuring that the app remains responsive and performs well under various conditions. Whether it’s fetching the latest reviews or updating user data, Combine helps keep everything running efficiently.</p><ul><li><strong>@Published Properties:</strong> Combine allows us to use @Published properties in our view models, which automatically notify SwiftUI views of any changes. This ensures that the UI is always up-to-date with the latest data, providing a responsive user experience.</li><li><strong>Data Binding:</strong> With Combine, we can bind our data streams to UI components, ensuring that any changes in data are immediately reflected in the UI. This is crucial for features like displaying search results and updating user reviews in real-time.</li><li><strong>Subscription Management:</strong> Combine helps manage subscription lifecycles with AnyCancellable, ensuring that resources are allocated efficiently and preventing memory leaks. This is particularly important for handling multiple asynchronous tasks without compromising performance.</li><li><strong>Asynchronous Operations:</strong> Combine excels at managing asynchronous operations, such as network requests or data fetching. In the context of Cooworka, Combine is used to fetch and update cafe information, synchronize user reviews, and handle location updates seamlessly.</li></ul><p>By leveraging Combine, Cooworka maintains a smooth and efficient user experience, handling real-time data updates and asynchronous tasks effectively.</p><p><strong>7. SwiftUI<br></strong>SwiftUI is the backbone of our user interface. With SwiftUI, we create dynamic, visually appealing, and user-friendly interfaces. Its declarative syntax and seamless integration with other Apple frameworks enable us to build a cohesive and intuitive app experience. SwiftUI also allows for rapid development and easy updates, keeping Cooworka fresh and engaging.</p><p><strong>8. Foundation<br></strong>Foundation is the core framework that provides essential data types, collections, and operating-system services. It’s the fundamental layer that supports the app’s functionalities. From managing data to handling network requests, Foundation ensures that all the underlying processes work smoothly and efficiently.</p><p>By leveraging these frameworks, we create an app that’s not only feature-rich but also reliable and user-friendly. Cooworka aims to provide a seamless experience for users to explore, review, and share their favorite cafes for working. With robust technical foundations and a focus on user engagement, we’re committed to making Cooworka the go-to app for WFC enthusiasts.</p><h3>Code Explanation: MapKit &amp; CoreLocation for Searching Nearby Cafes</h3><p>In our app, we use MapKit and CoreLocation to fetch and display nearby cafes based on the user’s current location. This integration provides users with a seamless experience when searching for and navigating to cafes suitable for working from cafes (WFC). Here’s how the code is structured and how each part contributes to the functionality:</p><p><strong>Initial Setup and Location Management</strong></p><pre>import Foundation<br>import Combine<br>import CoreLocation<br>import MapKit<br><br>class SearchViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {<br>    @Published var currentLocation: CLLocationCoordinate2D?<br>    @Published var searchCafeResults: [SearchCafe] = []<br>    @Published var nearbyCafeLocations: [SearchCafe] = []<br>    <br>    private var locationManager: CLLocationManager<br>    private var cancellable: AnyCancellable?<br>    <br>    override init() {<br>        self.locationManager = CLLocationManager()<br>        super.init()<br>        self.locationManager.delegate = self<br>        self.locationManager.desiredAccuracy = kCLLocationAccuracyBest<br>        self.locationManager.requestWhenInUseAuthorization()<br>        self.locationManager.startUpdatingLocation()<br>    }<br>}</pre><p>In this section, we import the necessary libraries and set up the SearchViewModel class. We declare published properties to hold the user’s current location, search results, and nearby cafe locations. The CLLocationManager is initialized to manage location updates, and its delegate is set to self.</p><p><strong>Requesting Current Location</strong></p><pre>func requestCurrentLocation() {<br>    self.locationManager.startUpdatingLocation()<br>}<br><br>func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {<br>    guard let location = locations.first else { return }<br>    self.currentLocation = location.coordinate<br>    self.locationManager.stopUpdatingLocation()<br>    self.fetchNearbyLocations(location: location)<br>}</pre><p>Here, we define a function to start updating the user’s location. When the location is updated, the didUpdateLocations delegate method is called, where we capture the first location, set it as the current location, and stop further updates. Then, we fetch nearby cafe locations based on this updated location.</p><p><strong>Searching Cafe Locations Based on User Query</strong></p><pre>func searchLocations(query: String) {<br>    let request = MKLocalSearch.Request()<br>    request.naturalLanguageQuery = query<br>    <br>    let search = MKLocalSearch(request: request)<br>    search.start { [weak self] response, error in<br>        guard let response = response else { return }<br>        self?.searchCafeResults = response.mapItems.compactMap {<br>            guard let name = $0.name,<br>                  let address = $0.placemark.title else {<br>                return nil<br>            }<br>            <br>            let rating = $0.pointOfInterestCategory == .cafe ? 4.5 : 4.0 // Dummy rating<br>            let totalRatings = Int.random(in: 1...10) // Dummy total ratings<br>            let openHours = &quot;09:00 - 22:00&quot; // Dummy open hours<br>            let distance = self?.calculateDistance(from: $0.placemark.coordinate) ?? 0.0<br>            let wifi = &quot;Wifi Kuat&quot;<br>            let powerOutlet = 2<br>            return SearchCafe(name: name,<br>                              coordinate: $0.placemark.coordinate,<br>                              address: address,<br>                              rating: rating,<br>                              totalRatings: totalRatings,<br>                              openHours: openHours,<br>                              distance: distance,<br>                              wifi: wifi,<br>                              powerOutlet: powerOutlet)<br>        }<br>    }<br>}</pre><p>This function handles the search functionality. It takes a user query, creates a search request, and performs the search using MKLocalSearch. The results are processed to extract relevant cafe information, such as name, address, rating, distance, WiFi quality, and power outlets, which are then stored in searchCafeResults.</p><p><strong>Fetching Nearby Cafe Locations</strong></p><pre>func fetchNearbyLocations(location: CLLocation) {<br>    let request = MKLocalPointsOfInterestRequest(center: location.coordinate, radius: 1000)<br>    request.pointOfInterestFilter = MKPointOfInterestFilter(including: [.restaurant, .cafe, .bakery])<br>    <br>    let search = MKLocalSearch(request: request)<br>    search.start { [weak self] response, error in<br>        guard let response = response else { return }<br>        self?.nearbyCafeLocations = response.mapItems.compactMap {<br>            guard let name = $0.name,<br>                  let address = $0.placemark.title else {<br>                return nil<br>            }<br>            <br>            let rating = $0.pointOfInterestCategory == .cafe ? 4.5 : 4.0<br>            let totalRatings = 0<br>            let openHours = &quot;09:00 - 22:00&quot; // Dummy open hours<br>            let distance = location.distance(from: CLLocation(latitude: $0.placemark.coordinate.latitude, longitude: $0.placemark.coordinate.longitude)) / 1000<br>            let wifi = &quot;Wifi Kuat&quot;<br>            let powerOutlet = 2<br>            return SearchCafe(name: name,<br>                              coordinate: $0.placemark.coordinate,<br>                              address: address,<br>                              rating: rating,<br>                              totalRatings: totalRatings,<br>                              openHours: openHours,<br>                              distance: distance,<br>                              wifi: wifi,<br>                              powerOutlet: powerOutlet)<br>        }<br>    }<br>}</pre><p>In this function, we fetch cafes near the user’s current location. We create a request with a specified radius and filter it to include restaurants, cafes, and bakeries. The search results are processed similarly to the search function, extracting relevant cafe details and storing them in nearbyCafeLocations.</p><p><strong>Calculating Distance</strong></p><pre>private func calculateDistance(from coordinate: CLLocationCoordinate2D) -&gt; Double {<br>    guard let currentLocation = currentLocation else {<br>        return 0.0<br>    }<br>    let currentCLLocation = CLLocation(latitude: currentLocation.latitude, longitude: currentLocation.longitude)<br>    let targetCLLocation = CLLocation(latitude: coordinate.latitude, longitude: coordinate.longitude)<br>    return currentCLLocation.distance(from: targetCLLocation) / 1000 // Distance in km<br>}</pre><p>This utility function calculates the distance between the user’s current location and a given coordinate. The distance is calculated in kilometers and used to provide users with proximity information for nearby cafes.</p><p>This code integrates MapKit and CoreLocation to provide a comprehensive solution for searching and displaying nearby cafes. The SearchViewModelmanages the user’s location, performs searches based on user queries, fetches nearby cafes, and calculates distances, all of which enhance the user experience by providing detailed and relevant cafe information for WFC activities.</p><h3>Code Explanation: MapKit &amp; CoreLocation for Searching Locations</h3><p>In this example, we use MapKit and CoreLocation to fetch and display locations based on the user’s current position. This integration allows users to search for specific locations and fetch nearby places, providing a seamless and engaging user experience. Here’s how the code is structured and what each part does:</p><p><strong>Initial Setup and Location Management<br></strong>The initial setup and location management code are the same as in the previous example for searching nearby cafes. We initialize the LocationViewModel class, declare published properties to hold the user’s current location, search results, and nearby locations, and set up the CLLocationManager to manage location updates.</p><p><strong>Requesting Current Location<br></strong>The code for requesting the current location and updating it is also the same as in the previous example. This part of the code starts updating the user’s location and stops once the location is fetched. It then calls the function to fetch nearby locations based on the current location.</p><p><strong>Search Locations</strong></p><pre>func searchLocations(query: String) {<br>    let request = MKLocalSearch.Request()<br>    request.naturalLanguageQuery = query<br>    <br>    let search = MKLocalSearch(request: request)<br>    search.start { [weak self] response, error in<br>        guard let response = response else { return }<br>        self?.searchResults = response.mapItems.compactMap {<br>            Location(name: $0.name ?? &quot;Unknown&quot;, coordinate: $0.placemark.coordinate)<br>        }<br>    }<br>}</pre><p><strong>Search Locations:</strong> The searchLocations function allows users to search for specific places based on a query. It uses MKLocalSearch to perform the search and then processes the results to extract names and coordinates.</p><p><strong>Fetching Nearby Locations</strong></p><pre>func fetchNearbyLocations(location: CLLocation) {<br>    CLGeocoder().reverseGeocodeLocation(location) { [weak self] placemarks, error in<br>        guard let placemark = placemarks?.first else { return }<br>        var nearbyLocations: [Location] = []<br>        <br>        if let areasOfInterest = placemark.areasOfInterest {<br>            for area in areasOfInterest {<br>                nearbyLocations.append(Location(name: area, coordinate: placemark.location!.coordinate))<br>            }<br>        }<br>        <br>        if let locality = placemark.locality {<br>            nearbyLocations.append(Location(name: locality, coordinate: placemark.location!.coordinate))<br>        }<br>        <br>        if let subLocality = placemark.subLocality {<br>            nearbyLocations.append(Location(name: subLocality, coordinate: placemark.location!.coordinate))<br>        }<br>        <br>        self?.nearbyLocations = nearbyLocations<br>    }<br>}</pre><p><strong>Fetch Nearby Locations:</strong> The fetchNearbyLocations function uses reverse geocoding to fetch nearby areas of interest, such as districts, cities, and other local points of interest. It processes the placemark results to extract relevant location names and coordinates.</p><p>By using both MKLocalSearch for querying specific locations and CLGeocoderfor reverse geocoding nearby points of interest, we provide a comprehensive solution for finding and displaying locations based on the user’s current position.</p><h3>Code Explanation: Animation</h3><p><strong>Animation for treasure chest &amp; mystery reward<br></strong>For the animation when opening the treasure chest, I used a rotation effect to create a shaking motion when the user taps on it. Once the shaking stops, the mystery reward appears and animates from the chest to the top. This animation is achieved by adjusting the offset of the reward element.</p><p>Here’s the code for the animation:</p><pre>if isChestOpen{<br>                    HStack {<br>                        ZStack{<br>                            Text(&quot;+\(totalPoint) XP&quot;)<br>                                .font(.subheadline)<br>                                .zIndex(1)<br>                                .foregroundColor(.buttonClaimChest)<br>                                .offset(y: 15)<br>                            <br>                            Image(&quot;RewardPointKuning&quot;)<br>                                .resizable()<br>                                .frame(width: 125, height: 75)<br>                        }<br>                        .scaleEffect(scale)<br>                        .offset(x: offsetX, y: offsetY)<br>                        .opacity(opacity)<br>                        <br>                        ZStack{<br>                            Text(&quot;Kacamata&quot;)<br>                                .font(.subheadline)<br>                                .zIndex(1)<br>                                .foregroundColor(.buttonClaimChest)<br>                                .offset(y: 15)<br>                            <br>                            Image(&quot;Kacamata&quot;)<br>                                .resizable()<br>                                .frame(width: 125, height: 65)<br>                                .padding(.top, 10)<br>                        }<br>                        .scaleEffect(scale)<br>                        .offset(x: -offsetX, y: offsetY)<br>                        .opacity(opacity)<br>                    }<br>                    .onAppear {<br>                        withAnimation(.spring(response: 1.5, dampingFraction: 1.5, blendDuration: 0.5)) {<br>                            scale = 1<br>                            offsetY = -170<br>                            offsetX = -3<br>                            opacity = 1<br>                        }<br>                    }<br>                }</pre><p><strong>Animation for Level Character<br></strong>As for the animation for Level Character, this animation works by updating the current level number when the next or previous button is clicked. This changes the displayed level name and character name to match the current level. Additionally, the character element appears larger when presented at the current level. These changes create the effect of a horizontal scroll without actually scrolling, as scrolling is disabled. Instead, the transition is triggered by pressing the next or previous button.</p><pre>ScrollViewReader { proxy in<br>                                    ScrollView(.horizontal){<br>                                        VStack (alignment: .leading){<br>                                            HStack(spacing: 75) {<br>                                                ForEach(levels, id: \.noLevel) { level in<br>                                                    Image(level.imageName)<br>                                                        .resizable()<br>                                                        .aspectRatio(contentMode: .fit)<br>                                                        .frame(width: 175)<br>                                                        .scaleEffect(currentLevel == level.noLevel ? 1.1 : 0.9)<br>                                                    <br>                                                }<br>                                            }<br>                                            .padding(.leading, 110)<br>                                            .padding(.bottom, 20)<br>                                            .padding(.top, 20)<br>                                            <br>                                            <br>                                            <br>                                            <br>                                            ZStack (alignment: .leading){<br>                                                RoundedRectangle(cornerRadius: 25)<br>                                                    .frame(width: CGFloat(userProgress.xp) / 1000 * 258, height: 10)<br>                                                    .padding()<br>                                                    .zIndex(0.5)<br>                                                    <br>                                                    .overlay(<br>                                                        LinearGradient(gradient: Gradient(colors: [.lightYellow, .darkYellow]), startPoint: .leading, endPoint: .trailing))<br>                                                    .mask(RoundedRectangle(cornerRadius: 25)<br>                                                        .frame(width: CGFloat(userProgress.xp) / 1000 * 258, height: 10))<br>    <br>                                                RoundedRectangle(cornerRadius: 25)<br>                                                    .frame(width: 2070, height: 14)<br>                                                    .padding(.horizontal, 15)<br>                                                    .foregroundColor(.white)<br>                                                <br>                                                <br>                                                HStack(spacing: 205){<br>                                                    ForEach(levels, id: \.noLevel){ level in<br>                                                        ZStack {<br>                                                            Image(&quot;PointBorder&quot;)<br>                                                                .resizable()<br>                                                                .frame(width: 46, height: 46)<br>                                                            <br>                                                            <br>                                                            Text(&quot;\(level.pointsToUnlock) XP&quot;)<br>                                                                .multilineTextAlignment(.center)<br>                                                                .frame(width: 40)<br>                                                                .font(.system(size: 7, weight: .regular))<br>                                                                .offset(y: 2)<br>                                                        }<br>                                                        <br>                                                    }<br>                                                    <br>                                                }<br>                                                .padding(.leading, 178)<br>                                                .padding(.trailing, 178)<br>                                                .zIndex(1)<br>                                            }<br>                                        }<br>                                    }<br>                                    .disabled(true)<br>                                    .onChange(of: currentLevel) { newValue in<br>                                        withAnimation {<br>                                            proxy.scrollTo(newValue, anchor: .center)<br>                                        }<br>                                    }<br>                                }</pre><p><strong>Animation for pop-up page shrinking<br></strong>For the pop-up that shrinks towards the activity icon, I used the offset property to create the animation. The offset is carefully adjusted to align with the position of the activity icon, ensuring a smooth and precise animation effect.</p><pre>Button(action: { <br>                                withAnimation(.spring(response: 0.5, dampingFraction: 2, blendDuration: 0.6)) {<br>                                    scale = 0.1<br>                                    offsetY = 390<br>                                    offsetX = 0<br>                                    backgroundOpacity = 0<br>                                    opacity = 0<br>                                }<br>                                DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {<br>                                    <br>                                    isActive = false<br>                                    <br>                                }<br>                            }) {<br>                                Text(&quot;Nanti aja&quot;)<br>                                    .font(.system(size: 14, weight: .regular))<br>                                    .foregroundColor(.blue)<br>                            }<br>                            .padding(.top, 2)</pre><p><strong>Animation for rating, price range, and yes/no button<br></strong>For the animations for rating and WiFi, we use a ForEach loop to configure the components. For the <strong>rating</strong>, if button number 3 is selected, the first three stars become filled. This is achieved using the filled parameter in the StarRatingComponent, which determines whether the star is filled. The filled parameter is set by comparing the current index of the loop to the selected rating. If the index is less than or equal to the rating, the filled parameter is set to true.</p><p>Here’s the code for the rating component:</p><pre>HStack {<br>                ForEach(1..&lt;6) { index in<br>                    StarRatingComponent(filled: index &lt;= rating, label: labels[index-1])<br>                        .onTapGesture {<br>                            if rating == 0{<br>                                onRatingChange()<br>                            }<br>                            rating = index<br><br>                        }<br>                }<br>            }</pre><p>For the <strong>price range</strong> rating, when a rating button is selected, it changes color and the background becomes a blue rectangle. This effect is achieved using the HargaElement component, which includes an isSelected parameter. The isSelectedparameter is set to true when the selectedLabel matches the label. Here’s the code:</p><pre>var body: some View {<br>        VStack{<br>            HStack{<br>                Text(&quot;Harga&quot;)<br>                    .font(.subheadline)<br>                    .fontWeight(.regular)<br>                    .padding(.bottom, 5)<br>                <br>                Spacer()<br>            }<br>            HStack(spacing: 2) {<br>                ForEach(labels, id: \.self) { label in<br>                    HargaElement(label: label, isSelected: selectedLabel == label){<br>                        handleSelection(label)<br>                    }<br>                }<br>            }<br>            <br>        }<br>    }<br>    <br>    private func handleSelection(_ label: String) {<br>        if selectedLabel != label {<br>            selectedLabel = label<br>            print(&quot;Selected label: \(label)&quot;)<br>            <br>            if !hasChanged {<br>                onFirstTap()<br>                hasChanged = true<br>            }<br>        }<br>    }</pre><p>For the <strong>yes/no button</strong> component, the logic of the button selected is also the same as before. However, we use the onChange modifier to ensure that the button can only be selected one at the same time.</p><pre>HStack{<br>                YesOrNoRating(label: &quot;Ada&quot;, isSelected: $ada)<br>                <br>                YesOrNoRating(label: &quot;Gak Ada&quot;, isSelected: $gakAda)<br>            }<br>            .onChange(of: ada) { newValue in<br>                if newValue {<br>                    gakAda = false<br>                    if !hasChanged {<br>                        onRatingChange()<br>                        hasChanged = true<br>                    }<br>                }<br>            }<br>            .onChange(of: gakAda) { newValue in<br>                if newValue {<br>                    ada = false<br>                    if !hasChanged {<br>                        onRatingChange()<br>                        hasChanged = true<br>                    }<br>                }<br>            }</pre><h3>Struggle in Using CloudKit</h3><p>In the Cooworka app, we utilize CloudKit to save and fetch data from iCloud, ensuring that every user can access the same data in real-time. Working with CloudKit presented significant challenges, as it was a new technology for us. Although we successfully managed to save and fetch data from the cloud, we encountered several errors when searching the data. Due to time constraints, we had to implement a temporary solution by filtering the data after fetching it. While this was not ideal, it allowed us to maintain a functioning app as we worked on a more efficient solution. Here is the code we used for saving and fetching data in our app:</p><pre>func save(record: T, recordType: String, completion: @escaping (Result&lt;T, Error&gt;) -&gt; Void) {<br>        let ckRecord = record.toCKRecord(recordType: recordType)<br>        <br>        database.save(ckRecord) { savedRecord, error in<br>            if let error = error {<br>                completion(.failure(error))<br>            } else if let savedRecord = savedRecord {<br>                let savedModel = T(record: savedRecord)<br>                completion(.success(savedModel))<br>            }<br>        }<br>    }<br>    <br>    func fetch(recordType: String, completion: @escaping (Result&lt;[T], Error&gt;) -&gt; Void) {<br>        let query = CKQuery(recordType: recordType, predicate: NSPredicate(value: true))<br>        <br>        database.perform(query, inZoneWith: nil) { records, error in<br>            if let error = error {<br>                completion(.failure(error))<br>            } else if let records = records {<br>                let models = records.map { T(record: $0) }<br>                completion(.success(models))<br>            }<br>        }<br>    }</pre><h3>Our Learnings from Developing Cooworka</h3><p><strong>1. Narrowing Focus for Better Results<br></strong>In the early stages, we cast a wide net, exploring all of Indonesia. However, we quickly realized from our interviews that our participants did not travel routinely across the country and had varied characteristics. This broad target audience made it difficult to address specific needs and provide relevant solutions. From this, we learned the importance of narrowing our focus to better understand and meet user needs. We discovered a recurring pattern among some of our interviewees: many expressed frustration when searching for suitable cafes as places to work from. They struggled to find reliable information about essential factors such as power outlets, wifi quality, and the comfort of chairs and tables. Users often resorted to zooming in on Google images to spot power outlets and reading multiple reviews across different sites for any mention of wifi quality, typically with disappointing results.</p><p>These common pain points highlighted a significant gap in the market and inspired us to develop Cooworka. By narrowing our focus and targeting specific user needs, we learned that we could deliver a more effective and valuable product. This approach allowed us to address specific pain points more accurately and create a tailored solution that met our users’ needs, ultimately achieving better results.</p><p><strong>2. Power of Gamification<br></strong>During development, we realized how powerful gamification could be in enhancing user engagement. We discovered that incorporating gamified elements goes beyond adding game-like features; it involves creating a system that drives user interaction and fosters habitual use. By integrating a gamified experience into Cooworka, we encouraged users to actively share their reviews and explore new cafes, transforming mundane tasks into enjoyable activities. This approach made the app more engaging and interactive, demonstrating that a well-designed gamified system can significantly boost user participation and satisfaction.</p><p><strong>3. Enhancing User Flow<br></strong>Optimizing the user flow to simplify the review-writing process and keep users engaged was another significant challenge. Initially, some pages had redundant components, making the process cumbersome. To address this, we conducted multiple brainstorming sessions and employed the Crazy Eight technique. Additionally, we integrated micro-interactions to enhance the user experience, making the app more intuitive and enjoyable to use. These efforts highlighted the importance of detailed attention to user flow and interface design in creating a seamless and engaging user experience.</p><p><strong>4. Learning New Technical Frameworks<br></strong>Developing Cooworka provided us with the opportunity to learn and leverage several new technical frameworks. We utilized AuthenticationServices for Apple sign-in, MapKit for location data and cafe addresses, CoreLocation for user locations, CloudKit for synchronizing user-posted reviews, and PhotosUI for selecting photos from the gallery. Additionally, we employed Combine and SwiftUI for overall app development. Each of these frameworks played a significant role in the functionality and user experience of Cooworka. This process enhanced our technical skills and provided us with valuable insights into effective application development.</p><p><strong>5. Effective Version Control<br></strong>We also encountered frequent conflicts with Git, which initially posed a significant challenge. However, by adhering to a strict protocol of pull, commit, push, and then pull request, we learned to minimize these conflicts. This disciplined approach improved our workflow and ensured smoother collaboration among team members. Our experience with Git taught us the value of effective version control practices and the importance of establishing clear protocols to minimize conflicts and improve team collaboration.</p><p><strong>6. Dedication and Iteration<br></strong>Despite numerous struggles, our dedication and iterative approach were key to our success. We learned the importance of perseverance, continuous improvement, and user-centric design. Our commitment to these principles enabled us to develop Cooworka, a platform that effectively addresses the common issues faced by WFC users and enhances their experience through a thoughtfully designed, gamified system. This journey taught us the value of listening to user feedback, being adaptable, and constantly refining our product to meet user needs, reinforcing that a user-focused, iterative development process is essential for creating a successful and impactful product.</p><h3>What’s Next?</h3><p>For further development, we aimed to add more gamification features to engage more new users and keep the current users being active. One exciting feature we’re planning is a dynamic leaderboard. This leaderboard will rank users based on the helpfulness of their reviews, as determined by the number of people who find their insights valuable. The more helpful reviews you write, the higher you’ll ascend, with the ultimate goal of claiming the top spot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-g5JqmvW33KMAc_1" /></figure><p>In addition, we’re introducing a variety of badges to reward users who consistently review specific topics. For example, if you frequently assess the wifi quality at different cafes, you’ll earn the prestigious “Wifi Hunter” badge. These badges not only recognize your expertise but also encourage you to provide more detailed and valuable reviews, enhancing the overall experience for everyone.</p><h4><a href="https://medium.com/@cindaarta16/share-your-perfect-workspace-cooworkas-engaging-review-system-part-1-8bc381d59f7d">Click here to read Part 1!! Thank You</a></h4><p>© 2024 Aileen Chalina Wijaya, Lucinda Artahni, Natasha Hartanti Winata, Shazkia Aulia Shafira Dewi, Sherly Phangestu. All Rights Reserved.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36b21db072cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OnePose Yoga: Elevate Your Yoga with CoreML Pose Detection]]></title>
            <link>https://medium.com/@cindaarta16/onepose-yoga-elevate-your-yoga-with-coreml-pose-detection-c37cc4e12b23?source=rss-8f45baafaa3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c37cc4e12b23</guid>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[image-classification]]></category>
            <category><![CDATA[coreml]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Cinda]]></dc:creator>
            <pubDate>Fri, 31 May 2024 01:37:05 GMT</pubDate>
            <atom:updated>2024-05-31T01:37:05.718Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tyz9LKCxPVUAUkdk6hp6Nw.png" /></figure><blockquote>Hello Everyone!</blockquote><blockquote>In this article, I’m excited to share my journey of developing the <strong>OnePose Yoga application</strong>, a project that took about two weeks to complete. Throughout this process, I gained invaluable insights and learned so much. I hope you enjoy reading about my experience and find it as enriching as I did. Happy reading!</blockquote><h3>Ideation</h3><p>I decided to create a yoga pose app because many people prefer exercising at home due to its cost-effectiveness and flexibility. However, <strong>without proper instruction, there’s a risk of incorrect poses</strong>. Therefore, this app aims to bridge that gap by <strong>providing real-time pose status, helping users determine if their yoga poses are correct</strong> and ensuring a beneficial and comfortable home yoga experience.</p><h3>What is OnePose Yoga?</h3><p>OnePose Yoga is an innovative app designed to help you determine if your yoga poses are correct using real-time camera technology. By leveraging CoreML’s image classification model, the app captures frames from your device’s camera, processes them, and provides instant feedback on your pose accuracy.</p><p>Here’s how it works:</p><ul><li><strong>Real-Time Pose Recognition: </strong>The app captures frames through your camera and feeds them into a CoreML model.</li><li><strong>Pose Status Feedback: </strong>The model classifies the captured image and outputs a pose status — either correct or incorrect.</li><li><strong>Guided Practice:</strong> If your pose is correct when the preparation timer ends, a new timer for holding the pose will start. If incorrect, the app will prompt you to retry until you achieve the correct pose.</li></ul><p>In developing OnePose Yoga, I utilized several frameworks, including Machine Learning (CreateML), AVKit, Vision, SwiftUI, and Foundation. I chose to create this app for the iPad, taking advantage of its larger display for a more immersive user experience compared to the iPhone, while still maintaining flexibility.</p><p>Whether you’re a beginner or an experienced yogi, OnePose Yoga aims to enhance your practice by ensuring your poses are performed safely and correctly.</p><h3>Designing Process</h3><p>I began by creating a low-fidelity (lo-fi) prototype in Figma to layout the components I wanted in the app. Once the basic structure was in place, I moved on to developing a high-fidelity (hi-fi) prototype, adding colors and completing it with all the necessary elements. Additionally, I also designed the logo, and created various other design elements to bring the app to life.</p><p>In the process of developing this application, I’ve noticed differences between the Hi-Fi and Lo-Fi designs. While the design continually improved, I focused my efforts mainly on updating the Hi-Fi prototype. Unfortunately, this led to a disparity between the two versions, with the Lo-Fi design lacking the same level of attention and updates.</p><p>Here’s my Lo-Fi Prototype:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ItA7unK5L5oHv9sy6qwikA.png" /><figcaption>Lo-Fi Prototype</figcaption></figure><p>Here’s my Hi-Fi Prototype:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.figma.com%2Fembed%3Fembed_host%3Dcdn.embedly.com%26embed_origin%3Dcdn.embedly.com%26url%3Dhttps%3A%2F%2Fwww.figma.com%2Fdesign%2FmhvHHENtJwpyVtLz1uMf0W%2FOnePose-Yoga%3Fnode-id%3D114-92%26t%3D87Vz9h0dueSpaYPC-1&amp;display_name=Figma&amp;url=https%3A%2F%2Fwww.figma.com%2Fdesign%2FmhvHHENtJwpyVtLz1uMf0W%2FOnePose-Yoga%3Fnode-id%3D114-92%26t%3D87Vz9h0dueSpaYPC-1&amp;image=https%3A%2F%2Fwww.figma.com%2Ffile%2FmhvHHENtJwpyVtLz1uMf0W%2Fthumbnail%3Fver%3Dthumbnails%2Fdcc2812f-e138-4704-83cc-42b586b92ff9&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=figma" width="800" height="450" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d5d2ecbc9d1972c91e90c225ae3079a/href">https://medium.com/media/1d5d2ecbc9d1972c91e90c225ae3079a/href</a></iframe><h3>Technical Process (Code) for OnePose Yoga App</h3><p>Developing the code for this app was an adventure, especially diving into the complexities of camera views and image classification. Despite encountering obstacles along the way, the support of friends and collaborative brainstorming sessions helped me find my way. Each challenge became an opportunity for learning and improvement, as I navigated through trial and error to better understand these technologies. In the end, the hard work paid off, and I’m proud of what I accomplished. It was a journey filled with ups and downs, but the sense of achievement made it all worthwhile.</p><blockquote>Here comes the most challenging part of this app development and I’ll tell you why</blockquote><h3>Building a Model with CoreML</h3><p>Creating a model with CoreML for this project was quite challenging. Initially, I aimed to classify poses into two categories: “wrong pose,” which included data where the legs and hands were too far apart, and “right pose,” which included data where the legs and hands were close together, specifically hand-to-hand and leg-to-leg.</p><p>However, I encountered an issue where sitting was incorrectly classified as a “right pose.” To address this, I added a third category, “others,” which included images of people sitting and standing. Unfortunately, this led to another problem: the model classified the correct pose as “others” with 100% confidence, causing considerable frustration.</p><blockquote>When we are lost, we need to ask others</blockquote><p>After further investigation and discussion with friends, I realized the data needed a more generalized pattern rather than detailed specifics. Consequently, I redefined the classes: “right pose” specifically contained the Tadasana yoga pose, while “wrong pose” included a mix of other yoga poses.</p><p>Finally, this revised model worked as intended, accurately predicting the poses as planned.</p><h3>Integrating MLModel, Camera view, and SwiftUI</h3><p>During this process, I encountered several challenges when trying to position the camera view and other UI elements in a 60:40 ratio, with the UI elements on the left. The primary issue was that the camera view wouldn’t properly fill the right side of the page. Since the app is designed to be used in landscape mode, the camera view also displayed in landscape format. However, I needed the camera view to be in portrait orientation.</p><p>I experimented with many different solutions, but none of them worked. The camera view either remained in landscape mode or could be forced into portrait mode but displayed a rotated view, as if the camera was being used in a portrait app.</p><blockquote>It’s challenging and sometimes seems impossible, but we must always find a way to improvise</blockquote><p>Finally, after further investigation, I discovered that the camera view can be set to a custom size, but this results in it being zoomed in. Although this zooming effect was not ideal, it allowed me to fit the camera view into the desired 60:40 layout ratio. By adjusting the camera view’s size and accepting the zoomed-in display, I was able to achieve a functional and visually appealing layout. This approach ensured that the camera view displayed correctly alongside the other UI elements, providing a better user experience.</p><p>Here is the code that i used for make the camera view’s size can be customize with consequence it will be zoomed in.</p><pre>func setupCamera() {<br>        captureSession = AVCaptureSession()<br>        guard let captureDevice = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .front),<br>              let input = try? AVCaptureDeviceInput(device: captureDevice) else { return }<br>        <br>        captureSession.addInput(input)<br>       <br>        let videoOutput = AVCaptureVideoDataOutput()<br>        <br>       <br>        videoOutput.setSampleBufferDelegate(self, queue: DispatchQueue(label: &quot;videoQueue&quot;))<br><br>        captureSession.addOutput(videoOutput)<br>        <br>       <br>        let previewLayer = AVCaptureVideoPreviewLayer(session: captureSession)<br>        previewLayer.videoGravity = .resizeAspectFill<br>        previewLayer.connection?.videoOrientation = .landscapeRight<br><br>        previewLayer.frame = previewFrame<br><br>        view.layer.addSublayer(previewLayer)<br>        <br>        <br>        captureSession.startRunning()<br>        <br>    }</pre><p>To integrate the ML model with the view, I configured the confidence level to 0.8. This means the poseStatus variable will only update and be displayed on the left side of the view if the model’s confidence is at least 0.8. By implementing this threshold, the poseStatus will not change for lower confidence levels, resulting in more stable and accurate feedback for the user.</p><h3>OnePose Yoga</h3><p>OnePose Yoga is now a fully functional app, though it does have a minor bug. If you’re interested in exploring the code behind the development of this app, feel free to check out the GitHub repository!</p><blockquote><a href="https://github.com/Cindaa10/YogaPose">OnePose Yoga Github Repository</a></blockquote><h4>Last but not least</h4><p>As we finish up, here’s something important I’ve learned from this project that I think will help you as you start your own.</p><blockquote>“Never let inexperience hold you back. Just because you’ve never done something before doesn’t mean you can’t. Dive in with all your strength and effort, and when you accomplish it, you’ll be amazed at what you’re capable of and proud of the hard work you’ve put in.”</blockquote><h4>Thank You All!! 💫🫶🏻</h4><p>© 2024 Lucinda Artahni. All Rights Reserved.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c37cc4e12b23" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>