Post

Replies

Boosts

Views

Activity

callkit and contact app
Hello, I am a developer currently working on a personal contact management app. What is the app? My app stores additional information beyond basic contact details. Therefore, instead of using the Contacts framework, I manage contact objects using Core Data. What am I trying to achieve? I want to display additional information on the caller ID screen when a call is received from a number stored in my app. What have I tried? I’ve attempted the following methods without success: 1. Call Directory Extension: I thought using this method would allow me to display additional information from Core Data on the call screen. However, I learned that when a call is received, the iOS system first searches for the phone number in the Contacts app and only looks to the Extension app if no match is found. Therefore, displaying contact information from my app seems unfeasible. 2. Custom Call UI: Using CallKit seemed like a viable option to display the necessary information during a call, but it appears to only be possible with VoIP apps. My app does not support VoIP calls, so this method was also not implementable. I am wondering if there are any technologies available that could help me achieve my goal, or if there’s something I might be missing. Any advice would be greatly appreciated. Thank you! If a similar question has been asked, I apologize for the repetition.
3
0
1.6k
Oct ’24
SwiftUI List selection bug
Is there a way to optimize a List in SwiftUI? There is a problem with selection not working properly when the List has many rows. If you scroll to multi-select and up, some rows in the middle are not selected. I have an issue where selecting an unselected row deselects nearby rows. Is there any way for selection to work reliably even for a List of many rows? I would like to find a solution that is stable even when multiple lines are selected, like mail and note, which are the default apps in ios. ps. I am using CoreData. @State var selectedItem = Set<MyEntity>() List(selection: $selectItem){   ForEach(items, id: \.self){ item in     ContactsRow(contactsData: item)   } } .environment(\.editMode, $editMode)
1
0
1.9k
Jun ’24
Looking for hints on swiftui camera app.
hello. I am a beginner developer. I am creating a camera app using swiftui. I want to create an app that allows you to take pictures with a camera, apply filters, and save them. I'm practicing following Apple's sample tutorial. https://developer.apple.com/tutorials/sample-apps/capturingphotos-camerapreview It was possible to apply CIFilter to the image displayed in the viewfinder, but I don't know how to apply the filter to the saved photo. I'd like to get some hints on this.
1
0
814
Sep ’23
Help! Get a contact and store it in CoreData
overview of the problem I'm making an app with SwiftUI. We even implemented fetching contacts using CNContactStore. The goal is to get the contacts and store them separately in CoreData. This is because you need to assign and manage attributes that are not in the default contact. class ContactStore: ObservableObject {   @Environment(\.managedObjectContext) private var viewContext   @Published var error: Error? = nil   @Published var results: [CNContact] = []       func fetch() {     do {       let store = CNContactStore()       let keysToFetch = [CNContactGivenNameKey as CNKeyDescriptor,                 CNContactMiddleNameKey as CNKeyDescriptor,                 CNContactFamilyNameKey as CNKeyDescriptor,                 CNContactImageDataAvailableKey as CNKeyDescriptor,                 CNContactPhoneNumbersKey as CNKeyDescriptor,                 CNContactImageDataKey as CNKeyDescriptor]       os_log("Fetching contacts: now")       let containerId = store.defaultContainerIdentifier()       let predicate = CNContact.predicateForContactsInContainer(withIdentifier: containerId)       let contacts = try store.unifiedContacts(matching: predicate, keysToFetch: keysToFetch)       os_log("Fetching contacts: succesfull with count = %d", contacts.count)       self.results = contacts       print(results)     } catch let error {       print("error occured! : \(error.localizedDescription)")     }   } } problem Is there a way to store the contact information in the array 'results' as CoreData? The attributes set in CoreData are 'name', 'phone', and 'company'.
1
0
1.4k
Dec ’22
I found SwiftUI bug. List selection bug
I used List(select:) to make it selectable. When scrolling to select many rows, the selected content sometimes disappears. Is running out of memory a problem? While the default app in ios has smooth multi-selection, it is unstable when using swiftui's list function. Multi-select in the mail app, for example, doesn't run out of memory when many rows are selected. How do you achieve this perfection? The code is nothing special. Create a list with List(select:) and rows with ForEach(array, id:.self). I'll attach a video https://i.stack.imgur.com/2px9i.gif
1
0
730
Jun ’22
Help. (coredata, ForEach crash) I've been looking for an answer for 16 hours.
I am using coredata. Draw a rectangle by taking only 2 values ​​with ForEach. However, when I add new data or modify the data, the app crashes. ForEach must have a maximum index value of 1. This is because the limit of fetchrequest is 2. However, when I add new data, the value of index becomes 2 and get an 'out of range' error. I've been looking for an answer for 16 hours. import SwiftUI struct chart: View{   @Environment(\.managedObjectContext) private var viewContext   @FetchRequest var datas: FetchedResults<Mind>       @State var show = [true, false]       init() {     let request: NSFetchRequest<Success> = Mind.fetchRequest()           request.sortDescriptors = [       NSSortDescriptor(keyPath: \Success.date, ascending: false)     ]     request.fetchLimit = 2     _datas = FetchRequest(fetchRequest: request)   }       var body: some View{     VStack(alignment: .leading){       ForEach(0..<datas.map{$0.suc}.count, id: \.self){ index in         RoundedRectangle(cornerRadius: 5)           .fill(Color.objcolor.opacity(show[index] ? 1 : 0.7))           .frame(width: 10, height: 5)       }     }   } }
0
0
678
Nov ’21
callkit and contact app
Hello, I am a developer currently working on a personal contact management app. What is the app? My app stores additional information beyond basic contact details. Therefore, instead of using the Contacts framework, I manage contact objects using Core Data. What am I trying to achieve? I want to display additional information on the caller ID screen when a call is received from a number stored in my app. What have I tried? I’ve attempted the following methods without success: 1. Call Directory Extension: I thought using this method would allow me to display additional information from Core Data on the call screen. However, I learned that when a call is received, the iOS system first searches for the phone number in the Contacts app and only looks to the Extension app if no match is found. Therefore, displaying contact information from my app seems unfeasible. 2. Custom Call UI: Using CallKit seemed like a viable option to display the necessary information during a call, but it appears to only be possible with VoIP apps. My app does not support VoIP calls, so this method was also not implementable. I am wondering if there are any technologies available that could help me achieve my goal, or if there’s something I might be missing. Any advice would be greatly appreciated. Thank you! If a similar question has been asked, I apologize for the repetition.
Replies
3
Boosts
0
Views
1.6k
Activity
Oct ’24
SwiftUI List selection bug
Is there a way to optimize a List in SwiftUI? There is a problem with selection not working properly when the List has many rows. If you scroll to multi-select and up, some rows in the middle are not selected. I have an issue where selecting an unselected row deselects nearby rows. Is there any way for selection to work reliably even for a List of many rows? I would like to find a solution that is stable even when multiple lines are selected, like mail and note, which are the default apps in ios. ps. I am using CoreData. @State var selectedItem = Set<MyEntity>() List(selection: $selectItem){   ForEach(items, id: \.self){ item in     ContactsRow(contactsData: item)   } } .environment(\.editMode, $editMode)
Replies
1
Boosts
0
Views
1.9k
Activity
Jun ’24
Looking for hints on swiftui camera app.
hello. I am a beginner developer. I am creating a camera app using swiftui. I want to create an app that allows you to take pictures with a camera, apply filters, and save them. I'm practicing following Apple's sample tutorial. https://developer.apple.com/tutorials/sample-apps/capturingphotos-camerapreview It was possible to apply CIFilter to the image displayed in the viewfinder, but I don't know how to apply the filter to the saved photo. I'd like to get some hints on this.
Replies
1
Boosts
0
Views
814
Activity
Sep ’23
Help! Get a contact and store it in CoreData
overview of the problem I'm making an app with SwiftUI. We even implemented fetching contacts using CNContactStore. The goal is to get the contacts and store them separately in CoreData. This is because you need to assign and manage attributes that are not in the default contact. class ContactStore: ObservableObject {   @Environment(\.managedObjectContext) private var viewContext   @Published var error: Error? = nil   @Published var results: [CNContact] = []       func fetch() {     do {       let store = CNContactStore()       let keysToFetch = [CNContactGivenNameKey as CNKeyDescriptor,                 CNContactMiddleNameKey as CNKeyDescriptor,                 CNContactFamilyNameKey as CNKeyDescriptor,                 CNContactImageDataAvailableKey as CNKeyDescriptor,                 CNContactPhoneNumbersKey as CNKeyDescriptor,                 CNContactImageDataKey as CNKeyDescriptor]       os_log("Fetching contacts: now")       let containerId = store.defaultContainerIdentifier()       let predicate = CNContact.predicateForContactsInContainer(withIdentifier: containerId)       let contacts = try store.unifiedContacts(matching: predicate, keysToFetch: keysToFetch)       os_log("Fetching contacts: succesfull with count = %d", contacts.count)       self.results = contacts       print(results)     } catch let error {       print("error occured! : \(error.localizedDescription)")     }   } } problem Is there a way to store the contact information in the array 'results' as CoreData? The attributes set in CoreData are 'name', 'phone', and 'company'.
Replies
1
Boosts
0
Views
1.4k
Activity
Dec ’22
I found SwiftUI bug. List selection bug
I used List(select:) to make it selectable. When scrolling to select many rows, the selected content sometimes disappears. Is running out of memory a problem? While the default app in ios has smooth multi-selection, it is unstable when using swiftui's list function. Multi-select in the mail app, for example, doesn't run out of memory when many rows are selected. How do you achieve this perfection? The code is nothing special. Create a list with List(select:) and rows with ForEach(array, id:.self). I'll attach a video https://i.stack.imgur.com/2px9i.gif
Replies
1
Boosts
0
Views
730
Activity
Jun ’22
Help. (coredata, ForEach crash) I've been looking for an answer for 16 hours.
I am using coredata. Draw a rectangle by taking only 2 values ​​with ForEach. However, when I add new data or modify the data, the app crashes. ForEach must have a maximum index value of 1. This is because the limit of fetchrequest is 2. However, when I add new data, the value of index becomes 2 and get an 'out of range' error. I've been looking for an answer for 16 hours. import SwiftUI struct chart: View{   @Environment(\.managedObjectContext) private var viewContext   @FetchRequest var datas: FetchedResults<Mind>       @State var show = [true, false]       init() {     let request: NSFetchRequest<Success> = Mind.fetchRequest()           request.sortDescriptors = [       NSSortDescriptor(keyPath: \Success.date, ascending: false)     ]     request.fetchLimit = 2     _datas = FetchRequest(fetchRequest: request)   }       var body: some View{     VStack(alignment: .leading){       ForEach(0..<datas.map{$0.suc}.count, id: \.self){ index in         RoundedRectangle(cornerRadius: 5)           .fill(Color.objcolor.opacity(show[index] ? 1 : 0.7))           .frame(width: 10, height: 5)       }     }   } }
Replies
0
Boosts
0
Views
678
Activity
Nov ’21