non-standard Storyboard view controller initialization (not -initWithCoder:)

815 views Asked by At

Is there a way to use init methods other than -initWithCoder: for Storyboard view controllers? I already know that you can set properties on VCs inside -prepareForSegue:.

1

There are 1 answers

1
Wizkid1490 On

Yes you can use -initWithNibName: to load a nib file for the view. You need to follow these steps:

  1. First you define the class for the view Controller created .
  2. Then delete the view attribute from that controller in the storyboard
  3. Then you can use nib file to initialize the class .