Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SB SDAutoLayout #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions SDAutoLayout 测试 Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
99E728A91BE5E22D00771161 /* SDRefreshHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 99E728A21BE5E22D00771161 /* SDRefreshHeaderView.m */; };
99E728AA1BE5E22D00771161 /* SDRefreshView.m in Sources */ = {isa = PBXBuildFile; fileRef = 99E728A41BE5E22D00771161 /* SDRefreshView.m */; };
99E728AB1BE5E22D00771161 /* UIView+SDExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 99E728A61BE5E22D00771161 /* UIView+SDExtension.m */; };
E6FEDD781C2A7BE60088E4F0 /* DemoVC9.m in Sources */ = {isa = PBXBuildFile; fileRef = E6FEDD751C2A7BE60088E4F0 /* DemoVC9.m */; };
E6FEDD791C2A7BE60088E4F0 /* DemoVC9Cell.m in Sources */ = {isa = PBXBuildFile; fileRef = E6FEDD771C2A7BE60088E4F0 /* DemoVC9Cell.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -129,6 +131,10 @@
99E728A41BE5E22D00771161 /* SDRefreshView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDRefreshView.m; sourceTree = "<group>"; };
99E728A51BE5E22D00771161 /* UIView+SDExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+SDExtension.h"; sourceTree = "<group>"; };
99E728A61BE5E22D00771161 /* UIView+SDExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+SDExtension.m"; sourceTree = "<group>"; };
E6FEDD741C2A7BE60088E4F0 /* DemoVC9.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoVC9.h; sourceTree = "<group>"; };
E6FEDD751C2A7BE60088E4F0 /* DemoVC9.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoVC9.m; sourceTree = "<group>"; };
E6FEDD761C2A7BE60088E4F0 /* DemoVC9Cell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoVC9Cell.h; sourceTree = "<group>"; };
E6FEDD771C2A7BE60088E4F0 /* DemoVC9Cell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoVC9Cell.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -248,6 +254,7 @@
487D3EDE1BCBA52900A66173 /* DemoVC */ = {
isa = PBXGroup;
children = (
E6FEDD731C2A7BE60088E4F0 /* DemoVC9 */,
4867A48C1C292EB500BE8767 /* DemoVC8 */,
484511661C24395F0071BE2C /* DemoVC7 */,
486A382A1C0D8499000D43E5 /* DemoVC6 */,
Expand Down Expand Up @@ -336,6 +343,17 @@
path = SDRefeshView;
sourceTree = "<group>";
};
E6FEDD731C2A7BE60088E4F0 /* DemoVC9 */ = {
isa = PBXGroup;
children = (
E6FEDD741C2A7BE60088E4F0 /* DemoVC9.h */,
E6FEDD751C2A7BE60088E4F0 /* DemoVC9.m */,
E6FEDD761C2A7BE60088E4F0 /* DemoVC9Cell.h */,
E6FEDD771C2A7BE60088E4F0 /* DemoVC9Cell.m */,
);
path = DemoVC9;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -453,6 +471,8 @@
48DA2B011BFB529200A771E6 /* UIView+SDAutoLayout.m in Sources */,
487D3EF41BCBB71500A66173 /* DemoVC3.m in Sources */,
486A382D1C0D852C000D43E5 /* DemoVC6.m in Sources */,
E6FEDD791C2A7BE60088E4F0 /* DemoVC9Cell.m in Sources */,
E6FEDD781C2A7BE60088E4F0 /* DemoVC9.m in Sources */,
48DBCD0E1C01DA1E002EC476 /* DemoVC5Model.m in Sources */,
484511711C2439830071BE2C /* DemoVC7Cell2.m in Sources */,
484511721C2439830071BE2C /* DemoVC7Model.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "487D3EB01BCB9EC700A66173"
BuildableName = "SDAutoLayout &#x6d4b;&#x8bd5; Demo.app"
BlueprintName = "SDAutoLayout &#x6d4b;&#x8bd5; Demo"
ReferencedContainer = "container:SDAutoLayout &#x6d4b;&#x8bd5; Demo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "487D3EC91BCB9EC700A66173"
BuildableName = "SDAutoLayout &#x6d4b;&#x8bd5; DemoTests.xctest"
BlueprintName = "SDAutoLayout &#x6d4b;&#x8bd5; DemoTests"
ReferencedContainer = "container:SDAutoLayout &#x6d4b;&#x8bd5; Demo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "487D3EB01BCB9EC700A66173"
BuildableName = "SDAutoLayout &#x6d4b;&#x8bd5; Demo.app"
BlueprintName = "SDAutoLayout &#x6d4b;&#x8bd5; Demo"
ReferencedContainer = "container:SDAutoLayout &#x6d4b;&#x8bd5; Demo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "487D3EB01BCB9EC700A66173"
BuildableName = "SDAutoLayout &#x6d4b;&#x8bd5; Demo.app"
BlueprintName = "SDAutoLayout &#x6d4b;&#x8bd5; Demo"
ReferencedContainer = "container:SDAutoLayout &#x6d4b;&#x8bd5; Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "487D3EB01BCB9EC700A66173"
BuildableName = "SDAutoLayout &#x6d4b;&#x8bd5; Demo.app"
BlueprintName = "SDAutoLayout &#x6d4b;&#x8bd5; Demo"
ReferencedContainer = "container:SDAutoLayout &#x6d4b;&#x8bd5; Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>SDAutoLayout 测试 Demo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>487D3EB01BCB9EC700A66173</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>487D3EC91BCB9EC700A66173</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
71 changes: 69 additions & 2 deletions SDAutoLayout 测试 Demo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Ify-Kw-yI1">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Ify-Kw-yI1">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<scenes>
<!--Root View Controller-->
Expand Down Expand Up @@ -41,5 +42,71 @@
</objects>
<point key="canvasLocation" x="-369" y="309"/>
</scene>
<!--DemoVC9-->
<scene sceneID="5hh-sI-oUv">
<objects>
<tableViewController storyboardIdentifier="DemoVC9" id="eSs-xM-uuS" customClass="DemoVC9" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="109" sectionHeaderHeight="28" sectionFooterHeight="28" id="lN3-Ab-qMF">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="DemoVC9Cell" rowHeight="100" id="dJ0-Qk-app" customClass="DemoVC9Cell">
<rect key="frame" x="0.0" y="28" width="375" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="dJ0-Qk-app" id="8q5-zW-F64">
<rect key="frame" x="0.0" y="0.0" width="375" height="99.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Jid-of-ZCb">
<rect key="frame" x="10" y="10" width="40" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="ZqN-r1-qeL"/>
<constraint firstAttribute="width" constant="40" id="pVw-rs-eD4"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UOj-dJ-JCs">
<rect key="frame" x="60" y="19" width="305" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ckI-zf-Y8D">
<rect key="frame" x="10" y="60" width="355" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="Jid-of-ZCb" firstAttribute="top" secondItem="8q5-zW-F64" secondAttribute="top" constant="10" id="AOh-li-8U9"/>
<constraint firstItem="Jid-of-ZCb" firstAttribute="leading" secondItem="8q5-zW-F64" secondAttribute="leading" constant="10" id="CaH-XF-q4G"/>
<constraint firstItem="UOj-dJ-JCs" firstAttribute="leading" secondItem="Jid-of-ZCb" secondAttribute="trailing" constant="10" id="EvO-w8-zep"/>
<constraint firstItem="UOj-dJ-JCs" firstAttribute="centerY" secondItem="Jid-of-ZCb" secondAttribute="centerY" id="P0T-cf-Zzs"/>
<constraint firstItem="ckI-zf-Y8D" firstAttribute="leading" secondItem="Jid-of-ZCb" secondAttribute="leading" id="WfA-wG-kKx"/>
<constraint firstAttribute="trailing" secondItem="UOj-dJ-JCs" secondAttribute="trailing" constant="10" id="ihK-te-xFv"/>
<constraint firstItem="ckI-zf-Y8D" firstAttribute="top" secondItem="Jid-of-ZCb" secondAttribute="bottom" constant="10" id="pT9-po-wgG"/>
<constraint firstItem="UOj-dJ-JCs" firstAttribute="trailing" secondItem="ckI-zf-Y8D" secondAttribute="trailing" id="wJY-8b-0Db"/>
</constraints>
</tableViewCellContentView>
<color key="backgroundColor" red="1" green="0.98336127179999999" blue="0.98776322530000005" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<outlet property="img" destination="Jid-of-ZCb" id="u2F-qg-k5a"/>
<outlet property="lbInfo" destination="ckI-zf-Y8D" id="ILB-8Q-2gY"/>
<outlet property="lbTitle" destination="UOj-dJ-JCs" id="FnE-dE-KTI"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="eSs-xM-uuS" id="Rlk-YU-VPo"/>
<outlet property="delegate" destination="eSs-xM-uuS" id="UJH-w6-lfl"/>
</connections>
</tableView>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="FHy-as-VmK" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="871.5" y="308.5"/>
</scene>
</scenes>
</document>
23 changes: 19 additions & 4 deletions SDAutoLayout 测试 Demo/DemoTableViewControler.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#import "DemoTableViewControler.h"

#import "DemoVC5.h"
#import "DemoVC9.h"

@implementation DemoTableViewControler

Expand All @@ -33,16 +34,16 @@ - (void)viewDidLoad

self.view.backgroundColor = [UIColor whiteColor];

UIViewController *vc = [DemoVC5 new];
vc.title = @"DemoVC5";
[self.navigationController pushViewController:vc animated:YES];
// UIViewController *vc = [DemoVC5 new];
// vc.title = @"DemoVC5";
// [self.navigationController pushViewController:vc animated:YES];
}

#pragma mark - tableview datasourece and delegate

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 9;
return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
Expand All @@ -59,6 +60,20 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *demoClassString = [NSString stringWithFormat:@"DemoVC%ld", indexPath.row];

if (indexPath.row == 9) {
static UIStoryboard * s_storyboardHome = nil;

if ( !s_storyboardHome ){
s_storyboardHome = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
}
DemoVC9 *vc9 = [s_storyboardHome instantiateViewControllerWithIdentifier:@"DemoVC9"];
vc9.title = demoClassString;
[self.navigationController pushViewController:vc9 animated:YES];
return;
}


UIViewController *vc = [NSClassFromString(demoClassString) new];
vc.title = demoClassString;
[self.navigationController pushViewController:vc animated:YES];
Expand Down
13 changes: 13 additions & 0 deletions SDAutoLayout 测试 Demo/DemoVC9/DemoVC9.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// DemoVC9.h
// SDAutoLayout 测试 Demo
//
// Created by Chai on 15/12/23.
// Copyright © 2015年 gsd. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface DemoVC9 : UITableViewController

@end
Loading