Skip to content

Commit

Permalink
Fixes issue where cells were not always wrapped.
Browse files Browse the repository at this point in the history
  • Loading branch information
bskinner committed May 22, 2015
1 parent 402a8ff commit a6750f8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ - (void)setTitle:(NSString *)title withDescription:(NSString *)description
self.titleLabel.text = title;
self.descriptionLabel.text = description;
[self setNeedsUpdateConstraints];
[self updateConstraintsIfNeeded];
[self setNeedsLayout];
}

- (void)layoutSubviews
Expand Down
55 changes: 31 additions & 24 deletions Common/UI/MITTitleDescriptionCell/MITTitleDescriptionCell.xib
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7531" systemVersion="14D131" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7520"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="50" id="KGk-i7-Jjw" userLabel="Title Description Cell" customClass="MITTitleDescriptionCell">
<rect key="frame" x="0.0" y="0.0" width="768" height="50"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="50" id="5xD-Li-ndQ" userLabel="Title Description Cell" customClass="MITTitleDescriptionCell">
<rect key="frame" x="0.0" y="0.0" width="467" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="5xD-Li-ndQ" id="qkP-na-k98">
<rect key="frame" x="0.0" y="0.0" width="768" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" textAlignment="right" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="lfF-58-8as">
<rect key="frame" x="15" y="2" width="364" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="NKI-Fx-Rt7">
<rect key="frame" x="389" y="2" width="364" height="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="1000" usesAttributedText="YES" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="213" translatesAutoresizingMaskIntoConstraints="NO" id="Q4y-Wt-Lln">
<rect key="frame" x="239" y="0.0" width="213" height="17"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="17" id="wZu-oJ-7GY"/>
</constraints>
<attributedString key="attributedText">
<fragment content="Description">
<attributes>
Expand All @@ -33,23 +31,32 @@
</attributedString>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="1000" text="Title" textAlignment="right" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="214" translatesAutoresizingMaskIntoConstraints="NO" id="vRV-pd-UtD">
<rect key="frame" x="17" y="0.0" width="214" height="17"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="17" id="51U-Ql-m9Q"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="NKI-Fx-Rt7" secondAttribute="bottom" constant="4" id="5yH-kw-Su0"/>
<constraint firstAttribute="trailing" secondItem="NKI-Fx-Rt7" secondAttribute="trailing" constant="15" id="GyH-7m-Bcb"/>
<constraint firstItem="NKI-Fx-Rt7" firstAttribute="leading" secondItem="lfF-58-8as" secondAttribute="trailing" constant="10" id="Ml6-4J-RoB"/>
<constraint firstItem="NKI-Fx-Rt7" firstAttribute="top" secondItem="lfF-58-8as" secondAttribute="top" id="ZsU-pE-Mz7"/>
<constraint firstItem="lfF-58-8as" firstAttribute="width" secondItem="NKI-Fx-Rt7" secondAttribute="width" id="dRR-gw-o2T"/>
<constraint firstItem="lfF-58-8as" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="k52-YI-ngo"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="lfF-58-8as" secondAttribute="bottom" constant="4" id="sfg-Yu-4pC"/>
<constraint firstItem="lfF-58-8as" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="2" id="way-a7-XIR"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="Q4y-Wt-Lln" secondAttribute="bottom" priority="750" constant="4" id="G7L-pB-ERg"/>
<constraint firstItem="Q4y-Wt-Lln" firstAttribute="width" secondItem="vRV-pd-UtD" secondAttribute="width" id="UF3-bL-pbo"/>
<constraint firstItem="Q4y-Wt-Lln" firstAttribute="leading" secondItem="vRV-pd-UtD" secondAttribute="trailing" constant="8" symbolic="YES" id="VMB-Y7-Tb0"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="vRV-pd-UtD" secondAttribute="bottom" priority="750" constant="4" id="Xja-ak-FfB"/>
<constraint firstItem="vRV-pd-UtD" firstAttribute="top" secondItem="qkP-na-k98" secondAttribute="top" id="lBR-Kp-tH9"/>
<constraint firstAttribute="trailingMargin" secondItem="Q4y-Wt-Lln" secondAttribute="trailing" constant="7" id="m6g-el-e9B"/>
<constraint firstItem="Q4y-Wt-Lln" firstAttribute="top" secondItem="qkP-na-k98" secondAttribute="top" id="tRp-6r-1ob"/>
<constraint firstItem="vRV-pd-UtD" firstAttribute="leading" secondItem="qkP-na-k98" secondAttribute="leadingMargin" constant="9" id="wv5-Xc-fS0"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="descriptionLabel" destination="NKI-Fx-Rt7" id="P1S-2N-dto"/>
<outlet property="titleLabel" destination="lfF-58-8as" id="Sh9-Cg-vnD"/>
<outlet property="descriptionLabel" destination="Q4y-Wt-Lln" id="WNm-XB-cLi"/>
<outlet property="titleLabel" destination="vRV-pd-UtD" id="UYe-oR-ng6"/>
</connections>
<point key="canvasLocation" x="405" y="173"/>
<point key="canvasLocation" x="254.5" y="321"/>
</tableViewCell>
</objects>
</document>

0 comments on commit a6750f8

Please sign in to comment.