Post

Replies

Boosts

Views

Activity

Minimum functionality for private distribution?
I have a customer who wants to give his employees an iPad that does nothing other than display some fixed videos and PDF files. The customer has an Apple Business Manager account an an MDM. The solution we discussed is that my company would build their content into a simple app, distribute it to them via private distribution in the app store, and they would use their MDM to put it on their iPads in Single App Mode. My concern is that Apple will still need to review the app and may reject it on the grounds that it violates the "Minimum Functionality" rule (4.2). Is this rule enforced even for B2B apps that are destined for private distribution? Thanks, Frank
1
0
664
May ’22
What happened to Info.plist and AppDelegate?
I don't really like to use Storyboards (I prefer individual XIB files) and I definitely don't want to use SwiftUI or "Scene Delegates". I'm familiar with the steps necessary to create my own UIWindow in AppDelegate. With each subsequent version of Xcode, it seems to get harder and harder to set up a new project the way I prefer. In order to get rid of the default storyboard, I have to both delete the file and then remove the word "Main" from Main Interface in the target, which is not obvious (you sort of have to backspace over it and hit Enter). With the addition of "Scene Delegates" (I don't know what they are and I don't care), I now have to remove some methods from AppDelegate and a key from Info.plist. With the current version of Xcode, I'm left with an app that has no other values in Info.plist and no methods in AppDelegate except didFinishLaunchingWithOptions. What happened to all that stuff? Should I manually create it or copy it from an older project? Will iOS even still call the rest of the AppDelegate methods if I create them? What happens if I want to change something that used to reside in Info.plist, such as Bundle display name? Do I just go in and add it? Why can't Apple just add a third option to create an empty project instead of making you start with Storyboards or SwiftUI? I know that Apple is keen on attracting new developers who have time to learn whatever they put out, but I hope they still care about people like me, an iOS developer since 2009 who doesn't want to completely relearn iOS programming every three years. Thanks, Frank
0
0
768
Aug ’22
Continuous autofocus not working on iPhone 14?
I have an app, which has been in production for about 8 years, which uses a live camera view for the purpose of capturing barcodes. The app configures the camera for continuous autofocus with this code: if ([videoDevice isFocusModeSupported:AVCaptureFocusModeContinuousAutoFocus]) {             videoDevice.focusMode = AVCaptureFocusModeContinuousAutoFocus; } This has worked fine for years, but a customer who just upgraded to an iPhone 14 says that it doesn't work on his phone; the image never focuses and the barcode cannot be read. Has something changed recently, either in iOS or with the iPhone 14, that would render this code incorrect? Xcode does not flag it with any warnings. Thanks, Frank
2
0
3.1k
Nov ’22
Using Xcode with arbitrary Git repository
My company uses Git repositories hosted with a service called Beanstalk. These are standard Git repositories that I can work with in the terminal window using the 'git' command line interface, which works fine and remembers my credentials. I'd like to use Xcode's integrated version control support, but it has never worked correctly with my repositories. In some cases, it works but prompts me to enter my credentials each time I try to do something. In other cases, it fails with a message that says "failed to start SSH session: Unable to exchange encryption keys". The account settings on Xcode only let you set up accounts with specific hosted Git services (Github, Gitlab, Bitbucket). It's nice that Xcode recognizes these specific Git providers, but how do I set up a repository that is hosted elsewhere? Thanks.
1
0
819
Jan ’23
How accurate is BGTaskScheduler?
When I submit a request for a background refresh through BGTaskScheduler, how likely is it that iOS will execute the task at the time I request? I know that with the pre-iOS 13 way of doing this, iOS didn't really guarantee any particular schedule or frequency except that it it would try to execute the task when it wasn't busy. I don't see any language in BGTaskScheduler that talks about this. The only clue is that the field specifying the time is called "earliestBeginDate" which suggests that iOS might execute it later than that date. If I submit a BGProcessingTaskRequest instead of a BGAppRefreshTaskRequest, does this change the behavior? I'd like to know this so that I can tell my users what to expect. Thanks, Frank
1
0
1.4k
Feb ’23
Popover view won't close keyboard
I have a popover view containing a tableview, and inside of the tableview are various UITextFields. If one of the text fields is selected and the keyboard is showing, and I swipe downwards on the popover view, the popover closes, but the keyboard remains visible. I updated my viewWillDisappear method on the view controller to have it issue a resignFirstResponder to the active input view when the popover closes, and although this code gets called, it doesn't close the keyboard. The problem only exists on an iPhone. When I run the same code on an iPad, it works as expected (tapping outside of the popover view closes both the view and the keyboard). If I dismiss the popover myself after issuing resignFirstResponder, that works. It is only the case where the user swipes down to dismiss that the problem appears.
3
0
740
Mar ’23
Xcode won't save my source control credentials
My company uses Beanstalk, a commercial provider of Git repositories. Within Xcode, there is no option to add a Beanstalk account. When I open Xcode and try to do a VCS operation, Xcode prompts me for my username and password. From then on it works normally except that when I close Xcode and reopen it, it prompts me for the credentials again. The Git command-line tool doesn't do this. It saved my credentials in the keychain when I first ran it, and doesn't ask me for them anymore. Is there any way to get Xcode to either use the credentials stored by the Git command line app or store the credentials itself? I've tried contacting the people who run Beanstalk but they couldn't help me. Thanks, Frank
0
0
435
Mar ’23
Command PhaseScriptExecution failed with a nonzero exit code
An app I've been working on for weeks suddenly started giving me this error when I try to archive it: "Command PhaseScriptExecution failed with a nonzero exit code" I tried cleaning the build folder, restarting Xcode, and restarting the computer. The app compiles and runs, it just won't archive. I deleted the entire project folder and re-cloned it, that didn't fix the problem either. My coworker is able to archive the same project on his computer without any problem. The only difference we can find is that my computer has Xcode 14.3 and he has 14.2 Unfortunately I have no idea what the error message means. I think it might have something to do with Pods, but I didn't install the pods, and don't really understand how Pods work. Is this a new bug in Xcode 14.3? What's the fix? Thanks
4
1
3.1k
Mar ’23
How do I call UNUserNotificationCenter asynchronously?
Hi, I'm trying to learn how to use asynchronous functions in Swift. I've used async functions in other languages such as C#, so I understand the general concept. I want to call getPendingNotificationRequests on UNUserNotificationCenter asynchronously, so I wrote this: let notificationCenter = UNUserNotificationCenter.current() let requests = await notificationCenter.getPendingNotificationRequests() This seems to match the examples I see in documentation, but it doesn't work. All I get is a compiler error that says "Missing argument for parameter 'completionHandler'". What am I doing wrong?
1
0
1.3k
Apr ’23
Stack buffer overflow error using JSONDecoder
I'm using JSONDecoder().decode(T.Type, from: data) to decode a JSON response from a server. It works in some cases but eventually my program crashes with the error "Stack buffer overflow". The size of the JSON data I'm trying to decide is about 16k, which is large, but not unusually so. The decode is happening in a non-main thread, but I tried pushing it into the main thread with the same results. Most of these crashes occur in the simulator rather than on a real device, but I'd like to figure out the problem anyway. I thought I'd try dispatching the work into a queue with a larger stack size, but I couldn't figure out how to make one. Is it possible? Thanks, Frank
1
0
852
May ’23
Image asset not recognized in interface builder
I added an asset catalog to an old iOS project that I'm in the process of updating. The app was originally created before asset catalogs existed. I added an image and an icon set to my catalog. The icon works, and the image shows up when I run the app, but Interface Builder doesn't recognize the image by name when I type it into the Image field on an imageview. I'm guessing that there is something somewhere which causes interface builder to read an asset catalog, which is probably not set on my old project, but I can't figure out what it is. Thanks, Frank
0
0
549
Jun ’23