Category "swift5"

How can I make a background color with opacity on a Sheet view?

I'm currently developing an application using SwiftUI. I'm looking for some way to make a background color with opacity on a Sheet view. is there any way to do

Change UIScrollView's frame programatically (Swift 5)

How can I change the height of the frame based on the size of the subview programatically? scrollView.frame = CGRect(origin: scrollView.frame.origin, size: CGSi

Why there's no Int Index for Set struct in Swift?

I know that Strings in Swift don't have Int indices as Swift supports Grapheme Clusters. But, when coming to Collections in Swift, Array supports Int indices bu

SwiftUI - is it possible to get didSet to fire when changing a @Published struct?

I have just updated to XCode 11.4 and some of my code has stopped working. I have some @Published struct variables in an ObservableObject. Previously, when I up

Swift 5 UIButton title didn't change

I just learned Swift and developed an iOS project. But the button title doesn't change when I click it. How can I change the title? Simulator: iPhone 11 iOS14.4

Whenever I add a spacer into my code. it crashes. It works fine until then

This is simple code I made to practice with spacers. This is SwiftUI. struct Spacer: View { var body: some View{ HStack{

Conditional property in SwiftUI

How can I add an additional property based on a condition? With my code below I get the error: Cannot assign value of type 'some View' (result of 'Self.overlay

Align Items in swiftUI Stack Evenly

How can the items in a swiftUI Stack be aligned evenly to fill up all the available space? The first and last item should be straight at the beginning / end of

Picker's configuration is not a valid configuration, Swift

I am working on new image picker API provided by Apple in WWDC2020 named as PHPicker. I am getting this error when I select the image form the picker second tim

Read Data From Text Field in TableView Dynamic Cell in Swift

I want to read the text in the text fields in my dynamic cells in the table view. Each cell has two text fields and the user can add more cells. My question : H

Dynamic links / universal links not working in cold start

I use firebase dynamic links. They work perfectly fine when the app is in background and I use the application continue userActivity function. However if I cli

What is the "some" keyword in Swift(UI)?

The new SwiftUI tutorial has the following code: struct ContentView: View { var body: some View { Text("Hello World") } } The second line the

Is there any way to swipe to delete/ Add actions into cell in UITableview Diffable datasource?

I am trying to add swipe actions into my tableview. when I used simple tableview datasource method it worked fine (trailingSwipeActionsConfigurationForRowAt). b

How can I conform a Swift actor to a protocol while preserving isolation?

Let's say we have the following goals: We want to use actors. We want to use dependency injection and resolve actors through DI. We want to hide our actors behi

Self sizing collection view enters a recursive loop in iOS 15

I have a self sizing collection view and when I call super.layoutSubviews my app crashes since the collection view enters a recursive update loop. This was work