what is the .Type in swift

Viewed 29

I am trying to use the Contacts framework in swift. when trying to request access i have the following error at compilation, can someone help me understand it?

test.swift:5:33: error: cannot convert value of type 'CNEntityType.Type' to expected argument type 'CNEntityType'
contactStore.requestAccess(for: CNEntityType, completionHandler: (Bool, Error?) -> Void) 
                                ^
test.swift:5:66: error: cannot convert value of type '((Bool, Error?) -> Void).Type' to expected argument type '(Bool, Error?) -> Void'
contactStore.requestAccess(for: CNEntityType, completionHandler: (Bool, Error?) -> Void) 

this is my code:

import Contacts

private let contactStore = CNContactStore()
contactStore.requestAccess(for: CNEntityType, completionHandler: (Bool, Error?) -> Void) 
0 Answers
Related