Posts

30 Days of SwiftUI Learning Journey: From Zero to Hero!

Image
CRASH COURSE : LEARN SwiftUI in 30 DAYS Welcome, Swift adventurers, to the culmination of our 30-day SwiftUI odyssey! We've journeyed through the fundamentals of Swift and the dynamic world of SwiftUI, and now it's time to reflect on our incredible progress. Consider this your ultimate crash course in SwiftUI, distilled into a thrilling 30-day recap! Our Swift Foundation: Day 1: Getting Started with SwiftUI : We took our first steps, setting up our development environment and crafting our initial "Hello, SwiftUI!" app. Day 2: Understanding Collections and Enums in Swift : We explored the power of arrays, dictionaries, and enums, the building blocks of data organization. Day 3: Mastering Conditions and Loops in Swift : We learned to control program flow with if , switch , and loops, making our code dynamic. Day 4: Mastering Functions and Data Structures in Swift : We delved into functions, structs, and classes, mastering data manipulation. Day 5: Unlocking the...

30 Days of SwiftUI - Day 30: SwiftUI Challenge Day: Image Magic, Maps, and Local Notification!

Image
Hello Swift learners! Today, we're putting our knowledge to the test with some practical questions based on what we've learned in the past few days. Let's sharpen our skills and solidify our understanding of image processing, maps, and advanced techniques. Practical Tests Test 1: Image Filter with Customization Question: Create a SwiftUI view that loads an image from the user's photo library using PhotosPicker . Apply a CIGaussianBlur filter to the image. Allow the user to adjust the blur radius using a Slider within a confirmationDialog . Test 2: Map with Editable Annotations Question: Create a SwiftUI view that displays a map with annotations. Allow the user to select an annotation. When an annotation is selected, display a sheet with text fields to edit the annotation's latitude and longitude. Update the annotation's position on the map when the user saves the changes. Test 3: MVVM with Local Notifications Question: Create a simple task list app using MV...

30 Days of SwiftUI - Day 29: Architecting, Accessing, and Interacting: MVVM, Accessibility, Notifications, and More!

Image
Hello Swift architects! Today, we're diving into some advanced SwiftUI topics, including MVVM architecture, accessibility, notifications, gestures, and layout. Let's get started! Architecting for Success: Introducing MVVM into Your SwiftUI Project MVVM (Model-View-ViewModel) is a popular architectural pattern that promotes separation of concerns, making your code more maintainable and testable. Detailed Explanation: Model: Represents the data and business logic of your application. It's responsible for fetching, storing, and manipulating data. In SwiftUI, models are often plain Swift structs or classes conforming to Codable . View: Represents the user interface. It's responsible for displaying data and handling user interactions. In SwiftUI, views are structs conforming to the View protocol. Views should be as "dumb" as possible, relying on the ViewModel for data and logic. ViewModel: Acts as a bridge between the Model and the View. It tran...

30 Days of SwiftUI - Day 28: Beyond the Basics: Custom Types, Maps, and Biometrics in SwiftUI

Image
Hello Swift adventurers! Today, we're exploring some advanced SwiftUI topics, including custom type conformance, file system interaction, map integration, and biometric authentication. Let's dive in! Custom Ordering: Adding Conformance to Comparable for Custom Types We'll learn how to make custom types comparable, allowing them to be sorted and compared. Example: Making a Person Struct Comparable import SwiftUI struct Person : Comparable , Identifiable { let id = UUID () let name: String let age: Int static func < ( lhs : Person , rhs : Person ) -> Bool { lhs.age < rhs.age } static func == ( lhs : Person , rhs : Person ) -> Bool { lhs.age == rhs.age && lhs.name == rhs.name } } struct ComparableDemo : View { let people = [ Person (name: "Alice" , age: 30 ), Person (name: "Bob" , age: 25 ), Person (name: "Charlie" , age: 35...