How would I use Interface Builder with CNContactViewController in iOS using Xcode and Swift?

38 Views Asked by At

I was able to discover that CNContactViewController is able to be subclassed. I would like to use Interface Builder so that I could show a standard back button with the standard partial arrow or less than sign looking symbol that indicates the view controller can go back to the previous view controller by tapping on that.

I think the way to make it look most standard is to use Interface Builder.

I have problems figuring out how to instantiate the subclass. How would the subclass be initialized as part of a View Controller object on a storyboard?

I get the following error where I call super.init(for:) in my subclass. What is a "designated initializer if init(for:) is not considered a designated initializer?

init(with contact: CNContact) {
    super.init(for: contact) // error here saying: "Must call a designated initializer of the superclass 'CNContactViewController'"
}

When I don't call any of super's initializer, I get an error like so:

init() {
    
} // error here saying: "'super.init' isn't called on all paths before returning from initializer"
0

There are 0 best solutions below