Latest 1.0.1
License MIT
Platforms ios 8.0, requires ARC

What’s this

CleanStoryBoard is very simple, it saves you from instantiating storyboards using string literals and you can leverage autocomplete feature to get storyboard instances. No scope for typos !


pod 'CleanStoryBoard'


  1. define an enum, e.g. Storyboards

    enum Storyboards: String {
            case Main
            case Home
            case Feed
            case Account
  2. extension the struct Storyboard, add static properties, just like below:

    extension Storyboard { 
        static let Main = Storyboard(rawValue: Storyboards.Main.rawValue)
        static let Home = Storyboard(rawValue: Storyboards.Home.rawValue) static let Feed = Storyboard(rawValue: Storyboards.Feed.rawValue)
        static let Account = Storyboard(rawValue: "Account") // not recommended

    as you see, you can create a Account by user String literals Account, but it’s not recommended, using the enum is high recommanded.

  3. assign identifiers to ViewControllers in your storyBoards, just be same as Class Name, then you can initialize your ViewController as below:
    let n1 = HomeNavigationController.instance(from: Storyboard.Home)
    let n2 = FeedNavigationController.instance(from: .Feed)
    let n3 = AccountNavigationController.instance(from: .Account)


CleanStoryBoard is released under an MIT license. See for more information.

Latest podspec

    "name": "CleanStoryBoard",
    "version": "1.0.1",
    "summary": "Clean Story Board",
    "description": "Clean the StoryBoard",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "liubo": "[email protected]"
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "1.0.1"
    "source_files": [
    "requires_arc": true,
    "swift_version": "4.1"

Pin It on Pinterest

Share This