mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-24 03:45:58 +08:00
[Examples, Build] Moving some smaller / less useful examples to a separate directory, speeding up builds.
This commit is contained in:
BIN
examples_extra/VideoTableView/Default-568h@2x.png
Normal file
BIN
examples_extra/VideoTableView/Default-568h@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
examples_extra/VideoTableView/Default-667h@2x.png
Normal file
BIN
examples_extra/VideoTableView/Default-667h@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
examples_extra/VideoTableView/Default-736h@3x.png
Normal file
BIN
examples_extra/VideoTableView/Default-736h@3x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
5
examples_extra/VideoTableView/Podfile
Normal file
5
examples_extra/VideoTableView/Podfile
Normal file
@@ -0,0 +1,5 @@
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
platform :ios, '7.1'
|
||||
target 'Sample' do
|
||||
pod 'AsyncDisplayKit', :path => '../..'
|
||||
end
|
||||
806
examples_extra/VideoTableView/Sample.xcodeproj/project.pbxproj
Normal file
806
examples_extra/VideoTableView/Sample.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,806 @@
|
||||
<?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>NicCageNode.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.cpp.objcpp</string>
|
||||
<key>path</key>
|
||||
<string>NicCageNode.mm</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>indentWidth</key>
|
||||
<string>2</string>
|
||||
<key>isa</key>
|
||||
<string>PBXGroup</string>
|
||||
<key>sourceTree</key>
|
||||
<string><group></string>
|
||||
<key>tabWidth</key>
|
||||
<string>2</string>
|
||||
<key>usesTabs</key>
|
||||
<string>0</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>67ADD7A0A11DF37B2D73094B</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>
|
||||
<string>6C2C82AC19EE274300767484</string>
|
||||
<string>6C2C82AD19EE274300767484</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>
|
||||
<string>EBE12F047824F0A2C6353B54</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>6C2C82AA19EE274300767484</string>
|
||||
<string>6C2C82AB19EE274300767484</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>246853115611E4007B767EA5</string>
|
||||
<key>buildSettings</key>
|
||||
<dict>
|
||||
<key>ASSETCATALOG_COMPILER_APPICON_NAME</key>
|
||||
<string>AppIcon</string>
|
||||
<key>INFOPLIST_FILE</key>
|
||||
<string>Sample/Info.plist</string>
|
||||
<key>IPHONEOS_DEPLOYMENT_TARGET</key>
|
||||
<string>7.1</string>
|
||||
<key>LD_RUNPATH_SEARCH_PATHS</key>
|
||||
<string>$(inherited) @executable_path/Frameworks</string>
|
||||
<key>PRODUCT_NAME</key>
|
||||
<string>$(TARGET_NAME)</string>
|
||||
<key>TARGETED_DEVICE_FAMILY</key>
|
||||
<string>1,2</string>
|
||||
</dict>
|
||||
<key>isa</key>
|
||||
<string>XCBuildConfiguration</string>
|
||||
<key>name</key>
|
||||
<string>Debug</string>
|
||||
</dict>
|
||||
<key>05E212A619D4DB510098F589</key>
|
||||
<dict>
|
||||
<key>baseConfigurationReference</key>
|
||||
<string>C822FB25F4C6DBD8EA3CE6EC</string>
|
||||
<key>buildSettings</key>
|
||||
<dict>
|
||||
<key>ASSETCATALOG_COMPILER_APPICON_NAME</key>
|
||||
<string>AppIcon</string>
|
||||
<key>INFOPLIST_FILE</key>
|
||||
<string>Sample/Info.plist</string>
|
||||
<key>IPHONEOS_DEPLOYMENT_TARGET</key>
|
||||
<string>7.1</string>
|
||||
<key>LD_RUNPATH_SEARCH_PATHS</key>
|
||||
<string>$(inherited) @executable_path/Frameworks</string>
|
||||
<key>PRODUCT_NAME</key>
|
||||
<string>$(TARGET_NAME)</string>
|
||||
<key>TARGETED_DEVICE_FAMILY</key>
|
||||
<string>1,2</string>
|
||||
</dict>
|
||||
<key>isa</key>
|
||||
<string>XCBuildConfiguration</string>
|
||||
<key>name</key>
|
||||
<string>Release</string>
|
||||
</dict>
|
||||
<key>12CBA11A5870DDF5A5626B7B</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-Sample.a</string>
|
||||
<key>sourceTree</key>
|
||||
<string>BUILT_PRODUCTS_DIR</string>
|
||||
</dict>
|
||||
<key>1A943BF0259746F18D6E423F</key>
|
||||
<dict>
|
||||
<key>children</key>
|
||||
<array>
|
||||
<string>12CBA11A5870DDF5A5626B7B</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>246853115611E4007B767EA5</string>
|
||||
<string>C822FB25F4C6DBD8EA3CE6EC</string>
|
||||
</array>
|
||||
<key>isa</key>
|
||||
<string>PBXGroup</string>
|
||||
<key>name</key>
|
||||
<string>Pods</string>
|
||||
<key>sourceTree</key>
|
||||
<string><group></string>
|
||||
</dict>
|
||||
<key>246853115611E4007B767EA5</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-Sample.debug.xcconfig</string>
|
||||
<key>path</key>
|
||||
<string>Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig</string>
|
||||
<key>sourceTree</key>
|
||||
<string><group></string>
|
||||
</dict>
|
||||
<key>67ADD7A0A11DF37B2D73094B</key>
|
||||
<dict>
|
||||
<key>fileRef</key>
|
||||
<string>12CBA11A5870DDF5A5626B7B</string>
|
||||
<key>isa</key>
|
||||
<string>PBXBuildFile</string>
|
||||
</dict>
|
||||
<key>6C2C82AA19EE274300767484</key>
|
||||
<dict>
|
||||
<key>isa</key>
|
||||
<string>PBXFileReference</string>
|
||||
<key>lastKnownFileType</key>
|
||||
<string>image.png</string>
|
||||
<key>path</key>
|
||||
<string>Default-667h@2x.png</string>
|
||||
<key>sourceTree</key>
|
||||
<string>SOURCE_ROOT</string>
|
||||
</dict>
|
||||
<key>6C2C82AB19EE274300767484</key>
|
||||
<dict>
|
||||
<key>isa</key>
|
||||
<string>PBXFileReference</string>
|
||||
<key>lastKnownFileType</key>
|
||||
<string>image.png</string>
|
||||
<key>path</key>
|
||||
<string>Default-736h@3x.png</string>
|
||||
<key>sourceTree</key>
|
||||
<string>SOURCE_ROOT</string>
|
||||
</dict>
|
||||
<key>6C2C82AC19EE274300767484</key>
|
||||
<dict>
|
||||
<key>fileRef</key>
|
||||
<string>6C2C82AA19EE274300767484</string>
|
||||
<key>isa</key>
|
||||
<string>PBXBuildFile</string>
|
||||
</dict>
|
||||
<key>6C2C82AD19EE274300767484</key>
|
||||
<dict>
|
||||
<key>fileRef</key>
|
||||
<string>6C2C82AB19EE274300767484</string>
|
||||
<key>isa</key>
|
||||
<string>PBXBuildFile</string>
|
||||
</dict>
|
||||
<key>C822FB25F4C6DBD8EA3CE6EC</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-Sample.release.xcconfig</string>
|
||||
<key>path</key>
|
||||
<string>Pods/Target Support Files/Pods-Sample/Pods-Sample.release.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>EBE12F047824F0A2C6353B54</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>Embed Pods Frameworks</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-Sample/Pods-Sample-frameworks.sh"
|
||||
</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-Sample/Pods-Sample-resources.sh"
|
||||
</string>
|
||||
<key>showEnvVarsInLog</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>rootObject</key>
|
||||
<string>05E2127919D4DB510098F589</string>
|
||||
</dict>
|
||||
</plist>
|
||||
7
examples_extra/VideoTableView/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
examples_extra/VideoTableView/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>
|
||||
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0620"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "05E2128019D4DB510098F589"
|
||||
BuildableName = "Sample.app"
|
||||
BlueprintName = "Sample"
|
||||
ReferencedContainer = "container:Sample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "05E2128019D4DB510098F589"
|
||||
BuildableName = "Sample.app"
|
||||
BlueprintName = "Sample"
|
||||
ReferencedContainer = "container:Sample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "05E2128019D4DB510098F589"
|
||||
BuildableName = "Sample.app"
|
||||
BlueprintName = "Sample"
|
||||
ReferencedContainer = "container:Sample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "05E2128019D4DB510098F589"
|
||||
BuildableName = "Sample.app"
|
||||
BlueprintName = "Sample"
|
||||
ReferencedContainer = "container:Sample.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
10
examples_extra/VideoTableView/Sample.xcworkspace/contents.xcworkspacedata
generated
Normal file
10
examples_extra/VideoTableView/Sample.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Sample.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
20
examples_extra/VideoTableView/Sample/AppDelegate.h
Normal file
20
examples_extra/VideoTableView/Sample/AppDelegate.h
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>
|
||||
|
||||
#define UseAutomaticLayout 1
|
||||
|
||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@end
|
||||
27
examples_extra/VideoTableView/Sample/AppDelegate.m
Normal file
27
examples_extra/VideoTableView/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 = [[UINavigationController alloc] initWithRootViewController:[[ViewController alloc] init]];
|
||||
[self.window makeKeyAndVisible];
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
19
examples_extra/VideoTableView/Sample/BlurbNode.h
Normal file
19
examples_extra/VideoTableView/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
|
||||
115
examples_extra/VideoTableView/Sample/BlurbNode.m
Normal file
115
examples_extra/VideoTableView/Sample/BlurbNode.m
Normal file
@@ -0,0 +1,115 @@
|
||||
/* 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 "AppDelegate.h"
|
||||
|
||||
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
|
||||
#import <AsyncDisplayKit/ASHighlightOverlayLayer.h>
|
||||
|
||||
#import <AsyncDisplayKit/ASInsetLayoutSpec.h>
|
||||
#import <AsyncDisplayKit/ASCenterLayoutSpec.h>
|
||||
|
||||
static CGFloat kTextPadding = 10.0f;
|
||||
static NSString *kLinkAttributeName = @"PlaceKittenNodeLinkAttributeName";
|
||||
|
||||
@interface BlurbNode () <ASTextNodeDelegate>
|
||||
{
|
||||
ASTextNode *_textNode;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation BlurbNode
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark ASCellNode.
|
||||
|
||||
- (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 = @"Nic Cage courtesy of himself.";
|
||||
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:blurb];
|
||||
_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];
|
||||
}
|
||||
|
||||
#if UseAutomaticLayout
|
||||
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
|
||||
{
|
||||
ASCenterLayoutSpec *centerSpec = [[ASCenterLayoutSpec alloc] init];
|
||||
centerSpec.centeringOptions = ASCenterLayoutSpecCenteringX;
|
||||
centerSpec.sizingOptions = ASCenterLayoutSpecSizingOptionMinimumY;
|
||||
centerSpec.child = _textNode;
|
||||
|
||||
UIEdgeInsets padding =UIEdgeInsetsMake(kTextPadding, kTextPadding, kTextPadding, kTextPadding);
|
||||
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:padding child:centerSpec];
|
||||
}
|
||||
#else
|
||||
- (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);
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark ASTextNodeDelegate methods.
|
||||
|
||||
- (BOOL)textNode:(ASTextNode *)richTextNode shouldHighlightLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point
|
||||
{
|
||||
// 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_extra/VideoTableView/Sample/Info.plist
Normal file
36
examples_extra/VideoTableView/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>
|
||||
24
examples_extra/VideoTableView/Sample/NicCageNode.h
Normal file
24
examples_extra/VideoTableView/Sample/NicCageNode.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/* 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 NicCageNode : ASCellNode
|
||||
|
||||
- (instancetype)initWithKittenOfSize:(CGSize)size;
|
||||
|
||||
- (void)toggleImageEnlargement;
|
||||
|
||||
@end
|
||||
255
examples_extra/VideoTableView/Sample/NicCageNode.mm
Normal file
255
examples_extra/VideoTableView/Sample/NicCageNode.mm
Normal file
@@ -0,0 +1,255 @@
|
||||
/* 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 "NicCageNode.h"
|
||||
#import "AppDelegate.h"
|
||||
|
||||
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
|
||||
|
||||
#import <AsyncDisplayKit/ASDisplayNode+Beta.h>
|
||||
#import <AsyncDisplayKit/ASStackLayoutSpec.h>
|
||||
#import <AsyncDisplayKit/ASInsetLayoutSpec.h>
|
||||
#import <AsyncDisplayKit/ASVideoNode.h>
|
||||
|
||||
static const CGFloat kImageSize = 80.0f;
|
||||
static const CGFloat kOuterPadding = 16.0f;
|
||||
static const CGFloat kInnerPadding = 10.0f;
|
||||
|
||||
@interface NicCageNode ()
|
||||
{
|
||||
CGSize _kittenSize;
|
||||
|
||||
// ASNetworkImageNode *_imageNode;
|
||||
ASVideoNode *_videoNode;
|
||||
ASTextNode *_textNode;
|
||||
ASDisplayNode *_divider;
|
||||
BOOL _isImageEnlarged;
|
||||
BOOL _swappedTextAndImage;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation NicCageNode
|
||||
|
||||
// lorem ipsum text courtesy https://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;
|
||||
|
||||
u_int32_t videoInitMethod = arc4random_uniform(3);
|
||||
u_int32_t autoPlay = arc4random_uniform(2);
|
||||
NSArray* methodArray = @[@"AVAsset", @"File URL", @"HLS URL"];
|
||||
NSArray* autoPlayArray = @[@"paused", @"auto play"];
|
||||
|
||||
switch (videoInitMethod) {
|
||||
case 0:
|
||||
// Construct an AVAsset from a URL
|
||||
_videoNode = [[ASVideoNode alloc] init];
|
||||
_videoNode.asset = [AVAsset assetWithURL:[NSURL URLWithString:@"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-753fe655-86bb-46da-89b7-aa59c60e49c0-niccage.mp4"]];
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// Construct the video node directly from the .mp4 URL
|
||||
_videoNode = [[ASVideoNode alloc] init];
|
||||
_videoNode.asset = [AVAsset assetWithURL:[NSURL URLWithString:@"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-753fe655-86bb-46da-89b7-aa59c60e49c0-niccage.mp4"]];
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// Construct the video node from an HTTP Live Streaming URL
|
||||
// URL from https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/02_Playback.html
|
||||
_videoNode = [[ASVideoNode alloc] init];
|
||||
_videoNode.asset = [AVAsset assetWithURL:[NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"]];
|
||||
break;
|
||||
}
|
||||
|
||||
if (autoPlay == 1)
|
||||
_videoNode.shouldAutoplay = YES;
|
||||
|
||||
_videoNode.shouldAutorepeat = YES;
|
||||
_videoNode.backgroundColor = ASDisplayNodeDefaultPlaceholderColor();
|
||||
|
||||
[self addSubnode:_videoNode];
|
||||
|
||||
_textNode = [[ASTextNode alloc] init];
|
||||
_textNode.attributedString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ %@ %@", methodArray[videoInitMethod], autoPlayArray[autoPlay], [self kittyIpsum]]
|
||||
attributes:[self textStyle]];
|
||||
[self addSubnode:_textNode];
|
||||
|
||||
// hairline cell separator
|
||||
_divider = [[ASDisplayNode alloc] init];
|
||||
_divider.backgroundColor = [UIColor lightGrayColor];
|
||||
[self addSubnode:_divider];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)kittyIpsum
|
||||
{
|
||||
NSArray *placeholders = [NicCageNode 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 };
|
||||
}
|
||||
|
||||
#if UseAutomaticLayout
|
||||
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
|
||||
{
|
||||
_videoNode.preferredFrameSize = _isImageEnlarged ? CGSizeMake(2.0 * kImageSize, 2.0 * kImageSize) : CGSizeMake(kImageSize, kImageSize);
|
||||
_textNode.flexShrink = YES;
|
||||
|
||||
ASStackLayoutSpec *stackSpec = [[ASStackLayoutSpec alloc] init];
|
||||
stackSpec.direction = ASStackLayoutDirectionHorizontal;
|
||||
stackSpec.spacing = kInnerPadding;
|
||||
[stackSpec setChildren:!_swappedTextAndImage ? @[_videoNode, _textNode] : @[_textNode, _videoNode]];
|
||||
|
||||
ASInsetLayoutSpec *insetSpec = [[ASInsetLayoutSpec alloc] init];
|
||||
insetSpec.insets = UIEdgeInsetsMake(kOuterPadding, kOuterPadding, kOuterPadding, kOuterPadding);
|
||||
insetSpec.child = stackSpec;
|
||||
|
||||
return insetSpec;
|
||||
}
|
||||
|
||||
// With box model, you don't need to override this method, unless you want to add custom logic.
|
||||
- (void)layout
|
||||
{
|
||||
[super layout];
|
||||
|
||||
// Manually layout the divider.
|
||||
CGFloat pixelHeight = 1.0f / [[UIScreen mainScreen] scale];
|
||||
_divider.frame = CGRectMake(0.0f, 0.0f, self.calculatedSize.width, pixelHeight);
|
||||
}
|
||||
#else
|
||||
- (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);
|
||||
}
|
||||
#endif
|
||||
|
||||
- (void)toggleImageEnlargement
|
||||
{
|
||||
_isImageEnlarged = !_isImageEnlarged;
|
||||
[self setNeedsLayout];
|
||||
}
|
||||
|
||||
- (void)toggleNodesSwap
|
||||
{
|
||||
_swappedTextAndImage = !_swappedTextAndImage;
|
||||
|
||||
[UIView animateWithDuration:0.15 animations:^{
|
||||
self.alpha = 0;
|
||||
} completion:^(BOOL finished) {
|
||||
[self setNeedsLayout];
|
||||
[self.view layoutIfNeeded];
|
||||
|
||||
[UIView animateWithDuration:0.15 animations:^{
|
||||
self.alpha = 1;
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)updateBackgroundColor
|
||||
{
|
||||
if (self.highlighted) {
|
||||
self.backgroundColor = [UIColor lightGrayColor];
|
||||
} else if (self.selected) {
|
||||
self.backgroundColor = [UIColor blueColor];
|
||||
} else {
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected
|
||||
{
|
||||
[super setSelected:selected];
|
||||
[self updateBackgroundColor];
|
||||
}
|
||||
|
||||
- (void)setHighlighted:(BOOL)highlighted
|
||||
{
|
||||
[super setHighlighted:highlighted];
|
||||
[self updateBackgroundColor];
|
||||
}
|
||||
|
||||
@end
|
||||
16
examples_extra/VideoTableView/Sample/ViewController.h
Normal file
16
examples_extra/VideoTableView/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
|
||||
199
examples_extra/VideoTableView/Sample/ViewController.m
Normal file
199
examples_extra/VideoTableView/Sample/ViewController.m
Normal file
@@ -0,0 +1,199 @@
|
||||
/* 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 <AsyncDisplayKit/ASAssert.h>
|
||||
|
||||
#import "BlurbNode.h"
|
||||
#import "NicCageNode.h"
|
||||
#import <AsyncDisplayKit/ASDisplayNode+Beta.h>
|
||||
|
||||
static const NSInteger kCageSize = 20; // intial number of Cage cells in ASTableView
|
||||
static const NSInteger kCageBatchSize = 10; // number of Cage cells to add to ASTableView
|
||||
static const NSInteger kMaxCageSize = 100; // max number of Cage cells allowed in ASTableView
|
||||
|
||||
@interface ViewController () <ASTableViewDataSource, ASTableViewDelegate>
|
||||
{
|
||||
ASTableView *_tableView;
|
||||
|
||||
// array of boxed CGSizes corresponding to placekitten.com kittens
|
||||
NSMutableArray *_kittenDataSource;
|
||||
|
||||
BOOL _dataSourceLocked;
|
||||
NSIndexPath *_blurbNodeIndexPath;
|
||||
}
|
||||
|
||||
@property (nonatomic, strong) NSMutableArray *kittenDataSource;
|
||||
@property (atomic, assign) BOOL dataSourceLocked;
|
||||
|
||||
@end
|
||||
|
||||
@implementation ViewController
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark UIViewController.
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
if (!(self = [super init]))
|
||||
return nil;
|
||||
|
||||
_tableView = [[ASTableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain asyncDataFetching:YES];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone; // KittenNode has its own separator
|
||||
_tableView.asyncDataSource = self;
|
||||
_tableView.asyncDelegate = self;
|
||||
|
||||
// populate our "data source" with some random kittens
|
||||
_kittenDataSource = [self createLitterWithSize:kCageSize];
|
||||
|
||||
_blurbNodeIndexPath = [NSIndexPath indexPathForItem:0 inSection:0];
|
||||
|
||||
self.title = @"Nic Cage";
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit
|
||||
target:self
|
||||
action:@selector(toggleEditingMode)];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSMutableArray *)createLitterWithSize:(NSInteger)litterSize
|
||||
{
|
||||
NSMutableArray *cages = [NSMutableArray arrayWithCapacity:litterSize];
|
||||
for (NSInteger i = 0; i < litterSize; 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);
|
||||
|
||||
[cages addObject:[NSValue valueWithCGSize:size]];
|
||||
}
|
||||
return cages;
|
||||
}
|
||||
|
||||
- (void)setKittenDataSource:(NSMutableArray *)kittenDataSource {
|
||||
ASDisplayNodeAssert(!self.dataSourceLocked, @"Could not update data source when it is locked !");
|
||||
|
||||
_kittenDataSource = kittenDataSource;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
[self.view addSubview:_tableView];
|
||||
}
|
||||
|
||||
- (void)viewWillLayoutSubviews
|
||||
{
|
||||
_tableView.frame = self.view.bounds;
|
||||
}
|
||||
|
||||
- (void)toggleEditingMode
|
||||
{
|
||||
[_tableView setEditing:!_tableView.editing animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark ASTableView.
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
[_tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
// Assume only kitten nodes are selectable (see -tableView:shouldHighlightRowAtIndexPath:).
|
||||
NicCageNode *node = (NicCageNode *)[_tableView nodeForRowAtIndexPath:indexPath];
|
||||
[node toggleImageEnlargement];
|
||||
}
|
||||
|
||||
- (ASCellNode *)tableView:(ASTableView *)tableView nodeForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
// special-case the first row
|
||||
if ([_blurbNodeIndexPath compare:indexPath] == NSOrderedSame) {
|
||||
BlurbNode *node = [[BlurbNode alloc] init];
|
||||
return node;
|
||||
}
|
||||
|
||||
NSValue *size = _kittenDataSource[indexPath.row - 1];
|
||||
NicCageNode *node = [[NicCageNode 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
|
||||
{
|
||||
// Enable selection for kitten nodes
|
||||
return [_blurbNodeIndexPath compare:indexPath] != NSOrderedSame;
|
||||
}
|
||||
|
||||
- (void)tableViewLockDataSource:(ASTableView *)tableView
|
||||
{
|
||||
self.dataSourceLocked = YES;
|
||||
}
|
||||
|
||||
- (void)tableViewUnlockDataSource:(ASTableView *)tableView
|
||||
{
|
||||
self.dataSourceLocked = NO;
|
||||
}
|
||||
|
||||
- (BOOL)shouldBatchFetchForTableView:(UITableView *)tableView
|
||||
{
|
||||
return _kittenDataSource.count < kMaxCageSize;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView willBeginBatchFetchWithContext:(ASBatchContext *)context
|
||||
{
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
sleep(1);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
// populate a new array of random-sized kittens
|
||||
NSArray *moarKittens = [self createLitterWithSize:kCageBatchSize];
|
||||
|
||||
NSMutableArray *indexPaths = [[NSMutableArray alloc] init];
|
||||
|
||||
// find number of kittens in the data source and create their indexPaths
|
||||
NSInteger existingRows = _kittenDataSource.count + 1;
|
||||
|
||||
for (NSInteger i = 0; i < moarKittens.count; i++) {
|
||||
[indexPaths addObject:[NSIndexPath indexPathForRow:existingRows + i inSection:0]];
|
||||
}
|
||||
|
||||
// add new kittens to the data source & notify table of new indexpaths
|
||||
[_kittenDataSource addObjectsFromArray:moarKittens];
|
||||
[tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationFade];
|
||||
|
||||
[context completeBatchFetching:YES];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
// Enable editing for Kitten nodes
|
||||
return [_blurbNodeIndexPath compare:indexPath] != NSOrderedSame;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
if (editingStyle == UITableViewCellEditingStyleDelete) {
|
||||
// Assume only kitten nodes are editable (see -tableView:canEditRowAtIndexPath:).
|
||||
[_kittenDataSource removeObjectAtIndex:indexPath.row - 1];
|
||||
[_tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
20
examples_extra/VideoTableView/Sample/main.m
Normal file
20
examples_extra/VideoTableView/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]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user