Skip to content

Commit

Permalink
Updated sample project for new screens also fixed CEWendel#244
Browse files Browse the repository at this point in the history
  • Loading branch information
CEWendel committed Oct 20, 2014
1 parent ddcf6aa commit 07b7b4b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
13 changes: 13 additions & 0 deletions SWTableViewCell/PodFiles/SWTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,19 @@ - (void)layoutSubviews
[self updateCellState];
}

- (void)setFrame:(CGRect)frame
{
// Fix for new screen sizes
// Initially, the cell is still 320 points wide
// We need to layout our subviews again when this changes so our constraints clip to the right width
BOOL widthChanged = (self.frame.size.width != frame.size.width);

[super setFrame:frame];

if (widthChanged)
[self layoutIfNeeded];
}

- (void)prepareForReuse
{
[super prepareForReuse];
Expand Down
2 changes: 2 additions & 0 deletions SWTableViewCell/SWTableViewCell-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>MainStoryboard</string>
<key>UIMainStoryboardFile</key>
<string>MainStoryboard</string>
<key>UIRequiredDeviceCapabilities</key>
Expand Down
8 changes: 3 additions & 5 deletions SWTableViewCell/en.lproj/MainStoryboard.storyboard
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13C1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="HAv-OM-WVV">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="14A329f" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="HAv-OM-WVV">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<scenes>
<!--View Controller - Root View Controller-->
<!--Root View Controller-->
<scene sceneID="8UO-he-yD1">
<objects>
<tableViewController id="gqK-s8-DTV" customClass="ViewController" sceneMemberID="viewController">
Expand All @@ -22,11 +22,9 @@
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="um.png" translatesAutoresizingMaskIntoConstraints="NO" id="mys-5a-TES">
<rect key="frame" x="192" y="10" width="75" height="75"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AHM-FM-2Pc">
<rect key="frame" x="20" y="10" width="165" height="75"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
Expand Down

0 comments on commit 07b7b4b

Please sign in to comment.