Post

Replies

Boosts

Views

Activity

Pitfalls of manual dependency management in Xcode?
I have given up trying to get Xcode's package manager to work. This is a question about whether my workaround is a bad idea. (Yes, I know, when SPM works, it works just fine. But recently I needed to update some package versions and spent hours staring at Package resolution failed. The worst part is that it takes 15-30min to fail (fetching, verifying, validating endlessly)! I have tried deleting DerivedData, Packages.resolved, restarting Xcode, resetting the package cache, removing ~/Library/Caches/org.swift.swiftpm, etc.) My workaround is simple: for each dependency, clone the repo myself and then drag it into Xcode navigator. Add its library to each target's "Frameworks, Libraries, and Embedded Content" section. This seems to work fine. My question is whether there are pitfalls to this approach?
3
0
698
Feb ’24
Checking for connectivity impossible in background URLSession?
To check for connectivity we should either: Set waitsForConnectivity = true and then monitor taskIsWaitingForConnectivity, or Set waitsForConnectivity = false and then fail immediately However background sessions always wait for connectivity AND never call taskIsWaitingForConnectivity. Huh? In our case, at the time user is initiating downloads the "background" session is actually in the foreground and we need this information. What am I missing?
2
0
517
Aug ’23
Widget is completely black on some devices
On most devices, my widget works fine. However, on some devices it gets stuck in a mode where it is solid black with no content. Even the preview snapshot displayed in the widget installer is black. Deleting and reinstalling the app and widget does not fix this. This is a simple widget that displays an image included in the app, with a fallback to a bundle asset if that image cannot be found. No networking is involved. I am wondering if iOS is somehow caching a "blank" widget, although I am able to break on widget code and verify that getSnapshot() is getting called by the installer.
1
0
3.8k
Jun ’23
OSLog capture semantics
If I write: Logger().log("Log this value: \(myInstanceProperty)") I get "Reference to property 'myInstanceProperty' in closure requires explicit use of 'self' to make capture semantics explicit." This seems to imply an escaping autoclosure, which means we must guard against retaining self. Is this correct or is it safe to include a strong self here?
1
1
1k
Mar ’23
Compiler thinks non-async property is async?
I am getting an error from the compiler: Expression is 'async' but is not marked with 'await' But the expression is not async. Here's a minimalist example: func testAsync() async -> String { let result = App.instance.dataManager.getData() // ERROR: Expression is 'async' but is not marked with 'await' ... async stuff here ... return result } The error occurs on the first line of this function. But getData() is not async, nor is dataManager an async property. I can get rid of the error if I get rid of the singleton instance property: func testAsync() async -> String { let dataManager = DataManager() // no error let result = dataManager.getData() // no error ... async stuff here ... return result } But neither the singleton nor the instance property are async. If I comment out the "async stuff" and remove async from the function declaration, it builds fine. Is this a compiler error or am I missing something?
4
0
2.4k
May ’22
Unusual configuration problem for subscriptions
My educational app is structured around courses. Users can subscribe for "unlimited" courses or a "single course". The question is how best to implement the "single course" subscription -- so that the app knows which course is subscribed and also so that the user can change courses? One approach would be to define a separate subscription IAP for each course. Then it's trivial for the app to know which course, and the user could upgrade/downgrade/crossgrade to a different course using the Manage Subscriptions UI. The problem is that we already have a dozen courses and we're headed for dozens more. I'm afraid the Manage Subscriptions UI wasn't intended to handle a case where there are hundreds of subscription options. The other approach would be to have only one "single course" subscription; then I'd need to manage the course info myself and there'd be no good crossgrade path for the user. Am I thinking about this correctly? Are there other options besides the two mentioned?
1
0
662
May ’22
How to submit already approved IAP for review? App Rejection, guideline 2.1
I have an app that has been in production for years. It has a single in-app purchase that was approved years ago. Recently I submitted a routine update for review and my binary was rejected. The reason: Guideline 2.1 - Performance - App Completeness We are unable to complete the review of your app because one or more of your in-app purchase products have not been submitted for review. I replied (with screenshots) that the IAP is already approved and they said, "no, that's a different IAP." But the app has only one IAP. I tried to submit a new binary and re-submit the IAP for review, but it seems that you have to remove it from production in order to do that. This will break the app. I have appealed the rejection and the appeal reviewer agreed with the original review. The App Review Board evaluated your app and determined that the original rejection feedback is valid. Your app does not comply with App Store Review Guideline 2.1. Here's another developer with the same experience: https://developer.apple.com/forums/thread/102738 Any way out of this catch-22?
3
0
1.2k
Dec ’21
Archive build w/ SwiftUI dependency fails in Xcode 13
My app uses a 3rd party lib (AMPopTip) which conditionally includes some SwiftUI code. The app builds and runs fine in Xcode 13, but the archive build fails with errors such as: Cannot find type 'View' in scope Cannot find 'UIHostingController' in scope These errors only show up for armv7 architecture. At first, I thought I should not be building for armv7, but in fact the same archive build works fine in Xcode 12.5.
4
0
2.6k
Sep ’21
IAP Unexpectedly "Waiting for Review"?
My app was rejected bc the reviewer had a problem completing an in-app purchase. That code is thoroughly tested; I can only guess they ran into the usual sandbox App Store flakiness. After the rejection, all my IAP's were marked "Developer action needed". Following a suggestion on the forums, I made one trivial edit and they all changed to "waiting for review". This makes no sense as they haven't actually changed. But now I'm unable to re-submit my app. My launch is time-sensitive and I'm afraid I've fallen into limbo. Can anyone explain what's going on?
1
0
699
Jul ’20
UICollectionView compositional layout with hierarchical (nested) data
I am super excited about the new compositional layout apis in collection view, however it's not clear how to handle an important use case in my app: hierarchical data.Here's a made-up example of a hierarchical data model:I'm displaying a list of fruit. For each type of fruit (apple, banana, ...), I have: + a variable number of varieties + a variable number of favorite dishesIn my list, I want each variety and each dish to have its own thumbnail image.From a layout perspective, compositional layout is perfect for this; but from a data model perspective ...Each fruit could be a separate section; but within each section you have to flatten your data, indexing varieties and dishes in a single collection. That feels ugly and error-prone.Now imagine we want a single list that covers fruit, vegetables, and herbs. If we make each main category a section, then within each category we have to flatten all our names, varieties and dishes into one big list. That feels really ugly and error-prone.Alternatively, we could define a separate section for every distinct data set:1. Apple2. Apple varieties3. Apple dishes4. Banana5. Banana varieties6. Banana dishes...But this also loses the nested quality of the data. Eg., we couldn't have separate sections for our categories.I'm wondering if I'm thinking about this correctly or perhaps missing something?
8
0
2.1k
Jan ’20
Can't generate promo code
I have been receiving this error message since April 5:Can't Generate Promo CodeWe're having trouble generating the codes. Please contact App Store Developer Support for assistance.I have plenty of promo codes remaining.Also, when I click through to the contact page, I get a useless series of menus that let me specify my problem and no place to actually send a message. It just has two buttons ("Start over" and "Done").UPDATE: After six (6) days of downtime, this appears to be fixed.
50
0
14k
Apr ’18