Skip to content

Commit

Permalink
Updated sample app to allow for size testing
Browse files Browse the repository at this point in the history
  • Loading branch information
TimOliver committed Oct 2, 2023
1 parent 5cf4c4f commit ae63374
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 2 additions & 7 deletions TORoundedButtonExample/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3Rx-9D-Udo" userLabel="RoundedButton" customClass="TORoundedButton">
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3Rx-9D-Udo" userLabel="RoundedButton" customClass="TORoundedButton">
<rect key="frame" x="67" y="353" width="280" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="280" id="OXU-dJ-PiL"/>
<constraint firstAttribute="height" constant="50" id="s1F-Eq-SaU"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="text" value="Continue"/>
</userDefinedRuntimeAttributes>
Expand All @@ -41,9 +38,7 @@
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="YuK-c8-gCA" firstAttribute="centerY" secondItem="yn0-Wx-glq" secondAttribute="centerY" multiplier="0.5" id="1aK-Gn-u8l"/>
<constraint firstItem="3Rx-9D-Udo" firstAttribute="centerX" secondItem="yn0-Wx-glq" secondAttribute="centerX" id="4Pd-sN-oZH"/>
<constraint firstItem="YuK-c8-gCA" firstAttribute="centerX" secondItem="yn0-Wx-glq" secondAttribute="centerX" id="KUL-o1-7MR"/>
<constraint firstItem="3Rx-9D-Udo" firstAttribute="centerY" secondItem="yn0-Wx-glq" secondAttribute="centerY" id="rFU-Gn-CY5"/>
</constraints>
</view>
<connections>
Expand Down
8 changes: 8 additions & 0 deletions TORoundedButtonExample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ - (void)viewDidLoad {
self.button.tappedHandler = ^{
[weakSelf playFadeAnimationOnView:weakSelf.tappedLabel];
};

// Uncomment to have the button shrink to wrap the text
// [self.button sizeToFit];
}

- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
self.button.center = self.view.center;
}

- (void)playFadeAnimationOnView:(UIView *)view
Expand Down

0 comments on commit ae63374

Please sign in to comment.