> For the complete documentation index, see [llms.txt](https://tule-developer.gitbook.io/noway/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tule-developer.gitbook.io/noway/_posts/2019-02-04-generic-loading-ios.md).

# 2019-02-04-generic-loading-ios

As iOS developers, we already know the basic load/instantiate an `UIViewController` from Storyboard is

```swift
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let loginViewController = storyboard.instantiateViewController(withIdentifier: "Login") as? LoginViewController
```

or `UIView` from Xib

```swift
let view = Bundle.main.loadNibNamed("WelcomeView", owner: nil, options: nil)?.first
```

In this post, I just want to suggest a generic way:

This requires the **Storyboard ID** of `UIViewController` in Storyboard is same as **it’s name**, or the **Xib’s name** have the same **name as UIView**.

Using:
