Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 7a373ac

Browse files
author
Hannah Troisi
authored
Update Layout Examples to ASDK 2.0 (#2551)
* Objective-c project updated to ASDK 2.0 * fix assets error * [LayoutSpecExamples] Renamed new example project to be easier to type / find. * [Bulid] Manually create Sample.xcscheme file to hopefully fix complaining bulid :). * clean up project * commentary on ASAbsoluteLayoutSpec * address @maicki's comments
1 parent 735d141 commit 7a373ac

18 files changed

Lines changed: 1251 additions & 0 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://github.com/CocoaPods/Specs.git'
2+
platform :ios, '7.0'
3+
target 'Sample' do
4+
pod 'AsyncDisplayKit', :path => '../..'
5+
end
6+

examples/LayoutSpecExamples/Sample.xcodeproj/project.pbxproj

Lines changed: 391 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0810"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "694993CC1C8B334F00491CA5"
18+
BuildableName = "Sample.app"
19+
BlueprintName = "Sample"
20+
ReferencedContainer = "container:Sample.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
<MacroExpansion>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "694993CC1C8B334F00491CA5"
36+
BuildableName = "Sample.app"
37+
BlueprintName = "Sample"
38+
ReferencedContainer = "container:Sample.xcodeproj">
39+
</BuildableReference>
40+
</MacroExpansion>
41+
<AdditionalOptions>
42+
</AdditionalOptions>
43+
</TestAction>
44+
<LaunchAction
45+
buildConfiguration = "Debug"
46+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
47+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
48+
launchStyle = "0"
49+
useCustomWorkingDirectory = "NO"
50+
ignoresPersistentStateOnLaunch = "NO"
51+
debugDocumentVersioning = "YES"
52+
debugServiceExtension = "internal"
53+
allowLocationSimulation = "YES">
54+
<BuildableProductRunnable
55+
runnableDebuggingMode = "0">
56+
<BuildableReference
57+
BuildableIdentifier = "primary"
58+
BlueprintIdentifier = "694993CC1C8B334F00491CA5"
59+
BuildableName = "Sample.app"
60+
BlueprintName = "Sample"
61+
ReferencedContainer = "container:Sample.xcodeproj">
62+
</BuildableReference>
63+
</BuildableProductRunnable>
64+
<AdditionalOptions>
65+
</AdditionalOptions>
66+
</LaunchAction>
67+
<ProfileAction
68+
buildConfiguration = "Release"
69+
shouldUseLaunchSchemeArgsEnv = "YES"
70+
savedToolIdentifier = ""
71+
useCustomWorkingDirectory = "NO"
72+
debugDocumentVersioning = "YES">
73+
<BuildableProductRunnable
74+
runnableDebuggingMode = "0">
75+
<BuildableReference
76+
BuildableIdentifier = "primary"
77+
BlueprintIdentifier = "694993CC1C8B334F00491CA5"
78+
BuildableName = "Sample.app"
79+
BlueprintName = "Sample"
80+
ReferencedContainer = "container:Sample.xcodeproj">
81+
</BuildableReference>
82+
</BuildableProductRunnable>
83+
</ProfileAction>
84+
<AnalyzeAction
85+
buildConfiguration = "Debug">
86+
</AnalyzeAction>
87+
<ArchiveAction
88+
buildConfiguration = "Release"
89+
revealArchiveInOrganizer = "YES">
90+
</ArchiveAction>
91+
</Scheme>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// AppDelegate.h
3+
// Sample
4+
//
5+
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
6+
// This source code is licensed under the BSD-style license found in the
7+
// LICENSE file in the root directory of this source tree. An additional grant
8+
// of patent rights can be found in the PATENTS file in the same directory.
9+
//
10+
11+
#import <UIKit/UIKit.h>
12+
13+
@interface AppDelegate : UIResponder <UIApplicationDelegate>
14+
@property (strong, nonatomic) UIWindow *window;
15+
@end
16+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// AppDelegate.m
3+
// Sample
4+
//
5+
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
6+
// This source code is licensed under the BSD-style license found in the
7+
// LICENSE file in the root directory of this source tree. An additional grant
8+
// of patent rights can be found in the PATENTS file in the same directory.
9+
//
10+
11+
#import "AppDelegate.h"
12+
#import "OverviewViewController.h"
13+
14+
@implementation AppDelegate
15+
16+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
17+
18+
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
19+
self.window.backgroundColor = [UIColor whiteColor];
20+
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[OverviewViewController new]];
21+
[self.window makeKeyAndVisible];
22+
23+
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:47/255.0 green:184/255.0 blue:253/255.0 alpha:1.0]];
24+
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
25+
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];;
26+
27+
return YES;
28+
}
29+
30+
@end
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<deployment identifier="iOS"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
6+
</dependencies>
7+
<scenes>
8+
<!--View Controller-->
9+
<scene sceneID="EHf-IW-A2E">
10+
<objects>
11+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
12+
<layoutGuides>
13+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
14+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
15+
</layoutGuides>
16+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
17+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
18+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
20+
</view>
21+
</viewController>
22+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
23+
</objects>
24+
<point key="canvasLocation" x="53" y="375"/>
25+
</scene>
26+
</scenes>
27+
</document>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
<key>LSRequiresIPhoneOS</key>
24+
<true/>
25+
<key>NSAppTransportSecurity</key>
26+
<dict>
27+
<key>NSAllowsArbitraryLoads</key>
28+
<true/>
29+
</dict>
30+
<key>UILaunchStoryboardName</key>
31+
<string>LaunchScreen</string>
32+
<key>UIRequiredDeviceCapabilities</key>
33+
<array>
34+
<string>armv7</string>
35+
</array>
36+
<key>UISupportedInterfaceOrientations</key>
37+
<array>
38+
<string>UIInterfaceOrientationPortrait</string>
39+
<string>UIInterfaceOrientationLandscapeLeft</string>
40+
<string>UIInterfaceOrientationLandscapeRight</string>
41+
</array>
42+
</dict>
43+
</plist>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// LayoutExampleNodes.h
3+
// Sample
4+
//
5+
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
6+
// This source code is licensed under the BSD-style license found in the
7+
// LICENSE file in the root directory of this source tree. An additional grant
8+
// of patent rights can be found in the PATENTS file in the same directory.
9+
//
10+
11+
#import <AsyncDisplayKit/AsyncDisplayKit.h>
12+
13+
@interface LayoutExampleNode : ASDisplayNode
14+
+ (NSString *)title;
15+
+ (NSString *)descriptionTitle;
16+
@end
17+
18+
@interface HeaderWithRightAndLeftItems : LayoutExampleNode
19+
@end
20+
21+
@interface PhotoWithInsetTextOverlay : LayoutExampleNode
22+
@end
23+
24+
@interface PhotoWithOutsetIconOverlay : LayoutExampleNode
25+
@end
26+
27+
@interface FlexibleSeparatorSurroundingContent : LayoutExampleNode
28+
@end

0 commit comments

Comments
 (0)