Skip to content
All you would want to know about yer Storyboards
Swift Ruby Shell Objective-C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Cocoapod
Libraries
StoryboardKit.xcodeproj
StoryboardKit
StoryboardKitTests
Tools
fastlane
.gitignore
.gitmodules
.overcommit.yml
.travis.yml
CHANGELOG.md
Gemfile
Gemfile.lock
LICENSE.md
README.md
StoryboardKit.podspec

README.md

StoryboardKit

Build Status codecov.io Pod Platform Pod License Pod Version

StoryboardKit a simple OSX library that tells you all you would want to know about storyboard files.

Currently it supports iOS storyboards only. OSX storyboard support forthcoming!

Installation


StoryboardKit is available through cocoapods, to install simple add the following line to your PodFile:

  pod "StoryboardKit"

Alternatively you can add the github repo as a submodule and use StoryboardKit as a framework.

Carthage support soon!

Setup and Usage


The library uses two "root" level objects to provide the tree of information you'll need:

  • ApplicationInfo - contains all information global to your application such as class information as well as instance information
  • StoryboardInfo - contains all information specific to a particular Storyboard file

To parse a Storyboard file:

	var applicationInfo = ApplicationInfo()
	var storyboardInfo = StoryboardFileParser.parse(applicationInfo!, pathFileName: "Main.storyboard")

From here you can access things like the list of all ViewControllerClassInfos or ViewControllerInstanceInfos in the app through your ApplicationInfo instance

	for viewControllerClass in application.viewControllerClasses {
		...
	}

Or perhaps you'll traverse through your Storyboard graph via the StoryboardInstanceInfo's initialViewController or scenes list.

	guard let initialViewController = storyboardInfo.initialViewController else { ... }
	guard let initialView = initialViewController.view else { ... }
	
	guard let subviews = initialView.subviews else { ... }
	
	for subview in subviews {
		...
	}

To learn more about the information StoryboardKit currently parses please read the docs here: cocoadocs.org

To see an example of StoryboardKit in use check out the seguecode repo here: seguecode

Contributing

If you have any ideas, suggestions or bugs to report please create an issue labeled feature or bug (check to see if the issue exists first please!).

Or submit a pull request, there is a lot more work to be done!

You can’t perform that action at this time.