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
752
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
917
Aug ’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
1.2k
Jan ’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
521
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.7k
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
1k
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
732
Jun ’23
App for personal use?
I wrote an app for my own personal use. It is loaded onto my iPhone as a debug build and I also have a build on my Mac. These builds expire every few months and force me to go back into Xcode and rebuild them. Is there a better solution? I am not an enterprise and don't have a business account, I'm just an individual developer.
3
0
545
Dec ’23
Hashable class extending NSObject?
I have some Swift classes in my project that extend an Objective-C base class, which in turn extends NSObject. I did this years ago when Swift was new in order to take advantage of some Objective-C code that was difficult to rewrite in Swift. It's not a common situation but it has been working fine for a long time. One of these classes is used as the key to a Dictionary and thus needs to be Hashable. The way I did this was to implement an == function and override the 'hash' property. It is a very simple case where the identity of the object is based on a single integer: static func == (lhs: FishModel, rhs: FishModel) -> Bool { return lhs.fishId == rhs.fishId } override var hash: Int { return fishId } I believe that I initially tried to add "Hashable" to the class definition but was told it was redundant. I'm not sure why that is, but it worked fine without it. Today I took the latest Xcode update to 15.2, and now my project won't compile anymore. The compiler error says that my class "does not conform to protocol Hashable". Adding Hashable to the class definition did not fix it. There are also some unusual errors about missing files, such as abi.json, swiftdoc, swiftmodule, and swiftsourceinfo. Was this caused by the Xcode update? How do I fix it?
2
0
1.2k
Jan ’24
Best way to determine region?
My app downloads files from AWS S3. What we'd like to do is replicate our files across several of Amazon's data centers (regions) to put the content closer to our users, who are worldwide. What I need is a way to determine in a very gross way which data center would be best to use. For example North America, Europe, Asia, etc. I don't want to use location services since I don't really need the exact location. Is there a simpler way to do this? I suppose I could use the localization settings, but I don't think that's really guaranteed to represent their actual location. Thanks, Frank
1
0
932
May ’24
Crash during startup [CBUUID initWithData:]
The crash logs for my app show an occasional crash that happens during the launch of the app. The highlighed line is "CoreBluetooth -[CBUUID initiWithData:]. The stack trace ends with "static AppDelegate.$main()". My app does use Core Bluetooth, but there are no Bluetooth related functions in the App Delegate. Also, my app does not use [CBUUID initWithData:] explicitly anywhere. With a stack trace that contains no reference to any of my code, it is extremely difficult to figure out what is going on. I cannot reproduce the crash on any of my own devices. One of my affected users says the app crashes on startup on his phone consistently, even if he deletes and reinstalls it.
0
0
584
May ’24
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
Replies
1
Boosts
0
Views
752
Activity
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
Replies
0
Boosts
0
Views
917
Activity
Aug ’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.
Replies
1
Boosts
0
Views
1.2k
Activity
Jan ’23
How do I JSON-encode a dictionary?
Hi, I have a dictionary defined as [String:Encodable]. I'm trying to encode it using JSONEncoder().encode(). When I do this I get a compiler error, "Type 'any Encodable' cannot conform to 'Encodable'". What does this mean and how do I fix it?
Replies
1
Boosts
0
Views
1.8k
Activity
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
Replies
0
Boosts
0
Views
521
Activity
Mar ’23
Initializer issue with Swift in Xcode 14.3
Did something just change in Swift with regard to initializer inheritance? Since installing Xcode 14.3, I have some code that is flagged with errors when I try to initialize a class using an initializer inherited from its superclass. This has always worked in the past.
Replies
3
Boosts
0
Views
839
Activity
Apr ’23
Timezone on simulator?
How do I change the timezone on the simulator? I need to test how my app works in other timezones.
Replies
1
Boosts
0
Views
5.2k
Activity
Apr ’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?
Replies
1
Boosts
0
Views
1.7k
Activity
Apr ’23
Is a CBPeripheral tied to an instance of CBCentralManager?
Suppose I have two instances of CBCentralManager: let manager1 = CBCentralManager(delegate: delegate1, queue: nil) let manager2 = CBCentralManager(delegate: delegate2, queue: nil) If I scan for peripherals using manager1, can I take the CBPeripheral that it gives me and connect to it with manager2? Frank
Replies
0
Boosts
0
Views
646
Activity
May ’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
Replies
1
Boosts
0
Views
1k
Activity
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
Replies
0
Boosts
0
Views
732
Activity
Jun ’23
App for personal use?
I wrote an app for my own personal use. It is loaded onto my iPhone as a debug build and I also have a build on my Mac. These builds expire every few months and force me to go back into Xcode and rebuild them. Is there a better solution? I am not an enterprise and don't have a business account, I'm just an individual developer.
Replies
3
Boosts
0
Views
545
Activity
Dec ’23
Hashable class extending NSObject?
I have some Swift classes in my project that extend an Objective-C base class, which in turn extends NSObject. I did this years ago when Swift was new in order to take advantage of some Objective-C code that was difficult to rewrite in Swift. It's not a common situation but it has been working fine for a long time. One of these classes is used as the key to a Dictionary and thus needs to be Hashable. The way I did this was to implement an == function and override the 'hash' property. It is a very simple case where the identity of the object is based on a single integer: static func == (lhs: FishModel, rhs: FishModel) -> Bool { return lhs.fishId == rhs.fishId } override var hash: Int { return fishId } I believe that I initially tried to add "Hashable" to the class definition but was told it was redundant. I'm not sure why that is, but it worked fine without it. Today I took the latest Xcode update to 15.2, and now my project won't compile anymore. The compiler error says that my class "does not conform to protocol Hashable". Adding Hashable to the class definition did not fix it. There are also some unusual errors about missing files, such as abi.json, swiftdoc, swiftmodule, and swiftsourceinfo. Was this caused by the Xcode update? How do I fix it?
Replies
2
Boosts
0
Views
1.2k
Activity
Jan ’24
Best way to determine region?
My app downloads files from AWS S3. What we'd like to do is replicate our files across several of Amazon's data centers (regions) to put the content closer to our users, who are worldwide. What I need is a way to determine in a very gross way which data center would be best to use. For example North America, Europe, Asia, etc. I don't want to use location services since I don't really need the exact location. Is there a simpler way to do this? I suppose I could use the localization settings, but I don't think that's really guaranteed to represent their actual location. Thanks, Frank
Replies
1
Boosts
0
Views
932
Activity
May ’24
Crash during startup [CBUUID initWithData:]
The crash logs for my app show an occasional crash that happens during the launch of the app. The highlighed line is "CoreBluetooth -[CBUUID initiWithData:]. The stack trace ends with "static AppDelegate.$main()". My app does use Core Bluetooth, but there are no Bluetooth related functions in the App Delegate. Also, my app does not use [CBUUID initWithData:] explicitly anywhere. With a stack trace that contains no reference to any of my code, it is extremely difficult to figure out what is going on. I cannot reproduce the crash on any of my own devices. One of my affected users says the app crashes on startup on his phone consistently, even if he deletes and reinstalls it.
Replies
0
Boosts
0
Views
584
Activity
May ’24