-
Read events from the calendar
In this post, we’ll learn how to read events from the calendar in our SwiftUI application. In the next one, we’ll learn how to add an event to the calendar. For today’s events, I display only the title: We need to complete two steps: The Event Manager: First step: Import EventKit. The class is annotated…
-
Navigate Programmatically
The classic way to navigate in a SwiftUI application is by using the NavigationStack with NavigationLink. In 99% of cases, this is sufficient. However, in some cases, we may need to navigate programmatically. How can we do that? As we can see, we use a path passed to the NavigationStack. When something is added to…
-
Localization
When you create a successful app, you need to localize the application for users from different countries. To do that in Xcode is simple. In the File menu, choose New and then File from Template, then select the String Catalog and save the file as Localizable. Now, if you run the application, this file will…
-
Splash screen
In this post, we’ll see an object that is present in many popular applications: the Splash Screen. With the storyboard, we have a specific object for that. In SwiftUI, the splash screen is a regular view that we can create however we want. In the example, the splash screen contains a heart that pulses for…
-
Alert
We can display an alert using the .alert modifier. Take a look at the code: The role of the button can be: Note that using a button with .destructive is also added the default cancel button
-
LazyGrid
In SwiftUI we have two powerful and efficient grids to display multiple items: The fundamental element for these types of grids is the GridItem, which can be of three types: GridItem Adaptive GridItem Adaptive is essential for a responsive layout. By setting a minimum size for it, the grid will try to adapt to all…