Post

Replies

Boosts

Views

Activity

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
327
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
330
Dec ’21
iOS Contacts Framework Change History Data using Swift and Xcode 13
On Apple's documentation of the Contacts Framework for iOS and Swift on their developer website, there is a section called Change History Data. It consists of a list of classes and one protocol. The protocol seems to be the most important item of the list - the CNChangeHistoryEventVisitor protocol. The protocol apparently has instance methods each of which use one of those classes listed. Where do I find documentation to use this protocol and these classes? Anyone ever use these before? Here's the list: class CNChangeHistoryAddContactEvent class CNChangeHistoryAddGroupEvent class CNChangeHistoryAddMemberToGroupEvent class CNChangeHistoryAddSubgroupToGroupEvent class CNChangeHistoryDeleteContactEvent class CNChangeHistoryDeleteGroupEvent class CNChangeHistoryDropEverythingEvent class CNChangeHistoryEvent class CNChangeHistoryFetchRequest class CNChangeHistoryRemoveMemberFromGroupEvent class CNChangeHistoryRemoveSubgroupFromGroupEvent class CNChangeHistoryUpdateContactEvent class CNChangeHistoryUpdateGroupEvent protocol CNChangeHistoryEventVisitor
3
0
1.6k
Dec ’21
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
659
Dec ’21
How do I set the default contacts container for my iOS app to the contacts container that is saved in iCloud?
I am writing an iOS app using Swift and Xcode 13.1. I am using the Contacts Framework, and I read that each app has a default contacts container, and the default container in an app can be different than the default container in another app, and there is not a default container for the entire device. What determines which is the default container for the app made by an Xcode project? I didn't set the default container for my app and somehow the contacts container for a Google account became the default contacts container for my app. How do I use code to set the default contacts container for my app? How do I find out which is the default container of Apple's Contacts app that comes with iOS? I would like to set my app's default contacts container to the same default container of Apple's Contacts app, if that is the contacts container that is saved on iCloud. If not, I would like to set my app's default contacts container to the contacts container that is saved in iCloud. I assume that only one contacts container is saved on iCloud.
0
0
482
Dec ’21
Does unifiedContacts(matching:keysToFetch:) return only unified contacts and leave out non-unified contacts?
When I use the Contacts Framework with Swift for iOS 15 using Xcode 13, when I use CNContactStore instance method unifiedContacts(matching:keysToFetch:), what happens to those CNContact objects that are not linked with any other CNContact objects, would they be returned as non-unified contacts, or would they be left out since they are non-unified contacts?
2
0
745
Nov ’21
Contacts Framework CNFetchResult
Anyone ever use CNFetchResult successfully? I find nothing on the internet, on stackoverflow, and in Apple Developer Forums. The only thing I have found is Apple Documentation for it. It says CNFetchResult is a Generic Class. What exactly does that mean. I found an explanation that gives its definition, but the rest of the explanation is very long winded.
10
0
1.3k
Nov ’21
View controller dismisses by swiping down on it.
I have a view controller that can be swiped down to get out of. The problem is, I need the user to get out of the view controller by pressing a bar button item that goes to an unwind function. The bar button items are hidden by the search controller. I need to either make a way for the user to hide the search controller or put code that triggers when the view controller is dismissed by swiping down on it. Is there a callback function that is called when the view controller is dismissed like that? How would I do either of those? Another question: Is there a way to make the view controller so that it's not able to be dismissed by swiping down on it like that?
1
0
2.7k
May ’20