@@ -179,6 +179,11 @@ public struct ComposableContactConfig: Sendable {
179179 let historyToken : Data ?
180180 /// An event visitor for enumerating and responding to change history events in the contact store.
181181 let eventVisitor : CNChangeHistoryEventVisitor
182+
183+ public init ( historyToken: Data ? , eventVisitor: CNChangeHistoryEventVisitor ) {
184+ self . historyToken = historyToken
185+ self . eventVisitor = eventVisitor
186+ }
182187}
183188
184189/// A request structure specifying a contact to retrieve by its identifier along with the keys to fetch.
@@ -187,6 +192,11 @@ public struct ContactWithIdentifierRequest: Sendable {
187192 let identifier : String
188193 /// A set of `ComposableContactKey` values indicating which contact properties to fetch.
189194 let keysToFetch : Set < ComposableContactKey >
195+
196+ public init ( identifier: String , keysToFetch: Set < ComposableContactKey > ) {
197+ self . identifier = identifier
198+ self . keysToFetch = keysToFetch
199+ }
190200}
191201
192202/// A request structure for retrieving multiple contacts by their identifiers and specifying keys to fetch.
@@ -195,6 +205,11 @@ public struct ContactsWithIdentifiersRequest: Sendable {
195205 let identifiers : [ String ]
196206 /// A set of `ComposableContactKey` values indicating which contact properties to fetch.
197207 let keysToFetch : Set < ComposableContactKey >
208+
209+ public init ( identifiers: [ String ] , keysToFetch: Set < ComposableContactKey > ) {
210+ self . identifiers = identifiers
211+ self . keysToFetch = keysToFetch
212+ }
198213}
199214
200215/// A request structure for retrieving contacts by a phone number.
@@ -203,6 +218,11 @@ public struct ContactsMatchingPhoneNumberRequest: Sendable {
203218 let phoneNumber : String
204219 /// A set of `ComposableContactKey` values indicating which contact properties to fetch.
205220 let keysToFetch : Set < ComposableContactKey >
221+
222+ public init ( phoneNumber: String , keysToFetch: Set < ComposableContactKey > ) {
223+ self . phoneNumber = phoneNumber
224+ self . keysToFetch = keysToFetch
225+ }
206226}
207227
208228/// A request structure for retrieving contacts by a name substring or full name.
@@ -211,6 +231,11 @@ public struct ContactsMatchingNameRequest: Sendable {
211231 let name : String
212232 /// A set of `ComposableContactKey` values indicating which contact properties to fetch.
213233 let keysToFetch : Set < ComposableContactKey >
234+
235+ public init ( name: String , keysToFetch: Set < ComposableContactKey > ) {
236+ self . name = name
237+ self . keysToFetch = keysToFetch
238+ }
214239}
215240
216241/// A request structure for retrieving contacts by an email address.
@@ -219,6 +244,11 @@ public struct ContactsMatchingEmailRequest: Sendable {
219244 let email : String
220245 /// A set of `ComposableContactKey` values indicating which contact properties to fetch.
221246 let keysToFetch : Set < ComposableContactKey >
247+
248+ public init ( email: String , keysToFetch: Set < ComposableContactKey > ) {
249+ self . email = email
250+ self . keysToFetch = keysToFetch
251+ }
222252}
223253
224254/// A request structure for retrieving contacts that belong to a specific group.
@@ -227,6 +257,11 @@ public struct ContactsInGroupRequest: Sendable {
227257 let groupID : String
228258 /// A set of `ComposableContactKey` values indicating which contact properties to fetch.
229259 let keysToFetch : Set < ComposableContactKey >
260+
261+ public init ( groupID: String , keysToFetch: Set < ComposableContactKey > ) {
262+ self . groupID = groupID
263+ self . keysToFetch = keysToFetch
264+ }
230265}
231266
232267/// A request structure for retrieving contacts in a specific container.
@@ -235,4 +270,9 @@ public struct ContactsInContainerRequest: Sendable {
235270 let containerID : String
236271 /// A set of `ComposableContactKey` values indicating which contact properties to fetch.
237272 let keysToFetch : Set < ComposableContactKey >
273+
274+ public init ( containerID: String , keysToFetch: Set < ComposableContactKey > ) {
275+ self . containerID = containerID
276+ self . keysToFetch = keysToFetch
277+ }
238278}
0 commit comments