Skip to content

Commit

Permalink
chore: Added a force unwrapped optional crash to the sample project (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrenskers authored Nov 30, 2022
1 parent c7d7a55 commit dd266f5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
40 changes: 24 additions & 16 deletions Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -122,93 +122,101 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="1a2-Yg-Az9">
<rect key="frame" x="181.5" y="0.0" width="216.5" height="379.5"/>
<rect key="frame" x="181.5" y="0.0" width="216.5" height="360"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Yi7-GN-26l">
<rect key="frame" x="0.0" y="0.0" width="216.5" height="34.5"/>
<rect key="frame" x="0.0" y="0.0" width="216.5" height="30"/>
<state key="normal" title="ANR fully blocking"/>
<connections>
<action selector="anrFullyBlocking:" destination="BYZ-38-t0r" eventType="touchUpInside" id="dJy-Fs-khK"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TSF-10-5ts">
<rect key="frame" x="0.0" y="34.5" width="216.5" height="34.5"/>
<rect key="frame" x="0.0" y="30" width="216.5" height="30"/>
<state key="normal" title="ANR filling run loop"/>
<connections>
<action selector="anrFillingRunLoop:" destination="BYZ-38-t0r" eventType="touchUpInside" id="13D-io-hVz"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cdR-H3-8fr">
<rect key="frame" x="0.0" y="69" width="216.5" height="34.5"/>
<rect key="frame" x="0.0" y="60" width="216.5" height="30"/>
<state key="normal" title="Capture Transaction"/>
<connections>
<action selector="captureTransaction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="kff-pT-Uf4"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Jwi-v3-e8T">
<rect key="frame" x="0.0" y="103.5" width="216.5" height="34.5"/>
<rect key="frame" x="0.0" y="90" width="216.5" height="30"/>
<accessibility key="accessibilityConfiguration" identifier="loremIpsumButton"/>
<state key="normal" title="Lorem Ipsum"/>
<connections>
<segue destination="2jd-n4-Ihk" kind="show" id="wcP-y8-kPR"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8CV-WC-ffq">
<rect key="frame" x="0.0" y="138" width="216.5" height="34.5"/>
<rect key="frame" x="0.0" y="120" width="216.5" height="30"/>
<accessibility key="accessibilityConfiguration" identifier="testNavigationTransactionButton"/>
<state key="normal" title="Image"/>
<connections>
<segue destination="cay-7M-Gvd" kind="show" id="boD-GG-VVF"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LvU-yx-01i">
<rect key="frame" x="0.0" y="172.5" width="216.5" height="34.5"/>
<rect key="frame" x="0.0" y="150" width="216.5" height="30"/>
<accessibility key="accessibilityConfiguration" identifier="showNibButton"/>
<state key="normal" title="Show Nib"/>
<connections>
<action selector="showNibController:" destination="BYZ-38-t0r" eventType="touchUpInside" id="E8m-GA-zvY"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RjO-LN-eHj">
<rect key="frame" x="0.0" y="207" width="216.5" height="34.5"/>
<rect key="frame" x="0.0" y="180" width="216.5" height="30"/>
<accessibility key="accessibilityConfiguration" identifier="showTableViewButton"/>
<state key="normal" title="TableView"/>
<connections>
<action selector="showTableViewController:" destination="BYZ-38-t0r" eventType="touchUpInside" id="u6U-9d-UMi"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ok0-hq-2kK">
<rect key="frame" x="0.0" y="241.5" width="216.5" height="34.5"/>
<rect key="frame" x="0.0" y="210" width="216.5" height="30"/>
<accessibility key="accessibilityConfiguration" identifier="showSplitViewButton"/>
<state key="normal" title="SplitView"/>
<connections>
<segue destination="DGj-BO-BQ5" kind="presentation" id="G2z-UO-upZ"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cTC-V8-T1j">
<rect key="frame" x="0.0" y="276" width="216.5" height="34.5"/>
<rect key="frame" x="0.0" y="240" width="216.5" height="30"/>
<accessibility key="accessibilityConfiguration" identifier="useCoreData"/>
<state key="normal" title="Core Data"/>
<connections>
<action selector="useCoreData:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Ycl-fG-7Bk"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ld2-mz-wQD">
<rect key="frame" x="0.0" y="310.5" width="216.5" height="34.5"/>
<rect key="frame" x="0.0" y="270" width="216.5" height="30"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Performance scenarios"/>
<connections>
<action selector="performanceScenarios:" destination="BYZ-38-t0r" eventType="touchUpInside" id="cuc-qv-hNv"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WRX-HQ-DjW">
<rect key="frame" x="0.0" y="345" width="216.5" height="34.5"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Flush"/>
<rect key="frame" x="0.0" y="300" width="216.5" height="30"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Flush"/>
<connections>
<action selector="flush:" destination="BYZ-38-t0r" eventType="touchUpInside" id="FZC-ku-RYU"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RXH-Yy-7t0">
<rect key="frame" x="0.0" y="330" width="216.5" height="30"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Force unwrap optional"/>
<connections>
<action selector="unwrapCrash:" destination="BYZ-38-t0r" eventType="touchUpInside" id="qdc-Of-kqz"/>
</connections>
</button>
</subviews>
</stackView>
</subviews>
Expand Down Expand Up @@ -402,14 +410,14 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<navigationBar contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1SX-yg-zgj">
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<rect key="frame" x="-1" y="0.0" width="414" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<items>
<navigationItem title="Hello" id="7le-ZX-hzV"/>
</items>
</navigationBar>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" delaysContentTouches="NO" editable="NO" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sla-j3-cfX">
<rect key="frame" x="19" y="70" width="374" height="825"/>
<rect key="frame" x="19" y="69" width="373" height="825"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<color key="textColor" systemColor="labelColor"/>
Expand Down
8 changes: 7 additions & 1 deletion Samples/iOS-Swift/iOS-Swift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@ class ViewController: UIViewController {
@IBAction func crash(_ sender: Any) {
SentrySDK.crash()
}


@IBAction func unwrapCrash(_ sender: Any) {
let a: String! = nil
let b: String = a!
print(b)
}

@IBAction func asyncCrash(_ sender: Any) {
DispatchQueue.main.async {
self.asyncCrash1()
Expand Down

0 comments on commit dd266f5

Please sign in to comment.