Posts

Working with REST APIs in SwiftUI: Tips, Tricks, and Best Practices

Image
I am using a REST API to fetch data. You will see how to use URL sessions in Swift to get JSON files and images.  This is a very important topic, especially if you are planning to land a job as an iOS developer soon. Using an API in a take-home project is a very common task. 

Sections 56: Searchable in SwiftUI

Image
Starting SwiftUI 3.0 and iOS 15, Apple made searching through a list a lot easier. With a simple modifier, SwiftUI will automatically add a search field in the best possible place it can find. Effortlessly search through a list.

Sections 55: Swipe actions in SwiftUI

Image
Easily add swipe actions to a row in a list. Swipe actions on a list row is easy to implement with the new swipeActions(edge:allowsFullSwipe:content:) modifier, introduced in SwiftUI 3.0 and iOS 15. In this tutorial, let's see how to implement that!

Sections 54: List Row Separators in SwiftUI

Image
Customizing how a list is displayed has never been easier than with SwiftUI 3.0. Two new modifiers have been introduced to customize the list row separator's color and its visibility. Let's see how to use them!  Customize list row separators.

Sections 53: Format Date with Formatted in SwiftUI

Image
Use SwiftUI 3.0's .formatted() function to format a date. With SwiftUI 3.0, we can now easily format a date with the .formatted() method. Let's see how easy and simple it is to get different formatted dates with this new method.

Sections 52: Load remote images using AsyncImage in SwiftUI

Image
Starting from SwiftUI 3.0, loading remote images in an application doesn't require a third-party package anymore: it's built-in with AsyncImage! In this section, we'll take a look at this new view and learn how easy it is to implement it.

Sections 51: AttributeContainer in SwiftUI

Image
AttributeContainer , along with AttributedString, allows us to easily style our Texts - wether it's by adding a foreground color, a background color or adding an underline. Any Text style can be easily achieved with AttributeContainer. Let's see how to make use of it! Style AttributedStrings with AttributeContainer

Sections 50: Markdown with AttributedString in SwiftUI

Image
SwiftUI 3.0 comes with amazing new features, including markdown support with AttributedString. Let's see how to format a string from markdown using AttributedStrings! Use AttributedString to generate formatted text from markdown.

Sections 49: Conditional modifier in SwiftUI

Image
Learn different ways to add a conditional modifier to your SwiftUI view In your SwiftUI application, you might want add a modifier to an element depending on a certain condition.  There are multiple ways to achieve that: wrapping everything in an if else statement, adding a ternary operator in a modifier, or creating a View extension so that we can simply add a .if modifier.  In this section, we'll cover the three methods.

Sections 48: Wheel and Segmented Picker in SwiftUI

Image
Create a wheel picker using SwiftUI's built-in Picker, to allow the user to select from multiple choices When you create a form in your application and want to get, let's say, the user's age, you can easily add SwiftUI's built-in number picker.  You can also easily create a segmented picker with SwiftUI's built-in Picker. Let's see how to create a wheel picker, as well as a segmented picker.

Learn with videos and source files. Available to "SwiftUI IO" subscribers only.