mavusane
mavusane

Reputation: 247

How do l initialize this class instance in Swift Xcode

enter image description here

myTVcontroller is a tableview controller, l want to create this instance in my custom cell to aid with my custom delegation to update a UILabel e.g.

instance.delegate = yes

But l don't know how and what to put inside the brackets, can you show me a sample please.

Upvotes: 0

Views: 112

Answers (1)

Greg
Greg

Reputation: 25459

Init with coder is used when you create instance of UIView (or subclass like table view) from xib/storyboard and this init with coder mostly is override in subclass to do some custom initialisation.

If you want to create table view controller in code use init with style:

myTVController(style: UITableViewStyle.Plain)

Upvotes: 1

Related Questions