Post

Replies

Boosts

Views

Activity

Custom section header isn't visible
I have a tableview and I want to use a custom section header. Instead of writing out all the code to create the section header, I added the view to my XIB file and connected it to an outlet in my view controller. I hid the view behind another view so it isn't visible and doesn't take up any room in the layout of the screen. In my view controller, I removed the view from the layout (removeFromSuperview) and then I returned it from my viewForHeaderInSection function. I also implemented heightForHeaderInSection to make sure I get the right height. When I run my app, what shows up is a blank space in the table where I'm expecting the header view to be. The space is the right height, but there is nothing in it. I do not understand why.
Topic: UI Frameworks SubTopic: UIKit
1
0
413
Jul ’24
Codable with superclass doesn't work ??
class A: Codable { var x: String? } class B: A { var y: String? } When I try to decode class B, the property "y" remains nil even though there is a value for it in the JSON data. If I change it to B: Codable then it works. When I try to search for a solution, all I can find is people overriding init methods and doing decoding manually in some way. I am having a hard time believeing that this is the right answer. Surely, coding works across class hierarchies?
3
0
489
Aug ’24
APNs certificate authority?
I manage apps and servers on behalf of several customers. Recently they all started getting a message from Apple that says, "The Certification Authority for APNs is changing". I don't understand how or if this affects me. My servers are all hosted on Amazon EC2 instances. I have never had to install any specific certificate for APNs to work. Is this new CA something that I can expect my servers to receive automatically as part of their system updates? If not, how do I install it?
2
0
521
Dec ’24
Background location tracking on iPad fails
My app needs to track background location for a period of several hours while the user is using it, and we want to allow the user to switch apps or lock their phone while this is happening. We don't need to track location permanently and because of this, we don't want to request the "Always allow" permission. The app requests "While in use" permission and it has the "Location updates" background mode enabled. The CLLocationManager has 'allowsBackgroundLocationUpdates' set to true, 'pausesLocationUpdatesAutomatically' false, kCLLocationAccuracyBest, kCLDistanceFilterNone, and .fitness for the activity type (we expect the user to be walking). The app also initializes a CLBackgroundActivitySession while it is tracking location and invalidates it when done. When I test this combination on my iPhone, it works fine. I get location tracking in the background for as long as I need it, regardless of what else I do with the phone. However, my customer says it doesn't work for him. He is using a Wifi-only iPad with an external GPS receiver called "BadElf GPS Pro". He says that the external GPS receiver works fine with other apps on his iPad. With my app, he gets background location tracking only for a short time, and then it stops. The app does monitor the "locationManagerDidPauseLocationUpdates" callback and posts a local notification if it gets called, but it doesn't get called. I've also confirmed with him that he is not force-quitting the app and the app is not otherwise being terminated by iOS. Is there something I'm missing?
3
0
695
Feb ’25
UINavigtionController as a child view leaves an unwanted gap
I have a situation where I need to add a UINavigationController as a child view controller within another view controller. When I do this, there is a gap between the bottom of the navigation controller's root view controller and the bottom of the navigation controller's own view. This happens even though I am constraining the navigation controller's view to the edges of its superview, not the safe areas. I'd really like to eliminate this gap, but nothing I have tried is working.
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
255
Mar ’25
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.8k
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.
Topic: UI Frameworks SubTopic: UIKit Tags:
3
0
978
Mar ’23
Location not tracking in background
I really need some help. I have been going back and forth with a customer of mine for weeks. Our app is supposed to track location in the background after a user starts it in the foreground. Every time I test it, it works. I can put the app in the background and walk around for hours. Every time he tests it, it doesn't work. He puts the app into the background and about a minute later, it stops tracking him. Then it starts again when the app comes back to the foreground. We have each tried it on two devices with the same results. I'm willing to post the rest of the details if anyone is interested in helping me, but the last couple of times I got no response, so I'm not going to bother unless I can get some help this time. Thanks.
1
0
507
Feb ’25
Xcode won't remember my Git credentials
I can't get Xcode to permanently remember my Git credentials. It remembers them for as long as Xcode is open, but when I close it and re-open it later, it prompts me for the credentials again. I don't see any kind of an option to save them. I use the 'git' command-line program on my computer and I've stored my credentials there, but Xcode doesn't seem to be able to access them that way. How can I get Xcode to remember my credentials?
0
2
618
Aug ’23
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.7k
Feb ’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.7k
Jun ’23
Custom section header isn't visible
I have a tableview and I want to use a custom section header. Instead of writing out all the code to create the section header, I added the view to my XIB file and connected it to an outlet in my view controller. I hid the view behind another view so it isn't visible and doesn't take up any room in the layout of the screen. In my view controller, I removed the view from the layout (removeFromSuperview) and then I returned it from my viewForHeaderInSection function. I also implemented heightForHeaderInSection to make sure I get the right height. When I run my app, what shows up is a blank space in the table where I'm expecting the header view to be. The space is the right height, but there is nothing in it. I do not understand why.
Topic: UI Frameworks SubTopic: UIKit
Replies
1
Boosts
0
Views
413
Activity
Jul ’24
Codable with superclass doesn't work ??
class A: Codable { var x: String? } class B: A { var y: String? } When I try to decode class B, the property "y" remains nil even though there is a value for it in the JSON data. If I change it to B: Codable then it works. When I try to search for a solution, all I can find is people overriding init methods and doing decoding manually in some way. I am having a hard time believeing that this is the right answer. Surely, coding works across class hierarchies?
Replies
3
Boosts
0
Views
489
Activity
Aug ’24
APNs certificate authority?
I manage apps and servers on behalf of several customers. Recently they all started getting a message from Apple that says, "The Certification Authority for APNs is changing". I don't understand how or if this affects me. My servers are all hosted on Amazon EC2 instances. I have never had to install any specific certificate for APNs to work. Is this new CA something that I can expect my servers to receive automatically as part of their system updates? If not, how do I install it?
Replies
2
Boosts
0
Views
521
Activity
Dec ’24
Background location tracking on iPad fails
My app needs to track background location for a period of several hours while the user is using it, and we want to allow the user to switch apps or lock their phone while this is happening. We don't need to track location permanently and because of this, we don't want to request the "Always allow" permission. The app requests "While in use" permission and it has the "Location updates" background mode enabled. The CLLocationManager has 'allowsBackgroundLocationUpdates' set to true, 'pausesLocationUpdatesAutomatically' false, kCLLocationAccuracyBest, kCLDistanceFilterNone, and .fitness for the activity type (we expect the user to be walking). The app also initializes a CLBackgroundActivitySession while it is tracking location and invalidates it when done. When I test this combination on my iPhone, it works fine. I get location tracking in the background for as long as I need it, regardless of what else I do with the phone. However, my customer says it doesn't work for him. He is using a Wifi-only iPad with an external GPS receiver called "BadElf GPS Pro". He says that the external GPS receiver works fine with other apps on his iPad. With my app, he gets background location tracking only for a short time, and then it stops. The app does monitor the "locationManagerDidPauseLocationUpdates" callback and posts a local notification if it gets called, but it doesn't get called. I've also confirmed with him that he is not force-quitting the app and the app is not otherwise being terminated by iOS. Is there something I'm missing?
Replies
3
Boosts
0
Views
695
Activity
Feb ’25
UINavigtionController as a child view leaves an unwanted gap
I have a situation where I need to add a UINavigationController as a child view controller within another view controller. When I do this, there is a gap between the bottom of the navigation controller's root view controller and the bottom of the navigation controller's own view. This happens even though I am constraining the navigation controller's view to the edges of its superview, not the safe areas. I'd really like to eliminate this gap, but nothing I have tried is working.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
1
Boosts
0
Views
255
Activity
Mar ’25
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
Replies
1
Boosts
0
Views
1.8k
Activity
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.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
3
Boosts
0
Views
978
Activity
Mar ’23
Location not tracking in background
I really need some help. I have been going back and forth with a customer of mine for weeks. Our app is supposed to track location in the background after a user starts it in the foreground. Every time I test it, it works. I can put the app in the background and walk around for hours. Every time he tests it, it doesn't work. He puts the app into the background and about a minute later, it stops tracking him. Then it starts again when the app comes back to the foreground. We have each tried it on two devices with the same results. I'm willing to post the rest of the details if anyone is interested in helping me, but the last couple of times I got no response, so I'm not going to bother unless I can get some help this time. Thanks.
Replies
1
Boosts
0
Views
507
Activity
Feb ’25
Xcode won't remember my Git credentials
I can't get Xcode to permanently remember my Git credentials. It remembers them for as long as Xcode is open, but when I close it and re-open it later, it prompts me for the credentials again. I don't see any kind of an option to save them. I use the 'git' command-line program on my computer and I've stored my credentials there, but Xcode doesn't seem to be able to access them that way. How can I get Xcode to remember my credentials?
Replies
0
Boosts
2
Views
618
Activity
Aug ’23
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
Replies
2
Boosts
0
Views
3.7k
Activity
Feb ’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
Replies
4
Boosts
1
Views
3.7k
Activity
Jun ’23