Latest 0.1.3
Homepage https://github.com/pasanmabs/StoryboardInitializable
License MIT
Platforms ios 11.0
Authors

StoryboardInitializable

Swift Version

Problem

A great advantage of using a storyboard with multiple views in it is that you can get a wholistic view of the app along with the navigation flow, but this has a major downside if you work with a team.

  • Source Control – endless merge conflicts on the storyboard, if each screen was kept seperate the number of conflicts would reduce.
  • Navigation – if the storyboard has multiple screens with navigation within the storyboard can become difficult or you might end up changing something unintentionally.
  • Storyboard Id – using storyboard ids can be error prone or lead to boilerplate code

Solution – Use a single storyboard per screen :)

Usage

Import

import StoryboardInitializable

Basic usage if the name of the storyboard and the view controller is the same

let viewController = ViewControllerName.initFromStoryboard()

If the name of the view controller and the storyboard is different

Override the storyboard name with the name you have given the storyboard

 static var storyboardName: String {
        return "NameOfYourStoryboard"
    }

Then load the view controller like earlier

let viewController = ViewControllerName.initFromStoryboard()

StoryboardInitializable

Example

To run the example project, clone the repo, and run it in Xcode 10.

Requirements

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate StoryboardInitializable into your Xcode project using CocoaPods, specify it in your Podfile:

  pod 'StoryboardInitializable', '0.1.2'

Meta

Pasan Mabotuwana – [email protected]

Latest podspec

{
    "name": "StoryboardInitializable",
    "version": "0.1.3",
    "summary": "An easy way to init a storyboard.",
    "description": "A great advantage of using a storyboard with multiple views in it is that you can get a wholistic view of the app along with the navigation flow, but this has a major downside if you work with a team. nn- Source Control - endless merge conflicts on the storyboard, if each screen was kept seperate the number of conflicts would reduce. n- Navigation - if the storyboard has multiple screens with navigation within the storyboard can become difficult or you might end up changing something unintentionally.n-  Storyboard Id - using storyboard ids can be error prone or lead to boilerplate codennSolution - Use a single storyboard per screen :)",
    "homepage": "https://github.com/pasanmabs/StoryboardInitializable",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Pasan Mabotuwana": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pasanmabs/StoryboardInitializable.git",
        "tag": "0.1.3"
    },
    "platforms": {
        "ios": "11.0"
    },
    "swift_version": "4.2",
    "source_files": "Classes/StoryboardInitializable.swift"
}

Pin It on Pinterest

Share This