NavigationSplitView in SwiftUI automatically adapts to the available screen space. On iPad, it can display multiple columns side by side, while on iPhone, it collapses into a single navigation stack. swiftwithmajid.com/2022/10/18/m...
Majid Jabrayilov
Majid Jabrayilov
@mecid.bsky.social
Swift Developer: iOS, watchOS, visionOS, tvOS, macOS. https://swiftwithmajid.com
1.7K followers587 following687 posts
Are you using TabView as root navigation component in your app? Then you need only 2 lines of code to adopt it to iPhone Duo folded and unfolded states. #swiftui swiftwithmajid.com/2026/10/14/a...
Another technique that we might need to use in our apps is dynamic layout switching using AnyLayout type. For example, it might be useful while transitioning from the folded to the unfolded state on iPhone Duo. swiftwithmajid.com/2026/10/14/a...
One of my favorite things about Swift is how its type system encourages better code. Prefer structs for value semantics. Use enums to model mutually exclusive states. Let optionals make missing values explicit. swiftwithmajid.com/2021/04/01/w...
We encounter bugs that are very hard to catch in the debugger from time to time. For example, it might occur only after a few days of app usage. Logging is an excellent technique to track and understand user actions through the app. swiftwithmajid.com/2022/04/06/l...
iPhone Duo became the first folding iPhone providing us with two displays of different sizes and aspect ratios. This week, we will talk about adapting our apps to different screen sizes using simple techniques that Apple UI frameworks provide us. swiftwithmajid.com/2026/10/14/a...
I usually set up three build configurations for every project: Debug, TestFlight, and App Store. They vary in both settings and features. I’ve been adding feature flags so new work shows up in Debug and TestFlight builds, but not in the production builds. swiftwithmajid.com/2025/09/16/f...
Toolbars play a crucial role, especially with the recent update to the design language where we have a content layer and the UI controls layer above it, or even with iPhone Duo providing vertical bars. swiftwithmajid.com/2026/06/23/t...
SwiftUI’s .task modifier provides a clean and efficient way to manage asynchronous operations within the view lifecycle. It handles task cancellation, reacting to value changes, and easily implements debouncing using structured concurrency. swiftwithmajid.com/2022/06/28/t...
I just launched a new app that makes food logging super easy and stress-free—and it’s part of #shipaton! Please give it a try and leave a review if you enjoy it. Thanks for the support! apps.apple.com/us/app/plate...
The new iPhone Duo makes adaptive layouts more important than ever in SwiftUI. With AnyLayout, you can seamlessly switch between horizontal and vertical layouts while preserving view identity and state. swiftwithmajid.com/2022/08/16/c...
Backporting SwiftUI APIs lets us use new features without raising the app’s deployment target; depending on the API, this may bypass availability checks or provide custom implementations for older versions. swiftwithmajid.com/2026/09/22/b...
AsyncSequence isn’t just for streams of events. It can also be a great way to model data loading — producing values as they become available and letting the UI progressively react to them. swiftwithmajid.com/2026/09/29/i...
How to deal with complex features that might need 40–50 async requests to populate the screen? We can model our data fetching using the AsyncSequence type. The AsyncSequence protocol is designed for sequential and iterative access to its elements. swiftwithmajid.com/2026/09/29/i...
Majid Jabrayilov reposted
How to deal with complex features that might need 40–50 async requests to populate the screen? How might we arrange these requests to prevent overwhelming the Cooperative Thread Pool, or how could we refine concurrent tasks? swiftwithmajid.com/2026/09/29/i...
Whenever you consider creating a scrollable screen in SwiftUI, you might think of using a List. However, it’s not always the best choice. Lists are great for displaying uniform data. For anything else, a ScrollView is the best option. swiftwithmajid.com/2026/04/06/b...
Custom layout might be a good solution while adopting your app to iPhone Duo. SwiftUI provides the Layout protocol allowing us to build super-custom layouts by digging into the layout system without using GeometryReader. swiftwithmajid.com/2022/11/16/b...
Majid Jabrayilov reposted
When you are an Apple developer, every day is Xmas! safearea.info/iphone-duo
Use an availability annotation to trigger compiler warnings or errors when new APIs are ready. Pair it with a ported prefix instead of a dedicated namespace to flag and locate obsolete functions easily. swiftwithmajid.com/2026/09/22/b...
Majid Jabrayilov reposted
Stanford just launched CS329Z: Engineering AI Agents. Covers everything from compound systems and building RAG/tool workflows from first principles, to agent frameworks, to the hardest part: actual evaluation. Definitely bookmarking this one. #AgentAI #AI cs329z.stanford.edu
Let's introduce a Backport type with a generic constraint. Next, add an extension to SwiftUI’s View protocol to get the instance of the Backport type with a wrapped view. This trick allows us to namespace the APIs we will backport. swiftwithmajid.com/2026/09/22/b...
We don’t see many new APIs in intermediate releases like 27.1, but this time is different. Apple introduced several new iPhone Duo-related APIs in the 27.1 release. This week, we will learn how to use new APIs without bumping your project’s target version. swiftwithmajid.com/2026/09/22/b...
Another way of adopting your layout to iPhone Duo inner screen is using content margins. The contentMargins view modifier allows us to shift a particular type of content in the view. swiftwithmajid.com/2024/04/23/c...
Do we need something like this for now? #iphone #duo #swiftui swiftwithmajid.com/2023/05/17/a...
ViewThatFits automatically measures available space and the size of its children and takes the first view that perfectly fits the available space. All you need to do is to create an instance of the ViewThatFits view and place in it a few views. swiftwithmajid.com/2022/07/26/v...
Another SwiftUI APIs that might be useful while implementing iPhone Duo layouts is Container APIs allowing you to restructure your views. I've been using it heavily while implementing design primitives for my apps. swiftwithmajid.com/2024/09/24/m...
Xcode 27.2 Beta is here! Xcode now supports a JSON-based project format (.xcproj) that’s more readable, merge-friendly, and easier for coding agents to edit. developer.apple.com/download/app...
Another important API to make your app feel home on iPhone Duo is how you display your toolbars. SwiftUI introduced a bunch of new modifiers allowing us to prioritize toolbar items visibility. swiftwithmajid.com/2026/06/23/t...
Meet the new CardioBot readiness mascot powered by Apple Intelligence. This update also includes support for all available device sizes and the redesigned trends, allowing you to understand long-term changes in your health. apps.apple.com/az/app/cardi...
I guess it is the best time to learn or to revise how to use NavigationSplitView in SwiftUI. It is almost the easiest way to support the new iPhone Duo layout in a correct way. swiftwithmajid.com/2022/10/18/m...
iPhone Duo is a completely new device with variable screen size. We have a set of new APIs to understand the screen size of the iPhone, but the fundamental API for recognizing available screen space is still size classes. swiftwithmajid.com/2022/08/16/c...
Majid Jabrayilov reposted
My complete overview of the iPhone 18 Pro and iPhone Duo, with lots of notes and questions about the latter: www.macstories.net/news/iphone-...
available(anyAppleOS 27, *) is a new language improvement that significantly simplifies code by eliminating the need to list all five Apple platforms individually in availability attributes. swiftwithmajid.com/2023/05/17/a...
Majid Jabrayilov reposted
Not me shrieking "PREORDER PREORDER HOW DO I PREORDER" so loudly that my Apple Watch gave me a loud environment warning. www.youtube.com/watch?v=wuFfi...
Majid Jabrayilov reposted
Custom layouts in SwiftUI are a super neat. These 2D layouts server as a foundation that we can extend with depth and 3D concepts later. stepinto.vision/labs/lab-067...
Majid Jabrayilov reposted
The Ocarina of Time remake looks astounding
The PromptBuilder type works with any type conforming to the PromptRepresentable protocol. And the framework provides us with a lot of conformances out of the box, like String, Array, Optionals, our Generable types, and the most important, the new Attachment type. swiftwithmajid.com/2026/09/01/b...
I’ve been working on a plate scanner app, a simple app where you capture your plate and it gives you some sort of food analysis, without numbers and calories. This app is a perfect fit for multimodal usage of Foundation Models. swiftwithmajid.com/2026/09/01/b...
One of the most eagerly anticipated additions to Foundation Models was the ability to input images. This week, we will learn how to utilize the multimodal input capability in Foundation Models. swiftwithmajid.com/2026/09/01/b...
SwiftUI introduces the ContentUnavailableView type, allowing us to display empty, error states or any other state where content is unavailable in our apps. swiftwithmajid.com/2023/10/31/m...
A phantom type is a generic type that is declared but never used inside a type where it is declared. It is usually used as a generic constraint to build a more type-safe and robust API. swiftwithmajid.com/2021/02/18/p...
We define a non-optional constant without a value, requiring us to set its initial value before use to satisfy the compiler. This leads to readability issues due to the loss of local reasoning. Switch expressions help address this. swiftwithmajid.com/2024/05/28/i...
The redacted modifier transforms images and text views in the view hierarchy to hide its content. Remember that the redacted modifier hides the data only visually. It is still clickable in case of buttons. It is your responsibility to disable buttons. swiftwithmajid.com/2020/10/22/t...
To handle app refresh tasks in SwiftUI, we have the backgroundTask modifier that we can attach to any scene. SwiftUI relies on the new Swift Concurrency feature and allows us to build complex async jobs using the async/await syntax. swiftwithmajid.com/2022/07/06/b...
SwiftUI provides a way to keep the structural identity of the view hierarchy while changing the layout container using the AnyLayout type. In this case, the SwiftUI doesn’t recreate the views. It only moves them according to the new layout. swiftwithmajid.com/2022/08/16/c...
Modularizing apps in the era of AI agents has become even more crucial. By establishing clear boundaries, you can ensure that your agent respects them, leading to better code outcomes. swiftwithmajid.com/2022/01/19/m...
ViewThatFits automatically measures available space and the size of its children and takes the first view that perfectly fits the available space. You don’t need to manually measure available space or calculate if the particular view fits into the available space. swiftwithmajid.com/2022/07/26/v...
You may think about defer keyword as one of the most ambiguous language features in Swift, but it is very useful in some cases. You can use it deliberately, and it will give you safety. swiftwithmajid.com/2026/05/26/s...
Remember to check whenever user enabled reduced motion accessibility setting while playing you custom animations in the app. SwiftUI provides access to a bunch of environment values like reduced transparency, cross fade transitions, reduced motion, etc. swiftwithmajid.com/2019/09/10/a...