Tagged: SwiftUI
There are 202 items tagged #SwiftUI.
And there a lots of other tags to explore.
There are 202 items tagged #SwiftUI.
And there a lots of other tags to explore.
iOS 17 bring a new trick to animate number in SwiftUI. Let's learn how to do it.
Learn how and when you should ask for a user's review.
Learn different ways to create a Button with a Rounded corner Border in SwiftUI.
Learn a simple way to hide a back button in SwiftUI. And whether we should hide it or not.
iOS doesn't have a Floating Action Button, but we can easily recreate it using what we have in SwiftUI.
Learn how to use an old NSAttributedString inside a SwiftUI app.
The plain button style has behavior and appearance different from the other styles. Let's learn how this affects a tappable area.
You might want to use small caps to make your UI more interesting, but not all languages and typography support small caps. Let's learn how to solve this in iOS 17.
By default, you can dismiss a sheet presentation using a swipe-down gesture. But you might don't want this behavior on every sheet. Learn how to disable it in SwiftUI.
If you have ever added a tap gesture to a VStack or HStack, you might notice that space between content in a stack isn't tappable. Learn the reason and how to mitigate the problem.
In iOS 15, SwiftUI can indirectly set content inset using the safeAreaInset modifier. Let's learn how to do it.
In iOS 16, we can also set the size of a ProgressView, but it isn't straightforward as we do in UIKit. Let's learn how to do it.
In this article, I will teach you what I think is the proper way to present SFSafariViewController in a SwiftUI app.
In SwiftUI, there are two ways to open a URL in Safari, Link view, and openURL environment value.
Learn how to implement a custom init that accepts a @Binding variable.
At the moment (iOS 16), there is no specific way to style a Form. But you can style it based on the style that SwiftUI chooses for that platform. In iOS, Form uses a List view style.
Learn how to use an image as a button's label and how to adjust its color.
Let's learn how easy it is to pop or dismiss a view from a NavigationStack, a new navigation view in iOS 16.
Learn how to remove the topmost separator in any List view.
Learn how to pop a view from a navigation view in SwiftUI.
An Enum is one of the data structures that best represents options for the Picker view. Let's learn what we need to do to make an enum usable in a Picker.
Configure a launch screen via Info.plist is quite limited. If you want greater control and flexibility, you can use a Storyboard as a launch screen instead.
Learn how to preview SwiftUI view without a distraction of a device frame.
If you create a new SwiftUI project, you won't see a launch screen storyboard anymore. Learn how to configure a launch screen in the SwiftUI world.
In iOS 15, we finally got a way for users to manage their subscriptions right within the app.
Learn a proper way to remove a back button title in SwiftUI.
Explore all possible picker styles, so you can choose the one that suits your needs.
In this article, we will quickly go through some of the new features in Xcode 14.3 and iOS 16.4 that I find interesting.
The ability to run some code periodically is an important task in iOS development. Let's learn how to do it in SwiftUI.
Since iOS 14, SwiftUI Text has had many initializers dedicated to presenting dates. Let's explore all of them.
Learn how to use SwiftUI view as a UIView in a UIKit project that uses a Storyboard.
In IOS 16, SwiftUI comes up with a better way to manipulate a navigation path. This makes it possible to pop a navigation stack to the root view.
Learn how to have custom logic for a navigation view back button.
We can create a view controller that represents a SwiftUI view by subclassing a UIHostingController. Let's learn how to do it.
Learn how to use SwiftUI view as a UIViewController in a UIKit project that uses a Storyboard.
Having both background and border in SwiftUI isn't straightforward. Let's learn how to do it.
We can use SwiftUI view in UIKit by wrapping it in UIViewController. Let's learn how to do it.
The onMove modifier enables item reordering on every row. Let's learn how to disable this on particular rows.
Learn how to change the background color of a SwiftUI Button.
The onDelete modifier enables item deletion on every row. Let's learn how to disable this on particular rows.
Learn how to remove the bottom separator in any List view.
Learn how to enable/disable the reorder ability in SwiftUI List.
Learn how to change a status bar text color in SwiftUI.
Learn how to enable/disable the delete ability in SwiftUI List.
In this article, I will show you all 5 button styles you can use with SwiftUI Button in iOS.
Some list style has section separators. Let's learn how to remove them.
SwiftUI made it incredibly easy to create a button compared to how we do it in UIKit. Let's learn how to do it.
Learn how to make all subviews in HStack have an equal height.
A list view doesn't support horizontal scrolling, but we can fake it using ScrollView and LazyHStack. Let's learn how to do it.
It is very common to populate a list view from an array of data. Let's learn how to do it in SwiftUI.
SwiftUI has many ways to dismiss a modal view based on how you structure your view and the minimum iOS version you support.
Even though ForEach and List have similar syntax, they serve different purposes. Let's learn about their differences.
Is it OK to manually initialize @StateObject? Let's find out.
Learn how to initialize a state variable and discuss whether you should do it or not.
In iOS 15, we can remove a List row separator. Let's learn how to do it.
You can use ForEach inside a List view in SwiftUI, but when should we use it? Let's learn in which cases we should use ForEach.
In iOS 16, SwiftUI finally got a new modifier to disable scrolling in ScrolView and List.
By default, the selected tab bar item will use the iOS default blue color. Let's learn how to change this in SwiftUI.
An accent color is a simple and unified way to theming your app. This article will teach you how to set a global accent color for your app.
Dynamic Type automatically scales a font size according to Accessibility settings. In iOS 14, we also have a way to scale numeric values like padding and margin.
Most of those styles use uppercase text for the section header. In this article, we will learn how to opt-out of this behavior.
In iOS 16, we can adjust a List row separator insets with the new alignment, listRowSeparatorLeading.
In iOS 16, SwiftUI got a way to change the bottom tab bar background color with the new modifier, toolbarBackground.
In this article, I will show you all 6 list styles you can use with SwiftUI List view in iOS.
SwiftUI has many ways to dismiss a sheet view based on how you structure your view and the minimum iOS version you support.
Learn how to make your custom font scale automatically like the system one.
You can easily add keyboard shortcuts to Mac, iPhone, and iPad with the keyboardShortcut modifier.
There are many ways to create a rounded corners button in SwiftUI. Let's learn how to do it.
Learn how to simulate the viewDidLoad() behavior in SwiftUI using the onAppear modifier.
When creating an app, there is a time when you want to create a repetitive view or a collection of views from an array of data. We can do that in SwiftUI with ForEach.
zIndex is a modifier that controls the display order of overlapping views in SwiftUI. Let's learn how it works.
SwiftUI made it incredibly easy to create a list or table view compared to how we do it in UIKit. Let's learn how to use it.
In iOS 16, Apple introduces three new width styles to the SF font family. Let's see what they look like and how to use them.
SwiftUI got many beautiful built-in button styles. One problem you might get is it isn't obvious how to control the size of it. Let's learn how to do it.
In iOS 16, SwiftUI got a new tool, AnyLayout, that makes it possible to transition between layouts while maintaining the identity of the views.
If you have a layout that the built-in layout like VStack and HStack can't serve, you can create a custom one in iOS 16. Let's learn how to do it.
Making SwiftUI views responsive usually involves a lot of GeometryReaders and if-else. In iOS 16, SwiftUI got a new view that makes it easier. Let's learn how to do it.
When you read SwiftUI tutorials, you might stumble on the fixedSize() modifier. Let's see what it is and why we need it.
A navigation bar is an essential part of iOS apps. It is a part where we usually apply color to match our branding. In iOS 16, we can customize a navigation bar purely in SwiftUI.
Variable Color is a new feature of SF Symbols that allows you to change the appearance of a symbol based on a percentage value. Let's learn what it is and how to use it.
In iOS, we have dedicated built-in ways to dismiss the keyboard in scrollable content. Let's learn how to set that in SwiftUI.
In iOS 16, we got a native way to present a bottom sheet in SwiftUI. Let's explore its behavior and limitation.
In iOS 16, we got a big improvement over lineLimit modifiers. Let's see what we can do with it.
In iOS 16, we finally got a native way to change the background color of a list view in SwiftUI.
In SwiftUI, we have no direct way to change a status bar style. But we can indirectly control it through two view modifiers.
In iOS 16, we have a new view to select multiple dates. Let's explore its capabilities.
In iOS 16, we can create a multiple text field with new initializers and a little help from the .lineLimit(_:) modifier.
iOS 16 add a new Grid view to SwiftUI. A Grid view arranges child views in rows and columns. This table-like structure makes a layout that is hard to do in vertical and horizontal stacks become easier.
iOS 16 add the ability to integrate a text field in an alert.
Learn a dedicated modifier to change a list row background color in SwiftUI.
Learn the difference between a horizontal and vertical grid and everything you need to know to use them.
We can group related data in a SwiftUI list using Section view. We can also optionally add a header and footer to describe a particular section. Let's learn how to do that.
SwiftUI Divider has some limitations, but you can overcome that with modifiers. Let's explore its limitation and capability.
In this tutorial, we will learn how to create a circular progress bar in SwiftUI using just three SwiftUI views.
There are two ways to set a font size for Text view in SwiftUI. Let's see what they are and how to set them.
We have no way to set the minimum lines of Text in SwiftUI, but you can have that with this bit of hack.
Learn how to apply gradient colors to a SwiftUI text view.
Learn how to make hexagon-shaped profile pictures in SwiftUI.
Align text within a container view in SwiftUI isn't a straightforward operation as you might think. Let's learn how to do it.
A label might seem trivial, but it plays an important role in SwiftUI. Let's learn about this simple view.
iOS introduces a new concept to SF Symbols, SymbolVariants. Let's see how this improves the way we interact with symbols.
Initializing an NSViewController without nib isn't straightforward as UIViewController. Trying to do so would result in a runtime error. Let's learn how to do that.
We can use a frame modifier to make a view appear to be full width and height, but the result might not be what you expected.
In Swift 5.5, we can apply button style using leading dot syntax, .buttonStyle(.plain), instead of a full name of a concreate type, .buttonStyle(PlainButtonStyle()). Let's see how we can make our custom button style support this.
Learn the difference between all-new alert APIs in iOS 15.
It might not be obvious that we can create a custom environment value, but we can do that. The steps to create one are not as straightforward as we usually do, but it isn't hard if you know how to do it.
If you have ever worked with an app with multiple alerts, please beware that the system can present only the latest or outermost one. Let's see how we can mitigate this.
Learn how to show an alert (UIAlertController) in SwiftUI.
Once the sidebar is collapsed, there is no way to get it back. Learn how to mitigate the situation.
In UISearchController, we can set search bar hiding behavior with hidesSearchBarWhenScrolling property. But how to control this behavior isn't obvious in SwiftUI. Learn how to control search bar hiding behavior in SwiftUI.
SwiftUI finally got native search support in iOS 15. We can add search functionality to any navigation view with the new searchable modifier. Let's explore its capability and limitation.
New in iOS 15, SwiftUI has finally support preview in landscape orientation. Let's find out how to do it.
SwiftUI got a native way to add UIRefreshControl in iOS 15. Let's find out how to add it in the list view and even your custom view.
We can make a simple bevel effect using two inner shadows. SwiftUI has a built-in way to add a drop shadow with the shadow modifier. But if you want to add an inner shadow effect, you need to be a bit creative.
Leaning tips and tricks about the tool will help you down the road. Today, I will show you 4 Xcode shortcuts that I find helpful when dealing with SwiftUI.
Setting background color in SwiftUI is not as straightforward as UIKit. Let's learn how to do it.
Learn how to fit an image view to any container.
In UIKit, we have various ways to control an image's position and behavior in UIImageView with a help contentMode property. In SwiftUI, we only have fit and fill content mode. Let's see how we can replicate the rest.
Learn how hard or easy it is to add a background view in SwiftUI.
SwiftUI doesn't have a built-in way to preview for a device in landscape orientation at the moment, but we can simulate that with a few modifiers.
@StateObject is an essential property wrapper in SwiftUI, but I found the way to initialize them is not obvious.
Learn how to use aspect fit and aspect fill content mode to fit your image to its bounds.
Show and hide transition animation in ZStack can be glitchy. Learn how to fix it with a simple trick.
Learn the way to create the UISegmentedControl equivalent in SwiftUI.
Part 4 in the series "Building Lists and Navigation in SwiftUI". We will explore a NavigationView, UINavigationController equivalent in SwiftUI.
Part 3 in the series "Building Lists and Navigation in SwiftUI". We will explore a List, UITableView equivalent in SwiftUI.
Part 2 in the series "Building Lists and Navigation in SwiftUI". We will explore a ScrollView, UIScrollView equivalent in SwiftUI.
Learn how SwiftUI shares application settings and preference values across the app.
Part 1 in the series "Building Lists and Navigation in SwiftUI". We visit the first building block of any list view, content, and how to create them.
SwiftUI provides an easy way to convert to render any view into a placeholder style by redacting its content.
In iOS 14, we have a new way to put images along with texts.
SKOverlay is a new tool from Apple for doing apps cross-promotion.
In iOS 14, we finally have a way to set a toolbar for a view in a navigation view.
Learn how to set a navigation bar title view in SwiftUI.
This modifier can interpolate position and size between two views. This is one of the most exciting features for me. Let's see what is capable of in this beta.
The most popular question since the introduction of SwiftUI. Here is my thought after WWDC20.
A new way to create a reusable view.
Explore how delay and repeatForever affect an animation.
Introduction of SF Symbols, learn the basics, and how to use them.
Neumorphism or Neomorphism is a new design trend of UI recently. We are going to see how to implement this in SwiftUI.
A guide to creating an activity-ring-like circular progress bar in SwiftUI. An in-depth tutorial of what I think when making a custom view. At the end of this article, you will be able to create the Activity ring used in the Activity app on Apple Watch.
SwiftUI has built-in ways to apply gradient color to its view. We are going to explore all three types of gradients provided, LinearGradient, RadialGradient, and AngularGradient.
Most complex custom views can be made by composing many basic shapes together. Today we will learn basic operations that we can do with them. It may seem trivial, but knowing these basics will benefit you in the future.
The last part in a series on understanding data in SwiftUI. See all tools SwiftUI provided to declare different types of data and dependency. Learn when and how to use @State, @Binding, ObservableObject, @ObservedObject, @EnvironmentObject, and @Environment.
Part 2 in a series on understanding data in SwiftUI. We will talk about the key that makes principles in part 1 possible in SwiftUI. And how this resulting in a reduction of the complexity of UI development.
Part 1 in a series on understanding data in SwiftUI. In the first part, we will try to understand the importance of data and how they play an essential role in SwiftUI.
Learn how to create a custom subclass of UIHostingController and its benefit.
Learn a crucial concept in SwiftUI, view modifier, and a guide of how to create your custom modifier.
WWDC session shows us a way to create UISplitViewController with NavigationView in SwiftUI. It finally works in Xcode 11 Beta 3.
See all tags.