Skip to content

Commit 293f542

Browse files
author
Mattes Groeger
committed
Add crash button
1 parent 03e51e5 commit 293f542

4 files changed

Lines changed: 51 additions & 11 deletions

File tree

TravisExample/ViewController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@
1010

1111
@interface ViewController : UIViewController
1212

13+
- (IBAction)onCrash:(id)sender;
14+
1315
@end

TravisExample/ViewController.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ - (void)didReceiveMemoryWarning
2626
// Dispose of any resources that can be recreated.
2727
}
2828

29+
- (IBAction)onCrash:(id)sender
30+
{
31+
[NSException raise:@"EnforcesException" format:@"You pushed the crash button!"];
32+
}
33+
2934
@end

TravisExample/en.lproj/MainStoryboard_iPad.storyboard

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,33 @@
2121
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
2222
<nil key="highlightedColor"/>
2323
</label>
24+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SyL-J4-cLR">
25+
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
26+
<state key="normal" title="Crash Me :(">
27+
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
28+
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
29+
</state>
30+
<state key="highlighted">
31+
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
32+
</state>
33+
<connections>
34+
<action selector="onCrash:" destination="2" eventType="touchUpInside" id="FQX-le-wLE"/>
35+
</connections>
36+
</button>
2437
</subviews>
2538
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
2639
<constraints>
2740
<constraint firstItem="BoF-bD-kmD" firstAttribute="top" secondItem="5" secondAttribute="top" constant="166" id="5sj-ZY-PUE"/>
28-
<constraint firstItem="BoF-bD-kmD" firstAttribute="centerX" secondItem="5" secondAttribute="centerX" type="default" id="xxg-gv-Jz5"/>
41+
<constraint firstItem="SyL-J4-cLR" firstAttribute="centerX" secondItem="BoF-bD-kmD" secondAttribute="centerX" type="default" id="83x-Jc-6jD"/>
42+
<constraint firstItem="SyL-J4-cLR" firstAttribute="top" secondItem="5" secondAttribute="top" constant="232" id="FKe-3Z-Wmb"/>
43+
<constraint firstItem="SyL-J4-cLR" firstAttribute="centerX" secondItem="5" secondAttribute="centerX" type="default" id="WA1-5O-mrF"/>
2944
</constraints>
3045
</view>
3146
</viewController>
3247
<placeholder placeholderIdentifier="IBFirstResponder" id="3" sceneMemberID="firstResponder"/>
3348
</objects>
3449
</scene>
3550
</scenes>
36-
<classes>
37-
<class className="NSLayoutConstraint" superclassName="NSObject">
38-
<source key="sourceIdentifier" type="project" relativePath="./Classes/NSLayoutConstraint.h"/>
39-
</class>
40-
<class className="ViewController" superclassName="UIViewController">
41-
<source key="sourceIdentifier" type="project" relativePath="./Classes/ViewController.h"/>
42-
</class>
43-
</classes>
4451
<simulatedMetricsContainer key="defaultSimulatedMetrics">
4552
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
4653
<simulatedOrientationMetrics key="orientation"/>

TravisExample/en.lproj/MainStoryboard_iPhone.storyboard

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,44 @@
2121
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
2222
<nil key="highlightedColor"/>
2323
</label>
24+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fCD-xb-xMh">
25+
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
26+
<state key="normal" title="Crash Me :(">
27+
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
28+
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
29+
</state>
30+
<state key="highlighted">
31+
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
32+
</state>
33+
<connections>
34+
<action selector="onCrash:" destination="2" eventType="touchUpInside" id="Nf1-ZV-Exo"/>
35+
</connections>
36+
</button>
2437
</subviews>
2538
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
2639
<constraints>
27-
<constraint firstItem="AZi-Bx-28g" firstAttribute="top" secondItem="3" secondAttribute="top" constant="112" id="ESp-fJ-BGU"/>
28-
<constraint firstItem="AZi-Bx-28g" firstAttribute="centerX" secondItem="3" secondAttribute="centerX" type="default" id="Sap-5o-jsm"/>
40+
<constraint firstItem="fCD-xb-xMh" firstAttribute="centerX" secondItem="AZi-Bx-28g" secondAttribute="centerX" type="default" id="AmZ-qg-AEy"/>
41+
<constraint firstItem="AZi-Bx-28g" firstAttribute="centerX" secondItem="3" secondAttribute="centerX" type="default" id="W1E-tI-dpA"/>
42+
<constraint firstItem="AZi-Bx-28g" firstAttribute="top" secondItem="3" secondAttribute="top" constant="111" id="XC4-iw-r4y"/>
43+
<constraint firstItem="fCD-xb-xMh" firstAttribute="top" secondItem="3" secondAttribute="top" constant="184" id="oUp-NG-Ayo"/>
2944
</constraints>
3045
</view>
3146
</viewController>
3247
<placeholder placeholderIdentifier="IBFirstResponder" id="4" sceneMemberID="firstResponder"/>
3348
</objects>
3449
</scene>
3550
</scenes>
51+
<classes>
52+
<class className="NSLayoutConstraint" superclassName="NSObject">
53+
<source key="sourceIdentifier" type="project" relativePath="./Classes/NSLayoutConstraint.h"/>
54+
</class>
55+
<class className="ViewController" superclassName="UIViewController">
56+
<source key="sourceIdentifier" type="project" relativePath="./Classes/ViewController.h"/>
57+
<relationships>
58+
<relationship kind="action" name="onCrash:"/>
59+
</relationships>
60+
</class>
61+
</classes>
3662
<simulatedMetricsContainer key="defaultSimulatedMetrics">
3763
<simulatedStatusBarMetrics key="statusBar"/>
3864
<simulatedOrientationMetrics key="orientation"/>

0 commit comments

Comments
 (0)