I don't see Xcode 10 anywhere on that download page that Max108 gave in this accepted answer to this post. Am I able to download Xcode 10 anymore?
I have some old Xcode project files that I need to open using Xcode 10.3 or Xcode 10.1 in order to be able to be transitioned to a higher version of Swift than my project files use. I don't think that "transition"is the right word for it. I mean I need one of those older versions of Xcode to open my old Xcode project files so that those older versions of Xcode would notice that I'm using an older version of Swift and would ask me to alter my code to use a higher version of Swift. I have noticed before that if the code is too old, then the current version of Xcode will say the Swift version the code is using is too old for Xcode to alter to use the current version of Swift.
Post
Replies
Boosts
Views
Activity
Yes. Thank you. I should probably just accept what the documentation says. I may be complicating things on myself. I'm not sure why anyone would fetch just the unified contacts. Thank you again.
I'm trying to paste code in here. Whether I use the inline code feature or not, it doesn't come out right.
From my test code, it looks like they both do the same thing. What do you think about this?
(I wasn't able to uncheck that your answer is correct.)
I tried this code in a test project:
class ViewController: UIViewController {
let store = CNContactStore()
let keys = [CNContactGivenNameKey as CNKeyDescriptor]
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
store.requestAccess(for: .contacts) {
permissionGranted, error in
let request = CNContactFetchRequest(keysToFetch: self.keys)
print("enumerate contacts")
do {
try self.store.enumerateContacts(with: request) {
contact, pointer in
print(contact.givenName)
}
} catch {
print("error")
print(error.localizedDescription)
}
print("unified contacts")
do {
let containers = try self.store.containers(matching: nil)
if containers.count > 1 {
fatalError("More than one container!")
}
let predicate = CNContact.predicateForContactsInContainer(withIdentifier: self.store.defaultContainerIdentifier())
let contacts = try self.store.unifiedContacts(matching: predicate, keysToFetch: self.keys)
for contact in contacts {
print(contact.givenName)
}
} catch {
print("error")
print(error.localizedDescription)
}
}
}
}
The result I get in the debug window is:
enumerate contacts
Kate
Daniel
John
Anna
Hank
David
unified contacts
Kate
Daniel
John
Anna
Hank
David
Yeah. That's a good idea. I did that with an app that used reminders. Every time I made a change to the store that kept the reminders, I used the boolean value to let the function that the notification fired know my app was the one that changed the store.
I found this list in the main page for the Contacts framework. This looks like what I need.
Change History Data
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
Xcode 13.1
I see no changes in the top bar.
When I go to the menu to build or to build for running, nothing happens. It doesn't show to be building like it usually does at the top bar when it shows a small circle turning blue in a circle.
I tried to open the issue navigator from the menu, but it won't start.
I did do a Clean Build Folder.
It started working for me, then stopped working, so I came back to this question.
I mean an instance of the Logger structure.
I just got this error. I hope someone has a good answer to this post.
Would you be willing to share what different route you took?
I think Background Tasks is a good solution. What happens when the user turns off and then turns on the device? I there a way for my app to start the background task again or for my app itself to open on startup? I found (this thread)[https://developer.apple.com/forums/thread/108561) that suggests going into kiosk mode and has a link to another thread about MDM. My app is one that anyone would be able to purchase from App Store, so I think MDM wouldn't work, but is there a way to use kiosk mode without additional setup, so that my app uses kiosk mode right after the user installs the app from App Store? Guided Access still requires the user to do additional setup, as far as I can tell. If there is no other way around requiring user setup, what is the best way to go about it?
Am I correct that the only way for my app to start automatically on iOS startup or for anything I want to be done automatically on iOS startup is for the iOS device to be supervised, and that an app installed from App Store can never be automatically supervised without another system supervising the device the app is installed on? I apologize for my bad wording. I don't have the vocabulary to describe what might be required in order for a device to be supervised. I am basically asking if there is a way for my app or background task to automatically start up on iOS startup without the device to be part of a system that runs independently of Apple's App Store. I think that's the best wording I can come up with.
What about using a Shortcut. Does this open up any possibilities?
I'm guessing from seeing T and S used, that T stands for Type, as in and S stands for Sequence. Just guessing. It seems that is how they are used in a couple of declarations of functions in Foundation.
I saw that first post or another post about the same thing. I've used the solution that the second post you shared uses. This question was part of my search for a way monitor whenever a contact store changes even when my app is not running. Thanks for the input.
Using change history data appears to do more than the store changed notification using NotificationCenter. Am I correct in assuming that?
Yeah. I just found something down the line from the link you gave me. I never have figured out how to make a link to an answer to a post instead of to the post itself.