Search code examples
iosswiftstoryboardxib

How to present new controller in a xib file swift in another storyboard


I want to present a controller to xib file in another storyboard In the meantime, I want to use this xib to use several other storyboard How do i do this?


Solution

  • Please follow this step.

    1. Register Nib let xibController = NewViewController(nibName: "XIBController", bundle: nil)

    2. Present View Modally self.presentViewController(xibController, animated: true, completion: nil)