Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

@EnvironmentObject explained for sharing data between views in SwiftUI

@EnvironmentObject is part of the family of SwiftUI Property Wrappers that can make working with SwiftUI views a little easier. Sharing data between views can be challenging when working in SwiftUI, especially when we have a lot of child views being dependent on the same piece of data. We could ...
SwiftUI

How to create a Conditional View Modifier in SwiftUI

Conditional View Modifier creation in SwiftUI allows you only to apply modifiers if a certain condition is true. Whether it's a simple checkbox value or an OS availability check, there are many cases in which you want to apply different configurations to your views. A View Modifier in SwiftUI modifies ...
SwiftUI

How to create a Dynamic Pager View for onboardings

A pager view in SwiftUI like we know UIPageViewController in UIKit didn't exist until iOS 14 and macOS 11.0. Using the PageTabViewStyle on a TabView will result in a swipeable set of pages. However, what if you want to support iOS 13? And how would you do something similar on ...
SwiftUI

withAnimation completion callback with animatable modifiers

SwiftUI is great when it comes down to animations as it does a lot for you with methods like withAnimation and animation(...). You can simply pass in the things you'd like it to animate and SwiftUI will make sure your views move smoothly from one state to another. Sometimes, however, ...
SwiftUI

How to combine text weights in SwiftUI

Combining multiple text weights in SwiftUI might not look straight forward at first. If you're used to using UIKit you were probably looking into support for NSAttributedString in which you could apply different text styles for certain ranges. SwiftUI makes it possible to combine different text styles with the built-in ...
SwiftUI

SwiftUI Previews: Validating views in different states

SwiftUI Previews allow us to develop a lot faster as we can now preview our views live in Xcode. Whenever we change a piece of code, our preview will update and show the rendered change accordingly. While developing a view that has to change into different appearances for certain states ...
SwiftUIXcode

Using Xcode Previews with existing UIKit views without using SwiftUI

Xcode Previews have been added in Xcode 11 and allow you to quickly preview the current state of your view. Although you might think that you need to use SwiftUI to make use of this great new feature, it's not true! Whether you're working with a custom UIView or with ...
SwiftUIXcode
Loading...