Skip to content

Instantly share code, notes, and snippets.

@mluton
Created November 15, 2012 00:40
Show Gist options
  • Select an option

  • Save mluton/4075876 to your computer and use it in GitHub Desktop.

Select an option

Save mluton/4075876 to your computer and use it in GitHub Desktop.
Interface Builder View Controller That Automatically Resizes to its Container
<scene sceneID="v5c-aN-zd9">
<objects>
<viewController id="JHA-3b-Fah" sceneMemberID="viewController">
<view key="view" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="redraw" id="iNd-Pp-gkg">
<rect key="frame" x="0.0" y="0.0" width="280" height="150"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="First View Controller" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="di2-sr-QZd">
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.79037786990000003" green="0.78934041239999997" blue="0.42745200189999999" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="centerX" secondItem="di2-sr-QZd" secondAttribute="centerX" type="user" id="EmI-YG-gD4"/>
<constraint firstAttribute="centerY" secondItem="di2-sr-QZd" secondAttribute="centerY" type="user" id="kQH-xu-Ia0"/>
</constraints>
</view>
<toolbarItems/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="bxC-dN-Hh4" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="933" y="489"/>
</scene>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment