krzyzanowskim / Natalie

Natalie - Storyboard Code Generator (for Swift)
http://blog.krzyzanowskim.com/2015/04/15/natalie-storyboard-code-generator/
MIT License
1.17k stars 74 forks source link

Support Apple Watch storyboards #68

Open marcelofabri opened 9 years ago

marcelofabri commented 9 years ago

Currently, a fatalError is thrown:

fatal error: Unsupported: file /usr/local/bin/natalie.swift, line 618
krzyzanowskim commented 9 years ago

thanks, have to look into

phimage commented 7 years ago

maybe we must just skip it instead of fatalError until something could be done or if there is a command line parser, we can have --platform macOS,iOS ...

There is no performSegue but pushController or presentController and the key is not segue identifier but Controller name http://www.informit.com/articles/article.aspx?p=2272657&seqNum=3

storyboard sample

<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="AgC-eL-Hgc">
    <device id="watch38" orientation="portrait">
        <adaptation id="fullscreen"/>
    </device>
    <dependencies>
        <deployment identifier="watchOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="12029"/>
    </dependencies>
    <scenes>
        <!--Main View Controller-->
        <scene sceneID="aou-V4-d1y">
            <objects>
                <controller id="AgC-eL-Hgc" customClass="MainViewController" customModule="NatalieExample">
                    <items>
                        <button width="1" alignment="left" title="Button" id="j50-qh-I3k">
                            <connections>
                                <action selector="screen1ButtonPressed:" destination="AgC-eL-Hgc" id="ZHB-Mb-6pW"/>
                            </connections>
                        </button>
                        <button width="1" alignment="left" title="Button" id="Tx1-7n-xFc">
                            <connections>
                                <action selector="screen22ButtonPressed:" destination="AgC-eL-Hgc" id="xoj-gm-sOn"/>
                            </connections>
                        </button>
                        <button width="1" alignment="left" title="Button" id="LRA-cm-Iu9">
                            <connections>
                                <segue destination="EGR-km-7cf" kind="push" identifier="Screen One Segue Button" id="HwS-s8-mnG"/>
                            </connections>
                        </button>
                    </items>
                    <connections>
                        <segue destination="9zd-tX-z6p" kind="relationship" relationship="nextPage" id="dkd-Ta-bKE"/>
                    </connections>
                </controller>
            </objects>
            <point key="canvasLocation" x="67" y="159"/>
        </scene>
        <!--Interface Controller-->
        <scene sceneID="S5p-mY-hz9">
            <objects>
                <controller id="9zd-tX-z6p"/>
            </objects>
            <point key="canvasLocation" x="194" y="474"/>
        </scene>
        <!--Interface Controller-->
        <scene sceneID="vqy-1R-H8t">
            <objects>
                <controller id="EGR-km-7cf"/>
            </objects>
            <point key="canvasLocation" x="371" y="159"/>
        </scene>
    </scenes>
</document>