Posts

Post marked as solved
3 Replies
262 Views
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?
Posted
by sharp11.
Last updated
.
Post not yet marked as solved
1 Replies
315 Views
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?
Posted
by sharp11.
Last updated
.
Post marked as solved
1 Replies
1.6k Views
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.
Posted
by sharp11.
Last updated
.
Post not yet marked as solved
6 Replies
5.0k Views
Since XCode 9, I've been seeing build errors hang around after they're fixed. It's very annoying because they obscure actual build errors.For example, a cocoapod was not in the right place, so the import statement was flagged. I fixed the dependency, ran the app, it ran fine, but the build error persisted for several more runs until I ran in a different simulator.Cleaning the build folder (even with OPTION key)did not help.Is there some other way to clear build errors?
Posted
by sharp11.
Last updated
.
Post marked as solved
1 Replies
674 Views
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?
Posted
by sharp11.
Last updated
.
Post not yet marked as solved
0 Replies
394 Views
What are the performance implications of letting a network monitor run for the life of the app versus starting and cancelling on a screen-by-screen basis? I'm particularly interested in network usage, but of course battery implications would be interesting as well.
Posted
by sharp11.
Last updated
.
Post not yet marked as solved
4 Replies
1.7k Views
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?
Posted
by sharp11.
Last updated
.
Post marked as solved
1 Replies
505 Views
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?
Posted
by sharp11.
Last updated
.
Post not yet marked as solved
3 Replies
910 Views
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?
Posted
by sharp11.
Last updated
.
Post not yet marked as solved
16 Replies
23k Views
In XCode 6.4, when I try to run the simulator of iPhone 4S (any of the iOS 8.x versions), I receive this error message:Unable to boot device because it cannot be located on disk.The simulator comes up, but (usually) the app doesn't run (occasionally, it does). XCode hangs.I was able to get it to run by removing all derived data and cleaning out the CoreSimulator/Devices dir and then rebooting my machine. But now it's doing it again.The other devices run fine on the simulator.
Posted
by sharp11.
Last updated
.
Post not yet marked as solved
2 Replies
1.9k Views
In XCode 9.2, I open the Accessibility Inspector and want to change font size to test dynamic type. I click the Settings tab, but there's no font size slider.
Posted
by sharp11.
Last updated
.
Post marked as solved
2 Replies
2.2k Views
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.
Posted
by sharp11.
Last updated
.
Post not yet marked as solved
50 Replies
13k Views
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.
Posted
by sharp11.
Last updated
.
Post not yet marked as solved
2 Replies
1.2k Views
I have a sample project with a single label constrained to the root view on top, leading, trailing sides. The label has numberOfLines=0 and multiple lines of text. In IB, the root view has Follow readable width checked, and for good measure so does the label. But when I run it on an iPad simulator, the width of the text is full screen. What's missing?
Posted
by sharp11.
Last updated
.