Post

Replies

Boosts

Views

Activity

How do I write code to run when the contact store was changed by another app, but not run when the contact store was changed by my app?
I noticed that when my app changes the contact store, the CNContactStoreDidChange notification fires in my app. How do I check if the notification fired because my app changed it. Is there a way to know which app made the change to the contact store. I need to know so I can write code to run only if the contact store was changed by another app instead of my app.
1
0
712
Dec ’21
Why is it when I set UITableViewController navigationItem.searchController with UISearchController, navigation.searchController still is nil?
For some reason, when I set UITableViewController navigationItem.searchController with a UISearchController, it doesn't take it. Here is my code: let searchController = UISearchController(searchResultsController: nil) if #available(iOS 11.0, *) { print("?", navigationItem.searchController) print("!", searchController) navigationItem.searchController? = searchController print("?", navigationItem.searchController) } else { tableView.tableHeaderView = searchController.searchBar } Here is the debug window: ? nil ! <UISearchController: 0x105077600> ? nil
1
0
379
Dec ’21
How to set Xcode to show pairings of beginning and ending of "clauses" determined by length from the left border of the code editor
How do I turn on that setting in Xcode that allows me to see how the beginning of a loop or if statement lines up with the ending of the loop as far as the number of tabs or the distance from the left border of the code editor. I have seen this on by default before. I don't know what it's called, so I don't know hot to search for it in Xcode help or on the internet or on forums.
1
0
384
Dec ’21
What is dynamic shared object (DSO) handle that #dsohandle applies to in Swift?
I'm looking at this Swift documentation on Literal Expression, particularly the #dsohandle literal. It's the last line in the table. I can't find any documentation by Apple for "dynamic shared object (DSO) handle", as it says in the very right-most column. When I do a search for "dynamic shared object", I find information for technology by other companies. Anyone have anything you can tell me about this?
1
0
1.6k
Jan ’22
Is the Console app an app that runs on iOS that I can get straight from the App Store?
Would someone explain something about this content I got from this URL to Apple documentation? Logging ”You view log messages using the Console app, log command-line tool, or Xcode debug console. You can also access log messages programmatically using the OSLogframework.” I’m not sure what Console app runs on. Is that an app on macOS? I’m not really sure what to ask really. I’m looking for a way to get debug data from people using my app who download it from the App Store, so they won’t be using TestFlight. I did a search on Google but didn’t find what I needed to know. I’m trying to connect to the App Store on my iPhone, but it’s not able to connect. That seems to happen often for some reason. I wonder if this is talking about the Console app that I’m wondering about? https://help.dayoneapp.com/en/articles/470117-using-ios-console
1
0
3.6k
Jan ’22
How to turn on feature in Xcode Editor
What is that feature called that shows a picture of the entire contents of the file on the right-hand side of the editor and shows it very small like it's zoomed out and shows the part of the file that is currently showing in the editor in a different shade in the picture? I am describing this to the best of my ability. I hope it comes across clearly.
1
0
446
Jan ’22
How do I run code in the background in iOS that will always run?
Is there a way to put code in iOS that is always watching in the background for the contact store to change? If I put it in my app, then the user can close the app, and the app won't receive notifications when the contact store changes? Is there an app extension I can use that would allow me to do this, whether that is the intent of the extension or not?
1
0
2.2k
Mar ’22
What to use instead of the deprecated ABAddressBookRegisterExternalChangeCallback(::_:) function?
I found information about the ABAddressBookRegisterExternalChangeCallback(::_:) function of the Address Book Framework, but that function has been deprecated, and only works with iOS 2.0–9.0. I don't see a function in the Contacts Framework that does what that function does. Is there some way that the Contacts Framework could do something that this function provided a solution for?
1
0
1.1k
Mar ’22
Is there a way to cause my app or a background task start running automatically when the iOS device is turned back on after being turned off?
I think I'm only entertaining wishful thinking, but I hope it is possible to somehow cause my iOS app or a background task to start up when the iOS device starts up, like when it was turned off and then turned back on. Does even the user of the device have a way to do this in iOS? I saw some threads saying something like this might be possible using MDM or supervised devices or kiosk mode or guided access. Those all seem to require the user or administrators to do some setting up. I want my app or background task to be able to do what I mentioned right as it comes after it is installed from App Store.
1
0
515
Mar ’22
Why are there no recent device logs
When I go to devices and simulators with my iPhone 8 plugged into my Mac, and then open device logs, I don't seen any recent logs. The last one was from november last year. Why are there no more recent logs? I went to my iOS device and searched for "log" in Settings, but there doesn't seem to be any setting to turn on logging. I also can't find any settings when I search for "developer" in settings. I thought I saw something in iOS that enabled me to send reports to Apple automatically on my iOS device. I don't know if that's what I really want.
1
0
846
Mar ’22
What does @MainActor mean
I'm trying to figure out what @MainActor means in this definition of UICloudSharingController in Apple Documents found here. Here's what it says: @MainActor class UICloudSharingController : UIViewController I couldn't find much information on Google. This Apple Documentation is the closest thing I found. Is this what i need? Here is the declaration to the MainActor class: @globalActor final actor MainActor
1
0
1.6k
Mar ’22
How do I convert an struct of type Data to an object of type CNGroup?
I'm having trouble converting a CNGroup object to a Data object and back to a CNGroup object. I decided to start rethinking the problem again. Somewhere along the way I decided that I should use the Data class to save a CNGroup object to CloudKit. I also learned that the field type to use in my CKRecord object would be of the type bytes. Am I correct so far? I am able to convert a CNGroup object to a Data object and back again unless I store the Data object in CloudKit and then retrieve it before I convert the Data object back to a CNGroup object, in which case I get an error when I try to access the pointee property of the typed pointer. That would be an UnsafeBufferPointer, an UnsafeMutableBufferPointer, or an UnsafePointer. I've tried a lot of different code using different ways. It is impractical to put so much code in my post. I have used the copyBytes method and the withUnsafeBytes method of the Data object. There is one simple code, and that is when I converted the CNGroup object to a Data object: func convertCNGroupToData(fromCNGroup group: inout CNGroup) -> Data { return Data(bytes: &group, count: MemoryLayout.size(ofValue: group)) } I am looking for a simple way to do what I want. I am relooking at Apple's documentation of Data and NSData. I am not able to be more specific with this question. I appreciate any effort to help me with this.
1
0
599
Apr ’22