mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Example projects.
This commit is contained in:
@@ -110,3 +110,5 @@ See the CONTRIBUTING file for how to help out.
|
|||||||
## License
|
## License
|
||||||
|
|
||||||
AsyncDisplayKit is BSD-licensed. We also provide an additional patent grant.
|
AsyncDisplayKit is BSD-licensed. We also provide an additional patent grant.
|
||||||
|
|
||||||
|
The files in the /examples directory are licensed under a separate license as specified in each file.
|
||||||
|
|||||||
2
examples/Kittens/Podfile
Normal file
2
examples/Kittens/Podfile
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
platform :ios, '8.0'
|
||||||
|
pod 'AsyncDisplayKit', :path => '../..'
|
||||||
727
examples/Kittens/Sample.xcodeproj/project.pbxproj
Normal file
727
examples/Kittens/Sample.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,727 @@
|
|||||||
|
<?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>archiveVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>classes</key>
|
||||||
|
<dict/>
|
||||||
|
<key>objectVersion</key>
|
||||||
|
<string>46</string>
|
||||||
|
<key>objects</key>
|
||||||
|
<dict>
|
||||||
|
<key>05561CF819D4E77700CBA93C</key>
|
||||||
|
<dict>
|
||||||
|
<key>fileEncoding</key>
|
||||||
|
<string>4</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>sourcecode.c.h</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>BlurbNode.h</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05561CF919D4E77700CBA93C</key>
|
||||||
|
<dict>
|
||||||
|
<key>fileEncoding</key>
|
||||||
|
<string>4</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>sourcecode.c.objc</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>BlurbNode.m</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05561CFA19D4E77700CBA93C</key>
|
||||||
|
<dict>
|
||||||
|
<key>fileRef</key>
|
||||||
|
<string>05561CF919D4E77700CBA93C</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXBuildFile</string>
|
||||||
|
</dict>
|
||||||
|
<key>05561CFB19D4F94A00CBA93C</key>
|
||||||
|
<dict>
|
||||||
|
<key>fileEncoding</key>
|
||||||
|
<string>4</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>sourcecode.c.h</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>KittenNode.h</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05561CFC19D4F94A00CBA93C</key>
|
||||||
|
<dict>
|
||||||
|
<key>fileEncoding</key>
|
||||||
|
<string>4</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>sourcecode.c.objc</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>KittenNode.m</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05561CFD19D4F94A00CBA93C</key>
|
||||||
|
<dict>
|
||||||
|
<key>fileRef</key>
|
||||||
|
<string>05561CFC19D4F94A00CBA93C</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXBuildFile</string>
|
||||||
|
</dict>
|
||||||
|
<key>0585427F19D4DBE100606EA6</key>
|
||||||
|
<dict>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>image.png</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Default-568h@2x.png</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>../Default-568h@2x.png</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>0585428019D4DBE100606EA6</key>
|
||||||
|
<dict>
|
||||||
|
<key>fileRef</key>
|
||||||
|
<string>0585427F19D4DBE100606EA6</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXBuildFile</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2127819D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>children</key>
|
||||||
|
<array>
|
||||||
|
<string>05E2128319D4DB510098F589</string>
|
||||||
|
<string>05E2128219D4DB510098F589</string>
|
||||||
|
<string>1A943BF0259746F18D6E423F</string>
|
||||||
|
<string>1AE410B73DA5C3BD087ACDD7</string>
|
||||||
|
</array>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXGroup</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2127919D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>attributes</key>
|
||||||
|
<dict>
|
||||||
|
<key>LastUpgradeCheck</key>
|
||||||
|
<string>0600</string>
|
||||||
|
<key>ORGANIZATIONNAME</key>
|
||||||
|
<string>Facebook</string>
|
||||||
|
<key>TargetAttributes</key>
|
||||||
|
<dict>
|
||||||
|
<key>05E2128019D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>CreatedOnToolsVersion</key>
|
||||||
|
<string>6.0.1</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>buildConfigurationList</key>
|
||||||
|
<string>05E2127C19D4DB510098F589</string>
|
||||||
|
<key>compatibilityVersion</key>
|
||||||
|
<string>Xcode 3.2</string>
|
||||||
|
<key>developmentRegion</key>
|
||||||
|
<string>English</string>
|
||||||
|
<key>hasScannedForEncodings</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXProject</string>
|
||||||
|
<key>knownRegions</key>
|
||||||
|
<array>
|
||||||
|
<string>en</string>
|
||||||
|
<string>Base</string>
|
||||||
|
</array>
|
||||||
|
<key>mainGroup</key>
|
||||||
|
<string>05E2127819D4DB510098F589</string>
|
||||||
|
<key>productRefGroup</key>
|
||||||
|
<string>05E2128219D4DB510098F589</string>
|
||||||
|
<key>projectDirPath</key>
|
||||||
|
<string></string>
|
||||||
|
<key>projectReferences</key>
|
||||||
|
<array/>
|
||||||
|
<key>projectRoot</key>
|
||||||
|
<string></string>
|
||||||
|
<key>targets</key>
|
||||||
|
<array>
|
||||||
|
<string>05E2128019D4DB510098F589</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<key>05E2127C19D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>buildConfigurations</key>
|
||||||
|
<array>
|
||||||
|
<string>05E212A219D4DB510098F589</string>
|
||||||
|
<string>05E212A319D4DB510098F589</string>
|
||||||
|
</array>
|
||||||
|
<key>defaultConfigurationIsVisible</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>defaultConfigurationName</key>
|
||||||
|
<string>Release</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>XCConfigurationList</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2127D19D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>buildActionMask</key>
|
||||||
|
<string>2147483647</string>
|
||||||
|
<key>files</key>
|
||||||
|
<array>
|
||||||
|
<string>05561CFD19D4F94A00CBA93C</string>
|
||||||
|
<string>05E2128D19D4DB510098F589</string>
|
||||||
|
<string>05E2128A19D4DB510098F589</string>
|
||||||
|
<string>05561CFA19D4E77700CBA93C</string>
|
||||||
|
<string>05E2128719D4DB510098F589</string>
|
||||||
|
</array>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXSourcesBuildPhase</string>
|
||||||
|
<key>runOnlyForDeploymentPostprocessing</key>
|
||||||
|
<string>0</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2127E19D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>buildActionMask</key>
|
||||||
|
<string>2147483647</string>
|
||||||
|
<key>files</key>
|
||||||
|
<array>
|
||||||
|
<string>3EC0CDCBA10D483D9F386E5E</string>
|
||||||
|
</array>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFrameworksBuildPhase</string>
|
||||||
|
<key>runOnlyForDeploymentPostprocessing</key>
|
||||||
|
<string>0</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2127F19D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>buildActionMask</key>
|
||||||
|
<string>2147483647</string>
|
||||||
|
<key>files</key>
|
||||||
|
<array>
|
||||||
|
<string>0585428019D4DBE100606EA6</string>
|
||||||
|
</array>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXResourcesBuildPhase</string>
|
||||||
|
<key>runOnlyForDeploymentPostprocessing</key>
|
||||||
|
<string>0</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128019D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>buildConfigurationList</key>
|
||||||
|
<string>05E212A419D4DB510098F589</string>
|
||||||
|
<key>buildPhases</key>
|
||||||
|
<array>
|
||||||
|
<string>E080B80F89C34A25B3488E26</string>
|
||||||
|
<string>05E2127D19D4DB510098F589</string>
|
||||||
|
<string>05E2127E19D4DB510098F589</string>
|
||||||
|
<string>05E2127F19D4DB510098F589</string>
|
||||||
|
<string>F012A6F39E0149F18F564F50</string>
|
||||||
|
</array>
|
||||||
|
<key>buildRules</key>
|
||||||
|
<array/>
|
||||||
|
<key>dependencies</key>
|
||||||
|
<array/>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXNativeTarget</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Sample</string>
|
||||||
|
<key>productName</key>
|
||||||
|
<string>Sample</string>
|
||||||
|
<key>productReference</key>
|
||||||
|
<string>05E2128119D4DB510098F589</string>
|
||||||
|
<key>productType</key>
|
||||||
|
<string>com.apple.product-type.application</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128119D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>explicitFileType</key>
|
||||||
|
<string>wrapper.application</string>
|
||||||
|
<key>includeInIndex</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>Sample.app</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string>BUILT_PRODUCTS_DIR</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128219D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>children</key>
|
||||||
|
<array>
|
||||||
|
<string>05E2128119D4DB510098F589</string>
|
||||||
|
</array>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXGroup</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Products</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128319D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>children</key>
|
||||||
|
<array>
|
||||||
|
<string>05E2128819D4DB510098F589</string>
|
||||||
|
<string>05E2128919D4DB510098F589</string>
|
||||||
|
<string>05E2128B19D4DB510098F589</string>
|
||||||
|
<string>05E2128C19D4DB510098F589</string>
|
||||||
|
<string>05561CFB19D4F94A00CBA93C</string>
|
||||||
|
<string>05561CFC19D4F94A00CBA93C</string>
|
||||||
|
<string>05561CF819D4E77700CBA93C</string>
|
||||||
|
<string>05561CF919D4E77700CBA93C</string>
|
||||||
|
<string>05E2128419D4DB510098F589</string>
|
||||||
|
</array>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXGroup</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>Sample</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128419D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>children</key>
|
||||||
|
<array>
|
||||||
|
<string>0585427F19D4DBE100606EA6</string>
|
||||||
|
<string>05E2128519D4DB510098F589</string>
|
||||||
|
<string>05E2128619D4DB510098F589</string>
|
||||||
|
</array>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXGroup</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Supporting Files</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128519D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>text.plist.xml</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>Info.plist</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128619D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>sourcecode.c.objc</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>main.m</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128719D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>fileRef</key>
|
||||||
|
<string>05E2128619D4DB510098F589</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXBuildFile</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128819D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>sourcecode.c.h</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>AppDelegate.h</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128919D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>sourcecode.c.objc</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>AppDelegate.m</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128A19D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>fileRef</key>
|
||||||
|
<string>05E2128919D4DB510098F589</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXBuildFile</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128B19D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>sourcecode.c.h</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>ViewController.h</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128C19D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>sourcecode.c.objc</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>ViewController.m</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>05E2128D19D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>fileRef</key>
|
||||||
|
<string>05E2128C19D4DB510098F589</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXBuildFile</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E212A219D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>buildSettings</key>
|
||||||
|
<dict>
|
||||||
|
<key>ALWAYS_SEARCH_USER_PATHS</key>
|
||||||
|
<string>NO</string>
|
||||||
|
<key>CLANG_CXX_LANGUAGE_STANDARD</key>
|
||||||
|
<string>gnu++0x</string>
|
||||||
|
<key>CLANG_CXX_LIBRARY</key>
|
||||||
|
<string>libc++</string>
|
||||||
|
<key>CLANG_ENABLE_MODULES</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_ENABLE_OBJC_ARC</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN_BOOL_CONVERSION</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN_CONSTANT_CONVERSION</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN_DIRECT_OBJC_ISA_USAGE</key>
|
||||||
|
<string>YES_ERROR</string>
|
||||||
|
<key>CLANG_WARN_EMPTY_BODY</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN_ENUM_CONVERSION</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN_INT_CONVERSION</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN_OBJC_ROOT_CLASS</key>
|
||||||
|
<string>YES_ERROR</string>
|
||||||
|
<key>CLANG_WARN_UNREACHABLE_CODE</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN__DUPLICATE_METHOD_MATCH</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CODE_SIGN_IDENTITY[sdk=iphoneos*]</key>
|
||||||
|
<string>iPhone Developer</string>
|
||||||
|
<key>COPY_PHASE_STRIP</key>
|
||||||
|
<string>NO</string>
|
||||||
|
<key>ENABLE_STRICT_OBJC_MSGSEND</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>GCC_C_LANGUAGE_STANDARD</key>
|
||||||
|
<string>gnu99</string>
|
||||||
|
<key>GCC_DYNAMIC_NO_PIC</key>
|
||||||
|
<string>NO</string>
|
||||||
|
<key>GCC_OPTIMIZATION_LEVEL</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>GCC_PREPROCESSOR_DEFINITIONS</key>
|
||||||
|
<array>
|
||||||
|
<string>DEBUG=1</string>
|
||||||
|
<string>$(inherited)</string>
|
||||||
|
</array>
|
||||||
|
<key>GCC_SYMBOLS_PRIVATE_EXTERN</key>
|
||||||
|
<string>NO</string>
|
||||||
|
<key>GCC_WARN_64_TO_32_BIT_CONVERSION</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>GCC_WARN_ABOUT_RETURN_TYPE</key>
|
||||||
|
<string>YES_ERROR</string>
|
||||||
|
<key>GCC_WARN_UNDECLARED_SELECTOR</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>GCC_WARN_UNINITIALIZED_AUTOS</key>
|
||||||
|
<string>YES_AGGRESSIVE</string>
|
||||||
|
<key>GCC_WARN_UNUSED_FUNCTION</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>GCC_WARN_UNUSED_VARIABLE</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>IPHONEOS_DEPLOYMENT_TARGET</key>
|
||||||
|
<string>8.0</string>
|
||||||
|
<key>MTL_ENABLE_DEBUG_INFO</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>ONLY_ACTIVE_ARCH</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>SDKROOT</key>
|
||||||
|
<string>iphoneos</string>
|
||||||
|
</dict>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>XCBuildConfiguration</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Debug</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E212A319D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>buildSettings</key>
|
||||||
|
<dict>
|
||||||
|
<key>ALWAYS_SEARCH_USER_PATHS</key>
|
||||||
|
<string>NO</string>
|
||||||
|
<key>CLANG_CXX_LANGUAGE_STANDARD</key>
|
||||||
|
<string>gnu++0x</string>
|
||||||
|
<key>CLANG_CXX_LIBRARY</key>
|
||||||
|
<string>libc++</string>
|
||||||
|
<key>CLANG_ENABLE_MODULES</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_ENABLE_OBJC_ARC</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN_BOOL_CONVERSION</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN_CONSTANT_CONVERSION</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN_DIRECT_OBJC_ISA_USAGE</key>
|
||||||
|
<string>YES_ERROR</string>
|
||||||
|
<key>CLANG_WARN_EMPTY_BODY</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN_ENUM_CONVERSION</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN_INT_CONVERSION</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN_OBJC_ROOT_CLASS</key>
|
||||||
|
<string>YES_ERROR</string>
|
||||||
|
<key>CLANG_WARN_UNREACHABLE_CODE</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CLANG_WARN__DUPLICATE_METHOD_MATCH</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>CODE_SIGN_IDENTITY[sdk=iphoneos*]</key>
|
||||||
|
<string>iPhone Developer</string>
|
||||||
|
<key>COPY_PHASE_STRIP</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>ENABLE_NS_ASSERTIONS</key>
|
||||||
|
<string>NO</string>
|
||||||
|
<key>ENABLE_STRICT_OBJC_MSGSEND</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>GCC_C_LANGUAGE_STANDARD</key>
|
||||||
|
<string>gnu99</string>
|
||||||
|
<key>GCC_WARN_64_TO_32_BIT_CONVERSION</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>GCC_WARN_ABOUT_RETURN_TYPE</key>
|
||||||
|
<string>YES_ERROR</string>
|
||||||
|
<key>GCC_WARN_UNDECLARED_SELECTOR</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>GCC_WARN_UNINITIALIZED_AUTOS</key>
|
||||||
|
<string>YES_AGGRESSIVE</string>
|
||||||
|
<key>GCC_WARN_UNUSED_FUNCTION</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>GCC_WARN_UNUSED_VARIABLE</key>
|
||||||
|
<string>YES</string>
|
||||||
|
<key>IPHONEOS_DEPLOYMENT_TARGET</key>
|
||||||
|
<string>8.0</string>
|
||||||
|
<key>MTL_ENABLE_DEBUG_INFO</key>
|
||||||
|
<string>NO</string>
|
||||||
|
<key>SDKROOT</key>
|
||||||
|
<string>iphoneos</string>
|
||||||
|
<key>VALIDATE_PRODUCT</key>
|
||||||
|
<string>YES</string>
|
||||||
|
</dict>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>XCBuildConfiguration</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Release</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E212A419D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>buildConfigurations</key>
|
||||||
|
<array>
|
||||||
|
<string>05E212A519D4DB510098F589</string>
|
||||||
|
<string>05E212A619D4DB510098F589</string>
|
||||||
|
</array>
|
||||||
|
<key>defaultConfigurationIsVisible</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>defaultConfigurationName</key>
|
||||||
|
<string>Release</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>XCConfigurationList</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E212A519D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>baseConfigurationReference</key>
|
||||||
|
<string>C068F1D3F0CC317E895FCDAB</string>
|
||||||
|
<key>buildSettings</key>
|
||||||
|
<dict>
|
||||||
|
<key>ASSETCATALOG_COMPILER_APPICON_NAME</key>
|
||||||
|
<string>AppIcon</string>
|
||||||
|
<key>INFOPLIST_FILE</key>
|
||||||
|
<string>Sample/Info.plist</string>
|
||||||
|
<key>LD_RUNPATH_SEARCH_PATHS</key>
|
||||||
|
<string>$(inherited) @executable_path/Frameworks</string>
|
||||||
|
<key>PRODUCT_NAME</key>
|
||||||
|
<string>$(TARGET_NAME)</string>
|
||||||
|
</dict>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>XCBuildConfiguration</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Debug</string>
|
||||||
|
</dict>
|
||||||
|
<key>05E212A619D4DB510098F589</key>
|
||||||
|
<dict>
|
||||||
|
<key>baseConfigurationReference</key>
|
||||||
|
<string>088AA6578212BE9BFBB07B70</string>
|
||||||
|
<key>buildSettings</key>
|
||||||
|
<dict>
|
||||||
|
<key>ASSETCATALOG_COMPILER_APPICON_NAME</key>
|
||||||
|
<string>AppIcon</string>
|
||||||
|
<key>INFOPLIST_FILE</key>
|
||||||
|
<string>Sample/Info.plist</string>
|
||||||
|
<key>LD_RUNPATH_SEARCH_PATHS</key>
|
||||||
|
<string>$(inherited) @executable_path/Frameworks</string>
|
||||||
|
<key>PRODUCT_NAME</key>
|
||||||
|
<string>$(TARGET_NAME)</string>
|
||||||
|
</dict>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>XCBuildConfiguration</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Release</string>
|
||||||
|
</dict>
|
||||||
|
<key>088AA6578212BE9BFBB07B70</key>
|
||||||
|
<dict>
|
||||||
|
<key>includeInIndex</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>text.xcconfig</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Pods.release.xcconfig</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>Pods/Target Support Files/Pods/Pods.release.xcconfig</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>1A943BF0259746F18D6E423F</key>
|
||||||
|
<dict>
|
||||||
|
<key>children</key>
|
||||||
|
<array>
|
||||||
|
<string>3D24B17D1E4A4E7A9566C5E9</string>
|
||||||
|
</array>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXGroup</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Frameworks</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>1AE410B73DA5C3BD087ACDD7</key>
|
||||||
|
<dict>
|
||||||
|
<key>children</key>
|
||||||
|
<array>
|
||||||
|
<string>C068F1D3F0CC317E895FCDAB</string>
|
||||||
|
<string>088AA6578212BE9BFBB07B70</string>
|
||||||
|
</array>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXGroup</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Pods</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>3D24B17D1E4A4E7A9566C5E9</key>
|
||||||
|
<dict>
|
||||||
|
<key>explicitFileType</key>
|
||||||
|
<string>archive.ar</string>
|
||||||
|
<key>includeInIndex</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>libPods.a</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string>BUILT_PRODUCTS_DIR</string>
|
||||||
|
</dict>
|
||||||
|
<key>3EC0CDCBA10D483D9F386E5E</key>
|
||||||
|
<dict>
|
||||||
|
<key>fileRef</key>
|
||||||
|
<string>3D24B17D1E4A4E7A9566C5E9</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXBuildFile</string>
|
||||||
|
</dict>
|
||||||
|
<key>C068F1D3F0CC317E895FCDAB</key>
|
||||||
|
<dict>
|
||||||
|
<key>includeInIndex</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXFileReference</string>
|
||||||
|
<key>lastKnownFileType</key>
|
||||||
|
<string>text.xcconfig</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Pods.debug.xcconfig</string>
|
||||||
|
<key>path</key>
|
||||||
|
<string>Pods/Target Support Files/Pods/Pods.debug.xcconfig</string>
|
||||||
|
<key>sourceTree</key>
|
||||||
|
<string><group></string>
|
||||||
|
</dict>
|
||||||
|
<key>E080B80F89C34A25B3488E26</key>
|
||||||
|
<dict>
|
||||||
|
<key>buildActionMask</key>
|
||||||
|
<string>2147483647</string>
|
||||||
|
<key>files</key>
|
||||||
|
<array/>
|
||||||
|
<key>inputPaths</key>
|
||||||
|
<array/>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXShellScriptBuildPhase</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Check Pods Manifest.lock</string>
|
||||||
|
<key>outputPaths</key>
|
||||||
|
<array/>
|
||||||
|
<key>runOnlyForDeploymentPostprocessing</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>shellPath</key>
|
||||||
|
<string>/bin/sh</string>
|
||||||
|
<key>shellScript</key>
|
||||||
|
<string>diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
|
||||||
|
if [[ $? != 0 ]] ; then
|
||||||
|
cat << EOM
|
||||||
|
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
|
||||||
|
EOM
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
</string>
|
||||||
|
<key>showEnvVarsInLog</key>
|
||||||
|
<string>0</string>
|
||||||
|
</dict>
|
||||||
|
<key>F012A6F39E0149F18F564F50</key>
|
||||||
|
<dict>
|
||||||
|
<key>buildActionMask</key>
|
||||||
|
<string>2147483647</string>
|
||||||
|
<key>files</key>
|
||||||
|
<array/>
|
||||||
|
<key>inputPaths</key>
|
||||||
|
<array/>
|
||||||
|
<key>isa</key>
|
||||||
|
<string>PBXShellScriptBuildPhase</string>
|
||||||
|
<key>name</key>
|
||||||
|
<string>Copy Pods Resources</string>
|
||||||
|
<key>outputPaths</key>
|
||||||
|
<array/>
|
||||||
|
<key>runOnlyForDeploymentPostprocessing</key>
|
||||||
|
<string>0</string>
|
||||||
|
<key>shellPath</key>
|
||||||
|
<string>/bin/sh</string>
|
||||||
|
<key>shellScript</key>
|
||||||
|
<string>"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh"
|
||||||
|
</string>
|
||||||
|
<key>showEnvVarsInLog</key>
|
||||||
|
<string>0</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>rootObject</key>
|
||||||
|
<string>05E2127919D4DB510098F589</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
7
examples/Kittens/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
examples/Kittens/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:Sample.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
1
examples/Kittens/Sample.xcworkspace/contents.xcworkspacedata
generated
Normal file
1
examples/Kittens/Sample.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?><Workspace version='1.0'><FileRef location='group:Sample.xcodeproj'/><FileRef location='group:Pods/Pods.xcodeproj'/></Workspace>
|
||||||
18
examples/Kittens/Sample/AppDelegate.h
Normal file
18
examples/Kittens/Sample/AppDelegate.h
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/* This file provided by Facebook is for non-commercial testing and evaluation
|
||||||
|
* purposes only. Facebook reserves all rights not expressly granted.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||||
|
|
||||||
|
@property (strong, nonatomic) UIWindow *window;
|
||||||
|
|
||||||
|
@end
|
||||||
27
examples/Kittens/Sample/AppDelegate.m
Normal file
27
examples/Kittens/Sample/AppDelegate.m
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
/* This file provided by Facebook is for non-commercial testing and evaluation
|
||||||
|
* purposes only. Facebook reserves all rights not expressly granted.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "AppDelegate.h"
|
||||||
|
|
||||||
|
#import "ViewController.h"
|
||||||
|
|
||||||
|
@implementation AppDelegate
|
||||||
|
|
||||||
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||||
|
{
|
||||||
|
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||||
|
self.window.backgroundColor = [UIColor whiteColor];
|
||||||
|
self.window.rootViewController = [[ViewController alloc] init];
|
||||||
|
[self.window makeKeyAndVisible];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
19
examples/Kittens/Sample/BlurbNode.h
Normal file
19
examples/Kittens/Sample/BlurbNode.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
/* This file provided by Facebook is for non-commercial testing and evaluation
|
||||||
|
* purposes only. Facebook reserves all rights not expressly granted.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple node that displays a placekitten.com attribution.
|
||||||
|
*/
|
||||||
|
@interface BlurbNode : ASCellNode
|
||||||
|
|
||||||
|
@end
|
||||||
100
examples/Kittens/Sample/BlurbNode.m
Normal file
100
examples/Kittens/Sample/BlurbNode.m
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
/* This file provided by Facebook is for non-commercial testing and evaluation
|
||||||
|
* purposes only. Facebook reserves all rights not expressly granted.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "BlurbNode.h"
|
||||||
|
|
||||||
|
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
|
||||||
|
#import <AsyncDisplayKit/ASHighlightOverlayLayer.h>
|
||||||
|
|
||||||
|
|
||||||
|
static CGFloat kTextPadding = 10.0f;
|
||||||
|
static NSString *kLinkAttributeName = @"PlaceKittenNodeLinkAttributeName";
|
||||||
|
|
||||||
|
@interface BlurbNode () <ASTextNodeDelegate>
|
||||||
|
{
|
||||||
|
ASTextNode *_textNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@implementation BlurbNode
|
||||||
|
|
||||||
|
- (instancetype)init
|
||||||
|
{
|
||||||
|
if (!(self = [super init]))
|
||||||
|
return nil;
|
||||||
|
|
||||||
|
// create a text node
|
||||||
|
_textNode = [[ASTextNode alloc] init];
|
||||||
|
|
||||||
|
// configure the node to support tappable links
|
||||||
|
_textNode.delegate = self;
|
||||||
|
_textNode.userInteractionEnabled = YES;
|
||||||
|
_textNode.linkAttributeNames = @[ kLinkAttributeName ];
|
||||||
|
|
||||||
|
// generate an attributed string using the custom link attribute specified above
|
||||||
|
NSString *blurb = @"kittens courtesy placekitten.com \U0001F638";
|
||||||
|
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:blurb];
|
||||||
|
[string addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Light" size:16.0f] range:NSMakeRange(0, blurb.length)];
|
||||||
|
[string addAttributes:@{
|
||||||
|
kLinkAttributeName: [NSURL URLWithString:@"http://placekitten.com/"],
|
||||||
|
NSForegroundColorAttributeName: [UIColor grayColor],
|
||||||
|
NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle | NSUnderlinePatternDot),
|
||||||
|
}
|
||||||
|
range:[blurb rangeOfString:@"placekitten.com"]];
|
||||||
|
_textNode.attributedString = string;
|
||||||
|
|
||||||
|
// add it as a subnode, and we're done
|
||||||
|
[self addSubnode:_textNode];
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)didLoad
|
||||||
|
{
|
||||||
|
// enable highlighting now that self.layer has loaded -- see ASHighlightOverlayLayer.h
|
||||||
|
self.layer.as_allowsHighlightDrawing = YES;
|
||||||
|
|
||||||
|
[super didLoad];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
|
||||||
|
{
|
||||||
|
// called on a background thread. custom nodes must call -measure: on their subnodes in -calculateSizeThatFits:
|
||||||
|
CGSize measuredSize = [_textNode measure:CGSizeMake(constrainedSize.width - 2 * kTextPadding,
|
||||||
|
constrainedSize.height - 2 * kTextPadding)];
|
||||||
|
return CGSizeMake(constrainedSize.width, measuredSize.height + 2 * kTextPadding);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)layout
|
||||||
|
{
|
||||||
|
// called on the main thread. we'll use the stashed size from above, instead of blocking on text sizing
|
||||||
|
CGSize textNodeSize = _textNode.calculatedSize;
|
||||||
|
_textNode.frame = CGRectMake(roundf((self.calculatedSize.width - textNodeSize.width) / 2.0f),
|
||||||
|
kTextPadding,
|
||||||
|
textNodeSize.width,
|
||||||
|
textNodeSize.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)textNode:(ASTextNode *)richTextNode shouldHighlightLinkAttribute:(NSString *)attribute value:(id)value
|
||||||
|
{
|
||||||
|
// opt into link highlighting -- tap and hold the link to try it! must enable highlighting on a layer, see -didLoad
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)textNode:(ASTextNode *)richTextNode tappedLinkAttribute:(NSString *)attribute value:(NSURL *)URL atPoint:(CGPoint)point textRange:(NSRange)textRange
|
||||||
|
{
|
||||||
|
// the node tapped a link, open it
|
||||||
|
[[UIApplication sharedApplication] openURL:URL];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
36
examples/Kittens/Sample/Info.plist
Normal file
36
examples/Kittens/Sample/Info.plist
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?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>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>$(PRODUCT_NAME)</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
<true/>
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>armv7</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
22
examples/Kittens/Sample/KittenNode.h
Normal file
22
examples/Kittens/Sample/KittenNode.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/* This file provided by Facebook is for non-commercial testing and evaluation
|
||||||
|
* purposes only. Facebook reserves all rights not expressly granted.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Social media-style node that displays a kitten picture and a random length
|
||||||
|
* of lorem ipsum text. Uses a placekitten.com kitten of the specified size.
|
||||||
|
*/
|
||||||
|
@interface KittenNode : ASCellNode
|
||||||
|
|
||||||
|
- (instancetype)initWithKittenOfSize:(CGSize)size;
|
||||||
|
|
||||||
|
@end
|
||||||
175
examples/Kittens/Sample/KittenNode.m
Normal file
175
examples/Kittens/Sample/KittenNode.m
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
/* This file provided by Facebook is for non-commercial testing and evaluation
|
||||||
|
* purposes only. Facebook reserves all rights not expressly granted.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "KittenNode.h"
|
||||||
|
|
||||||
|
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
|
||||||
|
|
||||||
|
static const CGFloat kImageSize = 80.0f;
|
||||||
|
static const CGFloat kOuterPadding = 16.0f;
|
||||||
|
static const CGFloat kInnerPadding = 10.0f;
|
||||||
|
|
||||||
|
|
||||||
|
@interface KittenNode ()
|
||||||
|
{
|
||||||
|
CGSize _kittenSize;
|
||||||
|
|
||||||
|
ASImageNode *_imageNode;
|
||||||
|
ASTextNode *_textNode;
|
||||||
|
ASDisplayNode *_divider;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@implementation KittenNode
|
||||||
|
|
||||||
|
// lorem ipsum text courtesy http://kittyipsum.com/ <3
|
||||||
|
+ (NSArray *)placeholders
|
||||||
|
{
|
||||||
|
static NSArray *placeholders = nil;
|
||||||
|
|
||||||
|
static dispatch_once_t once;
|
||||||
|
dispatch_once(&once, ^{
|
||||||
|
placeholders = @[
|
||||||
|
@"Kitty ipsum dolor sit amet, purr sleep on your face lay down in your way biting, sniff tincidunt a etiam fluffy fur judging you stuck in a tree kittens.",
|
||||||
|
@"Lick tincidunt a biting eat the grass, egestas enim ut lick leap puking climb the curtains lick.",
|
||||||
|
@"Lick quis nunc toss the mousie vel, tortor pellentesque sunbathe orci turpis non tail flick suscipit sleep in the sink.",
|
||||||
|
@"Orci turpis litter box et stuck in a tree, egestas ac tempus et aliquam elit.",
|
||||||
|
@"Hairball iaculis dolor dolor neque, nibh adipiscing vehicula egestas dolor aliquam.",
|
||||||
|
@"Sunbathe fluffy fur tortor faucibus pharetra jump, enim jump on the table I don't like that food catnip toss the mousie scratched.",
|
||||||
|
@"Quis nunc nam sleep in the sink quis nunc purr faucibus, chase the red dot consectetur bat sagittis.",
|
||||||
|
@"Lick tail flick jump on the table stretching purr amet, rhoncus scratched jump on the table run.",
|
||||||
|
@"Suspendisse aliquam vulputate feed me sleep on your keyboard, rip the couch faucibus sleep on your keyboard tristique give me fish dolor.",
|
||||||
|
@"Rip the couch hiss attack your ankles biting pellentesque puking, enim suspendisse enim mauris a.",
|
||||||
|
@"Sollicitudin iaculis vestibulum toss the mousie biting attack your ankles, puking nunc jump adipiscing in viverra.",
|
||||||
|
@"Nam zzz amet neque, bat tincidunt a iaculis sniff hiss bibendum leap nibh.",
|
||||||
|
@"Chase the red dot enim puking chuf, tristique et egestas sniff sollicitudin pharetra enim ut mauris a.",
|
||||||
|
@"Sagittis scratched et lick, hairball leap attack adipiscing catnip tail flick iaculis lick.",
|
||||||
|
@"Neque neque sleep in the sink neque sleep on your face, climb the curtains chuf tail flick sniff tortor non.",
|
||||||
|
@"Ac etiam kittens claw toss the mousie jump, pellentesque rhoncus litter box give me fish adipiscing mauris a.",
|
||||||
|
@"Pharetra egestas sunbathe faucibus ac fluffy fur, hiss feed me give me fish accumsan.",
|
||||||
|
@"Tortor leap tristique accumsan rutrum sleep in the sink, amet sollicitudin adipiscing dolor chase the red dot.",
|
||||||
|
@"Knock over the lamp pharetra vehicula sleep on your face rhoncus, jump elit cras nec quis quis nunc nam.",
|
||||||
|
@"Sollicitudin feed me et ac in viverra catnip, nunc eat I don't like that food iaculis give me fish.",
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
return placeholders;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)initWithKittenOfSize:(CGSize)size
|
||||||
|
{
|
||||||
|
if (!(self = [super init]))
|
||||||
|
return nil;
|
||||||
|
|
||||||
|
_kittenSize = size;
|
||||||
|
|
||||||
|
// kitten image, with a purple background colour serving as placeholder
|
||||||
|
_imageNode = [[ASImageNode alloc] init];
|
||||||
|
_imageNode.backgroundColor = [UIColor purpleColor];
|
||||||
|
[self addSubnode:_imageNode];
|
||||||
|
|
||||||
|
// lorem ipsum text, plus some nice styling
|
||||||
|
_textNode = [[ASTextNode alloc] init];
|
||||||
|
_textNode.attributedString = [[NSAttributedString alloc] initWithString:[self kittyIpsum]
|
||||||
|
attributes:[self textStyle]];
|
||||||
|
[self addSubnode:_textNode];
|
||||||
|
|
||||||
|
// hairline cell separator
|
||||||
|
_divider = [[ASDisplayNode alloc] init];
|
||||||
|
_divider.backgroundColor = [UIColor lightGrayColor];
|
||||||
|
[self addSubnode:_divider];
|
||||||
|
|
||||||
|
// download a placekitten of the requested size
|
||||||
|
[self fetchKitten];
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)kittyIpsum
|
||||||
|
{
|
||||||
|
NSArray *placeholders = [KittenNode placeholders];
|
||||||
|
u_int32_t ipsumCount = (u_int32_t)[placeholders count];
|
||||||
|
u_int32_t location = arc4random_uniform(ipsumCount);
|
||||||
|
u_int32_t length = arc4random_uniform(ipsumCount - location);
|
||||||
|
|
||||||
|
NSMutableString *string = [placeholders[location] mutableCopy];
|
||||||
|
for (u_int32_t i = location + 1; i < location + length; i++) {
|
||||||
|
[string appendString:(i % 2 == 0) ? @"\n" : @" "];
|
||||||
|
[string appendString:placeholders[i]];
|
||||||
|
}
|
||||||
|
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSDictionary *)textStyle
|
||||||
|
{
|
||||||
|
UIFont *font = [UIFont fontWithName:@"HelveticaNeue" size:12.0f];
|
||||||
|
|
||||||
|
NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
||||||
|
style.paragraphSpacing = 0.5 * font.lineHeight;
|
||||||
|
style.hyphenationFactor = 1.0;
|
||||||
|
|
||||||
|
return @{ NSFontAttributeName: font,
|
||||||
|
NSParagraphStyleAttributeName: style };
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)fetchKitten
|
||||||
|
{
|
||||||
|
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
|
||||||
|
|
||||||
|
NSInteger width = roundl(_kittenSize.width);
|
||||||
|
NSInteger height = roundl(_kittenSize.height);
|
||||||
|
|
||||||
|
NSURL *kittenURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://placekitten.com/%zd/%zd", width, height]];
|
||||||
|
[NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:kittenURL]
|
||||||
|
queue:queue
|
||||||
|
completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
|
||||||
|
if (connectionError || !data || !data.length)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// set our image node's data
|
||||||
|
if (_imageNode.nodeLoaded) {
|
||||||
|
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||||
|
// once the node's view is loaded, the node should only be used on the main thread
|
||||||
|
_imageNode.image = [UIImage imageWithData:data];
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// if the node hasn't loaded, we can use it on a background thread
|
||||||
|
_imageNode.image = [UIImage imageWithData:data];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
|
||||||
|
{
|
||||||
|
CGSize imageSize = CGSizeMake(kImageSize, kImageSize);
|
||||||
|
CGSize textSize = [_textNode measure:CGSizeMake(constrainedSize.width - kImageSize - 2 * kOuterPadding - kInnerPadding,
|
||||||
|
constrainedSize.height)];
|
||||||
|
|
||||||
|
// ensure there's room for the text
|
||||||
|
CGFloat requiredHeight = MAX(textSize.height, imageSize.height);
|
||||||
|
return CGSizeMake(constrainedSize.width, requiredHeight + 2 * kOuterPadding);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)layout
|
||||||
|
{
|
||||||
|
CGFloat pixelHeight = 1.0f / [[UIScreen mainScreen] scale];
|
||||||
|
_divider.frame = CGRectMake(0.0f, 0.0f, self.calculatedSize.width, pixelHeight);
|
||||||
|
|
||||||
|
_imageNode.frame = CGRectMake(kOuterPadding, kOuterPadding, kImageSize, kImageSize);
|
||||||
|
|
||||||
|
CGSize textSize = _textNode.calculatedSize;
|
||||||
|
_textNode.frame = CGRectMake(kOuterPadding + kImageSize + kInnerPadding, kOuterPadding, textSize.width, textSize.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
16
examples/Kittens/Sample/ViewController.h
Normal file
16
examples/Kittens/Sample/ViewController.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/* This file provided by Facebook is for non-commercial testing and evaluation
|
||||||
|
* purposes only. Facebook reserves all rights not expressly granted.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
@interface ViewController : UIViewController
|
||||||
|
|
||||||
|
@end
|
||||||
107
examples/Kittens/Sample/ViewController.m
Normal file
107
examples/Kittens/Sample/ViewController.m
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
/* This file provided by Facebook is for non-commercial testing and evaluation
|
||||||
|
* purposes only. Facebook reserves all rights not expressly granted.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "ViewController.h"
|
||||||
|
|
||||||
|
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||||
|
|
||||||
|
#import "BlurbNode.h"
|
||||||
|
#import "KittenNode.h"
|
||||||
|
|
||||||
|
static const NSInteger kLitterSize = 20;
|
||||||
|
|
||||||
|
|
||||||
|
@interface ViewController () <ASTableViewDataSource, ASTableViewDelegate>
|
||||||
|
{
|
||||||
|
ASTableView *_tableView;
|
||||||
|
|
||||||
|
// array of boxed CGSizes corresponding to placekitten kittens
|
||||||
|
NSArray *_kittenDataSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@implementation ViewController
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
#pragma mark UIViewController.
|
||||||
|
|
||||||
|
- (instancetype)init
|
||||||
|
{
|
||||||
|
if (!(self = [super init]))
|
||||||
|
return nil;
|
||||||
|
|
||||||
|
_tableView = [[ASTableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
||||||
|
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone; // KittenNode has its own separator
|
||||||
|
_tableView.asyncDataSource = self;
|
||||||
|
_tableView.asyncDelegate = self;
|
||||||
|
|
||||||
|
// populate our "data source" with some random kittens
|
||||||
|
NSMutableArray *kittenDataSource = [NSMutableArray arrayWithCapacity:kLitterSize];
|
||||||
|
for (NSInteger i = 0; i < kLitterSize; i++) {
|
||||||
|
u_int32_t deltaX = arc4random_uniform(10) - 5;
|
||||||
|
u_int32_t deltaY = arc4random_uniform(10) - 5;
|
||||||
|
CGSize size = CGSizeMake(350 + 2 * deltaX, 350 + 4 * deltaY);
|
||||||
|
|
||||||
|
[kittenDataSource addObject:[NSValue valueWithCGSize:size]];
|
||||||
|
}
|
||||||
|
_kittenDataSource = kittenDataSource;
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)viewDidLoad {
|
||||||
|
[super viewDidLoad];
|
||||||
|
|
||||||
|
[self.view addSubview:_tableView];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)viewWillLayoutSubviews
|
||||||
|
{
|
||||||
|
_tableView.frame = self.view.bounds;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)prefersStatusBarHidden
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#pragma mark -
|
||||||
|
#pragma mark Kittens.
|
||||||
|
|
||||||
|
- (ASCellNode *)tableView:(ASTableView *)tableView nodeForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
|
{
|
||||||
|
// special-case the first row
|
||||||
|
if (indexPath.section == 0 && indexPath.row == 0) {
|
||||||
|
BlurbNode *node = [[BlurbNode alloc] init];
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSValue *size = _kittenDataSource[indexPath.row - 1];
|
||||||
|
KittenNode *node = [[KittenNode alloc] initWithKittenOfSize:size.CGSizeValue];
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||||
|
{
|
||||||
|
// blurb node + kLitterSize kitties
|
||||||
|
return 1 + _kittenDataSource.count;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
|
{
|
||||||
|
// disable row selection
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
20
examples/Kittens/Sample/main.m
Normal file
20
examples/Kittens/Sample/main.m
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/* This file provided by Facebook is for non-commercial testing and evaluation
|
||||||
|
* purposes only. Facebook reserves all rights not expressly granted.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
#import "AppDelegate.h"
|
||||||
|
|
||||||
|
int main(int argc, char * argv[]) {
|
||||||
|
@autoreleasepool {
|
||||||
|
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
||||||
|
}
|
||||||
|
}
|
||||||
2
examples/Swift/Podfile
Normal file
2
examples/Swift/Podfile
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
platform :ios, '8.0'
|
||||||
|
pod 'AsyncDisplayKit', :path => '../..'
|
||||||
331
examples/Swift/Sample.xcodeproj/project.pbxproj
Normal file
331
examples/Swift/Sample.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,331 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 46;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
050E7C7419D22E19004363C2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 050E7C7319D22E19004363C2 /* AppDelegate.swift */; };
|
||||||
|
050E7C7619D22E19004363C2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 050E7C7519D22E19004363C2 /* ViewController.swift */; };
|
||||||
|
05DDD8DB19D2336300013C30 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 05DDD8DA19D2336300013C30 /* Default-568h@2x.png */; };
|
||||||
|
4690009EF79C47BBA8FDBAD4 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ACC614D420B4E90B7EE3BCE /* libPods.a */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
050E7C6E19D22E19004363C2 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
050E7C7219D22E19004363C2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
050E7C7319D22E19004363C2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
|
050E7C7519D22E19004363C2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||||
|
05DDD8DA19D2336300013C30 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = "<group>"; };
|
||||||
|
05DDD8DC19D2341D00013C30 /* AsyncDisplayKit-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AsyncDisplayKit-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
|
2ACC614D420B4E90B7EE3BCE /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
841652076B3E9351337AA7C7 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
E3EE87D12CE3EF73FAE2EF02 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
050E7C6B19D22E19004363C2 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
4690009EF79C47BBA8FDBAD4 /* libPods.a in Frameworks */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
050E7C6519D22E19004363C2 = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
050E7C7019D22E19004363C2 /* Sample */,
|
||||||
|
050E7C6F19D22E19004363C2 /* Products */,
|
||||||
|
092C2001FE124604891D6E90 /* Frameworks */,
|
||||||
|
655F2ABBD991CBDE7140FACE /* Pods */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
050E7C6F19D22E19004363C2 /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
050E7C6E19D22E19004363C2 /* Sample.app */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
050E7C7019D22E19004363C2 /* Sample */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
050E7C7319D22E19004363C2 /* AppDelegate.swift */,
|
||||||
|
050E7C7519D22E19004363C2 /* ViewController.swift */,
|
||||||
|
050E7C7119D22E19004363C2 /* Supporting Files */,
|
||||||
|
);
|
||||||
|
path = Sample;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
050E7C7119D22E19004363C2 /* Supporting Files */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
05DDD8DC19D2341D00013C30 /* AsyncDisplayKit-Bridging-Header.h */,
|
||||||
|
050E7C7219D22E19004363C2 /* Info.plist */,
|
||||||
|
05DDD8DA19D2336300013C30 /* Default-568h@2x.png */,
|
||||||
|
);
|
||||||
|
name = "Supporting Files";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
092C2001FE124604891D6E90 /* Frameworks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
2ACC614D420B4E90B7EE3BCE /* libPods.a */,
|
||||||
|
);
|
||||||
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
655F2ABBD991CBDE7140FACE /* Pods */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
841652076B3E9351337AA7C7 /* Pods.debug.xcconfig */,
|
||||||
|
E3EE87D12CE3EF73FAE2EF02 /* Pods.release.xcconfig */,
|
||||||
|
);
|
||||||
|
name = Pods;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
050E7C6D19D22E19004363C2 /* Sample */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 050E7C8D19D22E1A004363C2 /* Build configuration list for PBXNativeTarget "Sample" */;
|
||||||
|
buildPhases = (
|
||||||
|
B8824BD0ED824BAD8268EC35 /* Check Pods Manifest.lock */,
|
||||||
|
050E7C6A19D22E19004363C2 /* Sources */,
|
||||||
|
050E7C6B19D22E19004363C2 /* Frameworks */,
|
||||||
|
050E7C6C19D22E19004363C2 /* Resources */,
|
||||||
|
941C5E41C54B4613A2D3B760 /* Copy Pods Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = Sample;
|
||||||
|
productName = Sample;
|
||||||
|
productReference = 050E7C6E19D22E19004363C2 /* Sample.app */;
|
||||||
|
productType = "com.apple.product-type.application";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
050E7C6619D22E19004363C2 /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
LastUpgradeCheck = 0600;
|
||||||
|
ORGANIZATIONNAME = Facebook;
|
||||||
|
TargetAttributes = {
|
||||||
|
050E7C6D19D22E19004363C2 = {
|
||||||
|
CreatedOnToolsVersion = 6.0.1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 050E7C6919D22E19004363C2 /* Build configuration list for PBXProject "Sample" */;
|
||||||
|
compatibilityVersion = "Xcode 3.2";
|
||||||
|
developmentRegion = English;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = 050E7C6519D22E19004363C2;
|
||||||
|
productRefGroup = 050E7C6F19D22E19004363C2 /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
050E7C6D19D22E19004363C2 /* Sample */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
050E7C6C19D22E19004363C2 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
05DDD8DB19D2336300013C30 /* Default-568h@2x.png in Resources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
|
941C5E41C54B4613A2D3B760 /* Copy Pods Resources */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Copy Pods Resources";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
B8824BD0ED824BAD8268EC35 /* Check Pods Manifest.lock */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Check Pods Manifest.lock";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
||||||
|
showEnvVarsInLog = 0;
|
||||||
|
};
|
||||||
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
050E7C6A19D22E19004363C2 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
050E7C7619D22E19004363C2 /* ViewController.swift in Sources */,
|
||||||
|
050E7C7419D22E19004363C2 /* AppDelegate.swift in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
050E7C8B19D22E1A004363C2 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
050E7C8C19D22E1A004363C2 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = YES;
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
050E7C8E19D22E1A004363C2 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 841652076B3E9351337AA7C7 /* Pods.debug.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
INFOPLIST_FILE = Sample/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Sample/AsyncDisplayKit-Bridging-Header.h";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
050E7C8F19D22E1A004363C2 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = E3EE87D12CE3EF73FAE2EF02 /* Pods.release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
INFOPLIST_FILE = Sample/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Sample/AsyncDisplayKit-Bridging-Header.h";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
050E7C6919D22E19004363C2 /* Build configuration list for PBXProject "Sample" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
050E7C8B19D22E1A004363C2 /* Debug */,
|
||||||
|
050E7C8C19D22E1A004363C2 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
050E7C8D19D22E1A004363C2 /* Build configuration list for PBXNativeTarget "Sample" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
050E7C8E19D22E1A004363C2 /* Debug */,
|
||||||
|
050E7C8F19D22E1A004363C2 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 050E7C6619D22E19004363C2 /* Project object */;
|
||||||
|
}
|
||||||
7
examples/Swift/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
examples/Swift/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:Sample.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
1
examples/Swift/Sample.xcworkspace/contents.xcworkspacedata
generated
Normal file
1
examples/Swift/Sample.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?><Workspace version='1.0'><FileRef location='group:Sample.xcodeproj'/><FileRef location='group:Pods/Pods.xcodeproj'/></Workspace>
|
||||||
28
examples/Swift/Sample/AppDelegate.swift
Normal file
28
examples/Swift/Sample/AppDelegate.swift
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
/* This file provided by Facebook is for non-commercial testing and evaluation
|
||||||
|
* purposes only. Facebook reserves all rights not expressly granted.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
@UIApplicationMain
|
||||||
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
|
|
||||||
|
var window: UIWindow?
|
||||||
|
|
||||||
|
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||||
|
let window = UIWindow(frame: UIScreen.mainScreen().bounds)
|
||||||
|
window.backgroundColor = UIColor.whiteColor()
|
||||||
|
window.rootViewController = ViewController()
|
||||||
|
window.makeKeyAndVisible()
|
||||||
|
self.window = window
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
12
examples/Swift/Sample/AsyncDisplayKit-Bridging-Header.h
Normal file
12
examples/Swift/Sample/AsyncDisplayKit-Bridging-Header.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/* This file provided by Facebook is for non-commercial testing and evaluation
|
||||||
|
* purposes only. Facebook reserves all rights not expressly granted.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||||
36
examples/Swift/Sample/Info.plist
Normal file
36
examples/Swift/Sample/Info.plist
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?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>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>$(PRODUCT_NAME)</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
<true/>
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>armv7</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
66
examples/Swift/Sample/ViewController.swift
Normal file
66
examples/Swift/Sample/ViewController.swift
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
/* This file provided by Facebook is for non-commercial testing and evaluation
|
||||||
|
* purposes only. Facebook reserves all rights not expressly granted.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||||
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
class ViewController: UIViewController, ASTableViewDataSource, ASTableViewDelegate {
|
||||||
|
|
||||||
|
var tableView: ASTableView
|
||||||
|
|
||||||
|
|
||||||
|
// MARK: UIViewController.
|
||||||
|
|
||||||
|
required override init() {
|
||||||
|
self.tableView = ASTableView()
|
||||||
|
|
||||||
|
super.init(nibName: nil, bundle: nil)
|
||||||
|
|
||||||
|
self.tableView.asyncDataSource = self
|
||||||
|
self.tableView.asyncDelegate = self
|
||||||
|
}
|
||||||
|
|
||||||
|
required init(coder aDecoder: NSCoder) {
|
||||||
|
fatalError("storyboards are incompatible with truth and beauty")
|
||||||
|
}
|
||||||
|
|
||||||
|
override func viewDidLoad() {
|
||||||
|
super.viewDidLoad()
|
||||||
|
self.view.addSubview(self.tableView)
|
||||||
|
}
|
||||||
|
|
||||||
|
override func viewWillLayoutSubviews() {
|
||||||
|
self.tableView.frame = self.view.bounds
|
||||||
|
}
|
||||||
|
|
||||||
|
override func prefersStatusBarHidden() -> Bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// MARK: ASTableView data source and delegate.
|
||||||
|
|
||||||
|
func tableView(tableView: ASTableView!, nodeForRowAtIndexPath indexPath: NSIndexPath!) -> ASCellNode! {
|
||||||
|
let patter = NSString(format: "[%ld.%ld] says hello!", indexPath.section, indexPath.row)
|
||||||
|
let node = ASTextCellNode()
|
||||||
|
node.text = patter
|
||||||
|
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
|
||||||
|
func numberOfSectionsInTableView(tableView: UITableView!) -> Int {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int {
|
||||||
|
return 20
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user