Today is a great day to start learning iOS development. iOS development evolves every year and brings us new things to learn. This post should be valuable for the people who move to Swift from another programming language. This week we will talk about Swift idioms and how to write idiomatic Swift code.| Swift with Majid
We covered a lot of things related to microapps architecture in Swift during the last month. I would love to finalize the series of posts by touching another essential edge of the approach: Dependency Injection. This week we will learn how to inject the dependencies into feature modules to improve testability and facilitate Xcode previews.| Swift with Majid
Last week, we talked about the basics of Foundation Models, how to generate text content, and how to tune and control the output. This week, we will talk about simple and yet powerful structured content generation.| Swift with Majid
Apple introduced the brand-new Foundational Models framework, providing type-safe APIs for using Apple Intelligence models in your apps. This week, we will learn how to use this new framework while building AI features in your apps.| Swift with Majid
Apple introduced the new Observation framework powered by the macro feature of the Swift language. The new Observation framework, in combination with the Swift Concurrency features, allows us to replace the Combine framework that looks deprecated by Apple. This week, we will learn how to use the Observation framework to handle data flow in our apps.| Swift with Majid
Apple introduced the Observation framework a few years ago. The Observation framework became the main tool for building observable models, replacing the Combine framework. This week, we will talk about a new piece of the framework called Observations.| Swift with Majid
Glassifying custom views can be very easy using the glassEffect view modifier. It is a one-shot view modifier that handles everything for you. But things can become quite complicated when you try to glassify a group of views. Today, we will talk about glassifying a group of views in SwiftUI.| Swift with Majid
We already talked about glassifying tabs and toolbars in SwiftUI. This week, we will continue the topic of the new Liquid Glass design language and will talk about applying this concept to custom views.| Swift with Majid
Today, we will discuss thread safety, an essential programming aspect. I decided to cover this topic because of the issue I’ve noticed in the codebase I helped to build. This type of bug is straightforward to create but very hard to fix. So investing time into building a type-safe type in your codebase is much better.| Swift with Majid
SwiftUI is the declarative data-driven framework allowing us to build complex user interfaces by defining the data rendering on the screen. Navigation was the main pain point of the framework from the very first day. Fortunately, things have changed since WWDC 22, and SwiftUI provides the new data-driven Navigation API. This week we will learn how to use the new Navigation API to build complex user flows.| Swift with Majid
Easy-peasy animations were always one of the strongest points of the SwiftUI framework. This time Apple makes them even easier by introducing a new Animatable macro. This week, we will learn when and how to use the new Animatable macro.| Swift with Majid
Liquid Glass is the new design language Apple using across all of its platforms. The look and feel of tabs was the major change that we covered last week. This week we will focus on another significant change related to toolbars.| Swift with Majid
Button is one of the crucial components of any app. We use buttons to provide actions in the user interface of the app. SwiftUI 3 released a bunch of new view modifiers that allow us to style buttons in different ways. New bordered and borderedProminent button styles in conjunction with controlSize and buttonBorderShape view modifiers can change button presentation drastically.| Swift with Majid
Swift Concurrency provides a cooperative cancellation model to handle task cancellation. This week, we will learn what a cooperative cancellation model is, how to use it, and how to be a good citizen and handle it correctly.| Swift with Majid
One of the most important changes presented during WWDC 25 was the new design language used across all Apple platforms called Liquid Glass. Tabs play a significant role in the new design and provide new ways of interacting with them. This week, we will learn about new APIs that SwiftUI provides us to handle new tab interactions.| Swift with Majid
The 25th World Wide Developers Conference is here, and it’s the perfect time to explore the most significant changes and additions to the SwiftUI framework. Let’s delve into all the exciting new features Apple has prepared for us this year.| Swift with Majid
This week we will continue the topic of microapps architecture in Swift by touching on another essential edge of this approach. In this post, we will talk about sharing resources between modules and separating the localization of feature modules.| Swift with Majid
In the first post of the current series, I talked about Swift Package Manager basics and how we can maintain the project with many Swift modules. This week we continue the topic of Microapps architecture by introducing feature modules.| Swift with Majid
This week I want to start a series of posts about the new approach I use to build scalable apps in Swift. Microapps architecture allows you to reduce the compile-time and enhances the separation of concerns in your codebase. Teams can produce a module per feature and run it as a separate app to improve the value delivery.| Swift with Majid
The primary goals of the microapps architecture are to maintain separation of concerns to enhance compile time, adhere to the single responsibility principle, and facilitate continuous delivery, allowing for the deployment of a feature without the need for the completion of other features.| Swift with Majid
I’m very passionate about my health routine and have built a bunch of health-related apps. Almost all of them are integrated with Apple Health and provide tons of additional calculations over the functionality that the Apple Health app gives us. Today, we will talk about the hidden gem of the on-device calculations - the Accelerate framework.| Swift with Majid
Task local values is the recent addition to the concurrency feature of the Swift language. This week, we will not only learn the basics of task local values, but also discuss the interesting usage where we will build the dependency injection container using this language feature.| Swift with Majid
Actors is the new Swift language feature, making your types thread-safe. This week, we will learn how to use actors and their benefits over locks. We will also discuss actor reentrancy, the main confusing point of using actors.| Swift with Majid
Apple recently released Swift 6.1, with most of the changes being cosmetic. However, I particularly like the scoping feature introduced in the Swift Testing framework. This week, we’ll delve into the new test scoping feature and explore how to effectively utilize it in Swift.| Swift with Majid
The World Wide Developers Conference, the largest event in the Apple development world, is just around the corner. Today, I’m excited to share my wishes for the upcoming WWDC 25, which is expected to be unveiled in two months.| Swift with Majid
Today I would like to talk about documenting Swift code using the DocC. Documenting your code becomes even more important in the era of modularized apps. Whenever different parts of your app live in multiple Swift Packages, it becomes crucial to provide proper documentation.| Swift with Majid
A few weeks ago, we discussed Task Groups in Swift, which is an explicit way of executing multiple concurrent tasks and waiting for them to complete. This week, we’ll delve deeper into the topic by exploring the async let syntax in Swift, which offers a convenient way to work with Task Groups implicitly.| Swift with Majid
SwiftUI brings declarative and straightforward approach in building User Interfaces. We have List and Form components and Bindings. All of these things make SwiftUI so easy to use and very powerful. But today we are going to talk about another feature of SwiftUI, and it is animations.| Swift with Majid
Nowadays, Apple platform development has undergone significant changes. Previously, we believed that building the core of an app around UIKit and using SwiftUI for certain screens was a good idea. This week, we’ll delve into the foundation of app development using SwiftUI, while also exploring UIKit for scenarios where performance truly matters.| Swift with Majid
This week I want to show you how to use Shape API in SwiftUI. We will take a look at ready to use shapes like Circle, Capsule, Rectangle, etc. We will learn how to draw super custom shapes by using Path and GeometryReader. In the end, we will build BarChart implementation ultimately in SwiftUI.| Swift with Majid
I decided to continue the topic of Swift Concurrency to cover some not-obvious things. This week we will talk about task yielding and debouncing. Swift concurrency language features provide us with two simple but very powerful functions: yield and sleep. We will try to learn how and when to use them.| Swift with Majid
Swift Structured Concurrency makes our lives much easier by introducing task groups. Task groups are a way to run a dynamic number of child tasks, await all of them, or cancel. This week, we will learn how to use and optimize task groups in Swift.| Swift with Majid
The easiest way to size a view in SwiftUI is to place it in a container and allow it to fit its content size. You can also use the frame view modifier to specify a particular concrete size. Anything related to the size of its parent needs hard work using GeometryReader, which is not the easiest way to do things correctly in SwiftUI.| Swift with Majid
Last week we started a series of posts about developing interactive components using SwiftUI, where we talked about building the bottom sheet. We need to understand the power of @ViewBuilder before moving to the next post about building another interactive view. That’s why this week, we will talk about @ViewBuilder and its benefits while developing custom views.| Swift with Majid
With the latest release of SwiftUI, Apple has introduced a new feature called color mixing. It’s a single function that enables you to perform various creative tasks. In this week’s discussion, we’ll dive into color mixing in SwiftUI and explore its potential adoption.| Swift with Majid
I’ve been using Swift Concurrency since its initial version, which introduced the async and await keywords to enable asynchronous work. Over time, Swift Concurrency has become more powerful and provides robust data-race safety by allowing the Swift compiler to identify potential issues.| Swift with Majid
A few weeks ago, we talked about building views like PagerView and BottomSheetView from scratch in SwiftUI. SwiftUI is pretty young and misses some components that we expect to have out of the box. But it provides all the needed APIs to build whatever we want. However, sometimes we need to reuse UIKit views instead of making the SwiftUI versions. This week I want to talk to you about using UIKit views in SwiftUI.| Swift with Majid
SwiftUI has a powerful and easy to use approach in building Gestures. Today we will talk about how we can use gestures in SwiftUI. We will touch special GestureState Property Wrapper which is very similar to State but works only with gestures. Finally, we will build swipeable Tinder cards as a sample project.| Swift with Majid
SwiftUI provides the UIViewRepresentable and UIViewControllerRepresentable protocols since its inception. As you might know, we can use them to wrap any UIKit view or controller and place it in the SwiftUI hierarchy.| Swift with Majid
Previews in Xcode become more powerful every year. Previews in Xcode are not about SwiftUI; you can use them even with UIKit. This week, we will talk about enhancing Previewable and PreviewModifier types, allowing us to build reusable preview environments.| Swift with Majid
Usually, I try to avoid GeometryReader as much as I can. But sometimes, we need it to build our custom view. This week we will talk about GeometryReader. The view that allows us to read its geometry and layout child views manually.| Swift with Majid
Swift Testing is a new framework with expressive and intuitive APIs that improve your testing experience. It is powered by macros that allow you to organize and assert your tests. This week, we will learn about the basics of the Swift Testing framework and how we can use it side-by-side with XCTest.| Swift with Majid
In the series final post about container views in SwiftUI, we will discuss container values and how SwiftUI allows us to propagate data through the container view logic. This week, we will learn how to declaratively define and pass container values.| Swift with Majid
Since the very first version of the framework, SwiftUI has had several container views. The most popular ones are HStack, VStack, List, etc. This year, Apple introduced new APIs that allow us to build custom container views in a new way. This week, we will learn about the benefits of SwiftUI’s new decomposition APIs.| Swift with Majid
The SwiftUI framework became a mature tool for building apps on all Apple platforms. The recent WWDC introduced missing APIs, adding more value to the framework. One of them is even backward compatible with previous versions of Apple platforms. This week, we will discuss tracking geometry changes of any view in SwiftUI.| Swift with Majid
SwiftUI has become the leading framework for building apps on all Apple platforms. Almost half of these platforms support multiple windows, so we see more APIs allowing us to manipulate windows. This week, we will learn how to customize windows in SwiftUI using new APIs.| Swift with Majid
Another great addition to our scrolling APIs this year is the scroll visibility. Nowadays, you can fetch the list of visible identifiers or quickly check and monitor the view visibility inside a scroll view. This week, we will learn how to use the new onScrollTargetVisibilityChange and onScrollVisibilityChange view modifiers.| Swift with Majid
The ScrollPosition type is all you need to programmatically read or change the scroll position. Still, it doesn’t provide enough information when a user interacts with a scroll view using gestures. SwiftUI solves this problem by introducing the new ScrollGeometry type. This week, we will learn how to use the new onScrollGeometryChange view modifier to monitor scroll geometry.| Swift with Majid
WWDC 24 is here, and we have a lot to cover. Every year, SwiftUI matures by introducing more features to catch up with UIKit. This year is no exception. Let’s dive into the new features that the SwiftUI framework introduces.| Swift with Majid
Swift Concurrency became a vital part of my development stack. I leverage the power of the new Swift Concurrency features like async/await and task groups almost everywhere. SwiftUI Button type doesn’t support Swift Concurrency out of the box, but it is flexible enough to allow us to build a button type supporting Swift Concurrency.| Swift with Majid
Apple released Swift 5.5 almost three years ago. The main addition to the release was the Swift Concurrency feature. It introduced async and await keywords, allowing us to build concurrent apps in a new way. This week, we will learn how Swift determines where to run your function in a concurrent environment.| Swift with Majid
The Swift language allows us to define thread-safe types using actors. Actor type automatically manages exclusive access to the data it protects. But what if we need multiple types protected with a mutually exclusive access? That’s why we have global actors, and today, we will learn how to use global actors in Swift.| Swift with Majid
Apple Vision Pro is coming soon, and it is the perfect time to look at SwiftUI API, which allows us to adapt our apps to the immersive world that visionOS provides us. Apple states that the best way to build an app is with Swift and SwiftUI. This week, we will learn how to use SwiftUI to build a visionOS app.| Swift with Majid
In this post, we will continue the topic of the new MapKit API in SwiftUI. We will cover one of the most critical cases of displaying a map. This week, we will learn about camera position and map bounds.| Swift with Majid
Last week, we started a series of posts about the new MapKit API in SwiftUI. We talked about the basics of the new API, and now we can continue the topic by covering the customization part of new APIs. This week, we will learn the customization points of MapKit API in SwiftUI.| Swift with Majid
MapKit integration with SwiftUI significantly changed this year. In the previous version of SwiftUI, we had very basic functionality of MKMapView wrapped into the SwiftUI view named Map. Fortunately, things changed, and SwiftUI introduced a new API for MapKit integration. This week, we will learn how to use the new full-featured APIs available in the latest iteration of SwiftUI to integrate with MapKit.| Swift with Majid