TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Apr 2015 |
SPMSupports SPM | ✗ |
Maintained by Dominique d'Argent.
Seamlessly glue multiple storyboards together without writing a single line of code.
Facts:
UITabBarController
(replaces the tab).Due to the current lack of proper infrastructure for Swift dependency management, using Glue in your project requires the following steps:
cd
-ing into your top-level project directory, and entering the command git submodule add https://github.com/nubbel/Glue.git
Glue
folder, and drag Glue.xcodeproj
into the file navigator of your app project.Glue.framework
.Glue.framework
.+
button at the top left of the panel and select “New Copy Files Phase”. Rename this new phase to “Copy Frameworks”, set the “Destination” to “Frameworks”, and add Glue.framework
.Alternatively you could also just copy the GlueViewController.swift
file to your project, it doesn’t have any dependencies.
Suppose you have two storyboards A
and B
. In order to glue them together, follow these steps:
A
place a view controller where you want a view controller from B
to appear.GlueViewController
, the “Module” should then automatically be set to Glue
.B
and you’re done!The options can be set on the GlueViewController
instance either in the Attributes Inspector under “Glue View Controller” (courtesy of IBDesignable
& @IBInspectable
) or in the Identity Inspector as “User Defined Runtime Attributes”. Finally, you could also subclass GlueViewController
and override the properties there, but who wants to write code?
Storyboard Name (storyboardName
): The name of the storyboard you want to link this GlueViewController
instance to. If empty the current storyboard will be used.
View Controller Identifier (viewControllerIdentifier
): The “Storyboard ID” as defined in the Identity Inspector of the view controller you want to link this GlueViewController
instance to. If empty the initial view controller of the specified storyboard will be used.
You can find an example project in the Example directory. Here’s a short demo video: http://youtu.be/lQzjHntOKZg
This project is licensed under the terms of the MIT license. See the LICENSE file.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)