I have an app that was written in UIKit. It's too large, and it would be much too time consuming at this point to convert it to SwiftUI.
I want to incorporate the new limited contacts into this app. The way it's currently written everything works fine except for showing the limited contacts in the contact picker.
I have downloaded and gone though the Apple tutorial app but I'm having trouble thinking it through into UIKit. After a couple of hours I decided I need help.
I understand I need to pull the contact IDs of the contacts that are in the limited contacts list. Not sure how to do that or how to get it to display in the picker. Any help would be greatly appreciated.
func requestAccess(completionHandler: @escaping (_ accessGranted: Bool) -> Void)
{
switch CNContactStore.authorizationStatus(for: .contacts)
{
case .authorized:
completionHandler(true)
case .denied:
showSettingsAlert(completionHandler)
case .restricted, .notDetermined:
CNContactStore().requestAccess(for: .contacts) { granted, error in
if granted
{
completionHandler(true)
} else {
DispatchQueue.main.async { [weak self] in
self?.showSettingsAlert(completionHandler)
}
}
}
// iOS 18 only
case .limited:
completionHandler(true)
@unknown default: break
}
}
// A text field that displays the name of the chosen contact
@IBAction func contact_Fld_Tapped(_ sender: TextField_Designable)
{
sender.resignFirstResponder()
// The contact ID that is saved to the Db
getTheCurrentContactID()
let theAlert = UIAlertController(title: K.Titles.chooseAContact, message: nil, preferredStyle: .actionSheet)
// Create a new contact
let addContact = UIAlertAction(title: K.Titles.newContact, style: .default) { [weak self] _ in
self?.requestAccess { _ in
let openContact = CNContact()
let vc = CNContactViewController(forNewContact: openContact)
vc.delegate = self // this delegate CNContactViewControllerDelegate
DispatchQueue.main.async {
self?.present(UINavigationController(rootViewController: vc), animated: true)
}
}
}
let getContact = UIAlertAction(title: K.Titles.fromContacts, style: .default) { [weak self] _ in
self?.requestAccess { _ in
self?.contactPicker.delegate = self
DispatchQueue.main.async {
self?.present(self!.contactPicker, animated: true)
}
}
}
let editBtn = UIAlertAction(title: K.Titles.editContact, style: .default) { [weak self] _ in
self?.requestAccess { _ in
let store = CNContactStore()
var vc = CNContactViewController()
do {
let descriptor = CNContactViewController.descriptorForRequiredKeys()
let editContact = try store.unifiedContact(withIdentifier: self!.oldContactID, keysToFetch: [descriptor])
vc = CNContactViewController(for: editContact)
} catch {
print("Getting contact to edit failed: \(self!.VC_String) \(error)")
}
vc.delegate = self // delegate for CNContactViewControllerDelegate
self?.navigationController?.isNavigationBarHidden = false
self?.navigationController?.navigationItem.hidesBackButton = false
self?.navigationController?.pushViewController(vc, animated: true)
}
}
let cancel = UIAlertAction(title: K.Titles.cancel, style: .cancel) { _ in }
if oldContactID.isEmpty
{
editBtn.isEnabled = false
}
theAlert.addAction(getContact) // Select from contacts
theAlert.addAction(addContact) // Create new contact
theAlert.addAction(editBtn) // Edit this contact
theAlert.addAction(cancel)
let popOver = theAlert.popoverPresentationController
popOver?.sourceView = sender
popOver?.sourceRect = sender.bounds
popOver?.permittedArrowDirections = .any
present(theAlert,animated: true)
}
func requestAccess(completionHandler: @escaping (_ accessGranted: Bool) -> Void)
{
switch CNContactStore.authorizationStatus(for: .contacts)
{
case .authorized:
completionHandler(true)
case .denied:
showSettingsAlert(completionHandler)
case .restricted, .notDetermined:
CNContactStore().requestAccess(for: .contacts) { granted, error in
if granted
{
completionHandler(true)
} else {
DispatchQueue.main.async { [weak self] in
self?.showSettingsAlert(completionHandler)
}
}
}
// iOS 18 only
case .limited:
completionHandler(true)
@unknown default: break
}
}
// MARK: - Contact Picker Delegate
extension AddEdit_Quote_VC: CNContactPickerDelegate
{
func contactPicker(_ picker: CNContactPickerViewController, didSelect contact: CNContact)
{
selectedContactID = contact.identifier
let company: String = contact.organizationName
let companyText = company == "" ? K.Titles.noCompanyName : contact.organizationName
contactNameFld_Outlet.text = CNContactFormatter.string(from: contact, style: .fullName)!
companyFld_Outlet.text = companyText
save_Array[0] = K.AppFacing.true_App
setSaveBtn_AEQuote()
}
}
extension AddEdit_Quote_VC: CNContactViewControllerDelegate
{
func contactViewController(_ viewController: CNContactViewController, shouldPerformDefaultActionFor property: CNContactProperty) -> Bool
{
return false
}
func contactViewController(_ viewController: CNContactViewController, didCompleteWith contact: CNContact?)
{
selectedContactID = contact?.identifier ?? ""
if selectedContactID != ""
{
let company: String = contact?.organizationName ?? ""
let companyText = company == "" ? K.Titles.noCompanyName : contact!.organizationName
contactNameFld_Outlet.text = CNContactFormatter.string(from: contact!, style: .fullName)
companyFld_Outlet.text = companyText
getTheCurrentContactID()
if selectedContactID != oldContactID
{
save_Array[0] = K.AppFacing.true_App
setSaveBtn_AEQuote()
}
}
dismiss(animated: true, completion: nil)
}
}
Apple Developers
RSS for tagThis is a dedicated space for developers to connect, share ideas, collaborate, and ask questions. Introduce yourself, network with other developers, and foster a supportive community.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
On wake from sleep the Mac Studio's Desktop picture is shown in actual resolution instead of stretched to fit screen. For example, a picture which is 2059 × 1371 is shown at that resolution on a 5K Retina screen and so only fills about 60% of the screen area. It starts with the picture positioned in the top left corner but sometimes moves down the screen. This behaviour does not change if the screen is scaled up or down – the picture size is also scaled.
Notice that icons on the Desktop are displayed in the correct position.
At the same time, the Dock is shown at the bottom of the picture instead of at the bottom of the screen.
Usually, the Desktop redisplays correctly. But increasingly, the only solution is to log out and in again.
This might be related to my other question on the Desktop picture Pref Pane.
See attached example which is a full screen capture i.e. command-shift-3 (with my personal details obscured):
Connection is getting broken while moving from background to foreground in latest iOS 18.3.is there any change regarding background activity?
Hi everyone,
We are developing an app, Video Tradie, which operates as a marketplace platform connecting customers with independent tradespeople for consultations. The app facilitates scheduling, communication, and payments but does not directly provide any services—our role is strictly as a facilitator.
For payment processing, we are currently integrating Stripe to handle invoicing, payment splits to tradespeople, and detailed reporting features that are essential to our business model.
However, we want to ensure compliance with Apple’s App Store guidelines, particularly regarding:
Digital Services vs. Physical Services: Since the app facilitates consultations (virtual services), would it fall under Apple’s in-app purchase requirements, or could it qualify for exemptions, similar to apps facilitating physical services?
Stripe Integration: If we continue using Stripe for payments, are we allowed to remit Apple’s 15% commission (under the Small Business Programme) while not using Apple’s payment infrastructure?
Marketplace Positioning: Does positioning our app as a marketplace rather than a direct service provider exempt us from using Apple’s in-app payment system?
Alternative Billing Options: If operating in regions like the EU or South Korea, where alternative billing is permitted, are there specific steps we need to follow to comply?
We are seeking clarification to ensure we develop the app in a way that aligns with Apple’s expectations. If anyone has experience with similar setups or advice on communicating with Apple during the submission process, I’d greatly appreciate your input!
Thank you!
The rearrangemnet of the emoji menu is driving me crazy. I never use Memojis or the Apple animal emojis and now they're all squished together at the front of the emoji keyboard and it's difficult to select what I want, since the menu is so small.
I switch between language and emoji keyboards frequently and this is extremely frustrating.
I have been reviewing the documentation on preparing your app to be the default messaging app, and I am wondering about the following:
If I set my app as the default messaging app, will it be able to send and receive legacy SMS messages?
Does iOS provide any SMS-specific framework or APIs to facilitate handling SMS messages directly within my app?
I’d appreciate any clarification on whether iOS supports such functionality and, if so, how to integrate it into my app.
Thank you!
Topic:
Community
SubTopic:
Apple Developers
when i send a http request with NSURLSession, app is crashed.
_quic_frame_write
_quic_frame_write
__quic_packet_builder_assemble
_quic_conn_assemble_and_encrypt
_quic_conn_send_frames_for_key_state
_quic_conn_send_internal
_quic_recovery_pto
_quic_recovery_timer_fired
_quic_timer_run
___nw_protocol_instance_schedule_wakeup_block_invoke
___nw_context_reset_timer_block_with_time_block_invoke
__dispatch_client_callout
__dispatch_continuation_pop
__dispatch_source_latch_and_call
__dispatch_source_invoke
__dispatch_workloop_invoke
__dispatch_root_queue_drain_deferred_wlh
__dispatch_workloop_worker_thread
__pthread_wqthread
Topic:
Community
SubTopic:
Apple Developers
Recently, I have decided to delete all my Twitter accounts, but it turns out an Apple ID was used for one of them, I am unable to delete this account due to that fact because I do not have access to the “email” required.
Twitter support says contact email provider, given that I used an Apple ID as the email, am I supposed to contact Apple support instead?
Topic:
Community
SubTopic:
Apple Developers
I just got a new 2024 Macbook Pro today. I finished setting it up, and I'm trying to reinstall a few apps. It told me that since I haven't used my Apple ID yet, I need to complete my Apple account. I've entered all my address information, but every time I hit continue, the boxes turn red, telling me I need to enter my information as if I never entered it in the first place. How can I fix this? I need to set this computer up before classes tomorrow.
Open an existing contact
Click Edit —> Add Birthday
Select Date and Save
Close the contact app
Come back to the same contact, the birthday is gone.
Background:
We are using Apple WeatherKit for an app to fetch future weather data specialty cloudCover and condition and pretipitationChance from the Overnightforecast data from weatherResponse.dailyForecast.forecast array object.
Code Sample:
On xcode on Swift and Swift UI using Apple WeatherKit
task{
do{
let weatherResponse= try await self.weatherService.forecast(for: latLong)
let cloudCover = weatherResponse.dailyForecast.forecast[0].overnightforecast.cloudCover
Issue:
While we are on debug mode, we can literally see overnightforecast.cloudCover data (as well as condition and pretipitationChance) is available under from index 0 to index 10 of weatherResponse.dailyForecast.forecast array object but when we are trying to assign this property, its throwing error as
"overnightforecast object not present under weatherResponse.dailyForecast.forecast array object"
Attachment:
Is there a way to check whether third-party code can be inserted into parts of the ARM CPU architecture from outside? I have the paranoid impression that my MacBook Pro, M2 processor is being manipulated from outside. For example: Safari, when opened, displays pages scaled down without my conscious intervention, when clicked on the original size it scales back to normal for a short time and then implodes again; I use the navigation bar on the left excessively, it is my most important tool in Safari, today it was impossible to insert a link using drag & drop, the bar scrolls up or down very quickly; a behavior that I only know from Intel processors. For example, notes, I encrypted an important note, no problem even though photos and links are inserted, yesterday I could no longer open the note, neither on the MacBook Pro nor on the iPhone. When opening the notes app in the terminal on the MacBook Pro, an EXEC_CRASH report was generated. I have a terrible suspicion that the Apple branch in Munich is tampering with the devices and software of users in Germany. Sorry, I'm a big fan of Apple and its products, but this is very spooky. I just wanted to share my distrust with you!
Topic:
Community
SubTopic:
Apple Developers
I have two eSIMs from different providers. One shows data usage in settings>Mobile Service>Mobile Data For …….
It shows ‘Current Period‘ and ‘Roaming ‘usage for this eSIM but not the other one. I have contacted the help desk for the provider and they say it’s not enabled. I am assuming they mean they have not set it on the sims provided Or in Carrier Bundle.
Is there any way of enabling this through the device using any software tool etc.??
thanks in advance
I am trying to install macOS Big Sur on my VM. It gets stuck on “About 14 minutes remaining ”Does anyone know how to get past it?
Возможно ли сделать из iPhone мини квадрокоптер. Встроить маленькие пропеллеры , выдвижные естественно и с подвижной камерой, если это возможно ) или тогда просто неподвижной но зато летучим iPhone. На счет пульта не известно. Наверно такой телефон не будет стандартного размера, наверно как caterpillar, но я бы купил )
Other applications(Calibre, Thorium Reader...) support media overlay even if the rendtion:layout is set to reflowable.
Why not Apple book?
Apple Books only support media overlay on "pre-paginated".
Apple has a massive opportunity to improve iOS for business users with ARM (Apple Relationship Manager)—a built-in tool that allows professionals to log, summarize, and integrate calls & messages into CRM workflows.
Many professionals (salespeople, executives, entrepreneurs) use iPhones for business, but there’s no easy way to track conversations, categorize interactions, or integrate messages with a CRM.
ARM would solve this by allowing:
✅ AI-powered call summaries (users get a suggested summary after each call, which can be reviewed and tagged).
✅ iMessage/SMS tagging (users can hold down messages to assign a sentiment or create a follow-up).
✅ CRM Integration (ARM logs could sync with HubSpot, Salesforce, etc.).
How ARM Would Work:
• Users could tap an “ARM Accept” (green accept button with the ARM logo instead of white phone symbol) button before a call to activate AI-powered summarization.
• After the call, users would review/edit the summary and log a sentiment (e.g., “Needs Follow-Up”).
• In iMessage, users could long-press messages to summarize conversations and tag key interactions for both blue and green messages.
• ARM would keep everything on-device, ensuring privacy and security.
Since Apple Intelligence is already introducing AI-powered features, ARM could make iPhones the ultimate business communication tool while keeping everything private and secure.
If you also want Apple to build this, submit feedback at Apple Feedback and comment here to show support!
Topic:
Community
SubTopic:
Apple Developers
Hi,
I am a new user here, I have created my apple developer account and purchased an apple developer membership for a year. I have received my web order details and also the invoice few days ago but when I try to go to App Store Connect it won't let me in. I have contacted the apple developer support 3 days ago but I did not received any response yet. It's frustrating. I do not know much how to navigate on these apple products and devices so I am kind of lost here. Your help or advice, would be greatly appreciated.
Btw, I believed I have already enrolled in this apple developer membership because every time I tried to click enrol it leads me to another purchase membership page which I have already paid, so I ended up clicking the withdraw membership instead of clicking the purchase tab.
Thank you in advance to those who are able to address this concern.
Topic:
Community
SubTopic:
Apple Developers
Dear Apple Support Team,
I am trying to shared data between two different App target. Target A is main iOS app and Target B is Intent Extension. I have create app group and utilise app group to share data between different target but when setting the user default from Target B stile getting container null.
Target B UserDefault object details
sharedDefaults UserDefaults 0x0000600000c05110
baseNSObject@0 NSObject
kvo id 0x0 0x0000000000000000
[0] id
identifier __CFString * "group.com.xxxx. xxxx" 0x0000600001704900
container __CFString * NULL 0x0000000000000000
_volatileDomainNames id 0x0 0x0000000000000000
[0] id
Code snippet in Target B to setting UserDefault
guard let sharedDefaults = UserDefaults(suiteName: SharedUserDefaults.suitName)else {
completion(MuteIntentResponse(code: .failure, userActivity: nil))
return
}
///["event": AudioCommand.mute.rawValue]
sharedDefaults.set("test", forKey: SharedUserDefaults.Keys.audioCommand)
let didSynchronize = sharedDefaults.synchronize()
print("Intent Extension: Wrote Synchronize successful: \(didSynchronize)")
guard let command = sharedDefaults.string(forKey: SharedUserDefaults.Keys.audioCommand) else {
completion(MuteIntentResponse(code: .failure, userActivity: nil))
return
}
print("userDef \(command)")
While reading UserDefault value in Target A
UserDefault object details
baseNSObject@0 NSObject isa Class NSUserDefaults 0x01000001efe1a8a9 kvo id 0x0 0x0000000000000000 identifier __CFString * "group.com.xxxx. xxxx” 0x0000600001782200 container __CFString * NULL 0x0000000000000000 _volatileDomainNames id 0x0 0x0000000000000000 [0] id
Reading UserDefault value Code
if let def = UserDefaults(suiteName: SharedUserDefaults.suitName){
print("commandInfo (def.string(forKey: SharedUserDefaults.Keys.audioCommand))")
}
Please let me know what I am doing wrong.
Topic:
Community
SubTopic:
Apple Developers
My screen time report says that I’m on Google an average of 24 hrs and 4 minutes a day. How is this possible? I can’t be on Google more than 10 minutes a day let alone 24 hrs. I think it’s probably tracking whatever Google does when I’m not in the app or on the cite as part of screen time, but I can’t get it to stop. Are other people having this issue? How do I stop this so I can see my real screen time?