Post

Replies

Boosts

Views

Activity

WidgetKit memory limit and CoreData+CloudKit issue
I have my iOS app with a WidgetKit extension. The app is used for storing lists of any data that the user wishes to, and the widget shows a few of the items, such as upcoming birthdays, etc. The app and widget extension use CoreData+CloudKit, sharing the same database which is about 350mb currently. When the widget tries to load, it would seem that the size of the database is causing my widget to use more than 30mb of memory (about 45mb when run in the simulator). On a physical device (iPhone 13 Pro Max) using more than 30mb makes the widget crash out while updating its content. This is very frustrating as the iOS app uses about 50mb of memory and it's perfectly fine with it, but I am unable to use the same data to power my widget. I have considered maybe using some kind of temporary in memory data for my widgets, updated by the app, but the data would change regularly and you'd expect it to change without opening the app. e.g. A widget showing a list of upcoming birthdays should update each day, rather than rely on the user to open the app first. Is it possible to raise or remove the widget memory limit of 30mb? Or, is there some way to make CoreData use a lot less memory? It appears to be when I make a call to loadPersistentStores that the memory usage suddenly shoots up. I'm guessing that it's loading some kind of indexing data. I'm not even trying to read any data before it maxes out. My widget only sets up CoreData and then does loadPersistentStores and then boom! I've tried lots of googling, searching these forums, and ChatGPT, and none have given me any answers that actually work. ChatGPT gives me lots of answers that don't work lol. I'm hoping that somebody has answers that they've actually tried and know do work. Many thanks for any help, as this is super frustrating!
1
1
1.6k
Jun ’23
handleInApp response code not available in custom SiriKit intent
Hi, I have created my own custom SiriKit Intent, and in the handler I am returning the response code of .continueInApp which opens my app in response. I've worked out that I want to open my app in the background, and .handleInApp seems to be the correct response code to do this. However, .handleInApp is not an option in my intent's enum generated by Xcode. If I look at the auto-generated code, I see .continueInApp, and .success, etc, but no .handleInApp. My Deployment Target is set to iOS 15.5 everywhere that I can find, so I really can't figure out why .handleInApp is not included in the auto-generated code. I've even tried creating a brand new workspace and project totally separate from my main one, and still creating a SiriKit Intent Definition does not generate code that includes .handleInApp. Is there something I need to enable to make .handleInApp appear as an enum option?
3
0
1.2k
Jul ’22
Built in flood fill (bucket tool) ability for UIImage or CGImage?
Hi. I'd like to be able to do a flood fill on images, either UIImage or CGImage, and was wondering if there was a built in way to do this provided by Apple's standard frameworks? i.e. Take a bitmap image and specify a point and color and then make it fill the area with that color, no matter what shape it is. I've seen a few examples of algorithm code to do this, but they're quite large and complicated so am trying to avoid them.
0
0
1.1k
Mar ’22