Posts from Swift

Get index in ForEach in SwiftUI

By Samim

In this tutorial, we will see how to get an index in ForEach in SwiftUI. In SwiftUI, we can use the ForEach loop to create a list of items or views. If we want to get  index of th.... Read More

Disable Past date selection in DatePicker SwiftUI

By Samim

In this tutorial, we will see how to disable the selection of past dates in a DatePicker in SwiftUI. In SwiftUI, we can disable past dates in a DatePicker by setting a minimum date.... Read More

How to add a Package in SwiftUI project – Xcode

By Saruque Ahamed Mollick

In this tutorial, I will show you how to add a Package dependency in SwiftUI project in Xcode. This will work on any Xcode project. (Not only SwiftUI) Steps involved: Open your Pro.... Read More

How to draw a border around a view in SwiftUI

By Samim

In this tutorial, we will see how to draw a border around a view in SwiftUI. In SwiftUI, there is a special modifier called the border() modifier that helps us create borders aroun.... Read More

Change alert message font color, background color in SwiftUI

Change alert message font color, background color in SwiftUI

By Saruque Ahamed Mollick | October 30, 2023

The straightforward and simple answer is a big NO. For now, SwiftUI does not allow you to change any of the color schemes in the alert. Theoretically, you can do that by customizing UIAlertController which I do not recommend at all. Still, if you are desperate to get your own custom alert you can check […] Read More

Add spacing between letters in text in SwiftUI

By Samim

In this tutorial, we will see how to add spacing between letters in text in SwiftUI. In SwiftUI there are two modifiers that allows us to adjust the spacing between letters. The ke.... Read More

Add image and text both on a button in SwiftUI

By Saruque Ahamed Mollick

In this tutorial, I will show you how to add image and text at the same time on a button in SwiftUI. It’s easy for us to add text label to SwiftUI button. Here, you will lear.... Read More

Disable Auto Rotation in SwiftUI

By Saruque Ahamed Mollick

If you are building your app in SwiftUI using Xcode, you might notice that even if your device’s (maybe an iPhone or iPad) portrait orientation lock is turned on, your app wi.... Read More

Related Posts