Post

Replies

Boosts

Views

Activity

Comment on where are the old downloads?
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.
Nov ’21
Comment on Does unifiedContacts(matching:keysToFetch:) return only unified contacts and leave out non-unified contacts?
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
Nov ’21
Comment on 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?
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
Dec ’21
Comment on Why project won't run when I tell it to
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.
Dec ’21
Comment on How do I run code in the background in iOS that will always run?
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?
Mar ’22
Comment on How do I run code in the background in iOS that will always run?
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.
Mar ’22