Xcode storyboards diff and merge tool.

Overview

StoryboardMerge

alt tag

Storyboard diff and merge tool which:

  • compares and merges two storyboard files,
  • provides an automatic merge-facility,

The storyboarding is a new UI design feature introduced with the Xcode 4.2 which allows to describe all the application’s UI in one file. This very handy mechanism has one major drawback. Because all the UI lives in one file, the whole UI design process is very prone to revision control conflicts. Moreover, the Xcode standard merging mechanism treats storyboard files like ordinary text files which further complicates merging. The StoryboardMerge solves those problems.

How to use

Load two conflicted storyboard files from disk, SVN or Git and click Compare.

The StoryboardMerge compares files and shows conflicts (differences). Use checkboxes to tell the StoryboardMerge how to solve conflicts.

After setting all checkboxes click Merge. You will see the merged storyboard in a right panel.

The StoryboardMerge will validate a new storyboard and mark in red incorrect elements.

Click Save to write a new storyboard or override the old one.

How to use as a git mergetool

Edit your ~/.gitconfig file and add the following section:

[mergetool "storyboard"]
	name = StoryboardMerge interactive merge
	cmd = storyboard-merge $BASE $LOCAL $REMOTE $MERGED
	trustExitCode = false

Copy storyboard-merge into /usr/local/bin and make it executable:

$ chmod 755 /usr/local/bin/storyboard-merge

When a storyboard conflict occurs:

$ git status
On branch master
Your branch and 'origin/master' have diverged,
and have 1 and 1 different commit each, respectively.
  (use "git pull" to merge the remote branch into yours)

You have unmerged paths.
  (fix conflicts and run "git commit")

Unmerged paths:
  (use "git add <file>..." to mark resolution)

	both modified:   Storyboards/Base.lproj/Main.storyboard

no changes added to commit (use "git add" and/or "git commit -a")

Run:

$ git mergetool -t storyboard

Which will give you the following prompt in your terminal:

$ git mergetool -t storyboard
Merging:
Storyboards/Base.lproj/Main.storyboard

Normal merge conflict for 'Storyboards/Base.lproj/Main.storyboard':
  {local}: modified file
  {remote}: modified file
Hit return to start merge resolution tool (storyboard): 

Hit return to accept the default (as defined in your ~/.gitconfig above.) Which will launch StoryboardMerge and give you the following prompt in your terminal:

Storyboards/Base.lproj/Main.storyboard seems unchanged.
Was the merge successful? [y/n]

When your merge is complete, press the StoryboardMerge 'save' toolbar icon, which will save the file to the proper place, then return to your terminal and type 'y' to accept the merge. (Or 'n' if something went wrong and you'd like to start over.)

After merging I'd recommend opening the file in Xcode and verifying everything is okay and to allow it to rewrite any changes is sees fit before committing your changes.

Building

IMPORTANT: StoryboardMerge uses CocoaPods so make sure to always open the workspace file (StoryboardMerge.xcworkspace) instead of the project file (StoryboardMerge.xcodeproj) when building.

More info

See http://marcinolawski.pl/Tools.html

You might also like...
An executable that can be called from a Run Script Build Phase that makes comments such as // TODO: or // SERIOUS: appear in Xcode's Issue Navigator giving them project-wide visibility.

XcodeIssueGenerator An executable that can be called from a Run Script Build Phase that makes comments such as // TODO: or // SERIOUS: appear in Xcode

This repository contains rules for Bazel that can be used to generate Xcode projects

rules_xcodeproj This repository contains rules for Bazel that can be used to generate Xcode projects. If you run into any problems with these rules, p

AVXCAssets Generator takes path for your assets images and creates appiconset and imageset for you in just one click
AVXCAssets Generator takes path for your assets images and creates appiconset and imageset for you in just one click

AVXCAssets Generator Often while developing an app, We ran into a condition when we need to scale images to each and every aspect ratios for icons and

Build native iOS, Android, and Web apps with Capacitor and Remix.run 💿

This repository holds production ready Capacitor templates for building native mobile applications using Remix. Using Capacitor, you can quickly build out a native mobile application for iOS and Android using web technology, such as Remix.

Strong typed, autocompleted resources like images, fonts and segues in Swift projects
Strong typed, autocompleted resources like images, fonts and segues in Swift projects

R.swift Get strong typed, autocompleted resources like images, fonts and segues in Swift projects Why use this? It makes your code that uses resources

swiftenv allows you to easily install, and switch between multiple versions of Swift.
swiftenv allows you to easily install, and switch between multiple versions of Swift.

Swift Version Manager swiftenv allows you to easily install, and switch between multiple versions of Swift. This project was heavily inspired by pyenv

Mergel - a match-and-merge game written in Swift, using SpriteKit

Mergel is a match-and-merge game written in Swift, using SpriteKit. It was created for the purpose of having some fun with SpriteKit and learning the Swift language.

Play with Xcode storyboards...

Storyboards In this repo, we will be playing with storyboards. Add Table View and Collection Views and show some data using the data source and delega

A script to fetch packages via Github search and diff them against SPI

spi-package-importer importer is a command line utility with three subcommands: fetch package lists from Github via search and save them to JSON files

Simple diff library in pure Swift

Diff Simple diffing library in pure Swift. Installing You can use Carthage or Swift Package Manager to install Diff. Usage Start by importing the pack

Dwifft is a small Swift library that tells you what the
Dwifft is a small Swift library that tells you what the "diff" is between two collections

Dwifft! In 10 seconds Dwifft is a small Swift library that tells you what the "diff" is between two collections, namely, the series of "edit operation

Diff - Simple diffing library in pure Swift

Diff Simple diffing library in pure Swift. Installing You can use Carthage or Swift Package Manager to install Diff. Usage Start by importing the pack

Localize is a framework writed in swift to localize your projects easier improves i18n, including storyboards and strings.
Localize is a framework writed in swift to localize your projects easier improves i18n, including storyboards and strings.

Localize Localize is a framework written in swift to help you localize and pluralize your projects. It supports both storyboards and strings. Features

Custom segue for OSX Storyboards with slide and cross fade effects (NSViewControllerTransitionOptions)
Custom segue for OSX Storyboards with slide and cross fade effects (NSViewControllerTransitionOptions)

CustomSegue Custom segue for OSX Storyboards. Slide and cross fade effects, new customized window. class MyViewController: NSViewController { overr

A Swift mixin for reusing views easily and in a type-safe way (UITableViewCells, UICollectionViewCells, custom UIViews, ViewControllers, Storyboards…)
A Swift mixin for reusing views easily and in a type-safe way (UITableViewCells, UICollectionViewCells, custom UIViews, ViewControllers, Storyboards…)

Reusable A Swift mixin to use UITableViewCells, UICollectionViewCells and UIViewControllers in a type-safe way, without the need to manipulate their S

Swift CLI for strong-typing images, colors, storyboards, fonts and localizations

Shark Shark is a Swift command line tool that generates type safe enums for your images, colors, storyboards, fonts and localizations. Because Shark r

DevTool - A simple UI and powerful Mac OS application, Such as JSON-Formatting tool, JSON-to-model tool, AppIcon generator, Network-Request tool...
DevTool - A simple UI and powerful Mac OS application, Such as JSON-Formatting tool, JSON-to-model tool, AppIcon generator, Network-Request tool...

🔥 🔥 🔥 A simple UI and powerful Mac OS application. It is a collection of tools commonly used in my development work. Such as JSON-Formatting tool, JSON-to-model tool, AppIcon generator, Network-Request tool...

The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs!
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs!

SwiftGen SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them ty

Super lightweight library that helps you to localize strings, even directly in storyboards!
Super lightweight library that helps you to localize strings, even directly in storyboards!

Translatio Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 9 or higher. Swi

Comments
  • XPathException: Too many rows

    XPathException: Too many rows

    When running the project, I get the following error:

    2015-10-30 07:50:31.608 StoryboardMerge[3096:185407] Too many rows
    2015-10-30 07:50:31.610 StoryboardMerge[3096:185407] (
    0   CoreFoundation                      0x00007fff8554be32 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff8a5364fa objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff855b265d +[NSException raise:format:] + 205
    3   StoryboardMerge                     0x0000000100008962 -[MOXElement findCousin:] + 562
    4   StoryboardMerge                     0x0000000100008bc1 -[MOXElement findCousinAndCompare:] + 97
    5   StoryboardMerge                     0x0000000100008e9e -[MOXElement findCousinAndCompare:] + 830
    6   StoryboardMerge                     0x0000000100008e9e -[MOXElement findCousinAndCompare:] + 830
    7   StoryboardMerge                     0x0000000100004a2d -[MOXStoryboard compareStoryboards:] + 333
    8   StoryboardMerge                     0x000000010000b9e2 -[DocumentsWinCtrl _loadStorybords] + 146
    9   StoryboardMerge                     0x000000010000c739 -[DocumentsWinCtrl windowDidLoad] + 73
    10  AppKit                              0x00007fff94fa2607 -[NSWindowController _windowDidLoad] + 592
    11  AppKit                              0x00007fff94f3f48e -[NSWindowController window] + 110
    12  AppKit                              0x00007fff9512f5cd -[NSWindowController showWindow:] + 36
    13  StoryboardMerge                     0x0000000100002bee -[AppDelegate openButtonPressed:] + 1054
    14  libsystem_trace.dylib               0x00007fff8f9c4082 _os_activity_initiate + 75
    15  AppKit                              0x00007fff95198811 -[NSApplication sendAction:to:from:] + 460
    16  AppKit                              0x00007fff951aaa0e -[NSControl sendAction:to:] + 86
    17  AppKit                              0x00007fff951aa938 __26-[NSCell _sendActionFrom:]_block_invoke + 131
    18  libsystem_trace.dylib               0x00007fff8f9c4082 _os_activity_initiate + 75
    19  AppKit                              0x00007fff951aa895 -[NSCell _sendActionFrom:] + 144
    20  libsystem_trace.dylib               0x00007fff8f9c4082 _os_activity_initiate + 75
    21  AppKit                              0x00007fff951a8eba -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2693
    22  AppKit                              0x00007fff951f1b78 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 744
    23  AppKit                              0x00007fff951a75e4 -[NSControl mouseDown:] + 669
    24  AppKit                              0x00007fff956f542d -[NSWindow _handleMouseDownEvent:isDelayedEvent:] + 6322
    25  AppKit                              0x00007fff956f6411 -[NSWindow _reallySendEvent:isDelayedEvent:] + 212
    26  AppKit                              0x00007fff9513bb8d -[NSWindow sendEvent:] + 517
    27  AppKit                              0x00007fff950bbb27 -[NSApplication sendEvent:] + 2540
    28  AppKit                              0x00007fff94f22d9a -[NSApplication run] + 796
    29  AppKit                              0x00007fff94eebfbe NSApplicationMain + 1176
    30  StoryboardMerge                     0x00000001000012c2 main + 34
    31  libdyld.dylib                       0x00007fff93fd15ad start + 1
    )
    

    I can see that it is crashing on the xpath document/dependencies/capability, which indeed have multiple entries:

    <capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/>
    <capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
    <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
    <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
    
    opened by ghost 3
  • Adding support for xcode 6.4?

    Adding support for xcode 6.4?

    Hi,

    Just tried your tool with xcode 6.4 storyboard and got a crash (findcousin complains that it found more than one cousin for inside ). Are you working on an update?

    opened by Laurent-Brigaut 3
  • Added command line arguments to allow usage as a git mergetool.

    Added command line arguments to allow usage as a git mergetool.

    Not sure if you're actively maintaining this anymore, but I thought it was a useful tool and gave it a little tweak to make it better for my workflow. Hopefully it's useful. I'm an iOS dev and I've never done OS X development, so please forgive any newbie mistakes!

    Thanks for the great app!

    -Eric

    opened by edelabar 1
  • git mergetool -t storyboard asks for left and right hand side files to be selected

    git mergetool -t storyboard asks for left and right hand side files to be selected

    After setting up everything, storyboard-merge is opening, but asks for the left and the right hand side file explicitly. This is not the correct behavior. It should be automatically be taking up the left and right hand side versions based on the merge conflicts, right !

    opened by mythical-programmer 1
Owner
null
Generate a constants file by grabbing identifiers from storyboards in a project.

sbconstants Generate a constants file by grabbing identifiers from storyboards in a project. Installation $ gem install sbconstants Usage For automate

paul.s 310 Sep 9, 2022
Xcode-compatible build tool.

xcbuild xcbuild is an Xcode-compatible build tool with the goal of providing faster builds, better documentation of the build process and running on m

Meta Archive 2k Dec 11, 2022
Automatically build and rebuild Xcode image catalogs for app icons, universal images, and more

Better asset workflow for iOS developers. Generate Xcode image catalogs for iOS / OSX app icons, universal images, and more.

Dotan J. Nahum 822 Dec 21, 2022
An adorable little framework and command line tool for interacting with SourceKit.

SourceKitten An adorable little framework and command line tool for interacting with SourceKit. SourceKitten links and communicates with sourcekitd.fr

JP Simard 2.1k Jan 5, 2023
SwiftGen is a tool to automatically generate Swift code for resources of your projects

SwiftGen SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them ty

null 8.3k Jan 5, 2023
Xcode .appiconset generator for Adobe Illustrator.

Creating AppIcon sets from Adobe Illustrator This repo is rewrited from original repo https://github.com/CaryChamplin/CreatingIconsFromAI. Just genera

gitmerge 73 Nov 9, 2020
Script to support easily using Xcode Asset Catalog in Swift.

Misen Misen is a script to support using Xcode Asset Catalog in Swift. Features Misen scans sub-directories in the specified Asset Catalog and creates

Kazunobu Tasaka 123 Jun 29, 2022
A git plugin for real-world xcode versioning workflow.

git-xcp The most simplest, safe, and fully automatic git plugin for versioning workflow of real-world xcode projects. Current working or draft content

gitmerge 11 Dec 29, 2019
An Xcode plug-in to format your code using SwiftLint.

SwiftLintXcode An Xcode plug-in to format your code using SwiftLint. Runs swiftlint autocorrect --path CURRENT_FILE before *.swift file is saved. IMPO

Yuya Tanaka 348 Sep 18, 2022
An Xcode Plugin to convert Objective-C to Swift

XCSwiftr Convert Objective-C code into Swift from within Xcode. This plugin uses the Java applet of objc2swift to do the conversion. Noticed that the

Ignacio Romero Zurbuchen 338 Nov 29, 2022