Relative Content

Tag Archive for iosxcodeswiftui

Text refusing to show in preview mode with Xcode and swiftui

As the title suggests, unable to get the scene preview for a game using Xcode with SwiftUI to display any text on the screen at all. I’ve tried a few guides online and even put my code into a code tool with some suggestions but to no avail. The background is loading correctly but I’ve yet to see any sort of text appearing anywhere on the screen.

Text refusing to show in preview mode with Xcode and swiftui

As the title suggests, unable to get the scene preview for a game using Xcode with SwiftUI to display any text on the screen at all. I’ve tried a few guides online and even put my code into a code tool with some suggestions but to no avail. The background is loading correctly but I’ve yet to see any sort of text appearing anywhere on the screen.

How to update the uiview with the progress of class method

I have a UIView with a list of items. When one item is deleted from the list an overall variable will be recalculated in the model class, which will take some time as it will go over all data on all the items. In order to keep in touch with the user I like to show a progress bar, but for that I need the percentage done from the class to the UIView. I was not able to find out how to get the percentage during the recalculation. I would be very happy if one could point me to the right direction:

Text field in SwiftUI iOS app hangs/lags, why?

I’m creating a dictionary application as a personal project. I’m loading in a text file with 70,000 lines of strings (about 2MB). When typing in the keyboard, the key strokes hang, creating a frustrating lag for UX (can type like one character per second max). I’d like to know why. I’ve been debugging this application for the last week. At first, I thought it was the filtering operations when the user searches for text that was slowing everything down. So I created the TextField with debounce logic, to limit the number of times the filtering would happen (e.g. if I user typed keys with less than 800 miliseconds it wouldn’t filter on each individual keystroke, saving time of looping over the entire dictionary unnecessarily until the user paused for 800ms). Shockingly to me, this did not help. I could see that the filtering would execute only after 800 seconds, but the text field was still lagging when typing. I then put all that filtering logic into a Dispatch Queue to run on a secondary thread. That didn’t help. I then removed the filtering operations entirely, and the keyboard lag still persists!

SwiftUI use .presentationSizing

With iOS 18 beta which recently came out, I was curious in how to use the new .presentationSizing. Does it completely change the size of the sheet or is this only a notable feature for mac apps? Also are there any new features which make it so the .sheet can be presented above the tab bar like in the apple FindMy app.

Why does my app always prompt the same quote?

I’m a newbie Xcode enthusiast, trying to create an iOS application in Xcode where on the “Et moi” button, random quotes are prompted.
My problem is that despite having created tables for the different quotes to be generated randomly, it doesn’t work.