diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..0605feef2a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# http://editorconfig.org +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[**.{h,cc,mm,m}] +indent_style = space +indent_size = 2 + +[*.{md,markdown}] +trim_trailing_whitespace = false + +# Makefiles always use tabs for indentation +[Makefile] +indent_style = tab \ No newline at end of file diff --git a/.github/GITHUB_RULES.md b/.github/GITHUB_RULES.md new file mode 100644 index 0000000000..156168ac16 --- /dev/null +++ b/.github/GITHUB_RULES.md @@ -0,0 +1,61 @@ +### Contribute to ASDK's Friendly Reputation + +ASDK has earned its reputation as an exceptionally welcoming place for newbie & experienced developers alike through the extra time Scott takes to thank _everyone_ who posts a question, bug, feature request or PR, for their time and contribution to the project, no matter how large the contribution (or silly the question). + +###PR Reviewing + +Merge permissions granted to Scott Goodson (@appleguy), Michael Schneider (@maicki), Adlai Holler (@Adlai-Holler) + +**PR Type** | **Required Reviewers** +--- | --- +Documentation | Anyone +Bug Fix | 2 (external PR) or 1 (internal PR) of the following (Scott, Michael, Adlai, Levi) +Refactoring | 1-3 depending on size / author familiarity with feature +New API | Scott + component owner + 1 additional +Breaking API | Scott + component owner + 1 additional + +**Component** | **Experts For Reviewing** +--- | --- +ASTextNode + subclasses | Ricky / Oliver +ASImageNode + subclasses | Garrett / Scott / Michael +ASDataController / Table / Collection | Michael +ASRangeController | Scott +ASLayout | Huy +ASDisplayNode | Garret / Michael / Levi +ASVideoNode | #asvideonode channel + +###PR Merging + +BE CAUTIOUS, DON'T CAUSE A REGRESSION + +Try to include as much as possible: +- Description / Screenshots +- Motivation & Context +- Methods of testing / Sample app +- What type of change it is (bug fix, new feature, breaking change) +- Tag @hannahmbanana on any documentation needs* +- Title the PR with the component in brackets - e.g. "[ASTextNode] fix threading issues..." +- New files need to include the required Facebook licensing header info. +- For future viewers / potential contributors, try to describe why this PR is helpful / useful / awesome / makes an impact on the current or future community + +###What stays on GitHub vs goes to Ship? + +GitHub: +- active bugs +- active community discussions +- unresolved community questions +- open issue about slack channel +- open issue with list of β€œup-for-grabs” tasks to get involved + +Ship: +- feature requests +- documentation requests +- performance optimizations / refactoring + +Comment for moving to Ship: + +@\ The community is planning an exciting long term road map for the project and getting organized around how to deliver these feature requests. + +If you are interested in helping contribute to this component or any other, don’t hesitate to send us an email at AsyncDisplayKit@gmail.com or ping us on ASDK's Slack (#1582). If you would like to contribute for a few weeks, we can also add you to our Ship bug tracker so that you can see what everyone is working on and actively coordinate with us. + +As always, keep filing issues and submitting pull requests here on Github and we will only move things to the new tracker if they require long term coordination. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..03194fca3b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,4 @@ +// The more information you include, the faster we can help you out! +// Please include: a sample project or screenshots, code snippets +// AsyncDisplayKit version, and/or backtraces for any crashes (> bt all). +// Please delete these lines before posting. Thanks! \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 69217e9a71..2b7982d701 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,31 @@ language: objective-c +cache: + - bundler + - cocoapods osx_image: xcode7.3 +git: + depth: 10 before_install: - brew update - - brew reinstall --HEAD xctool - - brew reinstall carthage - - gem install cocoapods -v 0.38.2 - - gem install slather + - brew outdated xctool || brew upgrade xctool + - brew outdated carthage || brew upgrade carthage + - gem install cocoapods -v 1.0.1 + - gem install xcpretty + - gem install xcpretty-travis-formatter +# - gem install slather - xcrun simctl list install: echo "<3" env: - MODE=tests - - MODE=examples + - MODE=examples-pt1 + - MODE=examples-pt2 + - MODE=examples-pt3 - MODE=life-without-cocoapods - MODE=framework script: ./build.sh $MODE -after_success: - - slather + +#after_success: +# - slather # whitelist branches: diff --git a/AsyncDisplayKit.podspec b/AsyncDisplayKit.podspec index f094a38b55..8505b88f61 100644 --- a/AsyncDisplayKit.podspec +++ b/AsyncDisplayKit.podspec @@ -1,18 +1,23 @@ Pod::Spec.new do |spec| spec.name = 'AsyncDisplayKit' - spec.version = '1.9.7.2' + spec.version = '1.9.80' spec.license = { :type => 'BSD' } spec.homepage = 'http://asyncdisplaykit.org' spec.authors = { 'Scott Goodson' => 'scottgoodson@gmail.com', 'Ryan Nystrom' => 'rnystrom@fb.com' } spec.summary = 'Smooth asynchronous user interfaces for iOS apps.' - spec.source = { :git => 'https://github.com/facebook/AsyncDisplayKit.git', :tag => '1.9.7.2' } + spec.source = { :git => 'https://github.com/facebook/AsyncDisplayKit.git', :tag => '1.9.80' } spec.documentation_url = 'http://asyncdisplaykit.org/appledoc/' spec.frameworks = 'AssetsLibrary' spec.weak_frameworks = 'Photos','MapKit' spec.requires_arc = true - + + spec.ios.deployment_target = '7.0' + + # Uncomment when fixed: issues with tvOS build for release 1.9.8 + # spec.tvos.deployment_target = '9.0' + # Subspecs spec.subspec 'Core' do |core| core.public_header_files = [ @@ -54,7 +59,7 @@ Pod::Spec.new do |spec| spec.subspec 'PINRemoteImage' do |pin| pin.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) PIN_REMOTE_IMAGE=1' } - pin.dependency 'PINRemoteImage/iOS', '>= 2.1.2' + pin.dependency 'PINRemoteImage/iOS', '>= 3.0.0-beta.2' pin.dependency 'AsyncDisplayKit/Core' end @@ -68,7 +73,4 @@ Pod::Spec.new do |spec| 'CLANG_CXX_LIBRARY' => 'libc++' } - spec.ios.deployment_target = '7.0' - # tvOS not recognized by older versions of Cocoapods - add this only after tvOS support complete. - # spec.tvos.deployment_target = '9.0' end diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index 6d270f7b9d..e0cac1442b 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -190,7 +190,6 @@ 25E327581C16819500A2170C /* ASPagerNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 25E327551C16819500A2170C /* ASPagerNode.m */; }; 25E327591C16819500A2170C /* ASPagerNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 25E327551C16819500A2170C /* ASPagerNode.m */; }; 2767E9411BB19BD600EA9B77 /* ASViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = ACC945A81BA9E7A0005E1FB8 /* ASViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2767E9421BB19BD600EA9B77 /* ASViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ACC945AA1BA9E7C1005E1FB8 /* ASViewController.m */; }; 2911485C1A77147A005D0878 /* ASControlNodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2911485B1A77147A005D0878 /* ASControlNodeTests.m */; }; 291B63FB1AA53A7A000A71B3 /* ASScrollDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 296A0A311A951715005ACEAA /* ASScrollDirection.h */; settings = {ATTRIBUTES = (Public, ); }; }; 292C599F1A956527007E5DD6 /* ASLayoutRangeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 292C59991A956527007E5DD6 /* ASLayoutRangeType.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -251,9 +250,8 @@ 509E68661B3AEDD7009B9150 /* CGRect+ASConvenience.m in Sources */ = {isa = PBXBuildFile; fileRef = 205F0E201B376416007741D0 /* CGRect+ASConvenience.m */; }; 636EA1A41C7FF4EC00EE152F /* NSArray+Diffing.m in Sources */ = {isa = PBXBuildFile; fileRef = DBC452DA1C5BF64600B16017 /* NSArray+Diffing.m */; }; 636EA1A51C7FF4EF00EE152F /* ASDefaultPlayButton.m in Sources */ = {isa = PBXBuildFile; fileRef = AEB7B0191C5962EA00662EF4 /* ASDefaultPlayButton.m */; }; - 68355B301CB5799E001D4E68 /* ASImageNode+AnimatedImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 68355B2D1CB5799E001D4E68 /* ASImageNode+AnimatedImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 680346941CE4052A0009FEB4 /* ASNavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 68FC85DC1CE29AB700EDD713 /* ASNavigationController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 68355B311CB5799E001D4E68 /* ASImageNode+AnimatedImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 68355B2E1CB5799E001D4E68 /* ASImageNode+AnimatedImage.mm */; }; - 68355B331CB579AD001D4E68 /* ASImageNode+AnimatedImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 68355B2D1CB5799E001D4E68 /* ASImageNode+AnimatedImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; 68355B341CB579B9001D4E68 /* ASImageNode+AnimatedImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 68355B2E1CB5799E001D4E68 /* ASImageNode+AnimatedImage.mm */; }; 68355B3A1CB57A5A001D4E68 /* ASPINRemoteImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 68355B361CB57A5A001D4E68 /* ASPINRemoteImageDownloader.m */; }; 68355B3B1CB57A5A001D4E68 /* ASImageContainerProtocolCategories.h in Headers */ = {isa = PBXBuildFile; fileRef = 68355B371CB57A5A001D4E68 /* ASImageContainerProtocolCategories.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -275,10 +273,24 @@ 68EE0DBE1C1B4ED300BA1B99 /* ASMainSerialQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 68EE0DBB1C1B4ED300BA1B99 /* ASMainSerialQueue.h */; }; 68EE0DBF1C1B4ED300BA1B99 /* ASMainSerialQueue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 68EE0DBC1C1B4ED300BA1B99 /* ASMainSerialQueue.mm */; }; 68EE0DC01C1B4ED300BA1B99 /* ASMainSerialQueue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 68EE0DBC1C1B4ED300BA1B99 /* ASMainSerialQueue.mm */; }; + 68FC85DE1CE29AB700EDD713 /* ASNavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 68FC85DC1CE29AB700EDD713 /* ASNavigationController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 68FC85DF1CE29AB700EDD713 /* ASNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FC85DD1CE29AB700EDD713 /* ASNavigationController.m */; }; + 68FC85E21CE29B7E00EDD713 /* ASTabBarController.h in Headers */ = {isa = PBXBuildFile; fileRef = 68FC85E01CE29B7E00EDD713 /* ASTabBarController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 68FC85E31CE29B7E00EDD713 /* ASTabBarController.h in Headers */ = {isa = PBXBuildFile; fileRef = 68FC85E01CE29B7E00EDD713 /* ASTabBarController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 68FC85E41CE29B7E00EDD713 /* ASTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FC85E11CE29B7E00EDD713 /* ASTabBarController.m */; }; + 68FC85E51CE29B7E00EDD713 /* ASTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FC85E11CE29B7E00EDD713 /* ASTabBarController.m */; }; + 68FC85E61CE29B9400EDD713 /* ASNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FC85DD1CE29AB700EDD713 /* ASNavigationController.m */; }; + 68FC85E91CE29C7D00EDD713 /* ASVisibilityProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = 68FC85E71CE29C7D00EDD713 /* ASVisibilityProtocols.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 68FC85EA1CE29C7D00EDD713 /* ASVisibilityProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = 68FC85E71CE29C7D00EDD713 /* ASVisibilityProtocols.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 68FC85EB1CE29C7D00EDD713 /* ASVisibilityProtocols.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FC85E81CE29C7D00EDD713 /* ASVisibilityProtocols.m */; }; + 68FC85EC1CE29C7D00EDD713 /* ASVisibilityProtocols.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FC85E81CE29C7D00EDD713 /* ASVisibilityProtocols.m */; }; + 697B315A1CFE4B410049936F /* ASEditableTextNodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 697B31591CFE4B410049936F /* ASEditableTextNodeTests.m */; }; + 697C0DE31CF38F28001DE0D4 /* ASLayoutValidation.h in Headers */ = {isa = PBXBuildFile; fileRef = 697C0DE11CF38F28001DE0D4 /* ASLayoutValidation.h */; }; + 697C0DE41CF38F28001DE0D4 /* ASLayoutValidation.h in Headers */ = {isa = PBXBuildFile; fileRef = 697C0DE11CF38F28001DE0D4 /* ASLayoutValidation.h */; }; + 697C0DE51CF38F28001DE0D4 /* ASLayoutValidation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 697C0DE21CF38F28001DE0D4 /* ASLayoutValidation.mm */; }; + 697C0DE61CF38F28001DE0D4 /* ASLayoutValidation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 697C0DE21CF38F28001DE0D4 /* ASLayoutValidation.mm */; }; 698548631CA9E025008A345F /* ASEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = 698548611CA9E025008A345F /* ASEnvironment.h */; settings = {ATTRIBUTES = (Public, ); }; }; 698548641CA9E025008A345F /* ASEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = 698548611CA9E025008A345F /* ASEnvironment.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 698548651CA9E025008A345F /* ASEnvironment.m in Sources */ = {isa = PBXBuildFile; fileRef = 698548621CA9E025008A345F /* ASEnvironment.m */; }; - 698548661CA9E025008A345F /* ASEnvironment.m in Sources */ = {isa = PBXBuildFile; fileRef = 698548621CA9E025008A345F /* ASEnvironment.m */; }; 698C8B611CAB49FC0052DC3F /* ASLayoutableExtensibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 698C8B601CAB49FC0052DC3F /* ASLayoutableExtensibility.h */; settings = {ATTRIBUTES = (Public, ); }; }; 698C8B621CAB49FC0052DC3F /* ASLayoutableExtensibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 698C8B601CAB49FC0052DC3F /* ASLayoutableExtensibility.h */; settings = {ATTRIBUTES = (Public, ); }; }; 69CB62AB1CB8165900024920 /* _ASDisplayViewAccessiblity.h in Headers */ = {isa = PBXBuildFile; fileRef = 69CB62A91CB8165900024920 /* _ASDisplayViewAccessiblity.h */; }; @@ -304,6 +316,22 @@ 7AB338691C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7AB338681C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm */; }; 81EE384F1C8E94F000456208 /* ASRunLoopQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 81EE384D1C8E94F000456208 /* ASRunLoopQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; 81EE38501C8E94F000456208 /* ASRunLoopQueue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 81EE384E1C8E94F000456208 /* ASRunLoopQueue.mm */; }; + 8B0768B31CE752EC002E1453 /* ASDefaultPlaybackButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0768B11CE752EC002E1453 /* ASDefaultPlaybackButton.h */; }; + 8B0768B41CE752EC002E1453 /* ASDefaultPlaybackButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B0768B21CE752EC002E1453 /* ASDefaultPlaybackButton.m */; }; + 8BBBAB8C1CEBAF1700107FC6 /* ASDefaultPlaybackButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B0768B11CE752EC002E1453 /* ASDefaultPlaybackButton.h */; }; + 8BBBAB8D1CEBAF1E00107FC6 /* ASDefaultPlaybackButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B0768B21CE752EC002E1453 /* ASDefaultPlaybackButton.m */; }; + 8BDA5FC51CDBDDE1007D13B2 /* ASVideoPlayerNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BDA5FC31CDBDDE1007D13B2 /* ASVideoPlayerNode.h */; }; + 8BDA5FC61CDBDDE1007D13B2 /* ASVideoPlayerNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8BDA5FC41CDBDDE1007D13B2 /* ASVideoPlayerNode.mm */; }; + 8BDA5FC71CDBDF91007D13B2 /* ASVideoPlayerNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BDA5FC31CDBDDE1007D13B2 /* ASVideoPlayerNode.h */; }; + 8BDA5FC81CDBDF95007D13B2 /* ASVideoPlayerNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8BDA5FC41CDBDDE1007D13B2 /* ASVideoPlayerNode.mm */; }; + 92074A611CC8BA1900918F75 /* ASImageNode+tvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 92074A5F1CC8BA1900918F75 /* ASImageNode+tvOS.h */; }; + 92074A621CC8BA1900918F75 /* ASImageNode+tvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 92074A5F1CC8BA1900918F75 /* ASImageNode+tvOS.h */; }; + 92074A631CC8BA1900918F75 /* ASImageNode+tvOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 92074A601CC8BA1900918F75 /* ASImageNode+tvOS.m */; }; + 92074A641CC8BA1900918F75 /* ASImageNode+tvOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 92074A601CC8BA1900918F75 /* ASImageNode+tvOS.m */; }; + 92074A671CC8BADA00918F75 /* ASControlNode+tvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 92074A651CC8BADA00918F75 /* ASControlNode+tvOS.h */; }; + 92074A681CC8BADA00918F75 /* ASControlNode+tvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 92074A651CC8BADA00918F75 /* ASControlNode+tvOS.h */; }; + 92074A691CC8BADA00918F75 /* ASControlNode+tvOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 92074A661CC8BADA00918F75 /* ASControlNode+tvOS.m */; }; + 92074A6A1CC8BADA00918F75 /* ASControlNode+tvOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 92074A661CC8BADA00918F75 /* ASControlNode+tvOS.m */; }; 92DD2FE31BF4B97E0074C9DD /* ASMapNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 92DD2FE11BF4B97E0074C9DD /* ASMapNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; 92DD2FE41BF4B97E0074C9DD /* ASMapNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 92DD2FE21BF4B97E0074C9DD /* ASMapNode.mm */; }; 92DD2FE61BF4D05E0074C9DD /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92DD2FE51BF4D05E0074C9DD /* MapKit.framework */; }; @@ -321,6 +349,18 @@ 9C55866C1BD54A3000B50E3A /* ASAsciiArtBoxCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C5586671BD549CB00B50E3A /* ASAsciiArtBoxCreator.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9C6BB3B21B8CC9C200F13F52 /* ASStaticLayoutable.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C6BB3B01B8CC9C200F13F52 /* ASStaticLayoutable.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9C6BB3B31B8CC9C200F13F52 /* ASStaticLayoutable.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C6BB3B01B8CC9C200F13F52 /* ASStaticLayoutable.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9C70F2031CDA4EFA007D6C76 /* ASTraitCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C70F2011CDA4EFA007D6C76 /* ASTraitCollection.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9C70F2041CDA4EFA007D6C76 /* ASTraitCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C70F2021CDA4EFA007D6C76 /* ASTraitCollection.m */; }; + 9C70F2051CDA4F06007D6C76 /* ASTraitCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C70F2021CDA4EFA007D6C76 /* ASTraitCollection.m */; }; + 9C70F2061CDA4F0C007D6C76 /* ASTraitCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C70F2011CDA4EFA007D6C76 /* ASTraitCollection.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9C70F2081CDAA3C6007D6C76 /* ASEnvironment.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9CFFC6BD1CCAC52B006A6476 /* ASEnvironment.mm */; }; + 9C70F2091CDABA36007D6C76 /* ASViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9CFFC6BF1CCAC73C006A6476 /* ASViewController.mm */; }; + 9C70F20A1CDBE949007D6C76 /* ASTableNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9CFFC6C11CCAC768006A6476 /* ASTableNode.mm */; }; + 9C70F20B1CDBE9A4007D6C76 /* ASDataController+Subclasses.h in Headers */ = {isa = PBXBuildFile; fileRef = 251B8EF61BBB3D690087C538 /* ASDataController+Subclasses.h */; }; + 9C70F20C1CDBE9B6007D6C76 /* ASCollectionDataController.h in Headers */ = {isa = PBXBuildFile; fileRef = 251B8EF21BBB3D690087C538 /* ASCollectionDataController.h */; }; + 9C70F20D1CDBE9CB007D6C76 /* ASDefaultPlayButton.h in Headers */ = {isa = PBXBuildFile; fileRef = AEB7B0181C5962EA00662EF4 /* ASDefaultPlayButton.h */; }; + 9C70F20E1CDBE9E5007D6C76 /* NSArray+Diffing.h in Headers */ = {isa = PBXBuildFile; fileRef = DBC452D91C5BF64600B16017 /* NSArray+Diffing.h */; }; + 9C70F20F1CDBE9FF007D6C76 /* ASLayoutManager.h in Headers */ = {isa = PBXBuildFile; fileRef = B30BF6501C5964B0004FCD53 /* ASLayoutManager.h */; }; 9C8221951BA237B80037F19A /* ASStackBaselinePositionedLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C8221931BA237B80037F19A /* ASStackBaselinePositionedLayout.h */; }; 9C8221961BA237B80037F19A /* ASStackBaselinePositionedLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C8221931BA237B80037F19A /* ASStackBaselinePositionedLayout.h */; }; 9C8221971BA237B80037F19A /* ASStackBaselinePositionedLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9C8221941BA237B80037F19A /* ASStackBaselinePositionedLayout.mm */; }; @@ -330,7 +370,12 @@ 9C8898BD1C738BB800D6B02E /* ASTextKitFontSizeAdjuster.h in Headers */ = {isa = PBXBuildFile; fileRef = A32FEDD31C501B6A004F642A /* ASTextKitFontSizeAdjuster.h */; }; 9CDC18CC1B910E12004965E2 /* ASLayoutablePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CDC18CB1B910E12004965E2 /* ASLayoutablePrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9CDC18CD1B910E12004965E2 /* ASLayoutablePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CDC18CB1B910E12004965E2 /* ASLayoutablePrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9CFFC6BE1CCAC52B006A6476 /* ASEnvironment.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9CFFC6BD1CCAC52B006A6476 /* ASEnvironment.mm */; }; + 9CFFC6C01CCAC73C006A6476 /* ASViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9CFFC6BF1CCAC73C006A6476 /* ASViewController.mm */; }; + 9CFFC6C21CCAC768006A6476 /* ASTableNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9CFFC6C11CCAC768006A6476 /* ASTableNode.mm */; }; 9F06E5CD1B4CAF4200F015D8 /* ASCollectionViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9F06E5CC1B4CAF4200F015D8 /* ASCollectionViewTests.m */; }; + A2763D791CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = A2763D771CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.h */; }; + A2763D7A1CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = A2763D771CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.h */; }; A32FEDD51C501B6A004F642A /* ASTextKitFontSizeAdjuster.h in Headers */ = {isa = PBXBuildFile; fileRef = A32FEDD31C501B6A004F642A /* ASTextKitFontSizeAdjuster.h */; settings = {ATTRIBUTES = (Public, ); }; }; A373200F1C571B730011FC94 /* ASTextNode+Beta.h in Headers */ = {isa = PBXBuildFile; fileRef = A373200E1C571B050011FC94 /* ASTextNode+Beta.h */; settings = {ATTRIBUTES = (Public, ); }; }; A37320101C571B740011FC94 /* ASTextNode+Beta.h in Headers */ = {isa = PBXBuildFile; fileRef = A373200E1C571B050011FC94 /* ASTextNode+Beta.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -347,14 +392,13 @@ AC3C4A511A1139C100143C57 /* ASCollectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = AC3C4A4F1A1139C100143C57 /* ASCollectionView.h */; settings = {ATTRIBUTES = (Public, ); }; }; AC3C4A521A1139C100143C57 /* ASCollectionView.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A501A1139C100143C57 /* ASCollectionView.mm */; }; AC3C4A541A113EEC00143C57 /* ASCollectionViewProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = AC3C4A531A113EEC00143C57 /* ASCollectionViewProtocols.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AC47D9421B3B891B00AAEE9D /* ASCellNode.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6456071B0A335000CF11B8 /* ASCellNode.m */; }; + AC47D9421B3B891B00AAEE9D /* ASCellNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC6456071B0A335000CF11B8 /* ASCellNode.mm */; }; AC47D9451B3BB41900AAEE9D /* ASRelativeSize.h in Headers */ = {isa = PBXBuildFile; fileRef = AC47D9431B3BB41900AAEE9D /* ASRelativeSize.h */; settings = {ATTRIBUTES = (Public, ); }; }; AC47D9461B3BB41900AAEE9D /* ASRelativeSize.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC47D9441B3BB41900AAEE9D /* ASRelativeSize.mm */; }; - AC6456091B0A335000CF11B8 /* ASCellNode.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6456071B0A335000CF11B8 /* ASCellNode.m */; }; + AC6456091B0A335000CF11B8 /* ASCellNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC6456071B0A335000CF11B8 /* ASCellNode.mm */; }; AC7A2C171BDE11DF0093FE1A /* ASTableViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = AC7A2C161BDE11DF0093FE1A /* ASTableViewInternal.h */; }; AC7A2C181BDE11DF0093FE1A /* ASTableViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = AC7A2C161BDE11DF0093FE1A /* ASTableViewInternal.h */; }; ACC945A91BA9E7A0005E1FB8 /* ASViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = ACC945A81BA9E7A0005E1FB8 /* ASViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - ACC945AB1BA9E7C1005E1FB8 /* ASViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ACC945AA1BA9E7C1005E1FB8 /* ASViewController.m */; }; ACF6ED1A1B17843500DA7C62 /* ASBackgroundLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED011B17843500DA7C62 /* ASBackgroundLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; }; ACF6ED1B1B17843500DA7C62 /* ASBackgroundLayoutSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED021B17843500DA7C62 /* ASBackgroundLayoutSpec.mm */; }; ACF6ED1C1B17843500DA7C62 /* ASCenterLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED031B17843500DA7C62 /* ASCenterLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -397,7 +441,6 @@ AEEC47E21C20C2DD00EC1693 /* ASVideoNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = AEEC47E01C20C2DD00EC1693 /* ASVideoNode.mm */; }; AEEC47E41C21D3D200EC1693 /* ASVideoNodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AEEC47E31C21D3D200EC1693 /* ASVideoNodeTests.m */; }; B0F8805A1BEAEC7500D17647 /* ASTableNode.h in Headers */ = {isa = PBXBuildFile; fileRef = B0F880581BEAEC7500D17647 /* ASTableNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B0F8805B1BEAEC7500D17647 /* ASTableNode.m in Sources */ = {isa = PBXBuildFile; fileRef = B0F880591BEAEC7500D17647 /* ASTableNode.m */; }; B13CA0F71C519E9400E031AB /* ASCollectionViewLayoutFacilitatorProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = B13CA0F61C519E9400E031AB /* ASCollectionViewLayoutFacilitatorProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; B13CA0F81C519EBA00E031AB /* ASCollectionViewLayoutFacilitatorProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = B13CA0F61C519E9400E031AB /* ASCollectionViewLayoutFacilitatorProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; B13CA1001C52004900E031AB /* ASCollectionNode+Beta.h in Headers */ = {isa = PBXBuildFile; fileRef = B13CA0FF1C52004900E031AB /* ASCollectionNode+Beta.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -491,7 +534,6 @@ B350625D1B0111740018CF92 /* Photos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051943141A1575670030A7D0 /* Photos.framework */; }; B350625E1B0111780018CF92 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051943121A1575630030A7D0 /* AssetsLibrary.framework */; }; B350625F1B0111800018CF92 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 058D09AF195D04C000B7D73C /* Foundation.framework */; }; - C78F7E2A1BF7808300CDEAFC /* ASTableNode.m in Sources */ = {isa = PBXBuildFile; fileRef = B0F880591BEAEC7500D17647 /* ASTableNode.m */; }; C78F7E2B1BF7809800CDEAFC /* ASTableNode.h in Headers */ = {isa = PBXBuildFile; fileRef = B0F880581BEAEC7500D17647 /* ASTableNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; CC3B20831C3F76D600798563 /* ASPendingStateController.h in Headers */ = {isa = PBXBuildFile; fileRef = CC3B20811C3F76D600798563 /* ASPendingStateController.h */; }; CC3B20841C3F76D600798563 /* ASPendingStateController.h in Headers */ = {isa = PBXBuildFile; fileRef = CC3B20811C3F76D600798563 /* ASPendingStateController.h */; }; @@ -503,6 +545,7 @@ CC3B208C1C3F7A5400798563 /* ASWeakSet.m in Sources */ = {isa = PBXBuildFile; fileRef = CC3B20881C3F7A5400798563 /* ASWeakSet.m */; }; CC3B208E1C3F7D0A00798563 /* ASWeakSetTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC3B208D1C3F7D0A00798563 /* ASWeakSetTests.m */; }; CC3B20901C3F892D00798563 /* ASBridgedPropertiesTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC3B208F1C3F892D00798563 /* ASBridgedPropertiesTests.mm */; }; + CC4981B31D1A02BE004E13CC /* ASTableViewThrashTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC4981B21D1A02BE004E13CC /* ASTableViewThrashTests.m */; }; CC7FD9DE1BB5E962005CCB2B /* ASPhotosFrameworkImageRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = CC7FD9DC1BB5E962005CCB2B /* ASPhotosFrameworkImageRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; CC7FD9DF1BB5E962005CCB2B /* ASPhotosFrameworkImageRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = CC7FD9DD1BB5E962005CCB2B /* ASPhotosFrameworkImageRequest.m */; }; CC7FD9E11BB5F750005CCB2B /* ASPhotosFrameworkImageRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC7FD9E01BB5F750005CCB2B /* ASPhotosFrameworkImageRequestTests.m */; }; @@ -526,8 +569,8 @@ DBDB83971C6E879900D0098C /* ASPagerFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = DBDB83931C6E879900D0098C /* ASPagerFlowLayout.m */; }; DE040EF91C2B40AC004692FF /* ASCollectionViewFlowLayoutInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 251B8EF41BBB3D690087C538 /* ASCollectionViewFlowLayoutInspector.h */; settings = {ATTRIBUTES = (Public, ); }; }; DE0702FC1C3671E900D7DE62 /* libAsyncDisplayKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 058D09AC195D04C000B7D73C /* libAsyncDisplayKit.a */; }; - DE4843DB1C93EAB100A1F33B /* ASDisplayNodeLayoutContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = E52405B21C8FEF03004DC8E7 /* ASDisplayNodeLayoutContext.mm */; }; - DE4843DC1C93EAC100A1F33B /* ASDisplayNodeLayoutContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E52405B41C8FEF16004DC8E7 /* ASDisplayNodeLayoutContext.h */; }; + DE4843DB1C93EAB100A1F33B /* ASLayoutTransition.mm in Sources */ = {isa = PBXBuildFile; fileRef = E52405B21C8FEF03004DC8E7 /* ASLayoutTransition.mm */; }; + DE4843DC1C93EAC100A1F33B /* ASLayoutTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = E52405B41C8FEF16004DC8E7 /* ASLayoutTransition.h */; }; DE6EA3221C14000600183B10 /* ASDisplayNode+FrameworkPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = DE6EA3211C14000600183B10 /* ASDisplayNode+FrameworkPrivate.h */; }; DE6EA3231C14000600183B10 /* ASDisplayNode+FrameworkPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = DE6EA3211C14000600183B10 /* ASDisplayNode+FrameworkPrivate.h */; }; DE84918D1C8FFF2B003D89E9 /* ASRunLoopQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 81EE384D1C8E94F000456208 /* ASRunLoopQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -544,14 +587,15 @@ DECBD6E81BE56E1900CF4905 /* ASButtonNode.h in Headers */ = {isa = PBXBuildFile; fileRef = DECBD6E51BE56E1900CF4905 /* ASButtonNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; DECBD6E91BE56E1900CF4905 /* ASButtonNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = DECBD6E61BE56E1900CF4905 /* ASButtonNode.mm */; }; DECBD6EA1BE56E1900CF4905 /* ASButtonNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = DECBD6E61BE56E1900CF4905 /* ASButtonNode.mm */; }; - E52405B31C8FEF03004DC8E7 /* ASDisplayNodeLayoutContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = E52405B21C8FEF03004DC8E7 /* ASDisplayNodeLayoutContext.mm */; }; - E52405B51C8FEF16004DC8E7 /* ASDisplayNodeLayoutContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E52405B41C8FEF16004DC8E7 /* ASDisplayNodeLayoutContext.h */; }; + DEFAD8131CC48914000527C4 /* ASVideoNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = AEEC47E01C20C2DD00EC1693 /* ASVideoNode.mm */; }; + E52405B31C8FEF03004DC8E7 /* ASLayoutTransition.mm in Sources */ = {isa = PBXBuildFile; fileRef = E52405B21C8FEF03004DC8E7 /* ASLayoutTransition.mm */; }; + E52405B51C8FEF16004DC8E7 /* ASLayoutTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = E52405B41C8FEF16004DC8E7 /* ASLayoutTransition.h */; }; E55D86321CA8A14000A0C26F /* ASLayoutable.mm in Sources */ = {isa = PBXBuildFile; fileRef = E55D86311CA8A14000A0C26F /* ASLayoutable.mm */; }; E55D86331CA8A14000A0C26F /* ASLayoutable.mm in Sources */ = {isa = PBXBuildFile; fileRef = E55D86311CA8A14000A0C26F /* ASLayoutable.mm */; }; E5711A2B1C840C81009619D4 /* ASIndexedNodeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E5711A2A1C840C81009619D4 /* ASIndexedNodeContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; E5711A2C1C840C81009619D4 /* ASIndexedNodeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E5711A2A1C840C81009619D4 /* ASIndexedNodeContext.h */; }; - E5711A2E1C840C96009619D4 /* ASIndexedNodeContext.m in Sources */ = {isa = PBXBuildFile; fileRef = E5711A2D1C840C96009619D4 /* ASIndexedNodeContext.m */; }; - E5711A301C840C96009619D4 /* ASIndexedNodeContext.m in Sources */ = {isa = PBXBuildFile; fileRef = E5711A2D1C840C96009619D4 /* ASIndexedNodeContext.m */; }; + E5711A2E1C840C96009619D4 /* ASIndexedNodeContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = E5711A2D1C840C96009619D4 /* ASIndexedNodeContext.mm */; }; + E5711A301C840C96009619D4 /* ASIndexedNodeContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = E5711A2D1C840C96009619D4 /* ASIndexedNodeContext.mm */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -740,7 +784,7 @@ 257754BB1BEE458E00737CA5 /* ASTextKitCoreTextAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTextKitCoreTextAdditions.h; path = TextKit/ASTextKitCoreTextAdditions.h; sourceTree = ""; }; 257754BC1BEE458E00737CA5 /* ASTextNodeTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTextNodeTypes.h; path = TextKit/ASTextNodeTypes.h; sourceTree = ""; }; 257754BD1BEE458E00737CA5 /* ASTextNodeWordKerner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASTextNodeWordKerner.m; path = TextKit/ASTextNodeWordKerner.m; sourceTree = ""; }; - 25E327541C16819500A2170C /* ASPagerNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ASPagerNode.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 25E327541C16819500A2170C /* ASPagerNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ASPagerNode.h; sourceTree = ""; }; 25E327551C16819500A2170C /* ASPagerNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ASPagerNode.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 2911485B1A77147A005D0878 /* ASControlNodeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASControlNodeTests.m; sourceTree = ""; }; 292C59991A956527007E5DD6 /* ASLayoutRangeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutRangeType.h; sourceTree = ""; }; @@ -758,7 +802,6 @@ 4640521B1A3F83C40061C0BA /* ASFlowLayoutController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASFlowLayoutController.h; sourceTree = ""; }; 4640521C1A3F83C40061C0BA /* ASFlowLayoutController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASFlowLayoutController.mm; sourceTree = ""; }; 4640521D1A3F83C40061C0BA /* ASLayoutController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutController.h; sourceTree = ""; }; - 68355B2D1CB5799E001D4E68 /* ASImageNode+AnimatedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASImageNode+AnimatedImage.h"; sourceTree = ""; }; 68355B2E1CB5799E001D4E68 /* ASImageNode+AnimatedImage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "ASImageNode+AnimatedImage.mm"; sourceTree = ""; }; 68355B361CB57A5A001D4E68 /* ASPINRemoteImageDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASPINRemoteImageDownloader.m; sourceTree = ""; }; 68355B371CB57A5A001D4E68 /* ASImageContainerProtocolCategories.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASImageContainerProtocolCategories.h; sourceTree = ""; }; @@ -770,8 +813,16 @@ 68B8A4E01CBDB958007E4543 /* ASWeakProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASWeakProxy.m; sourceTree = ""; }; 68EE0DBB1C1B4ED300BA1B99 /* ASMainSerialQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASMainSerialQueue.h; sourceTree = ""; }; 68EE0DBC1C1B4ED300BA1B99 /* ASMainSerialQueue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASMainSerialQueue.mm; sourceTree = ""; }; + 68FC85DC1CE29AB700EDD713 /* ASNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASNavigationController.h; sourceTree = ""; }; + 68FC85DD1CE29AB700EDD713 /* ASNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASNavigationController.m; sourceTree = ""; }; + 68FC85E01CE29B7E00EDD713 /* ASTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTabBarController.h; sourceTree = ""; }; + 68FC85E11CE29B7E00EDD713 /* ASTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASTabBarController.m; sourceTree = ""; }; + 68FC85E71CE29C7D00EDD713 /* ASVisibilityProtocols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASVisibilityProtocols.h; sourceTree = ""; }; + 68FC85E81CE29C7D00EDD713 /* ASVisibilityProtocols.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASVisibilityProtocols.m; sourceTree = ""; }; + 697B31591CFE4B410049936F /* ASEditableTextNodeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASEditableTextNodeTests.m; sourceTree = ""; }; + 697C0DE11CF38F28001DE0D4 /* ASLayoutValidation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayoutValidation.h; path = AsyncDisplayKit/Layout/ASLayoutValidation.h; sourceTree = ""; }; + 697C0DE21CF38F28001DE0D4 /* ASLayoutValidation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASLayoutValidation.mm; path = AsyncDisplayKit/Layout/ASLayoutValidation.mm; sourceTree = ""; }; 698548611CA9E025008A345F /* ASEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASEnvironment.h; sourceTree = ""; }; - 698548621CA9E025008A345F /* ASEnvironment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASEnvironment.m; sourceTree = ""; }; 698C8B601CAB49FC0052DC3F /* ASLayoutableExtensibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayoutableExtensibility.h; path = AsyncDisplayKit/Layout/ASLayoutableExtensibility.h; sourceTree = ""; }; 69CB62A91CB8165900024920 /* _ASDisplayViewAccessiblity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _ASDisplayViewAccessiblity.h; sourceTree = ""; }; 69CB62AA1CB8165900024920 /* _ASDisplayViewAccessiblity.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _ASDisplayViewAccessiblity.mm; sourceTree = ""; }; @@ -786,6 +837,14 @@ 7AB338681C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASRelativeLayoutSpecSnapshotTests.mm; sourceTree = ""; }; 81EE384D1C8E94F000456208 /* ASRunLoopQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASRunLoopQueue.h; path = ../ASRunLoopQueue.h; sourceTree = ""; }; 81EE384E1C8E94F000456208 /* ASRunLoopQueue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASRunLoopQueue.mm; path = ../ASRunLoopQueue.mm; sourceTree = ""; }; + 8B0768B11CE752EC002E1453 /* ASDefaultPlaybackButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDefaultPlaybackButton.h; sourceTree = ""; }; + 8B0768B21CE752EC002E1453 /* ASDefaultPlaybackButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASDefaultPlaybackButton.m; sourceTree = ""; }; + 8BDA5FC31CDBDDE1007D13B2 /* ASVideoPlayerNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASVideoPlayerNode.h; sourceTree = ""; }; + 8BDA5FC41CDBDDE1007D13B2 /* ASVideoPlayerNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASVideoPlayerNode.mm; sourceTree = ""; }; + 92074A5F1CC8BA1900918F75 /* ASImageNode+tvOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASImageNode+tvOS.h"; sourceTree = ""; }; + 92074A601CC8BA1900918F75 /* ASImageNode+tvOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASImageNode+tvOS.m"; sourceTree = ""; }; + 92074A651CC8BADA00918F75 /* ASControlNode+tvOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASControlNode+tvOS.h"; sourceTree = ""; }; + 92074A661CC8BADA00918F75 /* ASControlNode+tvOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASControlNode+tvOS.m"; sourceTree = ""; }; 92DD2FE11BF4B97E0074C9DD /* ASMapNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASMapNode.h; sourceTree = ""; }; 92DD2FE21BF4B97E0074C9DD /* ASMapNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASMapNode.mm; sourceTree = ""; }; 92DD2FE51BF4D05E0074C9DD /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; @@ -793,11 +852,18 @@ 9C5586671BD549CB00B50E3A /* ASAsciiArtBoxCreator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASAsciiArtBoxCreator.h; path = AsyncDisplayKit/Layout/ASAsciiArtBoxCreator.h; sourceTree = ""; }; 9C5586681BD549CB00B50E3A /* ASAsciiArtBoxCreator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASAsciiArtBoxCreator.m; path = AsyncDisplayKit/Layout/ASAsciiArtBoxCreator.m; sourceTree = ""; }; 9C6BB3B01B8CC9C200F13F52 /* ASStaticLayoutable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASStaticLayoutable.h; path = AsyncDisplayKit/Layout/ASStaticLayoutable.h; sourceTree = ""; }; + 9C70F2011CDA4EFA007D6C76 /* ASTraitCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTraitCollection.h; sourceTree = ""; }; + 9C70F2021CDA4EFA007D6C76 /* ASTraitCollection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASTraitCollection.m; sourceTree = ""; }; 9C8221931BA237B80037F19A /* ASStackBaselinePositionedLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackBaselinePositionedLayout.h; sourceTree = ""; }; 9C8221941BA237B80037F19A /* ASStackBaselinePositionedLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASStackBaselinePositionedLayout.mm; sourceTree = ""; }; 9C8898BA1C738B9800D6B02E /* ASTextKitFontSizeAdjuster.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASTextKitFontSizeAdjuster.mm; path = TextKit/ASTextKitFontSizeAdjuster.mm; sourceTree = ""; }; 9CDC18CB1B910E12004965E2 /* ASLayoutablePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayoutablePrivate.h; path = AsyncDisplayKit/Layout/ASLayoutablePrivate.h; sourceTree = ""; }; + 9CFFC6BD1CCAC52B006A6476 /* ASEnvironment.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASEnvironment.mm; sourceTree = ""; }; + 9CFFC6BF1CCAC73C006A6476 /* ASViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASViewController.mm; sourceTree = ""; }; + 9CFFC6C11CCAC768006A6476 /* ASTableNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASTableNode.mm; sourceTree = ""; }; 9F06E5CC1B4CAF4200F015D8 /* ASCollectionViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ASCollectionViewTests.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + A2763D771CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASPINRemoteImageDownloader.h; path = Details/ASPINRemoteImageDownloader.h; sourceTree = ""; }; + A2763D781CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASPINRemoteImageDownloader.m; path = Details/ASPINRemoteImageDownloader.m; sourceTree = ""; }; A32FEDD31C501B6A004F642A /* ASTextKitFontSizeAdjuster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTextKitFontSizeAdjuster.h; path = TextKit/ASTextKitFontSizeAdjuster.h; sourceTree = ""; }; A373200E1C571B050011FC94 /* ASTextNode+Beta.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ASTextNode+Beta.h"; sourceTree = ""; }; AC026B571BD3F61800BBC17E /* ASStaticLayoutSpecSnapshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASStaticLayoutSpecSnapshotTests.m; sourceTree = ""; }; @@ -811,10 +877,9 @@ AC3C4A531A113EEC00143C57 /* ASCollectionViewProtocols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCollectionViewProtocols.h; sourceTree = ""; }; AC47D9431B3BB41900AAEE9D /* ASRelativeSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASRelativeSize.h; path = AsyncDisplayKit/Layout/ASRelativeSize.h; sourceTree = ""; }; AC47D9441B3BB41900AAEE9D /* ASRelativeSize.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASRelativeSize.mm; path = AsyncDisplayKit/Layout/ASRelativeSize.mm; sourceTree = ""; }; - AC6456071B0A335000CF11B8 /* ASCellNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASCellNode.m; sourceTree = ""; }; + AC6456071B0A335000CF11B8 /* ASCellNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASCellNode.mm; sourceTree = ""; }; AC7A2C161BDE11DF0093FE1A /* ASTableViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTableViewInternal.h; sourceTree = ""; }; ACC945A81BA9E7A0005E1FB8 /* ASViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASViewController.h; sourceTree = ""; }; - ACC945AA1BA9E7C1005E1FB8 /* ASViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASViewController.m; sourceTree = ""; }; ACF6ED011B17843500DA7C62 /* ASBackgroundLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASBackgroundLayoutSpec.h; path = AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.h; sourceTree = ""; }; ACF6ED021B17843500DA7C62 /* ASBackgroundLayoutSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASBackgroundLayoutSpec.mm; path = AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.mm; sourceTree = ""; }; ACF6ED031B17843500DA7C62 /* ASCenterLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASCenterLayoutSpec.h; path = AsyncDisplayKit/Layout/ASCenterLayoutSpec.h; sourceTree = ""; }; @@ -858,19 +923,20 @@ AEEC47E01C20C2DD00EC1693 /* ASVideoNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASVideoNode.mm; sourceTree = ""; }; AEEC47E31C21D3D200EC1693 /* ASVideoNodeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASVideoNodeTests.m; sourceTree = ""; }; B0F880581BEAEC7500D17647 /* ASTableNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTableNode.h; sourceTree = ""; }; - B0F880591BEAEC7500D17647 /* ASTableNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASTableNode.m; sourceTree = ""; }; B13CA0F61C519E9400E031AB /* ASCollectionViewLayoutFacilitatorProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCollectionViewLayoutFacilitatorProtocol.h; sourceTree = ""; }; B13CA0FF1C52004900E031AB /* ASCollectionNode+Beta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASCollectionNode+Beta.h"; sourceTree = ""; }; B30BF6501C5964B0004FCD53 /* ASLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayoutManager.h; path = TextKit/ASLayoutManager.h; sourceTree = ""; }; B30BF6511C5964B0004FCD53 /* ASLayoutManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASLayoutManager.m; path = TextKit/ASLayoutManager.m; sourceTree = ""; }; B35061DA1B010EDF0018CF92 /* AsyncDisplayKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AsyncDisplayKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B35061DD1B010EDF0018CF92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = "../AsyncDisplayKit-iOS/Info.plist"; sourceTree = ""; }; + BDC2D162BD55A807C1475DA5 /* Pods-AsyncDisplayKitTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AsyncDisplayKitTests.profile.xcconfig"; path = "Pods/Target Support Files/Pods-AsyncDisplayKitTests/Pods-AsyncDisplayKitTests.profile.xcconfig"; sourceTree = ""; }; CC3B20811C3F76D600798563 /* ASPendingStateController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASPendingStateController.h; sourceTree = ""; }; CC3B20821C3F76D600798563 /* ASPendingStateController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASPendingStateController.mm; sourceTree = ""; }; CC3B20871C3F7A5400798563 /* ASWeakSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASWeakSet.h; sourceTree = ""; }; CC3B20881C3F7A5400798563 /* ASWeakSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASWeakSet.m; sourceTree = ""; }; CC3B208D1C3F7D0A00798563 /* ASWeakSetTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASWeakSetTests.m; sourceTree = ""; }; CC3B208F1C3F892D00798563 /* ASBridgedPropertiesTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASBridgedPropertiesTests.mm; sourceTree = ""; }; + CC4981B21D1A02BE004E13CC /* ASTableViewThrashTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASTableViewThrashTests.m; sourceTree = ""; }; CC7FD9DC1BB5E962005CCB2B /* ASPhotosFrameworkImageRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASPhotosFrameworkImageRequest.h; sourceTree = ""; }; CC7FD9DD1BB5E962005CCB2B /* ASPhotosFrameworkImageRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASPhotosFrameworkImageRequest.m; sourceTree = ""; }; CC7FD9E01BB5F750005CCB2B /* ASPhotosFrameworkImageRequestTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASPhotosFrameworkImageRequestTests.m; sourceTree = ""; }; @@ -893,11 +959,11 @@ DEC146B51C37A16A004A0EE7 /* ASCollectionInternal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ASCollectionInternal.m; path = Details/ASCollectionInternal.m; sourceTree = ""; }; DECBD6E51BE56E1900CF4905 /* ASButtonNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASButtonNode.h; sourceTree = ""; }; DECBD6E61BE56E1900CF4905 /* ASButtonNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASButtonNode.mm; sourceTree = ""; }; - E52405B21C8FEF03004DC8E7 /* ASDisplayNodeLayoutContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASDisplayNodeLayoutContext.mm; sourceTree = ""; }; - E52405B41C8FEF16004DC8E7 /* ASDisplayNodeLayoutContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDisplayNodeLayoutContext.h; sourceTree = ""; }; + E52405B21C8FEF03004DC8E7 /* ASLayoutTransition.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASLayoutTransition.mm; sourceTree = ""; }; + E52405B41C8FEF16004DC8E7 /* ASLayoutTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutTransition.h; sourceTree = ""; }; E55D86311CA8A14000A0C26F /* ASLayoutable.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASLayoutable.mm; path = AsyncDisplayKit/Layout/ASLayoutable.mm; sourceTree = ""; }; E5711A2A1C840C81009619D4 /* ASIndexedNodeContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIndexedNodeContext.h; sourceTree = ""; }; - E5711A2D1C840C96009619D4 /* ASIndexedNodeContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASIndexedNodeContext.m; sourceTree = ""; }; + E5711A2D1C840C96009619D4 /* ASIndexedNodeContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASIndexedNodeContext.mm; sourceTree = ""; }; EFA731F0396842FF8AB635EE /* libPods-AsyncDisplayKitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AsyncDisplayKitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; FB07EABBCF28656C6297BC2D /* Pods-AsyncDisplayKitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AsyncDisplayKitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AsyncDisplayKitTests/Pods-AsyncDisplayKitTests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -1021,8 +1087,10 @@ 92DD2FE21BF4B97E0074C9DD /* ASMapNode.mm */, AEEC47DF1C20C2DD00EC1693 /* ASVideoNode.h */, AEEC47E01C20C2DD00EC1693 /* ASVideoNode.mm */, + 8BDA5FC31CDBDDE1007D13B2 /* ASVideoPlayerNode.h */, + 8BDA5FC41CDBDDE1007D13B2 /* ASVideoPlayerNode.mm */, 055F1A3A19ABD43F004DAFF1 /* ASCellNode.h */, - AC6456071B0A335000CF11B8 /* ASCellNode.m */, + AC6456071B0A335000CF11B8 /* ASCellNode.mm */, 18C2ED7C1B9B7DE800F627B3 /* ASCollectionNode.h */, 18C2ED7D1B9B7DE800F627B3 /* ASCollectionNode.mm */, B13CA0FF1C52004900E031AB /* ASCollectionNode+Beta.h */, @@ -1047,18 +1115,23 @@ 0587F9BC1A7309ED00AFF0BA /* ASEditableTextNode.mm */, 058D09DD195D050800B7D73C /* ASImageNode.h */, 058D09DE195D050800B7D73C /* ASImageNode.mm */, - 68355B2D1CB5799E001D4E68 /* ASImageNode+AnimatedImage.h */, 68355B2E1CB5799E001D4E68 /* ASImageNode+AnimatedImage.mm */, 0516FA3E1A1563D200B4EBED /* ASMultiplexImageNode.h */, 0516FA3F1A1563D200B4EBED /* ASMultiplexImageNode.mm */, + 68FC85DC1CE29AB700EDD713 /* ASNavigationController.h */, + 68FC85DD1CE29AB700EDD713 /* ASNavigationController.m */, 055B9FA61A1C154B00035D6D /* ASNetworkImageNode.h */, 055B9FA71A1C154B00035D6D /* ASNetworkImageNode.mm */, 25E327541C16819500A2170C /* ASPagerNode.h */, 25E327551C16819500A2170C /* ASPagerNode.m */, + A2763D771CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.h */, + A2763D781CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.m */, D785F6601A74327E00291744 /* ASScrollNode.h */, D785F6611A74327E00291744 /* ASScrollNode.m */, + 68FC85E01CE29B7E00EDD713 /* ASTabBarController.h */, + 68FC85E11CE29B7E00EDD713 /* ASTabBarController.m */, B0F880581BEAEC7500D17647 /* ASTableNode.h */, - B0F880591BEAEC7500D17647 /* ASTableNode.m */, + 9CFFC6C11CCAC768006A6476 /* ASTableNode.mm */, 055F1A3219ABD3E3004DAFF1 /* ASTableView.h */, 055F1A3319ABD3E3004DAFF1 /* ASTableView.mm */, AC7A2C161BDE11DF0093FE1A /* ASTableViewInternal.h */, @@ -1067,11 +1140,14 @@ A373200E1C571B050011FC94 /* ASTextNode+Beta.h */, 058D09E0195D050800B7D73C /* ASTextNode.mm */, ACC945A81BA9E7A0005E1FB8 /* ASViewController.h */, - ACC945AA1BA9E7C1005E1FB8 /* ASViewController.m */, + 9CFFC6BF1CCAC73C006A6476 /* ASViewController.mm */, 6BDC61F51978FEA400E50D21 /* AsyncDisplayKit.h */, 764D83D21C8EA515009B4FB8 /* AsyncDisplayKit+Debug.h */, 764D83D31C8EA515009B4FB8 /* AsyncDisplayKit+Debug.m */, DB55C2651C641AE4004EDCF5 /* ASContextTransitioning.h */, + 68FC85E71CE29C7D00EDD713 /* ASVisibilityProtocols.h */, + 68FC85E81CE29C7D00EDD713 /* ASVisibilityProtocols.m */, + 92074A5E1CC8B9DD00918F75 /* tvOS */, 058D09E1195D050800B7D73C /* Details */, 058D0A01195D050800B7D73C /* Private */, AC6456051B0A333200CF11B8 /* Layout */, @@ -1123,9 +1199,11 @@ 058D0A2F195D057000B7D73C /* ASDisplayNodeTests.m */, 058D0A30195D057000B7D73C /* ASDisplayNodeTestsHelper.h */, 058D0A31195D057000B7D73C /* ASDisplayNodeTestsHelper.m */, + 697B31591CFE4B410049936F /* ASEditableTextNodeTests.m */, 052EE0651A159FEF002C6279 /* ASMultiplexImageNodeTests.m */, 058D0A32195D057000B7D73C /* ASMutableAttributedStringBuilderTests.m */, 3C9C128419E616EF00E942A0 /* ASTableViewTests.m */, + CC4981B21D1A02BE004E13CC /* ASTableViewThrashTests.m */, 058D0A33195D057000B7D73C /* ASTextKitCoreTextAdditionsTests.m */, 254C6B511BF8FE6D003EC431 /* ASTextKitTruncationTests.mm */, 254C6B531BF8FF2A003EC431 /* ASTextKitTests.mm */, @@ -1151,6 +1229,7 @@ 058D09E1195D050800B7D73C /* Details */ = { isa = PBXGroup; children = ( + 9CFFC6BD1CCAC52B006A6476 /* ASEnvironment.mm */, 058D09E2195D050800B7D73C /* _ASDisplayLayer.h */, 058D09E3195D050800B7D73C /* _ASDisplayLayer.mm */, 058D09E4195D050800B7D73C /* _ASDisplayView.h */, @@ -1171,7 +1250,6 @@ 05A6D05819D0EB64002DD95E /* ASDealloc2MainObject.h */, 05A6D05919D0EB64002DD95E /* ASDealloc2MainObject.m */, 698548611CA9E025008A345F /* ASEnvironment.h */, - 698548621CA9E025008A345F /* ASEnvironment.m */, 4640521B1A3F83C40061C0BA /* ASFlowLayoutController.h */, 4640521C1A3F83C40061C0BA /* ASFlowLayoutController.mm */, 058D09E6195D050800B7D73C /* ASHighlightOverlayLayer.h */, @@ -1210,6 +1288,8 @@ 205F0E0D1B371875007741D0 /* UICollectionViewLayout+ASConvenience.h */, 205F0E0E1B371875007741D0 /* UICollectionViewLayout+ASConvenience.m */, 058D09FF195D050800B7D73C /* UIView+ASConvenience.h */, + 9C70F2011CDA4EFA007D6C76 /* ASTraitCollection.h */, + 9C70F2021CDA4EFA007D6C76 /* ASTraitCollection.m */, ); path = Details; sourceTree = ""; @@ -1252,8 +1332,8 @@ DE6EA3211C14000600183B10 /* ASDisplayNode+FrameworkPrivate.h */, 058D0A0B195D050800B7D73C /* ASDisplayNode+UIViewBridge.mm */, 058D0A0C195D050800B7D73C /* ASDisplayNodeInternal.h */, - E52405B41C8FEF16004DC8E7 /* ASDisplayNodeLayoutContext.h */, - E52405B21C8FEF03004DC8E7 /* ASDisplayNodeLayoutContext.mm */, + E52405B41C8FEF16004DC8E7 /* ASLayoutTransition.h */, + E52405B21C8FEF03004DC8E7 /* ASLayoutTransition.mm */, 69E100691CA89CB600D88C1B /* ASEnvironmentInternal.h */, 69E1006A1CA89CB600D88C1B /* ASEnvironmentInternal.mm */, 058D0A0D195D050800B7D73C /* ASImageNode+CGExtras.h */, @@ -1279,6 +1359,8 @@ CC3B20881C3F7A5400798563 /* ASWeakSet.m */, DBC452D91C5BF64600B16017 /* NSArray+Diffing.h */, DBC452DA1C5BF64600B16017 /* NSArray+Diffing.m */, + 8B0768B11CE752EC002E1453 /* ASDefaultPlaybackButton.h */, + 8B0768B21CE752EC002E1453 /* ASDefaultPlaybackButton.m */, ); path = Private; sourceTree = ""; @@ -1344,11 +1426,22 @@ AC026B671BD57D6F00BBC17E /* ASChangeSetDataController.h */, AC026B681BD57D6F00BBC17E /* ASChangeSetDataController.m */, E5711A2A1C840C81009619D4 /* ASIndexedNodeContext.h */, - E5711A2D1C840C96009619D4 /* ASIndexedNodeContext.m */, + E5711A2D1C840C96009619D4 /* ASIndexedNodeContext.mm */, ); name = "Data Controller"; sourceTree = ""; }; + 92074A5E1CC8B9DD00918F75 /* tvOS */ = { + isa = PBXGroup; + children = ( + 92074A5F1CC8BA1900918F75 /* ASImageNode+tvOS.h */, + 92074A601CC8BA1900918F75 /* ASImageNode+tvOS.m */, + 92074A651CC8BADA00918F75 /* ASControlNode+tvOS.h */, + 92074A661CC8BADA00918F75 /* ASControlNode+tvOS.m */, + ); + name = tvOS; + sourceTree = ""; + }; AC6456051B0A333200CF11B8 /* Layout */ = { isa = PBXGroup; children = ( @@ -1370,6 +1463,8 @@ 9CDC18CB1B910E12004965E2 /* ASLayoutablePrivate.h */, ACF6ED0D1B17843500DA7C62 /* ASLayoutSpec.h */, ACF6ED0E1B17843500DA7C62 /* ASLayoutSpec.mm */, + 697C0DE11CF38F28001DE0D4 /* ASLayoutValidation.h */, + 697C0DE21CF38F28001DE0D4 /* ASLayoutValidation.mm */, ACF6ED121B17843500DA7C62 /* ASOverlayLayoutSpec.h */, ACF6ED131B17843500DA7C62 /* ASOverlayLayoutSpec.mm */, ACF6ED141B17843500DA7C62 /* ASRatioLayoutSpec.h */, @@ -1412,6 +1507,7 @@ children = ( FB07EABBCF28656C6297BC2D /* Pods-AsyncDisplayKitTests.debug.xcconfig */, D3779BCFF841AD3EB56537ED /* Pods-AsyncDisplayKitTests.release.xcconfig */, + BDC2D162BD55A807C1475DA5 /* Pods-AsyncDisplayKitTests.profile.xcconfig */, ); name = Pods; sourceTree = ""; @@ -1440,6 +1536,7 @@ 058D0A72195D05F800B7D73C /* _ASCoreAnimationExtras.h in Headers */, 7A06A73B1C35F08800FE8DAA /* ASRelativeLayoutSpec.h in Headers */, 68B8A4DC1CBD911D007E4543 /* ASImageNode+AnimatedImagePrivate.h in Headers */, + A2763D791CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.h in Headers */, 058D0A53195D05DC00B7D73C /* _ASDisplayLayer.h in Headers */, 058D0A55195D05DC00B7D73C /* _ASDisplayView.h in Headers */, B13CA0F71C519E9400E031AB /* ASCollectionViewLayoutFacilitatorProtocol.h in Headers */, @@ -1452,6 +1549,7 @@ 058D0A82195D060300B7D73C /* ASAssert.h in Headers */, 0516FA3C1A15563400B4EBED /* ASAvailability.h in Headers */, AEB7B01A1C5962EA00662EF4 /* ASDefaultPlayButton.h in Headers */, + 68FC85E21CE29B7E00EDD713 /* ASTabBarController.h in Headers */, ACF6ED1A1B17843500DA7C62 /* ASBackgroundLayoutSpec.h in Headers */, 058D0A83195D060300B7D73C /* ASBaseDefines.h in Headers */, 054963491A1EA066000F8E56 /* ASBasicImageDownloader.h in Headers */, @@ -1467,6 +1565,7 @@ AC3C4A511A1139C100143C57 /* ASCollectionView.h in Headers */, AEEC47E11C20C2DD00EC1693 /* ASVideoNode.h in Headers */, DE8BEAC11C2DF3FC00D57C12 /* ASDelegateProxy.h in Headers */, + 68FC85DE1CE29AB700EDD713 /* ASNavigationController.h in Headers */, 205F0E1D1B373A2C007741D0 /* ASCollectionViewLayoutController.h in Headers */, AC3C4A541A113EEC00143C57 /* ASCollectionViewProtocols.h in Headers */, 058D0A49195D05CB00B7D73C /* ASControlNode+Subclasses.h in Headers */, @@ -1483,6 +1582,8 @@ 058D0A4A195D05CB00B7D73C /* ASDisplayNode.h in Headers */, AC7A2C171BDE11DF0093FE1A /* ASTableViewInternal.h in Headers */, 058D0A4D195D05CB00B7D73C /* ASDisplayNodeExtras.h in Headers */, + 92074A671CC8BADA00918F75 /* ASControlNode+tvOS.h in Headers */, + 697C0DE31CF38F28001DE0D4 /* ASLayoutValidation.h in Headers */, 68355B3B1CB57A5A001D4E68 /* ASImageContainerProtocolCategories.h in Headers */, 68B0277A1C1A79CC0041016B /* ASDisplayNode+Beta.h in Headers */, 767E7F8D1C9019130066C000 /* AsyncDisplayKit+Debug.h in Headers */, @@ -1491,15 +1592,18 @@ 0587F9BD1A7309ED00AFF0BA /* ASEditableTextNode.h in Headers */, DE6EA3221C14000600183B10 /* ASDisplayNode+FrameworkPrivate.h in Headers */, 1950C4491A3BB5C1005C8279 /* ASEqualityHelpers.h in Headers */, + 68FC85E91CE29C7D00EDD713 /* ASVisibilityProtocols.h in Headers */, 257754A81BEE44CD00737CA5 /* ASTextKitContext.h in Headers */, DB55C2611C6408D6004EDCF5 /* _ASTransitionContext.h in Headers */, 464052221A3F83C40061C0BA /* ASFlowLayoutController.h in Headers */, + 9C70F2031CDA4EFA007D6C76 /* ASTraitCollection.h in Headers */, 257754AF1BEE44CD00737CA5 /* ASTextKitRenderer+TextChecking.h in Headers */, 058D0A57195D05DC00B7D73C /* ASHighlightOverlayLayer.h in Headers */, 058D0A7C195D05F900B7D73C /* ASImageNode+CGExtras.h in Headers */, DBDB83941C6E879900D0098C /* ASPagerFlowLayout.h in Headers */, 058D0A4F195D05CB00B7D73C /* ASImageNode.h in Headers */, 05F20AA41A15733C00DCA68A /* ASImageProtocols.h in Headers */, + 8BDA5FC51CDBDDE1007D13B2 /* ASVideoPlayerNode.h in Headers */, 430E7C8F1B4C23F100697A4C /* ASIndexPath.h in Headers */, ACF6ED221B17843500DA7C62 /* ASInsetLayoutSpec.h in Headers */, ACF6ED4B1B17847A00DA7C62 /* ASInternalHelpers.h in Headers */, @@ -1521,11 +1625,12 @@ B13CA1001C52004900E031AB /* ASCollectionNode+Beta.h in Headers */, 0442850D1BAA64EC00D16268 /* ASMultidimensionalArrayUtils.h in Headers */, 0516FA401A1563D200B4EBED /* ASMultiplexImageNode.h in Headers */, + 8B0768B31CE752EC002E1453 /* ASDefaultPlaybackButton.h in Headers */, 058D0A59195D05DC00B7D73C /* ASMutableAttributedStringBuilder.h in Headers */, 055B9FA81A1C154B00035D6D /* ASNetworkImageNode.h in Headers */, ACF6ED2B1B17843500DA7C62 /* ASOverlayLayoutSpec.h in Headers */, 055F1A3819ABD413004DAFF1 /* ASRangeController.h in Headers */, - E52405B51C8FEF16004DC8E7 /* ASDisplayNodeLayoutContext.h in Headers */, + E52405B51C8FEF16004DC8E7 /* ASLayoutTransition.h in Headers */, ACF6ED2D1B17843500DA7C62 /* ASRatioLayoutSpec.h in Headers */, AC47D9451B3BB41900AAEE9D /* ASRelativeSize.h in Headers */, 291B63FB1AA53A7A000A71B3 /* ASScrollDirection.h in Headers */, @@ -1535,7 +1640,6 @@ 257754C31BEE458E00737CA5 /* ASTextNodeTypes.h in Headers */, 9C49C36F1B853957000B0DD5 /* ASStackLayoutable.h in Headers */, 69E1006D1CA89CB600D88C1B /* ASEnvironmentInternal.h in Headers */, - 68355B301CB5799E001D4E68 /* ASImageNode+AnimatedImage.h in Headers */, AC21EC101B3D0BF600C8B19A /* ASStackLayoutDefines.h in Headers */, CC7FD9DE1BB5E962005CCB2B /* ASPhotosFrameworkImageRequest.h in Headers */, ACF6ED2F1B17843500DA7C62 /* ASStackLayoutSpec.h in Headers */, @@ -1565,6 +1669,7 @@ 058D0A66195D05DC00B7D73C /* NSMutableAttributedString+TextKitAdditions.h in Headers */, 205F0E0F1B371875007741D0 /* UICollectionViewLayout+ASConvenience.h in Headers */, 058D0A6F195D05EC00B7D73C /* UIView+ASConvenience.h in Headers */, + 92074A611CC8BA1900918F75 /* ASImageNode+tvOS.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1578,6 +1683,7 @@ B35062481B010EFD0018CF92 /* _AS-objc-internal.h in Headers */, 69F10C871C84C35D0026140C /* ASRangeControllerUpdateRangeProtocol+Beta.h in Headers */, B350623C1B010EFD0018CF92 /* _ASAsyncTransaction.h in Headers */, + 9C70F20D1CDBE9CB007D6C76 /* ASDefaultPlayButton.h in Headers */, 68355B411CB57A6C001D4E68 /* ASImageContainerProtocolCategories.h in Headers */, 7630FFA81C9E267E007A7C0E /* ASVideoNode.h in Headers */, B350623F1B010EFD0018CF92 /* _ASAsyncTransactionContainer.h in Headers */, @@ -1598,6 +1704,7 @@ B35062581B010F070018CF92 /* ASAvailability.h in Headers */, DE84918D1C8FFF2B003D89E9 /* ASRunLoopQueue.h in Headers */, 254C6B731BF94DF4003EC431 /* ASTextKitCoreTextAdditions.h in Headers */, + A2763D7A1CBDD57D00A9ADBD /* ASPINRemoteImageDownloader.h in Headers */, 254C6B7A1BF94DF4003EC431 /* ASTextKitRenderer.h in Headers */, 69CB62AC1CB8165900024920 /* _ASDisplayViewAccessiblity.h in Headers */, 68355B3F1CB57A64001D4E68 /* ASPINRemoteImageDownloader.h in Headers */, @@ -1608,25 +1715,32 @@ B35062131B010EFD0018CF92 /* ASBasicImageDownloader.h in Headers */, B35062461B010EFD0018CF92 /* ASBasicImageDownloaderInternal.h in Headers */, B35062151B010EFD0018CF92 /* ASBatchContext.h in Headers */, + 92074A681CC8BADA00918F75 /* ASControlNode+tvOS.h in Headers */, 044285081BAA63FE00D16268 /* ASBatchFetching.h in Headers */, AC026B701BD57DBF00BBC17E /* _ASHierarchyChangeSet.h in Headers */, B35061F31B010EFD0018CF92 /* ASCellNode.h in Headers */, 34EFC7631B701CBF00AD841F /* ASCenterLayoutSpec.h in Headers */, + 9C70F20C1CDBE9B6007D6C76 /* ASCollectionDataController.h in Headers */, 18C2ED7F1B9B7DE800F627B3 /* ASCollectionNode.h in Headers */, 9C8898BD1C738BB800D6B02E /* ASTextKitFontSizeAdjuster.h in Headers */, B35061F51B010EFD0018CF92 /* ASCollectionView.h in Headers */, 254C6B791BF94DF4003EC431 /* ASTextKitEntityAttribute.h in Headers */, 509E68631B3AEDB4009B9150 /* ASCollectionViewLayoutController.h in Headers */, CC3B20841C3F76D600798563 /* ASPendingStateController.h in Headers */, + 92074A621CC8BA1900918F75 /* ASImageNode+tvOS.h in Headers */, B35061F71B010EFD0018CF92 /* ASCollectionViewProtocols.h in Headers */, + 68FC85E31CE29B7E00EDD713 /* ASTabBarController.h in Headers */, DE6EA3231C14000600183B10 /* ASDisplayNode+FrameworkPrivate.h in Headers */, + 9C70F20F1CDBE9FF007D6C76 /* ASLayoutManager.h in Headers */, B35061FA1B010EFD0018CF92 /* ASControlNode+Subclasses.h in Headers */, B35061F81B010EFD0018CF92 /* ASControlNode.h in Headers */, B35062171B010EFD0018CF92 /* ASDataController.h in Headers */, B35062191B010EFD0018CF92 /* ASDealloc2MainObject.h in Headers */, 34EFC75B1B701BAF00AD841F /* ASDimension.h in Headers */, + 68FC85EA1CE29C7D00EDD713 /* ASVisibilityProtocols.h in Headers */, A37320101C571B740011FC94 /* ASTextNode+Beta.h in Headers */, DBABFAFC1C6A8D2F0039EA4A /* _ASTransitionContext.h in Headers */, + 9C70F2061CDA4F0C007D6C76 /* ASTraitCollection.h in Headers */, 254C6B801BF94DF4003EC431 /* ASEqualityHashHelpers.h in Headers */, B350624F1B010EFD0018CF92 /* ASDisplayNode+DebugTiming.h in Headers */, B35061FD1B010EFD0018CF92 /* ASDisplayNode+Subclasses.h in Headers */, @@ -1635,6 +1749,7 @@ B35062521B010EFD0018CF92 /* ASDisplayNodeInternal.h in Headers */, B35062001B010EFD0018CF92 /* ASEditableTextNode.h in Headers */, B350625B1B010F070018CF92 /* ASEqualityHelpers.h in Headers */, + 680346941CE4052A0009FEB4 /* ASNavigationController.h in Headers */, B350621B1B010EFD0018CF92 /* ASFlowLayoutController.h in Headers */, B350621D1B010EFD0018CF92 /* ASHighlightOverlayLayer.h in Headers */, C78F7E2B1BF7809800CDEAFC /* ASTableNode.h in Headers */, @@ -1645,16 +1760,17 @@ B35062021B010EFD0018CF92 /* ASImageNode.h in Headers */, B350621F1B010EFD0018CF92 /* ASImageProtocols.h in Headers */, 430E7C901B4C23F100697A4C /* ASIndexPath.h in Headers */, + 9C70F20B1CDBE9A4007D6C76 /* ASDataController+Subclasses.h in Headers */, 34EFC75F1B701C8600AD841F /* ASInsetLayoutSpec.h in Headers */, 34EFC75D1B701BE900AD841F /* ASInternalHelpers.h in Headers */, 34EFC7671B701CD900AD841F /* ASLayout.h in Headers */, - 68355B331CB579AD001D4E68 /* ASImageNode+AnimatedImage.h in Headers */, DEC146B71C37A16A004A0EE7 /* ASCollectionInternal.h in Headers */, DBDB83951C6E879900D0098C /* ASPagerFlowLayout.h in Headers */, 34EFC7691B701CE100AD841F /* ASLayoutable.h in Headers */, 9CDC18CD1B910E12004965E2 /* ASLayoutablePrivate.h in Headers */, 68B8A4E21CBDB958007E4543 /* ASWeakProxy.h in Headers */, B35062201B010EFD0018CF92 /* ASLayoutController.h in Headers */, + 697C0DE41CF38F28001DE0D4 /* ASLayoutValidation.h in Headers */, B35062211B010EFD0018CF92 /* ASLayoutRangeType.h in Headers */, 34EFC76A1B701CE600AD841F /* ASLayoutSpec.h in Headers */, 34EFC7791B701D3600AD841F /* ASLayoutSpecUtilities.h in Headers */, @@ -1667,6 +1783,7 @@ DECBD6E81BE56E1900CF4905 /* ASButtonNode.h in Headers */, B35062241B010EFD0018CF92 /* ASMutableAttributedStringBuilder.h in Headers */, B13CA0F81C519EBA00E031AB /* ASCollectionViewLayoutFacilitatorProtocol.h in Headers */, + 8BBBAB8C1CEBAF1700107FC6 /* ASDefaultPlaybackButton.h in Headers */, B35062061B010EFD0018CF92 /* ASNetworkImageNode.h in Headers */, 34EFC76C1B701CED00AD841F /* ASOverlayLayoutSpec.h in Headers */, B35062261B010EFD0018CF92 /* ASRangeController.h in Headers */, @@ -1681,6 +1798,7 @@ 25E327571C16819500A2170C /* ASPagerNode.h in Headers */, B35062551B010EFD0018CF92 /* ASSentinel.h in Headers */, 9C8221961BA237B80037F19A /* ASStackBaselinePositionedLayout.h in Headers */, + 9C70F20E1CDBE9E5007D6C76 /* NSArray+Diffing.h in Headers */, 9C49C3701B853961000B0DD5 /* ASStackLayoutable.h in Headers */, DE040EF91C2B40AC004692FF /* ASCollectionViewFlowLayoutInspector.h in Headers */, 34EFC7701B701CFA00AD841F /* ASStackLayoutDefines.h in Headers */, @@ -1688,7 +1806,7 @@ E5711A2C1C840C81009619D4 /* ASIndexedNodeContext.h in Headers */, 254C6B7B1BF94DF4003EC431 /* ASTextKitRenderer+Positioning.h in Headers */, CC7FD9E21BB603FF005CCB2B /* ASPhotosFrameworkImageRequest.h in Headers */, - DE4843DC1C93EAC100A1F33B /* ASDisplayNodeLayoutContext.h in Headers */, + DE4843DC1C93EAC100A1F33B /* ASLayoutTransition.h in Headers */, 254C6B761BF94DF4003EC431 /* ASTextNodeTypes.h in Headers */, 34EFC7711B701CFF00AD841F /* ASStackLayoutSpec.h in Headers */, 2767E9411BB19BD600EA9B77 /* ASViewController.h in Headers */, @@ -1709,6 +1827,7 @@ B350623A1B010EFD0018CF92 /* NSMutableAttributedString+TextKitAdditions.h in Headers */, 044284FF1BAA3BD600D16268 /* UICollectionViewLayout+ASConvenience.h in Headers */, B35062431B010EFD0018CF92 /* UIView+ASConvenience.h in Headers */, + 8BDA5FC71CDBDF91007D13B2 /* ASVideoPlayerNode.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1755,12 +1874,12 @@ isa = PBXNativeTarget; buildConfigurationList = 058D09D2195D04C000B7D73C /* Build configuration list for PBXNativeTarget "AsyncDisplayKitTests" */; buildPhases = ( - 2E61B6A0DB0F436A9DDBE86F /* Check Pods Manifest.lock */, + 2E61B6A0DB0F436A9DDBE86F /* πŸ“¦ Check Pods Manifest.lock */, 058D09B8195D04C000B7D73C /* Sources */, 058D09B9195D04C000B7D73C /* Frameworks */, 058D09BA195D04C000B7D73C /* Resources */, - 3B9D88CDF51B429C8409E4B6 /* Copy Pods Resources */, - B130AB1AC0A1E5162E211C19 /* Embed Pods Frameworks */, + 3B9D88CDF51B429C8409E4B6 /* πŸ“¦ Copy Pods Resources */, + B130AB1AC0A1E5162E211C19 /* πŸ“¦ Embed Pods Frameworks */, ); buildRules = ( ); @@ -1864,14 +1983,14 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 2E61B6A0DB0F436A9DDBE86F /* Check Pods Manifest.lock */ = { + 2E61B6A0DB0F436A9DDBE86F /* πŸ“¦ Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "πŸ“¦ Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -1879,14 +1998,14 @@ 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; }; - 3B9D88CDF51B429C8409E4B6 /* Copy Pods Resources */ = { + 3B9D88CDF51B429C8409E4B6 /* πŸ“¦ Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "πŸ“¦ Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -1894,14 +2013,14 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AsyncDisplayKitTests/Pods-AsyncDisplayKitTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - B130AB1AC0A1E5162E211C19 /* Embed Pods Frameworks */ = { + B130AB1AC0A1E5162E211C19 /* πŸ“¦ Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Embed Pods Frameworks"; + name = "πŸ“¦ Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -1926,7 +2045,9 @@ buildActionMask = 2147483647; files = ( 058D0A22195D050800B7D73C /* _ASAsyncTransaction.mm in Sources */, + 8B0768B41CE752EC002E1453 /* ASDefaultPlaybackButton.m in Sources */, E55D86321CA8A14000A0C26F /* ASLayoutable.mm in Sources */, + 68FC85E41CE29B7E00EDD713 /* ASTabBarController.m in Sources */, 058D0A23195D050800B7D73C /* _ASAsyncTransactionContainer.m in Sources */, 058D0A24195D050800B7D73C /* _ASAsyncTransactionGroup.m in Sources */, 68355B3A1CB57A5A001D4E68 /* ASPINRemoteImageDownloader.m in Sources */, @@ -1947,14 +2068,16 @@ ACF6ED1B1B17843500DA7C62 /* ASBackgroundLayoutSpec.mm in Sources */, 0549634A1A1EA066000F8E56 /* ASBasicImageDownloader.mm in Sources */, 299DA1AA1A828D2900162D41 /* ASBatchContext.mm in Sources */, - AC6456091B0A335000CF11B8 /* ASCellNode.m in Sources */, + AC6456091B0A335000CF11B8 /* ASCellNode.mm in Sources */, DE8BEAC31C2DF3FC00D57C12 /* ASDelegateProxy.m in Sources */, ACF6ED1D1B17843500DA7C62 /* ASCenterLayoutSpec.mm in Sources */, 18C2ED801B9B7DE800F627B3 /* ASCollectionNode.mm in Sources */, 92DD2FE41BF4B97E0074C9DD /* ASMapNode.mm in Sources */, DBC452DC1C5BF64600B16017 /* NSArray+Diffing.m in Sources */, AC3C4A521A1139C100143C57 /* ASCollectionView.mm in Sources */, + 9CFFC6C21CCAC768006A6476 /* ASTableNode.mm in Sources */, 205F0E1E1B373A2C007741D0 /* ASCollectionViewLayoutController.mm in Sources */, + 68FC85EB1CE29C7D00EDD713 /* ASVisibilityProtocols.m in Sources */, 058D0A13195D050800B7D73C /* ASControlNode.mm in Sources */, 464052211A3F83C40061C0BA /* ASDataController.mm in Sources */, B30BF6531C5964B0004FCD53 /* ASLayoutManager.m in Sources */, @@ -1979,9 +2102,10 @@ 430E7C911B4C23F100697A4C /* ASIndexPath.m in Sources */, ACF6ED231B17843500DA7C62 /* ASInsetLayoutSpec.mm in Sources */, ACF6ED4C1B17847A00DA7C62 /* ASInternalHelpers.mm in Sources */, - 698548651CA9E025008A345F /* ASEnvironment.m in Sources */, + 68FC85DF1CE29AB700EDD713 /* ASNavigationController.m in Sources */, ACF6ED251B17843500DA7C62 /* ASLayout.mm in Sources */, DB55C2631C6408D6004EDCF5 /* _ASTransitionContext.m in Sources */, + 92074A631CC8BA1900918F75 /* ASImageNode+tvOS.m in Sources */, 251B8EFA1BBB3D690087C538 /* ASCollectionViewFlowLayoutInspector.m in Sources */, ACF6ED271B17843500DA7C62 /* ASLayoutSpec.mm in Sources */, 257754B01BEE44CD00737CA5 /* ASTextKitRenderer+TextChecking.mm in Sources */, @@ -1995,7 +2119,7 @@ 0442850F1BAA64EC00D16268 /* ASMultidimensionalArrayUtils.mm in Sources */, 7A06A73A1C35F08800FE8DAA /* ASRelativeLayoutSpec.mm in Sources */, 257754921BED28F300737CA5 /* ASEqualityHashHelpers.mm in Sources */, - E52405B31C8FEF03004DC8E7 /* ASDisplayNodeLayoutContext.mm in Sources */, + E52405B31C8FEF03004DC8E7 /* ASLayoutTransition.mm in Sources */, 69CB62AD1CB8165900024920 /* _ASDisplayViewAccessiblity.mm in Sources */, 257754AB1BEE44CD00737CA5 /* ASTextKitEntityAttribute.m in Sources */, 055F1A3919ABD413004DAFF1 /* ASRangeController.mm in Sources */, @@ -2006,27 +2130,31 @@ 205F0E121B371BD7007741D0 /* ASScrollDirection.m in Sources */, 9C8898BB1C738B9800D6B02E /* ASTextKitFontSizeAdjuster.mm in Sources */, D785F6631A74327E00291744 /* ASScrollNode.m in Sources */, - E5711A2E1C840C96009619D4 /* ASIndexedNodeContext.m in Sources */, + E5711A2E1C840C96009619D4 /* ASIndexedNodeContext.mm in Sources */, 058D0A2C195D050800B7D73C /* ASSentinel.m in Sources */, 9C8221971BA237B80037F19A /* ASStackBaselinePositionedLayout.mm in Sources */, 251B8EF81BBB3D690087C538 /* ASCollectionDataController.mm in Sources */, ACF6ED301B17843500DA7C62 /* ASStackLayoutSpec.mm in Sources */, 257754BE1BEE458E00737CA5 /* ASTextKitComponents.m in Sources */, 257754A91BEE44CD00737CA5 /* ASTextKitContext.mm in Sources */, + 697C0DE51CF38F28001DE0D4 /* ASLayoutValidation.mm in Sources */, ACF6ED501B17847A00DA7C62 /* ASStackPositionedLayout.mm in Sources */, ACF6ED521B17847A00DA7C62 /* ASStackUnpositionedLayout.mm in Sources */, 257754A61BEE44CD00737CA5 /* ASTextKitAttributes.mm in Sources */, 81EE38501C8E94F000456208 /* ASRunLoopQueue.mm in Sources */, + 9C70F2041CDA4EFA007D6C76 /* ASTraitCollection.m in Sources */, + 92074A691CC8BADA00918F75 /* ASControlNode+tvOS.m in Sources */, ACF6ED321B17843500DA7C62 /* ASStaticLayoutSpec.mm in Sources */, AC026B6B1BD57D6F00BBC17E /* ASChangeSetDataController.m in Sources */, 68355B311CB5799E001D4E68 /* ASImageNode+AnimatedImage.mm in Sources */, + 9CFFC6C01CCAC73C006A6476 /* ASViewController.mm in Sources */, 055F1A3519ABD3E3004DAFF1 /* ASTableView.mm in Sources */, 058D0A17195D050800B7D73C /* ASTextNode.mm in Sources */, 257754AC1BEE44CD00737CA5 /* ASTextKitRenderer.mm in Sources */, - ACC945AB1BA9E7C1005E1FB8 /* ASViewController.m in Sources */, - B0F8805B1BEAEC7500D17647 /* ASTableNode.m in Sources */, + 8BDA5FC61CDBDDE1007D13B2 /* ASVideoPlayerNode.mm in Sources */, 205F0E221B376416007741D0 /* CGRect+ASConvenience.m in Sources */, 257754B21BEE44CD00737CA5 /* ASTextKitShadower.mm in Sources */, + 9CFFC6BE1CCAC52B006A6476 /* ASEnvironment.mm in Sources */, 058D0A21195D050800B7D73C /* NSMutableAttributedString+TextKitAdditions.m in Sources */, 205F0E101B371875007741D0 /* UICollectionViewLayout+ASConvenience.m in Sources */, CC7FD9DF1BB5E962005CCB2B /* ASPhotosFrameworkImageRequest.m in Sources */, @@ -2049,6 +2177,7 @@ 2538B6F31BC5D2A2003CA0B4 /* ASCollectionViewFlowLayoutInspectorTests.m in Sources */, 058D0A39195D057000B7D73C /* ASDisplayNodeAppearanceTests.m in Sources */, 058D0A3A195D057000B7D73C /* ASDisplayNodeTests.m in Sources */, + CC4981B31D1A02BE004E13CC /* ASTableViewThrashTests.m in Sources */, 058D0A3B195D057000B7D73C /* ASDisplayNodeTestsHelper.m in Sources */, 056D21551ABCEF50001107EF /* ASImageNodeSnapshotTests.m in Sources */, AC026B581BD3F61800BBC17E /* ASStaticLayoutSpecSnapshotTests.m in Sources */, @@ -2057,6 +2186,7 @@ CC7FD9E11BB5F750005CCB2B /* ASPhotosFrameworkImageRequestTests.m in Sources */, 052EE0661A159FEF002C6279 /* ASMultiplexImageNodeTests.m in Sources */, 058D0A3C195D057000B7D73C /* ASMutableAttributedStringBuilderTests.m in Sources */, + 697B315A1CFE4B410049936F /* ASEditableTextNodeTests.m in Sources */, ACF6ED611B178DC700DA7C62 /* ASOverlayLayoutSpecSnapshotTests.mm in Sources */, ACF6ED621B178DC700DA7C62 /* ASRatioLayoutSpecSnapshotTests.mm in Sources */, 7AB338691C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm in Sources */, @@ -2079,7 +2209,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DE4843DB1C93EAB100A1F33B /* ASDisplayNodeLayoutContext.mm in Sources */, + 9C70F2091CDABA36007D6C76 /* ASViewController.mm in Sources */, + 8BBBAB8D1CEBAF1E00107FC6 /* ASDefaultPlaybackButton.m in Sources */, + DE4843DB1C93EAB100A1F33B /* ASLayoutTransition.mm in Sources */, B30BF6541C59D889004FCD53 /* ASLayoutManager.m in Sources */, 92DD2FE71BF4D0850074C9DD /* ASMapNode.mm in Sources */, 636EA1A51C7FF4EF00EE152F /* ASDefaultPlayButton.m in Sources */, @@ -2091,11 +2223,10 @@ B35062421B010EFD0018CF92 /* _ASAsyncTransactionGroup.m in Sources */, B350624A1B010EFD0018CF92 /* _ASCoreAnimationExtras.mm in Sources */, 68EE0DC01C1B4ED300BA1B99 /* ASMainSerialQueue.mm in Sources */, - 698548661CA9E025008A345F /* ASEnvironment.m in Sources */, - 2767E9421BB19BD600EA9B77 /* ASViewController.m in Sources */, B35062101B010EFD0018CF92 /* _ASDisplayLayer.mm in Sources */, 9C55866B1BD54A1900B50E3A /* ASAsciiArtBoxCreator.m in Sources */, B35062121B010EFD0018CF92 /* _ASDisplayView.mm in Sources */, + DEFAD8131CC48914000527C4 /* ASVideoNode.mm in Sources */, B350624C1B010EFD0018CF92 /* _ASPendingState.mm in Sources */, 509E68621B3AEDA5009B9150 /* ASAbstractLayoutController.mm in Sources */, 254C6B861BF94F8A003EC431 /* ASTextKitContext.mm in Sources */, @@ -2103,13 +2234,16 @@ 9C8898BC1C738BA800D6B02E /* ASTextKitFontSizeAdjuster.mm in Sources */, 34EFC7621B701CA400AD841F /* ASBackgroundLayoutSpec.mm in Sources */, DE8BEAC41C2DF3FC00D57C12 /* ASDelegateProxy.m in Sources */, + 9C70F2081CDAA3C6007D6C76 /* ASEnvironment.mm in Sources */, B35062141B010EFD0018CF92 /* ASBasicImageDownloader.mm in Sources */, B35062161B010EFD0018CF92 /* ASBatchContext.mm in Sources */, - AC47D9421B3B891B00AAEE9D /* ASCellNode.m in Sources */, + AC47D9421B3B891B00AAEE9D /* ASCellNode.mm in Sources */, 34EFC7641B701CC600AD841F /* ASCenterLayoutSpec.mm in Sources */, 18C2ED831B9B7DE800F627B3 /* ASCollectionNode.mm in Sources */, E55D86331CA8A14000A0C26F /* ASLayoutable.mm in Sources */, + 68FC85EC1CE29C7D00EDD713 /* ASVisibilityProtocols.m in Sources */, 68B8A4E41CBDB958007E4543 /* ASWeakProxy.m in Sources */, + 9C70F20A1CDBE949007D6C76 /* ASTableNode.mm in Sources */, 69CB62AE1CB8165900024920 /* _ASDisplayViewAccessiblity.mm in Sources */, B35061F61B010EFD0018CF92 /* ASCollectionView.mm in Sources */, 509E68641B3AEDB7009B9150 /* ASCollectionViewLayoutController.mm in Sources */, @@ -2126,7 +2260,7 @@ 69E100701CA89CB600D88C1B /* ASEnvironmentInternal.mm in Sources */, 254C6B891BF94F8A003EC431 /* ASTextKitRenderer+Positioning.mm in Sources */, 68355B341CB579B9001D4E68 /* ASImageNode+AnimatedImage.mm in Sources */, - E5711A301C840C96009619D4 /* ASIndexedNodeContext.m in Sources */, + E5711A301C840C96009619D4 /* ASIndexedNodeContext.mm in Sources */, B35062511B010EFD0018CF92 /* ASDisplayNode+UIViewBridge.mm in Sources */, B35061FC1B010EFD0018CF92 /* ASDisplayNode.mm in Sources */, B35061FF1B010EFD0018CF92 /* ASDisplayNodeExtras.mm in Sources */, @@ -2135,6 +2269,7 @@ CC3B208C1C3F7A5400798563 /* ASWeakSet.m in Sources */, B350621C1B010EFD0018CF92 /* ASFlowLayoutController.mm in Sources */, B350621E1B010EFD0018CF92 /* ASHighlightOverlayLayer.mm in Sources */, + 92074A641CC8BA1900918F75 /* ASImageNode+tvOS.m in Sources */, B35062541B010EFD0018CF92 /* ASImageNode+CGExtras.m in Sources */, 68355B401CB57A69001D4E68 /* ASImageContainerProtocolCategories.m in Sources */, B35062031B010EFD0018CF92 /* ASImageNode.mm in Sources */, @@ -2155,6 +2290,7 @@ 044285101BAA64EC00D16268 /* ASMultidimensionalArrayUtils.mm in Sources */, B35062271B010EFD0018CF92 /* ASRangeController.mm in Sources */, 0442850A1BAA63FE00D16268 /* ASBatchFetching.m in Sources */, + 68FC85E61CE29B9400EDD713 /* ASNavigationController.m in Sources */, 34EFC76F1B701CF700AD841F /* ASRatioLayoutSpec.mm in Sources */, 254C6B8B1BF94F8A003EC431 /* ASTextKitShadower.mm in Sources */, 34EFC7661B701CD200AD841F /* ASRelativeSize.mm in Sources */, @@ -2163,18 +2299,22 @@ B35062091B010EFD0018CF92 /* ASScrollNode.m in Sources */, B35062561B010EFD0018CF92 /* ASSentinel.m in Sources */, 9C8221981BA237B80037F19A /* ASStackBaselinePositionedLayout.mm in Sources */, + 8BDA5FC81CDBDF95007D13B2 /* ASVideoPlayerNode.mm in Sources */, 34EFC7721B701D0300AD841F /* ASStackLayoutSpec.mm in Sources */, 34EFC7761B701D2A00AD841F /* ASStackPositionedLayout.mm in Sources */, 7AB338661C55B3420055FDE8 /* ASRelativeLayoutSpec.mm in Sources */, + 697C0DE61CF38F28001DE0D4 /* ASLayoutValidation.mm in Sources */, + 9C70F2051CDA4F06007D6C76 /* ASTraitCollection.m in Sources */, 34EFC7781B701D3100AD841F /* ASStackUnpositionedLayout.mm in Sources */, DE84918E1C8FFF9F003D89E9 /* ASRunLoopQueue.mm in Sources */, + 68FC85E51CE29B7E00EDD713 /* ASTabBarController.m in Sources */, AC026B6C1BD57D6F00BBC17E /* ASChangeSetDataController.m in Sources */, 34EFC7741B701D0A00AD841F /* ASStaticLayoutSpec.mm in Sources */, + 92074A6A1CC8BADA00918F75 /* ASControlNode+tvOS.m in Sources */, DB78412E1C6BCE1600A9E2B4 /* _ASTransitionContext.m in Sources */, B350620B1B010EFD0018CF92 /* ASTableView.mm in Sources */, B350620E1B010EFD0018CF92 /* ASTextNode.mm in Sources */, 68355B3E1CB57A60001D4E68 /* ASPINRemoteImageDownloader.m in Sources */, - C78F7E2A1BF7808300CDEAFC /* ASTableNode.m in Sources */, 509E68661B3AEDD7009B9150 /* CGRect+ASConvenience.m in Sources */, 254C6B8D1BF94F8A003EC431 /* ASEqualityHashHelpers.mm in Sources */, 254C6B871BF94F8A003EC431 /* ASTextKitEntityAttribute.m in Sources */, @@ -2381,7 +2521,6 @@ BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ENABLE_CODE_COVERAGE = YES; FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); @@ -2412,7 +2551,6 @@ BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ENABLE_CODE_COVERAGE = YES; FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); @@ -2561,12 +2699,11 @@ }; D086A56B1CC0115200F08284 /* Hockeyapp */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D3779BCFF841AD3EB56537ED /* Pods-AsyncDisplayKitTests.release.xcconfig */; + baseConfigurationReference = BDC2D162BD55A807C1475DA5 /* Pods-AsyncDisplayKitTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ENABLE_CODE_COVERAGE = YES; FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(DEVELOPER_FRAMEWORKS_DIR)", ); diff --git a/AsyncDisplayKit.xcodeproj/xcshareddata/xcschemes/AsyncDisplayKit.xcscheme b/AsyncDisplayKit.xcodeproj/xcshareddata/xcschemes/AsyncDisplayKit.xcscheme index bbe1e020a6..2e60215819 100644 --- a/AsyncDisplayKit.xcodeproj/xcshareddata/xcschemes/AsyncDisplayKit.xcscheme +++ b/AsyncDisplayKit.xcodeproj/xcshareddata/xcschemes/AsyncDisplayKit.xcscheme @@ -85,6 +85,13 @@ ReferencedContainer = "container:AsyncDisplayKit.xcodeproj"> + + + + diff --git a/AsyncDisplayKit/ASButtonNode.h b/AsyncDisplayKit/ASButtonNode.h index 4363868de1..dd619085ce 100644 --- a/AsyncDisplayKit/ASButtonNode.h +++ b/AsyncDisplayKit/ASButtonNode.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASButtonNode.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import @@ -59,6 +61,7 @@ */ - (void)setAttributedTitle:(nullable NSAttributedString *)title forState:(ASControlState)state; +#if TARGET_OS_IOS /** * Sets the title to use for the specified state. This will reset styled title previously set with -setAttributedTitle:forState. * @@ -68,7 +71,7 @@ * @param state The state that uses the specified title. The possible values are described in ASControlState. */ - (void)setTitle:(nonnull NSString *)title withFont:(nullable UIFont *)font withColor:(nullable UIColor *)color forState:(ASControlState)state; - +#endif /** * Returns the image used for a button state. * diff --git a/AsyncDisplayKit/ASButtonNode.mm b/AsyncDisplayKit/ASButtonNode.mm index b673ff8a76..5638e7c125 100644 --- a/AsyncDisplayKit/ASButtonNode.mm +++ b/AsyncDisplayKit/ASButtonNode.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASButtonNode.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASButtonNode.h" #import "ASStackLayoutSpec.h" @@ -69,7 +71,11 @@ { if (!_titleNode) { _titleNode = [[ASTextNode alloc] init]; +#if TARGET_OS_IOS + // tvOS needs access to the underlying view + // of the button node to add a touch handler. [_titleNode setLayerBacked:YES]; +#endif [_titleNode setFlexShrink:YES]; } return _titleNode; @@ -241,40 +247,42 @@ - (ASVerticalAlignment)contentVerticalAlignment { - ASDN::MutexLocker l(_propertyLock); - return _contentVerticalAlignment; + ASDN::MutexLocker l(_propertyLock); + return _contentVerticalAlignment; } - (void)setContentVerticalAlignment:(ASVerticalAlignment)contentVerticalAlignment { - ASDN::MutexLocker l(_propertyLock); - _contentVerticalAlignment = contentVerticalAlignment; + ASDN::MutexLocker l(_propertyLock); + _contentVerticalAlignment = contentVerticalAlignment; } - (ASHorizontalAlignment)contentHorizontalAlignment { - ASDN::MutexLocker l(_propertyLock); - return _contentHorizontalAlignment; + ASDN::MutexLocker l(_propertyLock); + return _contentHorizontalAlignment; } - (void)setContentHorizontalAlignment:(ASHorizontalAlignment)contentHorizontalAlignment { - ASDN::MutexLocker l(_propertyLock); - _contentHorizontalAlignment = contentHorizontalAlignment; + ASDN::MutexLocker l(_propertyLock); + _contentHorizontalAlignment = contentHorizontalAlignment; } - (UIEdgeInsets)contentEdgeInsets { - ASDN::MutexLocker l(_propertyLock); - return _contentEdgeInsets; + ASDN::MutexLocker l(_propertyLock); + return _contentEdgeInsets; } - (void)setContentEdgeInsets:(UIEdgeInsets)contentEdgeInsets { - ASDN::MutexLocker l(_propertyLock); - _contentEdgeInsets = contentEdgeInsets; + ASDN::MutexLocker l(_propertyLock); + _contentEdgeInsets = contentEdgeInsets; } + +#if TARGET_OS_IOS - (void)setTitle:(NSString *)title withFont:(UIFont *)font withColor:(UIColor *)color forState:(ASControlState)state { NSDictionary *attributes = @{ @@ -286,6 +294,7 @@ attributes:attributes]; [self setAttributedTitle:string forState:state]; } +#endif - (NSAttributedString *)attributedTitleForState:(ASControlState)state { diff --git a/AsyncDisplayKit/ASCellNode+Internal.h b/AsyncDisplayKit/ASCellNode+Internal.h index 5241456b9f..c497fc07d5 100644 --- a/AsyncDisplayKit/ASCellNode+Internal.h +++ b/AsyncDisplayKit/ASCellNode+Internal.h @@ -1,9 +1,13 @@ // // ASCellNode+Internal.h -// Pods +// AsyncDisplayKit // // Created by Max Gu on 2/19/16. // +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASCellNode.h" diff --git a/AsyncDisplayKit/ASCellNode.h b/AsyncDisplayKit/ASCellNode.h index e38376bee4..e70d67efb5 100644 --- a/AsyncDisplayKit/ASCellNode.h +++ b/AsyncDisplayKit/ASCellNode.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCellNode.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -30,10 +32,22 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) { * Indicates a cell is no longer visible */ ASCellNodeVisibilityEventInvisible, + /** + * Indicates user has started dragging the visible cell + */ + ASCellNodeVisibilityEventWillBeginDragging, + /** + * Indicates user has ended dragging the visible cell + */ + ASCellNodeVisibilityEventDidEndDragging, }; /** * Generic cell node. Subclass this instead of `ASDisplayNode` to use with `ASTableView` and `ASCollectionView`. + + * @note When a cell node is contained inside a collection view (or table view), + * calling `-setNeedsLayout` will also notify the collection on the main thread + * so that the collection can update its item layout if the cell's size changed. */ @interface ASCellNode : ASDisplayNode @@ -85,16 +99,12 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) { - (void)touchesEnded:(NSSet *)touches withEvent:(nullable UIEvent *)event ASDISPLAYNODE_REQUIRES_SUPER; - (void)touchesCancelled:(nullable NSSet *)touches withEvent:(nullable UIEvent *)event ASDISPLAYNODE_REQUIRES_SUPER; -/** - * Marks the node as needing layout. Convenience for use whether the view / layer is loaded or not. - * - * If this node was measured, calling this method triggers an internal relayout: the calculated layout is invalidated, - * and the supernode is notified or (if this node is the root one) a full measurement pass is executed using the old constrained size. - * The delegate will then be notified on main thread. - * - * This method can be called inside of an animation block (to animate all of the layout changes). - */ -- (void)setNeedsLayout; +/** + * Called by the system when ASCellNode is used with an ASCollectionNode. It will not be called by ASTableNode. + * When the UICollectionViewLayout object returns a new UICollectionViewLayoutAttributes object, the corresponding ASCellNode will be updated. + * See UICollectionViewCell's applyLayoutAttributes: for a full description. +*/ +- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes; /** * @abstract Initializes a cell with a given view controller block. diff --git a/AsyncDisplayKit/ASCellNode.m b/AsyncDisplayKit/ASCellNode.mm similarity index 91% rename from AsyncDisplayKit/ASCellNode.m rename to AsyncDisplayKit/ASCellNode.mm index 85f9a08f0b..1bc660c41b 100644 --- a/AsyncDisplayKit/ASCellNode.m +++ b/AsyncDisplayKit/ASCellNode.mm @@ -1,15 +1,18 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCellNode.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASCellNode+Internal.h" #import "ASInternalHelpers.h" #import "ASEqualityHelpers.h" +#import "ASDisplayNodeInternal.h" #import #import #import @@ -120,10 +123,14 @@ ASDisplayNodeAssert(!layerBacked, @"ASCellNode does not support layer-backing."); } -- (void)setNeedsLayout +- (void)__setNeedsLayout { CGSize oldSize = self.calculatedSize; - [super setNeedsLayout]; + [super __setNeedsLayout]; + + //Adding this lock because lock used to be held when this method was called. Not sure if it's necessary for + //didRelayoutFromOldSize:toNewSize: + ASDN::MutexLocker l(_propertyLock); [self didRelayoutFromOldSize:oldSize toNewSize:self.calculatedSize]; } @@ -163,7 +170,7 @@ - (void)didRelayoutFromOldSize:(CGSize)oldSize toNewSize:(CGSize)newSize { - if (_layoutDelegate != nil && self.isNodeLoaded) { + if (_layoutDelegate != nil) { ASPerformBlockOnMainThread(^{ BOOL sizeChanged = !CGSizeEqualToSize(oldSize, newSize); [_layoutDelegate nodeDidRelayout:self sizeChanged:sizeChanged]; @@ -204,14 +211,19 @@ #pragma clang diagnostic pop +- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes +{ + // To be overriden by subclasses +} + - (void)cellNodeVisibilityEvent:(ASCellNodeVisibilityEvent)event inScrollView:(UIScrollView *)scrollView withCellFrame:(CGRect)cellFrame { // To be overriden by subclasses } -- (void)visibilityDidChange:(BOOL)isVisible +- (void)visibleStateDidChange:(BOOL)isVisible { - [super visibilityDidChange:isVisible]; + [super visibleStateDidChange:isVisible]; CGRect cellFrame = CGRectZero; if (_scrollView) { diff --git a/AsyncDisplayKit/ASCollectionNode+Beta.h b/AsyncDisplayKit/ASCollectionNode+Beta.h index a2073d4473..293d04bf2e 100644 --- a/AsyncDisplayKit/ASCollectionNode+Beta.h +++ b/AsyncDisplayKit/ASCollectionNode+Beta.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCollectionNode+Beta.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASCollectionNode.h" @protocol ASCollectionViewLayoutFacilitatorProtocol; diff --git a/AsyncDisplayKit/ASCollectionNode.h b/AsyncDisplayKit/ASCollectionNode.h index 1a8a70d98b..b65c79a244 100644 --- a/AsyncDisplayKit/ASCollectionNode.h +++ b/AsyncDisplayKit/ASCollectionNode.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Scott Goodson on 9/5/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/ASCollectionNode.mm b/AsyncDisplayKit/ASCollectionNode.mm index d33ef7bb0d..2784c9a9d1 100644 --- a/AsyncDisplayKit/ASCollectionNode.mm +++ b/AsyncDisplayKit/ASCollectionNode.mm @@ -1,15 +1,21 @@ // -// ASCollectionNode.m +// ASCollectionNode.mm // AsyncDisplayKit // // Created by Scott Goodson on 9/5/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASCollectionNode.h" #import "ASCollectionInternal.h" #import "ASCollectionViewLayoutFacilitatorProtocol.h" #import "ASDisplayNode+Subclasses.h" +#import "ASEnvironmentInternal.h" +#import "ASInternalHelpers.h" #import "ASRangeControllerUpdateRangeProtocol+Beta.h" #include @@ -53,6 +59,9 @@ #endif @interface ASCollectionNode () +{ + ASDN::RecursiveMutex _environmentStateLock; +} @property (nonatomic) _ASCollectionPendingState *pendingState; @end @@ -168,9 +177,9 @@ } #if ASRangeControllerLoggingEnabled -- (void)visibilityDidChange:(BOOL)isVisible +- (void)visibleStateDidChange:(BOOL)isVisible { - [super visibilityDidChange:isVisible]; + [super visibleStateDidChange:isVisible]; NSLog(@"%@ - visible: %d", self, isVisible); } #endif @@ -244,4 +253,6 @@ [self.view reloadDataImmediately]; } +ASEnvironmentCollectionTableSetEnvironmentState(_environmentStateLock) + @end diff --git a/AsyncDisplayKit/ASCollectionView.h b/AsyncDisplayKit/ASCollectionView.h index 99a4bd0548..a2d5e2ec44 100644 --- a/AsyncDisplayKit/ASCollectionView.h +++ b/AsyncDisplayKit/ASCollectionView.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCollectionView.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -164,6 +166,12 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)reloadDataImmediately; +/** + * Triggers a relayout of all nodes. + * + */ +- (void)relayoutItems; + /** * Blocks execution of the main thread until all section and row updates are committed. This method must be called from the main thread. */ @@ -342,7 +350,7 @@ NS_ASSUME_NONNULL_BEGIN * This is a node-based UICollectionViewDataSource. */ #define ASCollectionViewDataSource ASCollectionDataSource -@protocol ASCollectionDataSource +@protocol ASCollectionDataSource @optional @@ -422,6 +430,17 @@ NS_ASSUME_NONNULL_BEGIN @optional +/** + * Informs the delegate that the collection view will add the node + * at the given index path to the view hierarchy. + * + * @param collectionView The sender. + * @param indexPath The index path of the item that will be displayed. + * + * @warning AsyncDisplayKit processes collection view edits asynchronously. The index path + * passed into this method may not correspond to the same item in your data source + * if your data source has been updated since the last edit was processed. + */ - (void)collectionView:(ASCollectionView *)collectionView willDisplayNodeForItemAtIndexPath:(NSIndexPath *)indexPath; /** @@ -432,6 +451,10 @@ NS_ASSUME_NONNULL_BEGIN * @param collectionView The sender. * @param node The node which was removed from the view hierarchy. * @param indexPath The index path at which the node was located before it was removed. + * + * @warning AsyncDisplayKit processes collection view edits asynchronously. The index path + * passed into this method may not correspond to the same item in your data source + * if your data source has been updated since the last edit was processed. */ - (void)collectionView:(ASCollectionView *)collectionView didEndDisplayingNode:(ASCellNode *)node forItemAtIndexPath:(NSIndexPath *)indexPath; @@ -467,6 +490,10 @@ NS_ASSUME_NONNULL_BEGIN * Informs the delegate that the collection view did remove the node which was previously * at the given index path from the view hierarchy. * + * @warning AsyncDisplayKit processes collection view edits asynchronously. The index path + * passed into this method may not correspond to the same item in your data source + * if your data source has been updated since the last edit was processed. + * * This method is deprecated. Use @c collectionView:didEndDisplayingNode:forItemAtIndexPath: instead. */ - (void)collectionView:(ASCollectionView *)collectionView didEndDisplayingNodeForItemAtIndexPath:(NSIndexPath *)indexPath ASDISPLAYNODE_DEPRECATED; diff --git a/AsyncDisplayKit/ASCollectionView.mm b/AsyncDisplayKit/ASCollectionView.mm index 0835dcfbe1..0c979f4320 100644 --- a/AsyncDisplayKit/ASCollectionView.mm +++ b/AsyncDisplayKit/ASCollectionView.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCollectionView.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASAssert.h" #import "ASBatchFetching.h" @@ -56,6 +58,11 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; _node.highlighted = highlighted; } +- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes +{ + [_node applyLayoutAttributes:layoutAttributes]; +} + @end #pragma mark - @@ -91,7 +98,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; #pragma mark - #pragma mark ASCollectionView. -@interface ASCollectionView () { +@interface ASCollectionView () { ASCollectionViewProxy *_proxyDataSource; ASCollectionViewProxy *_proxyDelegate; @@ -106,9 +113,6 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; NSMutableArray *_batchUpdateBlocks; BOOL _asyncDataFetchingEnabled; - BOOL _asyncDelegateImplementsScrollviewDidScroll; - BOOL _asyncDataSourceImplementsConstrainedSizeForNode; - BOOL _asyncDataSourceImplementsNodeBlockForItemAtIndexPath; _ASCollectionViewNodeSizeInvalidationContext *_queuedNodeSizeInvalidationContext; // Main thread only BOOL _isDeallocating; @@ -133,6 +137,28 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; * The collection view never queried your data source before the update to see that it actually had 0 items. */ BOOL _superIsPendingDataLoad; + + struct { + unsigned int asyncDelegateScrollViewDidScroll:1; + unsigned int asyncDelegateScrollViewWillBeginDragging:1; + unsigned int asyncDelegateScrollViewDidEndDragging:1; + unsigned int asyncDelegateScrollViewWillEndDraggingWithVelocityTargetContentOffset:1; + unsigned int asyncDelegateCollectionViewWillDisplayNodeForItemAtIndexPath:1; + unsigned int asyncDelegateCollectionViewDidEndDisplayingNodeForItemAtIndexPath:1; + unsigned int asyncDelegateCollectionViewDidEndDisplayingNodeForItemAtIndexPathDeprecated:1; + unsigned int asyncDelegateCollectionViewWillBeginBatchFetchWithContext:1; + unsigned int asyncDelegateShouldBatchFetchForCollectionView:1; + } _asyncDelegateFlags; + + struct { + unsigned int asyncDataSourceConstrainedSizeForNode:1; + unsigned int asyncDataSourceNodeForItemAtIndexPath:1; + unsigned int asyncDataSourceNodeBlockForItemAtIndexPath:1; + unsigned int asyncDataSourceNumberOfSectionsInCollectionView:1; + unsigned int asyncDataSourceCollectionViewLockDataSource:1; + unsigned int asyncDataSourceCollectionViewUnlockDataSource:1; + unsigned int asyncDataSourceCollectionViewConstrainedSizeForNodeAtIndexPath:1; + } _asyncDataSourceFlags; } @property (atomic, assign) BOOL asyncDataSourceLocked; @@ -208,6 +234,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; _dataController = [[ASCollectionDataController alloc] initWithAsyncDataFetching:NO]; _dataController.delegate = _rangeController; _dataController.dataSource = self; + _dataController.environmentDelegate = self; _batchContext = [[ASBatchContext alloc] init]; @@ -295,6 +322,11 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; [super reloadData]; } +- (void)relayoutItems +{ + [_dataController relayoutAllNodes]; +} + - (void)waitUntilAllUpdatesAreCommitted { ASDisplayNodeAssertMainThread(); @@ -326,23 +358,29 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; { // Note: It's common to check if the value hasn't changed and short-circuit but we aren't doing that here to handle // the (common) case of nilling the asyncDataSource in the ViewController's dealloc. In this case our _asyncDataSource - // will return as nil (ARC magic) even though the _proxyDataSource still exists. It's really important to nil out - // super.dataSource in this case because calls to ASCollectionViewProxy will start failing and cause crashes. - - super.dataSource = nil; + // will return as nil (ARC magic) even though the _proxyDataSource still exists. It's really important to hold a strong + // reference to the old dataSource in this case because calls to ASCollectionViewProxy will start failing and cause crashes. + NS_VALID_UNTIL_END_OF_SCOPE id oldDataSource = super.dataSource; + if (asyncDataSource == nil) { _asyncDataSource = nil; _proxyDataSource = _isDeallocating ? nil : [[ASCollectionViewProxy alloc] initWithTarget:nil interceptor:self]; - _asyncDataSourceImplementsConstrainedSizeForNode = NO; - _asyncDataSourceImplementsNodeBlockForItemAtIndexPath = NO; + + memset(&_asyncDataSourceFlags, 0, sizeof(_asyncDataSourceFlags)); } else { _asyncDataSource = asyncDataSource; _proxyDataSource = [[ASCollectionViewProxy alloc] initWithTarget:_asyncDataSource interceptor:self]; - _asyncDataSourceImplementsConstrainedSizeForNode = [_asyncDataSource respondsToSelector:@selector(collectionView:constrainedSizeForNodeAtIndexPath:)]; - _asyncDataSourceImplementsNodeBlockForItemAtIndexPath = [_asyncDataSource respondsToSelector:@selector(collectionView:nodeBlockForItemAtIndexPath:)]; + + _asyncDataSourceFlags.asyncDataSourceConstrainedSizeForNode = [_asyncDataSource respondsToSelector:@selector(collectionView:constrainedSizeForNodeAtIndexPath:)]; + _asyncDataSourceFlags.asyncDataSourceNodeForItemAtIndexPath = [_asyncDataSource respondsToSelector:@selector(collectionView:nodeForItemAtIndexPath:)]; + _asyncDataSourceFlags.asyncDataSourceNodeBlockForItemAtIndexPath = [_asyncDataSource respondsToSelector:@selector(collectionView:nodeBlockForItemAtIndexPath:)]; + _asyncDataSourceFlags.asyncDataSourceNumberOfSectionsInCollectionView = [_asyncDataSource respondsToSelector:@selector(numberOfSectionsInCollectionView:)]; + _asyncDataSourceFlags.asyncDataSourceCollectionViewLockDataSource = [_asyncDataSource respondsToSelector:@selector(collectionViewLockDataSource:)]; + _asyncDataSourceFlags.asyncDataSourceCollectionViewUnlockDataSource = [_asyncDataSource respondsToSelector:@selector(collectionViewUnlockDataSource:)]; + _asyncDataSourceFlags.asyncDataSourceCollectionViewConstrainedSizeForNodeAtIndexPath = [_asyncDataSource respondsToSelector:@selector(collectionView:constrainedSizeForNodeAtIndexPath:)];; // Data-source must implement collectionView:nodeForItemAtIndexPath: or collectionView:nodeBlockForItemAtIndexPath: - ASDisplayNodeAssertTrue(_asyncDataSourceImplementsNodeBlockForItemAtIndexPath || [_asyncDataSource respondsToSelector:@selector(collectionView:nodeForItemAtIndexPath:)]); + ASDisplayNodeAssertTrue(_asyncDataSourceFlags.asyncDataSourceNodeBlockForItemAtIndexPath || _asyncDataSourceFlags.asyncDataSourceNodeForItemAtIndexPath); } super.dataSource = (id)_proxyDataSource; @@ -352,22 +390,28 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; { // Note: It's common to check if the value hasn't changed and short-circuit but we aren't doing that here to handle // the (common) case of nilling the asyncDelegate in the ViewController's dealloc. In this case our _asyncDelegate - // will return as nil (ARC magic) even though the _proxyDelegate still exists. It's really important to nil out - // super.delegate in this case because calls to ASCollectionViewProxy will start failing and cause crashes. - - // Order is important here, the asyncDelegate must be callable while nilling super.delegate to avoid random crashes - // in UIScrollViewAccessibility. - - super.delegate = nil; + // will return as nil (ARC magic) even though the _proxyDataSource still exists. It's really important to hold a strong + // reference to the old delegate in this case because calls to ASCollectionViewProxy will start failing and cause crashes. + NS_VALID_UNTIL_END_OF_SCOPE id oldDelegate = super.delegate; if (asyncDelegate == nil) { _asyncDelegate = nil; _proxyDelegate = _isDeallocating ? nil : [[ASCollectionViewProxy alloc] initWithTarget:nil interceptor:self]; - _asyncDelegateImplementsScrollviewDidScroll = NO; + + memset(&_asyncDelegateFlags, 0, sizeof(_asyncDelegateFlags)); } else { _asyncDelegate = asyncDelegate; _proxyDelegate = [[ASCollectionViewProxy alloc] initWithTarget:_asyncDelegate interceptor:self]; - _asyncDelegateImplementsScrollviewDidScroll = ([_asyncDelegate respondsToSelector:@selector(scrollViewDidScroll:)] ? 1 : 0); + + _asyncDelegateFlags.asyncDelegateScrollViewDidScroll = [_asyncDelegate respondsToSelector:@selector(scrollViewDidScroll:)]; + _asyncDelegateFlags.asyncDelegateScrollViewWillEndDraggingWithVelocityTargetContentOffset = [_asyncDelegate respondsToSelector:@selector(scrollViewWillEndDragging:withVelocity:targetContentOffset:)]; + _asyncDelegateFlags.asyncDelegateCollectionViewWillDisplayNodeForItemAtIndexPath = [_asyncDelegate respondsToSelector:@selector(collectionView:willDisplayNodeForItemAtIndexPath:)]; + _asyncDelegateFlags.asyncDelegateCollectionViewDidEndDisplayingNodeForItemAtIndexPathDeprecated = [_asyncDelegate respondsToSelector:@selector(collectionView:didEndDisplayingNodeForItemAtIndexPath:)]; + _asyncDelegateFlags.asyncDelegateCollectionViewDidEndDisplayingNodeForItemAtIndexPath = [_asyncDelegate respondsToSelector:@selector(collectionView:didEndDisplayingNode:forItemAtIndexPath:)]; + _asyncDelegateFlags.asyncDelegateCollectionViewWillBeginBatchFetchWithContext = [_asyncDelegate respondsToSelector:@selector(collectionView:willBeginBatchFetchWithContext:)]; + _asyncDelegateFlags.asyncDelegateShouldBatchFetchForCollectionView = [_asyncDelegate respondsToSelector:@selector(shouldBatchFetchForCollectionView:)]; + _asyncDelegateFlags.asyncDelegateScrollViewWillBeginDragging = [_asyncDelegate respondsToSelector:@selector(scrollViewWillBeginDragging:)]; + _asyncDelegateFlags.asyncDelegateScrollViewDidEndDragging = [_asyncDelegate respondsToSelector:@selector(scrollViewDidEndDragging:willDecelerate:)]; } super.delegate = (id)_proxyDelegate; @@ -566,7 +610,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; ASCellNode *cellNode = [cell node]; cellNode.scrollView = collectionView; - if ([_asyncDelegate respondsToSelector:@selector(collectionView:willDisplayNodeForItemAtIndexPath:)]) { + if (_asyncDelegateFlags.asyncDelegateCollectionViewWillDisplayNodeForItemAtIndexPath) { [_asyncDelegate collectionView:self willDisplayNodeForItemAtIndexPath:indexPath]; } @@ -586,7 +630,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; ASCellNode *cellNode = [cell node]; - if ([_asyncDelegate respondsToSelector:@selector(collectionView:didEndDisplayingNode:forItemAtIndexPath:)]) { + if (_asyncDelegateFlags.asyncDelegateCollectionViewDidEndDisplayingNodeForItemAtIndexPath) { ASDisplayNodeAssertNotNil(cellNode, @"Expected node associated with removed cell not to be nil."); [_asyncDelegate collectionView:self didEndDisplayingNode:cellNode forItemAtIndexPath:indexPath]; } @@ -597,7 +641,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - if ([_asyncDelegate respondsToSelector:@selector(collectionView:didEndDisplayingNodeForItemAtIndexPath:)]) { + if (_asyncDelegateFlags.asyncDelegateCollectionViewDidEndDisplayingNodeForItemAtIndexPathDeprecated) { [_asyncDelegate collectionView:self didEndDisplayingNodeForItemAtIndexPath:indexPath]; } #pragma clang diagnostic pop @@ -620,7 +664,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; inScrollView:scrollView withCellFrame:collectionCell.frame]; } - if (_asyncDelegateImplementsScrollviewDidScroll) { + if (_asyncDelegateFlags.asyncDelegateScrollViewDidScroll) { [_asyncDelegate scrollViewDidScroll:scrollView]; } } @@ -637,11 +681,34 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; [self _beginBatchFetchingIfNeededWithScrollView:self forScrollDirection:[self scrollDirection] contentOffset:*targetContentOffset]; } - if ([_asyncDelegate respondsToSelector:@selector(scrollViewWillEndDragging:withVelocity:targetContentOffset:)]) { + if (_asyncDelegateFlags.asyncDelegateScrollViewWillEndDraggingWithVelocityTargetContentOffset) { [_asyncDelegate scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset]; } } +- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView +{ + for (_ASCollectionViewCell *collectionCell in _cellsForVisibilityUpdates) { + [[collectionCell node] cellNodeVisibilityEvent:ASCellNodeVisibilityEventWillBeginDragging + inScrollView:scrollView + withCellFrame:collectionCell.frame]; + } + if (_asyncDelegateFlags.asyncDelegateScrollViewWillBeginDragging) { + [_asyncDelegate scrollViewWillBeginDragging:scrollView]; + } +} + +- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate +{ + for (_ASCollectionViewCell *collectionCell in _cellsForVisibilityUpdates) { + [[collectionCell node] cellNodeVisibilityEvent:ASCellNodeVisibilityEventDidEndDragging + inScrollView:scrollView + withCellFrame:collectionCell.frame]; + } + if (_asyncDelegateFlags.asyncDelegateScrollViewDidEndDragging) { + [_asyncDelegate scrollViewDidEndDragging:scrollView willDecelerate:decelerate]; + } +} #pragma mark - Scroll Direction. @@ -747,8 +814,8 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; - (BOOL)canBatchFetch { // if the delegate does not respond to this method, there is no point in starting to fetch - BOOL canFetch = [_asyncDelegate respondsToSelector:@selector(collectionView:willBeginBatchFetchWithContext:)]; - if (canFetch && [_asyncDelegate respondsToSelector:@selector(shouldBatchFetchForCollectionView:)]) { + BOOL canFetch = _asyncDelegateFlags.asyncDelegateCollectionViewWillBeginBatchFetchWithContext; + if (canFetch && _asyncDelegateFlags.asyncDelegateShouldBatchFetchForCollectionView) { return [_asyncDelegate shouldBatchFetchForCollectionView:self]; } else { return canFetch; @@ -788,7 +855,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; - (void)_beginBatchFetching { [_batchContext beginBatchFetching]; - if ([_asyncDelegate respondsToSelector:@selector(collectionView:willBeginBatchFetchWithContext:)]) { + if (_asyncDelegateFlags.asyncDelegateCollectionViewWillBeginBatchFetchWithContext) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [_asyncDelegate collectionView:self willBeginBatchFetchWithContext:_batchContext]; }); @@ -800,7 +867,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; - (ASCellNodeBlock)dataController:(ASDataController *)dataController nodeBlockAtIndexPath:(NSIndexPath *)indexPath { - if (!_asyncDataSourceImplementsNodeBlockForItemAtIndexPath) { + if (!_asyncDataSourceFlags.asyncDataSourceNodeBlockForItemAtIndexPath) { ASCellNode *node = [_asyncDataSource collectionView:self nodeForItemAtIndexPath:indexPath]; ASDisplayNodeAssert([node isKindOfClass:ASCellNode.class], @"invalid node class, expected ASCellNode"); __weak __typeof__(self) weakSelf = self; @@ -842,7 +909,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; // TODO: Move this logic into the flow layout inspector. Create a simple inspector for non-flow layouts that don't // implement a custom inspector. - if (_asyncDataSourceImplementsConstrainedSizeForNode) { + if (_asyncDataSourceFlags.asyncDataSourceConstrainedSizeForNode) { constrainedSize = [_asyncDataSource collectionView:self constrainedSizeForNodeAtIndexPath:indexPath]; } else { CGSize maxSize = CGSizeEqualToSize(_maxSizeForNodesConstrainedSize, CGSizeZero) ? self.bounds.size : _maxSizeForNodesConstrainedSize; @@ -863,7 +930,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; } - (NSUInteger)numberOfSectionsInDataController:(ASDataController *)dataController { - if ([_asyncDataSource respondsToSelector:@selector(numberOfSectionsInCollectionView:)]) { + if (_asyncDataSourceFlags.asyncDataSourceNumberOfSectionsInCollectionView) { return [_asyncDataSource numberOfSectionsInCollectionView:self]; } else { return 1; @@ -875,7 +942,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; ASDisplayNodeAssert(!self.asyncDataSourceLocked, @"The data source has already been locked"); self.asyncDataSourceLocked = YES; - if ([_asyncDataSource respondsToSelector:@selector(collectionViewLockDataSource:)]) { + if (_asyncDataSourceFlags.asyncDataSourceCollectionViewLockDataSource) { [_asyncDataSource collectionViewLockDataSource:self]; } } @@ -885,11 +952,19 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; ASDisplayNodeAssert(self.asyncDataSourceLocked, @"The data source has already been unlocked"); self.asyncDataSourceLocked = NO; - if ([_asyncDataSource respondsToSelector:@selector(collectionViewUnlockDataSource:)]) { + if (_asyncDataSourceFlags.asyncDataSourceCollectionViewUnlockDataSource) { [_asyncDataSource collectionViewUnlockDataSource:self]; } } +- (id)dataControllerEnvironment +{ + if (self.collectionNode) { + return self.collectionNode; + } + return self.strongCollectionNode; +} + #pragma mark - ASCollectionViewDataControllerSource Supplementary view support - (ASCellNode *)dataController:(ASCollectionDataController *)dataController supplementaryNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath @@ -932,6 +1007,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; - (NSArray *)visibleNodeIndexPathsForRangeController:(ASRangeController *)rangeController { ASDisplayNodeAssertMainThread(); + // Calling visibleNodeIndexPathsForRangeController: will trigger UIKit to call reloadData if it never has, which can result // in incorrect layout if performed at zero size. We can use the fact that nothing can be visible at zero size to return fast. BOOL isZeroSized = CGRectEqualToRect(self.bounds, CGRectZero); @@ -995,6 +1071,11 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; _performingBatchUpdates = NO; } +- (void)didCompleteUpdatesInRangeController:(ASRangeController *)rangeController +{ + [self _checkForBatchFetching]; +} + - (void)rangeController:(ASRangeController *)rangeController didInsertNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions { ASDisplayNodeAssertMainThread(); @@ -1002,13 +1083,12 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes } + [_layoutFacilitator collectionViewWillEditCellsAtIndexPaths:indexPaths batched:_performingBatchUpdates]; if (_performingBatchUpdates) { - [_layoutFacilitator collectionViewWillEditCellsAtIndexPaths:indexPaths batched:YES]; [_batchUpdateBlocks addObject:^{ [super insertItemsAtIndexPaths:indexPaths]; }]; } else { - [_layoutFacilitator collectionViewWillEditCellsAtIndexPaths:indexPaths batched:NO]; [UIView performWithoutAnimation:^{ [super insertItemsAtIndexPaths:indexPaths]; [self _scheduleCheckForBatchFetchingForNumberOfChanges:indexPaths.count]; @@ -1023,13 +1103,12 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes } + [_layoutFacilitator collectionViewWillEditCellsAtIndexPaths:indexPaths batched:_performingBatchUpdates]; if (_performingBatchUpdates) { - [_layoutFacilitator collectionViewWillEditCellsAtIndexPaths:indexPaths batched:YES]; [_batchUpdateBlocks addObject:^{ [super deleteItemsAtIndexPaths:indexPaths]; }]; } else { - [_layoutFacilitator collectionViewWillEditCellsAtIndexPaths:indexPaths batched:NO]; [UIView performWithoutAnimation:^{ [super deleteItemsAtIndexPaths:indexPaths]; [self _scheduleCheckForBatchFetchingForNumberOfChanges:indexPaths.count]; @@ -1044,13 +1123,12 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes } + [_layoutFacilitator collectionViewWillEditSectionsAtIndexSet:indexSet batched:_performingBatchUpdates]; if (_performingBatchUpdates) { - [_layoutFacilitator collectionViewWillEditSectionsAtIndexSet:indexSet batched:YES]; [_batchUpdateBlocks addObject:^{ [super insertSections:indexSet]; }]; } else { - [_layoutFacilitator collectionViewWillEditSectionsAtIndexSet:indexSet batched:NO]; [UIView performWithoutAnimation:^{ [super insertSections:indexSet]; [self _scheduleCheckForBatchFetchingForNumberOfChanges:indexSet.count]; @@ -1065,13 +1143,12 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell"; return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes } + [_layoutFacilitator collectionViewWillEditSectionsAtIndexSet:indexSet batched:_performingBatchUpdates]; if (_performingBatchUpdates) { - [_layoutFacilitator collectionViewWillEditSectionsAtIndexSet:indexSet batched:YES]; [_batchUpdateBlocks addObject:^{ [super deleteSections:indexSet]; }]; } else { - [_layoutFacilitator collectionViewWillEditSectionsAtIndexSet:indexSet batched:NO]; [UIView performWithoutAnimation:^{ [super deleteSections:indexSet]; [self _scheduleCheckForBatchFetchingForNumberOfChanges:indexSet.count]; diff --git a/AsyncDisplayKit/ASCollectionViewLayoutFacilitatorProtocol.h b/AsyncDisplayKit/ASCollectionViewLayoutFacilitatorProtocol.h index 38f43b71a8..7bd3261763 100644 --- a/AsyncDisplayKit/ASCollectionViewLayoutFacilitatorProtocol.h +++ b/AsyncDisplayKit/ASCollectionViewLayoutFacilitatorProtocol.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCollectionViewLayoutFacilitatorProtocol.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once diff --git a/AsyncDisplayKit/ASCollectionViewProtocols.h b/AsyncDisplayKit/ASCollectionViewProtocols.h index 5c4bcf96ed..eb2dbe0173 100644 --- a/AsyncDisplayKit/ASCollectionViewProtocols.h +++ b/AsyncDisplayKit/ASCollectionViewProtocols.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCollectionViewProtocols.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// NS_ASSUME_NONNULL_BEGIN diff --git a/AsyncDisplayKit/ASContextTransitioning.h b/AsyncDisplayKit/ASContextTransitioning.h index 037f9a64d3..1b87cad643 100644 --- a/AsyncDisplayKit/ASContextTransitioning.h +++ b/AsyncDisplayKit/ASContextTransitioning.h @@ -3,11 +3,17 @@ // AsyncDisplayKit // // Created by Levi McCallum on 2/4/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import +NS_ASSUME_NONNULL_BEGIN + extern NSString * const ASTransitionContextFromLayoutKey; extern NSString * const ASTransitionContextToLayoutKey; @@ -21,7 +27,7 @@ extern NSString * const ASTransitionContextToLayoutKey; /** * @abstract Retrieve either the "from" or "to" layout */ -- (ASLayout *)layoutForKey:(NSString *)key; +- (nullable ASLayout *)layoutForKey:(NSString *)key; /** * @abstract Retrieve either the "from" or "to" constrainedSize @@ -62,3 +68,5 @@ extern NSString * const ASTransitionContextToLayoutKey; - (void)completeTransition:(BOOL)didComplete; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/ASControlNode+Subclasses.h b/AsyncDisplayKit/ASControlNode+Subclasses.h index 003037532f..79da77e4d7 100644 --- a/AsyncDisplayKit/ASControlNode+Subclasses.h +++ b/AsyncDisplayKit/ASControlNode+Subclasses.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASControlNode+Subclasses.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASControlNode.h" #import "ASDisplayNode+Subclasses.h" diff --git a/AsyncDisplayKit/ASControlNode+tvOS.h b/AsyncDisplayKit/ASControlNode+tvOS.h new file mode 100644 index 0000000000..964fbbc52c --- /dev/null +++ b/AsyncDisplayKit/ASControlNode+tvOS.h @@ -0,0 +1,19 @@ +// +// ASControlNode+tvOS.h +// AsyncDisplayKit +// +// Created by Aaron Schubert on 21/04/2016. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#if TARGET_OS_TV +#import + +@interface ASControlNode (tvOS) + +@end +#endif diff --git a/AsyncDisplayKit/ASControlNode+tvOS.m b/AsyncDisplayKit/ASControlNode+tvOS.m new file mode 100644 index 0000000000..e4931cd0f9 --- /dev/null +++ b/AsyncDisplayKit/ASControlNode+tvOS.m @@ -0,0 +1,92 @@ +// +// ASControlNode+tvOS.m +// AsyncDisplayKit +// +// Created by Aaron Schubert on 21/04/2016. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +#if TARGET_OS_TV +#import "ASControlNode+tvOS.h" + +@implementation ASControlNode (tvOS) + +#pragma mark - tvOS +- (void)pressDown +{ + [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationCurveLinear animations:^{ + [self setPressedState]; + } completion:^(BOOL finished) { + if (finished) { + [UIView animateWithDuration:0.1 delay:0 options:UIViewAnimationCurveLinear animations:^{ + [self setFocusedState]; + } completion:nil]; + } + }]; +} + +- (BOOL)canBecomeFocused +{ + return YES; +} + +- (BOOL)shouldUpdateFocusInContext:(nonnull UIFocusUpdateContext *)context +{ + return YES; +} + +- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator +{ + //FIXME: This is never valid inside an ASCellNode + if (context.nextFocusedView && context.nextFocusedView == self.view) { + //Focused + [coordinator addCoordinatedAnimations:^{ + [self setFocusedState]; + } completion:nil]; + } else{ + //Not focused + [coordinator addCoordinatedAnimations:^{ + [self setDefaultFocusAppearance]; + } completion:nil]; + } +} + +- (void)setFocusedState +{ + CALayer *layer = self.layer; + layer.shadowOffset = CGSizeMake(2, 10); + [self applyDefaultShadowProperties: layer]; + self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.1, 1.1); +} + +- (void)setPressedState +{ + CALayer *layer = self.layer; + layer.shadowOffset = CGSizeMake(2, 2); + [self applyDefaultShadowProperties: layer]; + self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1, 1); +} + +- (void)applyDefaultShadowProperties:(CALayer *)layer +{ + layer.shadowColor = [UIColor blackColor].CGColor; + layer.shadowRadius = 12.0; + layer.shadowOpacity = 0.45; + layer.shadowPath = [UIBezierPath bezierPathWithRect:self.layer.bounds].CGPath; +} + +- (void)setDefaultFocusAppearance +{ + CALayer *layer = self.layer; + layer.shadowOffset = CGSizeZero; + layer.shadowColor = [UIColor blackColor].CGColor; + layer.shadowRadius = 0; + layer.shadowOpacity = 0; + layer.shadowPath = [UIBezierPath bezierPathWithRect:self.layer.bounds].CGPath; + self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1, 1); +} +@end +#endif diff --git a/AsyncDisplayKit/ASControlNode.h b/AsyncDisplayKit/ASControlNode.h index 4bac37ff22..cb0952fe4e 100644 --- a/AsyncDisplayKit/ASControlNode.h +++ b/AsyncDisplayKit/ASControlNode.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASControlNode.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -30,6 +32,9 @@ typedef NS_OPTIONS(NSUInteger, ASControlNodeEvent) ASControlNodeEventTouchUpOutside = 1 << 5, /** A system event canceling the current touches for the control node. */ ASControlNodeEventTouchCancel = 1 << 6, + /** A system event when the Play/Pause button on the Apple TV remote is pressed. */ + ASControlNodeEventPrimaryActionTriggered = 1 << 13, + /** All events, including system events. */ ASControlNodeEventAllEvents = 0xFFFFFFFF }; @@ -119,7 +124,12 @@ typedef NS_OPTIONS(NSUInteger, ASControlState) { @param event The event which triggered these control actions. May be nil. */ - (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(nullable UIEvent *)event; - +#if TARGET_OS_TV +/** + @abstract How the node looks when it isn't focused. Exposed here so that subclasses can override. + */ +- (void)setDefaultFocusAppearance; +#endif @end NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/ASControlNode.mm b/AsyncDisplayKit/ASControlNode.mm index afca48a486..a2be60e5bf 100644 --- a/AsyncDisplayKit/ASControlNode.mm +++ b/AsyncDisplayKit/ASControlNode.mm @@ -1,16 +1,20 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASControlNode.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASControlNode.h" #import "ASControlNode+Subclasses.h" #import "ASThread.h" #import "ASDisplayNodeExtras.h" #import "ASImageNode.h" +#import "AsyncDisplayKit+Debug.h" +#import "ASInternalHelpers.h" // UIControl allows dragging some distance outside of the control itself during // tracking. This value depends on the device idiom (25 or 70 points), so @@ -71,8 +75,6 @@ void _ASEnumerateControlEventsIncludedInMaskWithBlock(ASControlNodeEvent mask, v @end -static BOOL _enableHitTestDebug = NO; - @implementation ASControlNode { ASImageNode *_debugHighlightOverlay; @@ -89,9 +91,22 @@ static BOOL _enableHitTestDebug = NO; // As we have no targets yet, we start off with user interaction off. When a target is added, it'll get turned back on. self.userInteractionEnabled = NO; + return self; } +#if TARGET_OS_TV +- (void)didLoad +{ + // On tvOS all controls, such as buttons, interact with the focus system even if they don't have a target set on them. + // Here we add our own internal tap gesture to handle this behaviour. + self.userInteractionEnabled = YES; + UITapGestureRecognizer *tapGestureRec = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(pressDown)]; + tapGestureRec.allowedPressTypes = @[@(UIPressTypeSelect)]; + [self.view addGestureRecognizer:tapGestureRec]; +} +#endif + - (void)setUserInteractionEnabled:(BOOL)userInteractionEnabled { [super setUserInteractionEnabled:userInteractionEnabled]; @@ -249,14 +264,15 @@ static BOOL _enableHitTestDebug = NO; _controlEventDispatchTable = [[NSMutableDictionary alloc] initWithCapacity:kASControlNodeEventDispatchTableInitialCapacity]; // enough to handle common types without re-hashing the dictionary when adding entries. // only show tap-able areas for views with 1 or more addTarget:action: pairs - if (_enableHitTestDebug) { - - // add a highlight overlay node with area of ASControlNode + UIEdgeInsets - self.clipsToBounds = NO; - _debugHighlightOverlay = [[ASImageNode alloc] init]; - _debugHighlightOverlay.zPosition = 1000; // CALayer doesn't have -moveSublayerToFront, but this will ensure we're over the top of any siblings. - _debugHighlightOverlay.layerBacked = YES; - [self addSubnode:_debugHighlightOverlay]; + if ([ASControlNode enableHitTestDebug] && _debugHighlightOverlay == nil) { + ASPerformBlockOnMainThread(^{ + // add a highlight overlay node with area of ASControlNode + UIEdgeInsets + self.clipsToBounds = NO; + _debugHighlightOverlay = [[ASImageNode alloc] init]; + _debugHighlightOverlay.zPosition = 1000; // ensure we're over the top of any siblings + _debugHighlightOverlay.layerBacked = YES; + [self addSubnode:_debugHighlightOverlay]; + }); } } @@ -457,134 +473,9 @@ void _ASEnumerateControlEventsIncludedInMaskWithBlock(ASControlNodeEvent mask, v } #pragma mark - Debug -// Layout method required when _enableHitTestDebug is enabled. -- (void)layout +- (ASImageNode *)debugHighlightOverlay { - [super layout]; - - if (_debugHighlightOverlay) { - - // Even if our parents don't have clipsToBounds set and would allow us to display the debug overlay, UIKit event delivery (hitTest:) - // will not search sub-hierarchies if one of our parents does not return YES for pointInside:. In such a scenario, hitTestSlop - // may not be able to expand the tap target as much as desired without also setting some hitTestSlop on the limiting parents. - CGRect intersectRect = UIEdgeInsetsInsetRect(self.bounds, [self hitTestSlop]); - UIRectEdge clippedEdges = UIRectEdgeNone; - UIRectEdge clipsToBoundsClippedEdges = UIRectEdgeNone; - CALayer *layer = self.layer; - CALayer *intersectLayer = layer; - CALayer *intersectSuperlayer = layer.superlayer; - - // Stop climbing if we encounter a UIScrollView, as its offset bounds origin may make it seem like our events will be clipped when - // scrolling will actually reveal them (because this process will not re-run due to scrolling) - while (intersectSuperlayer && ![intersectSuperlayer.delegate respondsToSelector:@selector(contentOffset)]) { - // Get our parent's tappable bounds. If the parent has an associated node, consider hitTestSlop, as it will extend its pointInside:. - CGRect parentHitRect = intersectSuperlayer.bounds; - BOOL parentClipsToBounds = NO; - - ASDisplayNode *parentNode = ASLayerToDisplayNode(intersectSuperlayer); - if (parentNode) { - UIEdgeInsets parentSlop = [parentNode hitTestSlop]; - - // if parent has a hitTestSlop as well, we need to account for the fact that events will be routed towards us in that area too. - if (!UIEdgeInsetsEqualToEdgeInsets(UIEdgeInsetsZero, parentSlop)) { - parentClipsToBounds = parentNode.clipsToBounds; - // if the parent is clipping, this will prevent us from showing the overlay outside that area. - // in this case, we will make the overlay smaller so that the special highlight to indicate the overlay - // cannot accurately display the true tappable area is shown. - if (!parentClipsToBounds) { - parentHitRect = UIEdgeInsetsInsetRect(parentHitRect, [parentNode hitTestSlop]); - } - } - } - - // Convert our current rectangle to parent coordinates, and intersect with the parent's hit rect. - CGRect intersectRectInParentCoordinates = [intersectSuperlayer convertRect:intersectRect fromLayer:intersectLayer]; - intersectRect = CGRectIntersection(parentHitRect, intersectRectInParentCoordinates); - if (!CGSizeEqualToSize(parentHitRect.size, intersectRectInParentCoordinates.size)) { - clippedEdges = [self setEdgesOfIntersectionForChildRect:intersectRectInParentCoordinates - parentRect:parentHitRect rectEdge:clippedEdges]; - if (parentClipsToBounds) { - clipsToBoundsClippedEdges = [self setEdgesOfIntersectionForChildRect:intersectRectInParentCoordinates - parentRect:parentHitRect rectEdge:clipsToBoundsClippedEdges]; - } - } - - // Advance up the tree. - intersectLayer = intersectSuperlayer; - intersectSuperlayer = intersectLayer.superlayer; - } - - CGRect finalRect = [intersectLayer convertRect:intersectRect toLayer:layer]; - UIColor *fillColor = [[UIColor greenColor] colorWithAlphaComponent:0.4]; - - // determine if edges are clipped - if (clippedEdges == UIRectEdgeNone) { - _debugHighlightOverlay.backgroundColor = fillColor; - } else { - const CGFloat borderWidth = 2.0; - UIColor *borderColor = [[UIColor orangeColor] colorWithAlphaComponent:0.8]; - UIColor *clipsBorderColor = [UIColor colorWithRed:30/255.0 green:90/255.0 blue:50/255.0 alpha:0.7]; - CGRect imgRect = CGRectMake(0, 0, 2.0 * borderWidth + 1.0, 2.0 * borderWidth + 1.0); - UIGraphicsBeginImageContext(imgRect.size); - - [fillColor setFill]; - UIRectFill(imgRect); - - [self drawEdgeIfClippedWithEdges:clippedEdges color:clipsBorderColor borderWidth:borderWidth imgRect:imgRect]; - [self drawEdgeIfClippedWithEdges:clipsToBoundsClippedEdges color:borderColor borderWidth:borderWidth imgRect:imgRect]; - - UIImage *debugHighlightImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - UIEdgeInsets edgeInsets = UIEdgeInsetsMake(borderWidth, borderWidth, borderWidth, borderWidth); - _debugHighlightOverlay.image = [debugHighlightImage resizableImageWithCapInsets:edgeInsets - resizingMode:UIImageResizingModeStretch]; - _debugHighlightOverlay.backgroundColor = nil; - } - - _debugHighlightOverlay.frame = finalRect; - } -} - -- (UIRectEdge)setEdgesOfIntersectionForChildRect:(CGRect)childRect parentRect:(CGRect)parentRect rectEdge:(UIRectEdge)rectEdge -{ - if (childRect.origin.y < parentRect.origin.y) { - rectEdge |= UIRectEdgeTop; - } - if (childRect.origin.x < parentRect.origin.x) { - rectEdge |= UIRectEdgeLeft; - } - if (CGRectGetMaxY(childRect) > CGRectGetMaxY(parentRect)) { - rectEdge |= UIRectEdgeBottom; - } - if (CGRectGetMaxX(childRect) > CGRectGetMaxX(parentRect)) { - rectEdge |= UIRectEdgeRight; - } - - return rectEdge; -} - -- (void)drawEdgeIfClippedWithEdges:(UIRectEdge)rectEdge color:(UIColor *)color borderWidth:(CGFloat)borderWidth imgRect:(CGRect)imgRect -{ - [color setFill]; - - if (rectEdge & UIRectEdgeTop) { - UIRectFill(CGRectMake(0.0, 0.0, imgRect.size.width, borderWidth)); - } - if (rectEdge & UIRectEdgeLeft) { - UIRectFill(CGRectMake(0.0, 0.0, borderWidth, imgRect.size.height)); - } - if (rectEdge & UIRectEdgeBottom) { - UIRectFill(CGRectMake(0.0, imgRect.size.height - borderWidth, imgRect.size.width, borderWidth)); - } - if (rectEdge & UIRectEdgeRight) { - UIRectFill(CGRectMake(imgRect.size.width - borderWidth, 0.0, borderWidth, imgRect.size.height)); - } -} - -+ (void)setEnableHitTestDebug:(BOOL)enable -{ - _enableHitTestDebug = enable; + return _debugHighlightOverlay; } @end diff --git a/AsyncDisplayKit/ASDisplayNode+Beta.h b/AsyncDisplayKit/ASDisplayNode+Beta.h index 4bb108b66a..428f95f34c 100644 --- a/AsyncDisplayKit/ASDisplayNode+Beta.h +++ b/AsyncDisplayKit/ASDisplayNode+Beta.h @@ -1,13 +1,17 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNode+Beta.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASContextTransitioning.h" +NS_ASSUME_NONNULL_BEGIN + ASDISPLAYNODE_EXTERN_C_BEGIN void ASPerformBlockOnMainThread(void (^block)()); void ASPerformBlockOnBackgroundThread(void (^block)()); // DISPATCH_QUEUE_PRIORITY_DEFAULT @@ -35,12 +39,12 @@ ASDISPLAYNODE_EXTERN_C_END * restoring context if necessary. Restoring can be done in contextDidDisplayNodeContent * This block can be called from *any* thread and it is unsafe to access any UIKit main thread properties from it. */ -@property (nonatomic, strong) ASDisplayNodeContextModifier willDisplayNodeContentWithRenderingContext; +@property (nonatomic, copy, nullable) ASDisplayNodeContextModifier willDisplayNodeContentWithRenderingContext; /** * @abstract allow modification of a context after the node's content is drawn */ -@property (nonatomic, strong) ASDisplayNodeContextModifier didDisplayNodeContentWithRenderingContext; +@property (nonatomic, copy, nullable) ASDisplayNodeContextModifier didDisplayNodeContentWithRenderingContext; /** @name Layout Transitioning */ @@ -73,7 +77,7 @@ ASDISPLAYNODE_EXTERN_C_END - (void)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize animated:(BOOL)animated shouldMeasureAsync:(BOOL)shouldMeasureAsync - measurementCompletion:(void(^)())completion; + measurementCompletion:(nullable void(^)())completion; /** * @abstract Invalidates the current layout and begins a relayout of the node with the current `constrainedSize`. Must be called on main thread. @@ -88,8 +92,8 @@ ASDISPLAYNODE_EXTERN_C_END * @see animateLayoutTransition: */ - (void)transitionLayoutWithAnimation:(BOOL)animated - shouldMeasureAsync:(BOOL)shouldMeasureAsync - measurementCompletion:(void(^)())completion; + shouldMeasureAsync:(BOOL)shouldMeasureAsync + measurementCompletion:(nullable void(^)())completion; /** @@ -103,4 +107,15 @@ ASDISPLAYNODE_EXTERN_C_END */ - (void)cancelLayoutTransitionsInProgress; +/** + * @abstract Indicates that the receiver and all subnodes have finished displaying. May be called more than once, for example if the receiver has + * a network image node. This is called after the first display pass even if network image nodes have not downloaded anything (text would be done, + * and other nodes that are ready to do their final display). Each render of every progressive jpeg network node would cause this to be called, so + * this hook could be called up to 1 + (pJPEGcount * pJPEGrenderCount) times. The render count depends on how many times the downloader calls the + * progressImage block. + */ +- (void)hierarchyDisplayDidFinish; + @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/ASDisplayNode+Subclasses.h b/AsyncDisplayKit/ASDisplayNode+Subclasses.h index d7dad4cbc8..967b82270d 100644 --- a/AsyncDisplayKit/ASDisplayNode+Subclasses.h +++ b/AsyncDisplayKit/ASDisplayNode+Subclasses.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNode+Subclasses.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -89,7 +91,7 @@ NS_ASSUME_NONNULL_BEGIN * @discussion Gives a chance for subclasses to perform actions after the subclass and superclass have finished laying * out. */ -- (void)layoutDidFinish; +- (void)layoutDidFinish ASDISPLAYNODE_REQUIRES_SUPER; /** * @abstract Called on a background thread if !isNodeLoaded - called on the main thread if isNodeLoaded. @@ -97,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN * @discussion When the .calculatedLayout property is set to a new ASLayout (directly from -calculateLayoutThatFits: or * calculated via use of -layoutSpecThatFits:), subclasses may inspect it here. */ -- (void)calculatedLayoutDidChange; +- (void)calculatedLayoutDidChange ASDISPLAYNODE_REQUIRES_SUPER; /** @name Layout calculation */ @@ -143,6 +145,10 @@ NS_ASSUME_NONNULL_BEGIN * encouraged. * * @note This method should not be called directly outside of ASDisplayNode; use -measure: or -calculatedLayout instead. + * + * @warning Subclasses that implement -layoutSpecThatFits: must not also use .layoutSpecBlock. Doing so will trigger + * an exception. A future version of the framework may support using both, calling them serially, with the + * .layoutSpecBlock superseding any values set by the method override. */ - (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize; @@ -238,6 +244,31 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)visibilityDidChange:(BOOL)isVisible ASDISPLAYNODE_REQUIRES_SUPER; +/** + * @abstract Called whenever the visiblity of the node changed. + * + * @discussion Subclasses may use this to monitor when they become visible. + */ +- (void)visibleStateDidChange:(BOOL)isVisible ASDISPLAYNODE_REQUIRES_SUPER; + +/** + * @abstract Called whenever the the node has entered or exited the display state. + * + * @discussion Subclasses may use this to monitor when a node should be rendering its content. + * + * @note This method can be called from any thread and should therefore be thread safe. + */ +- (void)displayStateDidChange:(BOOL)inDisplayState ASDISPLAYNODE_REQUIRES_SUPER; + +/** + * @abstract Called whenever the the node has entered or left the load state. + * + * @discussion Subclasses may use this to monitor data for a node should be loaded, either from a local or remote source. + * + * @note This method can be called from any thread and should therefore be thread safe. + */ +- (void)loadStateDidChange:(BOOL)inLoadState ASDISPLAYNODE_REQUIRES_SUPER; + /** * Called just before the view is added to a window. */ diff --git a/AsyncDisplayKit/ASDisplayNode.h b/AsyncDisplayKit/ASDisplayNode.h index 2ec93bdad8..c0361d0ce6 100644 --- a/AsyncDisplayKit/ASDisplayNode.h +++ b/AsyncDisplayKit/ASDisplayNode.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNode.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -42,6 +44,11 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode * _Nonnull node); */ typedef void (^ASDisplayNodeContextModifier)(_Nonnull CGContextRef context); +/** + * ASDisplayNode layout spec block. This block can be used instead of implementing layoutSpecThatFits: in subclass + */ +typedef ASLayoutSpec * _Nonnull(^ASLayoutSpecBlock)(ASDisplayNode * _Nonnull node, ASSizeRange constrainedSize); + /** Interface state is available on ASDisplayNode and ASViewController, and allows checking whether a node is in an interface situation where it is prudent to trigger certain @@ -252,6 +259,21 @@ NS_ASSUME_NONNULL_BEGIN */ - (ASLayout *)measureWithSizeRange:(ASSizeRange)constrainedSize; + +/** + * @abstract Provides a way to declare a block to provide an ASLayoutSpec without having to subclass ASDisplayNode and + * implement layoutSpecThatFits: + * + * @return A block that takes a constrainedSize ASSizeRange argument, and must return an ASLayoutSpec that includes all + * of the subnodes to position in the layout. This input-output relationship is identical to the subclass override + * method -layoutSpecThatFits: + * + * @warning Subclasses that implement -layoutSpecThatFits: must not also use .layoutSpecBlock. Doing so will trigger + * an exception. A future version of the framework may support using both, calling them serially, with the + * .layoutSpecBlock superseding any values set by the method override. + */ +@property (nonatomic, readwrite, copy, nullable) ASLayoutSpecBlock layoutSpecBlock; + /** * @abstract Return the calculated size. * diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index 56f7f85458..e38731e7f8 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNode.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASDisplayNodeInternal.h" #import "ASDisplayNode+Subclasses.h" @@ -20,8 +22,9 @@ #import "_ASDisplayView.h" #import "_ASScopeTimer.h" #import "_ASCoreAnimationExtras.h" -#import "ASDisplayNodeLayoutContext.h" +#import "ASLayoutTransition.h" #import "ASDisplayNodeExtras.h" +#import "ASTraitCollection.h" #import "ASEqualityHelpers.h" #import "ASRunLoopQueue.h" #import "ASEnvironmentInternal.h" @@ -29,6 +32,7 @@ #import "ASInternalHelpers.h" #import "ASLayout.h" #import "ASLayoutSpec.h" +#import "ASLayoutValidation.h" #import "ASCellNode.h" NSInteger const ASDefaultDrawingPriority = ASDefaultTransactionPriority; @@ -60,7 +64,9 @@ NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp = @"AS @implementation ASDisplayNode // these dynamic properties all defined in ASLayoutOptionsPrivate.m -@dynamic spacingAfter, spacingBefore, flexGrow, flexShrink, flexBasis, alignSelf, ascender, descender, sizeRange, layoutPosition; +@dynamic spacingAfter, spacingBefore, flexGrow, flexShrink, flexBasis, + alignSelf, ascender, descender, sizeRange, layoutPosition, layoutableType; + @synthesize name = _name; @synthesize preferredFrameSize = _preferredFrameSize; @synthesize isFinalLayoutable = _isFinalLayoutable; @@ -83,6 +89,13 @@ BOOL ASDisplayNodeSubclassOverridesSelector(Class subclass, SEL selector) return ASSubclassOverridesSelector([ASDisplayNode class], subclass, selector); } +// For classes like ASTableNode, ASCollectionNode, ASScrollNode and similar - we have to be sure to set certain properties +// like setFrame: and setBackgroundColor: directly to the UIView and not apply it to the layer only. +BOOL ASDisplayNodeNeedsSpecialPropertiesHandlingForFlags(ASDisplayNodeFlags flags) +{ + return flags.synchronous && !flags.layerBacked; +} + _ASPendingState *ASDisplayNodeGetPendingState(ASDisplayNode *node) { ASDN::MutexLocker l(node->_propertyLock); @@ -160,8 +173,17 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) return overrides; } + // At most a layoutSpecBlock or one of the three layout methods is overridden +#define __ASDisplayNodeCheckForLayoutMethodOverrides \ + ASDisplayNodeAssert(_layoutSpecBlock != NULL || \ + (ASDisplayNodeSubclassOverridesSelector(self.class, @selector(calculateSizeThatFits:)) ? 1 : 0) \ + + (ASDisplayNodeSubclassOverridesSelector(self.class, @selector(layoutSpecThatFits:)) ? 1 : 0) \ + + (ASDisplayNodeSubclassOverridesSelector(self.class, @selector(calculateLayoutThatFits:)) ? 1 : 0) <= 1, \ + @"Subclass %@ must at least provide a layoutSpecBlock or override at most one of the three layout methods: calculateLayoutThatFits, layoutSpecThatFits or calculateSizeThatFits", NSStringFromClass(self.class)) + + (void)initialize { + [super initialize]; if (self != [ASDisplayNode class]) { // Subclasses should never override these @@ -171,12 +193,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) ASDisplayNodeAssert(!ASDisplayNodeSubclassOverridesSelector(self, @selector(measureWithSizeRange:)), @"Subclass %@ must not override measureWithSizeRange method", NSStringFromClass(self)); ASDisplayNodeAssert(!ASDisplayNodeSubclassOverridesSelector(self, @selector(recursivelyClearContents)), @"Subclass %@ must not override recursivelyClearContents method", NSStringFromClass(self)); ASDisplayNodeAssert(!ASDisplayNodeSubclassOverridesSelector(self, @selector(recursivelyClearFetchedData)), @"Subclass %@ must not override recursivelyClearFetchedData method", NSStringFromClass(self)); - - // At most one of the three layout methods is overridden - ASDisplayNodeAssert((ASDisplayNodeSubclassOverridesSelector(self, @selector(calculateSizeThatFits:)) ? 1 : 0) - + (ASDisplayNodeSubclassOverridesSelector(self, @selector(layoutSpecThatFits:)) ? 1 : 0) - + (ASDisplayNodeSubclassOverridesSelector(self, @selector(calculateLayoutThatFits:)) ? 1 : 0) <= 1, - @"Subclass %@ must override at most one of the three layout methods: calculateLayoutThatFits, layoutSpecThatFits or calculateSizeThatFits", NSStringFromClass(self)); } // Below we are pre-calculating values per-class and dynamically adding a method (_staticInitialize) to populate these values @@ -189,8 +205,11 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) BOOL instancesOverrideRespondsToSelector = ASSubclassOverridesSelector([NSObject class], self, @selector(respondsToSelector:)); struct ASDisplayNodeFlags flags = GetASDisplayNodeFlags(self, nil); ASDisplayNodeMethodOverrides methodOverrides = GetASDisplayNodeMethodOverrides(self); + + __unused Class initializeSelf = self; IMP staticInitialize = imp_implementationWithBlock(^(ASDisplayNode *node) { + ASDisplayNodeAssert(node.class == initializeSelf, @"Node class %@ does not have a matching _staticInitialize method; check to ensure [super initialize] is called within any custom +initialize implementations! Overridden methods will not be called unless they are also implemented by superclass %@", node.class, initializeSelf); node->_flags = (classOverridesRespondsToSelector || instancesOverrideRespondsToSelector) ? GetASDisplayNodeFlags(node.class, node) : flags; node->_methodOverrides = (classOverridesRespondsToSelector) ? GetASDisplayNodeMethodOverrides(node.class) : methodOverrides; }); @@ -254,6 +273,9 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) _preferredFrameSize = CGSizeZero; _environmentState = ASEnvironmentStateMakeDefault(); + + _flags.canClearContentsOfLayer = YES; + _flags.canCallNeedsDisplayOfLayer = NO; } - (instancetype)init @@ -364,7 +386,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) _pendingViewState = nil; _displaySentinel = nil; - _transitionSentinel = nil; _pendingDisplayNodes = nil; } @@ -422,6 +443,15 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) } view = [[_viewClass alloc] init]; } + + // Update flags related to special handling of UIImageView layers. More details on the flags + if (_flags.synchronous) { + if ([view isKindOfClass:[UIImageView class]]) { + _flags.canClearContentsOfLayer = NO; + } else { + _flags.canCallNeedsDisplayOfLayer = YES; + } + } return view; } @@ -600,25 +630,20 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) [self cancelLayoutTransitionsInProgress]; ASLayout *previousLayout = _layout; - ASSizeRange previousConstrainedSize = _constrainedSize; ASLayout *newLayout = [self calculateLayoutThatFits:constrainedSize]; if (ASHierarchyStateIncludesLayoutPending(_hierarchyState)) { - _pendingLayoutContext = [[ASDisplayNodeLayoutContext alloc] initWithNode:self - pendingLayout:newLayout - pendingConstrainedSize:constrainedSize - previousLayout:previousLayout - previousConstrainedSize:previousConstrainedSize]; + _pendingLayoutTransition = [[ASLayoutTransition alloc] initWithNode:self + pendingLayout:newLayout + previousLayout:previousLayout]; } else { - ASDisplayNodeLayoutContext *layoutContext; + ASLayoutTransition *layoutContext; if (self.usesImplicitHierarchyManagement) { - layoutContext = [[ASDisplayNodeLayoutContext alloc] initWithNode:self - pendingLayout:newLayout - pendingConstrainedSize:constrainedSize - previousLayout:previousLayout - previousConstrainedSize:previousConstrainedSize]; + layoutContext = [[ASLayoutTransition alloc] initWithNode:self + pendingLayout:newLayout + previousLayout:previousLayout]; } - [self applyLayout:newLayout constrainedSize:constrainedSize layoutContext:layoutContext]; + [self applyLayout:newLayout layoutContext:layoutContext]; [self _completeLayoutCalculation]; } @@ -639,19 +664,30 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) } } - // only calculate the size if - // - we haven't already - // - the constrained size range is different - return (!_flags.isMeasured || !ASSizeRangeEqualToSizeRange(constrainedSize, _constrainedSize)); + // Only generate a new layout if: + // - The current layout is dirty + // - The passed constrained size is different than the layout's constrained size + return ([self _hasDirtyLayout] || !ASSizeRangeEqualToSizeRange(constrainedSize, _layout.constrainedSizeRange)); } +- (BOOL)_hasDirtyLayout +{ + return _layout == nil || _layout.isDirty; +} + +- (ASLayoutableType)layoutableType +{ + return ASLayoutableTypeDisplayNode; +} + +#pragma mark - Layout Transition + - (void)transitionLayoutWithAnimation:(BOOL)animated shouldMeasureAsync:(BOOL)shouldMeasureAsync measurementCompletion:(void(^)())completion { - ASSizeRange currentConstrainedSize = _constrainedSize; [self invalidateCalculatedLayout]; - [self transitionLayoutWithSizeRange:currentConstrainedSize + [self transitionLayoutWithSizeRange:_layout.constrainedSizeRange animated:animated shouldMeasureAsync:shouldMeasureAsync measurementCompletion:completion]; @@ -672,10 +708,10 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) ASDisplayNodeAssert(ASHierarchyStateIncludesLayoutPending(_hierarchyState) == NO, @"Can't start a transition when one of the supernodes is performing one."); } - int32_t transitionID = [self _newTransitionID]; + int32_t transitionID = [self _startNewTransition]; ASDisplayNodePerformBlockOnEverySubnode(self, ^(ASDisplayNode * _Nonnull node) { - ASDisplayNodeAssert([node _hasTransitionsInProgress] == NO, @"Can't start a transition when one of the subnodes is performing one."); + ASDisplayNodeAssert([node _hasTransitionInProgress] == NO, @"Can't start a transition when one of the subnodes is performing one."); node.hierarchyState |= ASHierarchyStateLayoutPending; node.pendingTransitionID = transitionID; }); @@ -714,30 +750,27 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) } ASLayout *previousLayout = _layout; - ASSizeRange previousConstrainedSize = _constrainedSize; - [self applyLayout:newLayout constrainedSize:constrainedSize layoutContext:nil]; - - [self _invalidateTransitionSentinel]; + [self applyLayout:newLayout layoutContext:nil]; ASDisplayNodePerformBlockOnEverySubnode(self, ^(ASDisplayNode * _Nonnull node) { [node applyPendingLayoutContext]; [node _completeLayoutCalculation]; node.hierarchyState &= (~ASHierarchyStateLayoutPending); }); + + [self _finishOrCancelTransition]; if (completion) { completion(); } - _pendingLayoutContext = [[ASDisplayNodeLayoutContext alloc] initWithNode:self - pendingLayout:newLayout - pendingConstrainedSize:constrainedSize - previousLayout:previousLayout - previousConstrainedSize:previousConstrainedSize]; - [_pendingLayoutContext applySubnodeInsertions]; + _pendingLayoutTransition = [[ASLayoutTransition alloc] initWithNode:self + pendingLayout:newLayout + previousLayout:previousLayout]; + [_pendingLayoutTransition applySubnodeInsertions]; _transitionContext = [[_ASTransitionContext alloc] initWithAnimation:animated - layoutDelegate:_pendingLayoutContext + layoutDelegate:_pendingLayoutTransition completionDelegate:self]; [self animateLayoutTransition:_transitionContext]; }); @@ -772,7 +805,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) } } - - (void)calculatedLayoutDidChange { // subclass override @@ -781,9 +813,10 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) - (void)cancelLayoutTransitionsInProgress { ASDN::MutexLocker l(_propertyLock); - if ([self _hasTransitionsInProgress]) { - // Invalidate transition sentinel to cancel transitions in progress - [self _invalidateTransitionSentinel]; + if ([self _hasTransitionInProgress]) { + // Cancel transition in progress + [self _finishOrCancelTransition]; + // Tell subnodes to exit layout pending state and clear related properties ASDisplayNodePerformBlockOnEverySubnode(self, ^(ASDisplayNode * _Nonnull node) { node.hierarchyState &= (~ASHierarchyStateLayoutPending); @@ -791,8 +824,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) } } -#pragma mark - Layout Transition - - (BOOL)usesImplicitHierarchyManagement { ASDN::MutexLocker l(_propertyLock); @@ -805,6 +836,33 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) _usesImplicitHierarchyManagement = value; } +- (BOOL)_hasTransitionInProgress +{ + ASDN::MutexLocker l(_propertyLock); + return _transitionInProgress; +} + +/// Starts a new transition and returns the transition id +- (int32_t)_startNewTransition +{ + ASDN::MutexLocker l(_propertyLock); + _transitionInProgress = YES; + _transitionID = OSAtomicAdd32(1, &_transitionID); + return _transitionID; +} + +- (void)_finishOrCancelTransition +{ + ASDN::MutexLocker l(_propertyLock); + _transitionInProgress = NO; +} + +- (BOOL)_shouldAbortTransitionWithID:(int32_t)transitionID +{ + ASDN::MutexLocker l(_propertyLock); + return (!_transitionInProgress || _transitionID != transitionID); +} + - (void)animateLayoutTransition:(id)context { [self __layoutSublayouts]; @@ -813,9 +871,9 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) - (void)didCompleteLayoutTransition:(id)context { - [_pendingLayoutContext applySubnodeRemovals]; + [_pendingLayoutTransition applySubnodeRemovals]; [self _completeLayoutCalculation]; - _pendingLayoutContext = nil; + _pendingLayoutTransition = nil; } #pragma mark - _ASTransitionContextCompletionDelegate @@ -904,7 +962,7 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) [self _addSubnodeViewsAndLayers]; } - if (self.interfaceState & ASInterfaceStateVisible) { + if (ASInterfaceStateIncludesVisible(self.interfaceState)) { // TODO: Change this to recursivelyEnsureDisplay - but need a variant that does not skip // nodes that have shouldBypassEnsureDisplay set (such as image nodes) so they are rasterized. [self recursivelyDisplayImmediately]; @@ -954,8 +1012,8 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) if (self.layerBacked) { [_pendingViewState applyToLayer:self.layer]; } else { - BOOL setFrameDirectly = (_flags.synchronous && !_flags.layerBacked); - [_pendingViewState applyToView:self.view setFrameDirectly:setFrameDirectly]; + BOOL specialPropertiesHandling = ASDisplayNodeNeedsSpecialPropertiesHandlingForFlags(_flags); + [_pendingViewState applyToView:self.view withSpecialPropertiesHandling:specialPropertiesHandling]; } [_pendingViewState clearChanges]; @@ -984,35 +1042,38 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) ASDisplayNodeAssertThreadAffinity(self); ASDN::MutexLocker l(_propertyLock); - if (!_flags.isMeasured) { + if ([self _hasDirtyLayout]) { return; } - ASSizeRange oldConstrainedSize = _constrainedSize; [self invalidateCalculatedLayout]; if (_supernode) { + ASDisplayNode *supernode = _supernode; + ASDN::MutexUnlocker u(_propertyLock); // Cause supernode's layout to be invalidated - [_supernode setNeedsLayout]; - } else { - // This is the root node. Trigger a full measurement pass on *current* thread. Old constrained size is re-used. - [self measureWithSizeRange:oldConstrainedSize]; + // We need to release the lock to prevent a deadlock + [supernode setNeedsLayout]; + return; + } + + // This is the root node. Trigger a full measurement pass on *current* thread. Old constrained size is re-used. + [self measureWithSizeRange:_layout.constrainedSizeRange]; - CGRect oldBounds = self.bounds; - CGSize oldSize = oldBounds.size; - CGSize newSize = _layout.size; + CGRect oldBounds = self.bounds; + CGSize oldSize = oldBounds.size; + CGSize newSize = _layout.size; + + if (! CGSizeEqualToSize(oldSize, newSize)) { + self.bounds = (CGRect){ oldBounds.origin, newSize }; - if (! CGSizeEqualToSize(oldSize, newSize)) { - self.bounds = (CGRect){ oldBounds.origin, newSize }; - - // Frame's origin must be preserved. Since it is computed from bounds size, anchorPoint - // and position (see frame setter in ASDisplayNode+UIViewBridge), position needs to be adjusted. - CGPoint anchorPoint = self.anchorPoint; - CGPoint oldPosition = self.position; - CGFloat xDelta = (newSize.width - oldSize.width) * anchorPoint.x; - CGFloat yDelta = (newSize.height - oldSize.height) * anchorPoint.y; - self.position = CGPointMake(oldPosition.x + xDelta, oldPosition.y + yDelta); - } + // Frame's origin must be preserved. Since it is computed from bounds size, anchorPoint + // and position (see frame setter in ASDisplayNode+UIViewBridge), position needs to be adjusted. + CGPoint anchorPoint = self.anchorPoint; + CGPoint oldPosition = self.position; + CGFloat xDelta = (newSize.width - oldSize.width) * anchorPoint.x; + CGFloat yDelta = (newSize.height - oldSize.height) * anchorPoint.y; + self.position = CGPointMake(oldPosition.x + xDelta, oldPosition.y + yDelta); } } @@ -1207,7 +1268,7 @@ static bool disableNotificationsForMovingBetweenParents(ASDisplayNode *from, ASD // This call will apply our .hierarchyState to the new subnode. // If we are a managed hierarchy, as in ASCellNode trees, it will also apply our .interfaceState. [subnode __setSupernode:self]; - + if (self.nodeLoaded) { // If this node has a view or layer, force the subnode to also create its view or layer and add it to the hierarchy here. // Otherwise there is no way for the subnode's view or layer to enter the hierarchy, except recursing down all @@ -1253,7 +1314,7 @@ static bool disableNotificationsForMovingBetweenParents(ASDisplayNode *from, ASD _subnodes = [[NSMutableArray alloc] init]; [_subnodes insertObject:subnode atIndex:subnodeIndex]; [subnode __setSupernode:self]; - + // Don't bother inserting the view/layer if in a rasterized subtree, because there are no layers in the hierarchy and none of this could possibly work. if (!_flags.shouldRasterizeDescendants && [self __shouldLoadViewOrLayer]) { if (_layer) { @@ -1466,40 +1527,36 @@ static NSInteger incrementIfFound(NSInteger i) { [subnode __setSupernode:nil]; } +// NOTE: You must not called this method while holding the receiver's property lock. This may cause deadlocks. - (void)removeFromSupernode { ASDisplayNodeAssertThreadAffinity(self); - BOOL shouldRemoveFromSuperviewOrSuperlayer = NO; + _propertyLock.lock(); + __weak ASDisplayNode *supernode = _supernode; + __weak UIView *view = _view; + __weak CALayer *layer = _layer; + BOOL layerBacked = _flags.layerBacked; + _propertyLock.unlock(); - { - ASDN::MutexLocker l(_propertyLock); - if (!_supernode) - return; + if (supernode == nil) { + return; + } + [supernode _removeSubnode:self]; + + if (self.nodeLoaded && supernode.nodeLoaded) { // Check to ensure that our view or layer is actually inside of our supernode; otherwise, don't remove it. // Though _ASDisplayView decouples the supernode if it is inserted inside another view hierarchy, this is // more difficult to guarantee with _ASDisplayLayer because CoreAnimation doesn't have a -didMoveToSuperlayer. - - if (self.nodeLoaded && _supernode.nodeLoaded) { - if (_flags.layerBacked || _supernode.layerBacked) { - shouldRemoveFromSuperviewOrSuperlayer = (_layer.superlayer == _supernode.layer); - } else { - shouldRemoveFromSuperviewOrSuperlayer = (_view.superview == _supernode.view); - } - } - } - - // Do this before removing the view from the hierarchy, as the node will clear its supernode pointer when its view is removed from the hierarchy. - // This call may result in the object being destroyed. - [_supernode _removeSubnode:self]; - - if (shouldRemoveFromSuperviewOrSuperlayer) { ASPerformBlockOnMainThread(^{ - ASDN::MutexLocker l(_propertyLock); - if (_flags.layerBacked) { - [_layer removeFromSuperlayer]; + if (layerBacked || supernode.layerBacked) { + if (layer.superlayer == supernode.layer) { + [layer removeFromSuperlayer]; + } } else { - [_view removeFromSuperview]; + if (view.superview == supernode.view) { + [view removeFromSuperview]; + } } }); } @@ -1676,9 +1733,11 @@ static NSInteger incrementIfFound(NSInteger i) { } if (supernodeDidChange) { + // Hierarchy state ASHierarchyState stateToEnterOrExit = (newSupernode ? newSupernode.hierarchyState : oldSupernode.hierarchyState); + // Rasterized state BOOL parentWasOrIsRasterized = (newSupernode ? newSupernode.shouldRasterizeDescendants : oldSupernode.shouldRasterizeDescendants); if (parentWasOrIsRasterized) { @@ -1687,8 +1746,15 @@ static NSInteger incrementIfFound(NSInteger i) { if (newSupernode) { [self enterHierarchyState:stateToEnterOrExit]; } else { + // If a node will be removed from the supernode it should go out from the layout pending state to remove all + // layout pending state related properties on the node + stateToEnterOrExit |= ASHierarchyStateLayoutPending; + [self exitHierarchyState:stateToEnterOrExit]; } + + // now that we have a supernode, propagate its traits to self. + ASEnvironmentStatePropagateDown(self, [newSupernode environmentTraitCollection]); } } @@ -1713,27 +1779,39 @@ static NSInteger incrementIfFound(NSInteger i) { [_pendingDisplayNodes removeObject:node]; - if (_pendingDisplayNodes.count == 0 && _placeholderLayer.superlayer && ![self placeholderShouldPersist]) { - void (^cleanupBlock)() = ^{ - [_placeholderLayer removeFromSuperlayer]; - }; + if (_pendingDisplayNodes.count == 0) { + [self hierarchyDisplayDidFinish]; + + if (_placeholderLayer.superlayer && ![self placeholderShouldPersist]) { + void (^cleanupBlock)() = ^{ + [_placeholderLayer removeFromSuperlayer]; + }; - if (_placeholderFadeDuration > 0.0 && ASInterfaceStateIncludesVisible(self.interfaceState)) { - [CATransaction begin]; - [CATransaction setCompletionBlock:cleanupBlock]; - [CATransaction setAnimationDuration:_placeholderFadeDuration]; - _placeholderLayer.opacity = 0.0; - [CATransaction commit]; - } else { - cleanupBlock(); + if (_placeholderFadeDuration > 0.0 && ASInterfaceStateIncludesVisible(self.interfaceState)) { + [CATransaction begin]; + [CATransaction setCompletionBlock:cleanupBlock]; + [CATransaction setAnimationDuration:_placeholderFadeDuration]; + _placeholderLayer.opacity = 0.0; + [CATransaction commit]; + } else { + cleanupBlock(); + } } } } -// Helper method to summarize whether or not the node run through the display process +/// Helper method to summarize whether or not the node run through the display process - (BOOL)__implementsDisplay { - return _flags.implementsDrawRect || _flags.implementsImageDisplay || _flags.shouldRasterizeDescendants || _flags.implementsInstanceDrawRect || _flags.implementsInstanceImageDisplay; + return _flags.implementsDrawRect || _flags.implementsImageDisplay || _flags.shouldRasterizeDescendants || + _flags.implementsInstanceDrawRect || _flags.implementsInstanceImageDisplay; +} + +// Helper method to determine if it's save to call setNeedsDisplay on a layer without throwing away the content. +// For details look at the comment on the canCallNeedsDisplayOfLayer flag +- (BOOL)__canCallNeedsDisplayOfLayer +{ + return _flags.canCallNeedsDisplayOfLayer; } - (BOOL)placeholderShouldPersist @@ -1783,6 +1861,13 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) // (even a runloop observer at a late call order will not stop the next frame from compositing, showing placeholders). ASDisplayNode *node = [layer asyncdisplaykit_node]; + + if ([node __canCallNeedsDisplayOfLayer]) { + // Layers for UIKit components that are wrapped wtihin a node needs to be set to be displayed as the contents of + // the layer get's cleared and would not be recreated otherwise + [layer setNeedsDisplay]; + } + if ([node __implementsDisplay]) { // For layers that do get displayed here, this immediately kicks off the work on the concurrent -[_ASDisplayLayer displayQueue]. // At the same time, it creates an associated _ASAsyncTransaction, which we can use to block on display completion. See ASDisplayNode+AsyncDisplay.mm. @@ -1790,7 +1875,8 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) } // Kick off the recursion first, so that all necessary display calls are sent and the displayQueue is full of parallelizable work. - for (CALayer *sublayer in layer.sublayers) { + // NOTE: The docs report that `sublayers` returns a copy but it actually doesn't. + for (CALayer *sublayer in [layer.sublayers copy]) { recursivelyTriggerDisplayForLayer(sublayer, shouldBlock); } @@ -1841,41 +1927,56 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) - (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize { + __ASDisplayNodeCheckForLayoutMethodOverrides; + ASDN::MutexLocker l(_propertyLock); - if (_methodOverrides & ASDisplayNodeMethodOverrideLayoutSpecThatFits) { + if ((_methodOverrides & ASDisplayNodeMethodOverrideLayoutSpecThatFits) || _layoutSpecBlock != NULL) { ASLayoutSpec *layoutSpec = [self layoutSpecThatFits:constrainedSize]; layoutSpec.parent = self; // This causes upward propogation of any non-default layoutable values. + + // manually propagate the trait collection here so that any layoutSpec children of layoutSpec will get a traitCollection + ASEnvironmentStatePropagateDown(layoutSpec, self.environmentTraitCollection); + layoutSpec.isMutable = NO; ASLayout *layout = [layoutSpec measureWithSizeRange:constrainedSize]; // Make sure layoutableObject of the root layout is `self`, so that the flattened layout will be structurally correct. - if (layout.layoutableObject != self) { + BOOL isFinalLayoutable = (layout.layoutableObject != self); + if (isFinalLayoutable) { layout.position = CGPointZero; - layout = [ASLayout layoutWithLayoutableObject:self size:layout.size sublayouts:@[layout]]; + layout = [ASLayout layoutWithLayoutableObject:self constrainedSizeRange:constrainedSize size:layout.size sublayouts:@[layout]]; +#if LAYOUT_VALIDATION + ASLayoutableValidateLayout(layout); +#endif } - return [layout flattenedLayoutUsingPredicateBlock:^BOOL(ASLayout *evaluatedLayout) { - if (self.usesImplicitHierarchyManagement) { - return ASObjectIsEqual(layout, evaluatedLayout) == NO && [evaluatedLayout.layoutableObject isKindOfClass:[ASDisplayNode class]]; - } else { - return [_subnodes containsObject:evaluatedLayout.layoutableObject]; - } - }]; + return [layout filteredNodeLayoutTree]; } else { // If neither -layoutSpecThatFits: nor -calculateSizeThatFits: is overridden by subclassses, preferredFrameSize should be used, // assume that the default implementation of -calculateSizeThatFits: returns it. CGSize size = [self calculateSizeThatFits:constrainedSize.max]; - return [ASLayout layoutWithLayoutableObject:self size:ASSizeRangeClamp(constrainedSize, size)]; + return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize + size:ASSizeRangeClamp(constrainedSize, size)]; } } - (CGSize)calculateSizeThatFits:(CGSize)constrainedSize { + __ASDisplayNodeCheckForLayoutMethodOverrides; + ASDN::MutexLocker l(_propertyLock); return _preferredFrameSize; } - (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize { + __ASDisplayNodeCheckForLayoutMethodOverrides; + ASDN::MutexLocker l(_propertyLock); + + if (_layoutSpecBlock != NULL) { + return _layoutSpecBlock(self, constrainedSize); + } + return nil; } @@ -1894,7 +1995,15 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) - (ASSizeRange)constrainedSizeForCalculatedLayout { ASDN::MutexLocker l(_propertyLock); - return _constrainedSize; + return _layout.constrainedSizeRange; +} + +- (void)setLayoutSpecBlock:(ASLayoutSpecBlock)layoutSpecBlock +{ + // For now there should never be a overwrite of layoutSpecThatFits: and a layoutSpecThatFitsBlock: be provided + ASDisplayNodeAssert(!(_methodOverrides & ASDisplayNodeMethodOverrideLayoutSpecThatFits), @"Overwriting layoutSpecThatFits: and providing a layoutSpecBlock block is currently not supported"); + + _layoutSpecBlock = layoutSpecBlock; } - (void)setPendingTransitionID:(int32_t)pendingTransitionID @@ -1940,8 +2049,10 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) - (void)invalidateCalculatedLayout { ASDN::MutexLocker l(_propertyLock); - // This will cause -measureWithSizeRange: to actually compute the size instead of returning the previously cached size - _flags.isMeasured = NO; + + // This will cause the next call to -measureWithSizeRange: to actually compute a new layout + // instead of returning the current layout + _layout.dirty = YES; } - (void)__didLoad @@ -1959,6 +2070,8 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) ASDisplayNodeAssertMainThread(); } +#pragma mark Hierarchy State + - (void)willEnterHierarchy { ASDisplayNodeAssertMainThread(); @@ -1979,7 +2092,7 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) if (![self supportsRangeManagedInterfaceState]) { self.interfaceState = ASInterfaceStateNone; } else { - // This case is important when tearing down hierarchies. We must deliver a visibilityDidChange:NO callback, as part our API guarantee that this method can be used for + // This case is important when tearing down hierarchies. We must deliver a visibileStateDidChange:NO callback, as part our API guarantee that this method can be used for // things like data analytics about user content viewing. We cannot call the method in the dealloc as any incidental retain operations in client code would fail. // Additionally, it may be that a Standard UIView which is containing us is moving between hierarchies, and we should not send the call if we will be re-added in the // same runloop. Strategy: strong reference (might be the last!), wait one runloop, and confirm we are still outside the hierarchy (both layer-backed and view-backed). @@ -1998,10 +2111,15 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) } } +#pragma mark Interface State + - (void)clearContents { - // No-op if these haven't been created yet, as that guarantees they don't have contents that needs to be released. - _layer.contents = nil; + if (_flags.canClearContentsOfLayer) { + // No-op if these haven't been created yet, as that guarantees they don't have contents that needs to be released. + _layer.contents = nil; + } + _placeholderLayer.contents = nil; _placeholderImage = nil; } @@ -2046,7 +2164,22 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) - (void)visibilityDidChange:(BOOL)isVisible { - // subclass override + // subclass override +} + +- (void)visibleStateDidChange:(BOOL)isVisible +{ + // subclass override +} + +- (void)displayStateDidChange:(BOOL)inDisplayState +{ + //subclass override +} + +- (void)loadStateDidChange:(BOOL)inLoadState +{ + //subclass override } /** @@ -2093,10 +2226,12 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) if (nowFetchData != wasFetchData) { if (nowFetchData) { [self fetchData]; + [self loadStateDidChange:YES]; } else { if ([self supportsRangeManagedInterfaceState]) { [self clearFetchedData]; } + [self loadStateDidChange:NO]; } } @@ -2140,6 +2275,8 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) } } } + + [self displayStateDidChange:nowDisplay]; } // Became visible or invisible. When range-managed, this represents literal visibility - at least one pixel @@ -2148,14 +2285,16 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) BOOL wasVisible = ASInterfaceStateIncludesVisible(oldState); if (nowVisible != wasVisible) { - [self visibilityDidChange:nowVisible]; + [self visibleStateDidChange:nowVisible]; + [self visibilityDidChange:nowVisible]; //TODO: remove once this method has been deprecated } - + [self interfaceStateDidChange:newState fromState:oldState]; } - (void)interfaceStateDidChange:(ASInterfaceState)newState fromState:(ASInterfaceState)oldState { + // subclass hook } - (void)enterInterfaceState:(ASInterfaceState)interfaceState @@ -2238,7 +2377,7 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) { ASDN::MutexLocker l(_propertyLock); _pendingTransitionID = ASLayoutableContextInvalidTransitionID; - _pendingLayoutContext = nil; + _pendingLayoutTransition = nil; } } } @@ -2271,17 +2410,13 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) - (void)applyPendingLayoutContext { ASDN::MutexLocker l(_propertyLock); - if (_pendingLayoutContext) { - [self applyLayout:_pendingLayoutContext.pendingLayout - constrainedSize:_pendingLayoutContext.pendingConstrainedSize - layoutContext:_pendingLayoutContext]; - _pendingLayoutContext = nil; + if (_pendingLayoutTransition) { + [self applyLayout:_pendingLayoutTransition.pendingLayout layoutContext:_pendingLayoutTransition]; + _pendingLayoutTransition = nil; } } -- (void)applyLayout:(ASLayout *)layout - constrainedSize:(ASSizeRange)constrainedSize - layoutContext:(ASDisplayNodeLayoutContext *)layoutContext +- (void)applyLayout:(ASLayout *)layout layoutContext:(ASLayoutTransition *)layoutContext { ASDN::MutexLocker l(_propertyLock); _layout = layout; @@ -2289,9 +2424,6 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) ASDisplayNodeAssertTrue(layout.layoutableObject == self); ASDisplayNodeAssertTrue(layout.size.width >= 0.0); ASDisplayNodeAssertTrue(layout.size.height >= 0.0); - - _constrainedSize = constrainedSize; - _flags.isMeasured = YES; if (self.usesImplicitHierarchyManagement && layoutContext != nil) { [layoutContext applySubnodeInsertions]; @@ -2303,7 +2435,7 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) { ASDisplayNodeAssertMainThread(); - if (!_flags.isMeasured) { + if ([self _hasDirtyLayout]) { return; } @@ -2312,7 +2444,7 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) - (void)__layoutSublayouts { - for (ASLayout *subnodeLayout in _layout.immediateSublayouts) { + for (ASLayout *subnodeLayout in _layout.sublayouts) { ((ASDisplayNode *)subnodeLayout.layoutableObject).frame = [subnodeLayout frame]; } } @@ -2362,6 +2494,11 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) }); } +- (void)hierarchyDisplayDidFinish +{ + // subclass hook +} + - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { // subclass hook @@ -2603,38 +2740,12 @@ static const char *ASDisplayNodeDrawingPriorityKey = "ASDrawingPriority"; _flags.isInHierarchy = inHierarchy; } -- (BOOL)_hasTransitionsInProgress -{ - ASDN::MutexLocker l(_propertyLock); - return _transitionSentinel != nil; -} - -- (void)_invalidateTransitionSentinel -{ - ASDN::MutexLocker l(_propertyLock); - _transitionSentinel = nil; -} - -- (BOOL)_shouldAbortTransitionWithID:(int32_t)transitionID -{ - ASDN::MutexLocker l(_propertyLock); - return _transitionSentinel == nil || transitionID != _transitionSentinel.value; -} - -- (int32_t)_newTransitionID -{ - ASDN::MutexLocker l(_propertyLock); - if (!_transitionSentinel) { - _transitionSentinel = [[ASSentinel alloc] init]; - } - return [_transitionSentinel increment]; -} - - (id)finalLayoutable { return self; } + #pragma mark - ASEnvironment - (ASEnvironmentState)environmentState @@ -2662,9 +2773,29 @@ static const char *ASDisplayNodeDrawingPriorityKey = "ASDrawingPriority"; return ASEnvironmentStatePropagationEnabled(); } +- (BOOL)supportsTraitsCollectionPropagation +{ + return ASEnvironmentStateTraitCollectionPropagationEnabled(); +} + +- (ASEnvironmentTraitCollection)environmentTraitCollection +{ + return _environmentState.environmentTraitCollection; +} + +- (void)setEnvironmentTraitCollection:(ASEnvironmentTraitCollection)environmentTraitCollection +{ + _environmentState.environmentTraitCollection = environmentTraitCollection; +} + ASEnvironmentLayoutOptionsForwarding ASEnvironmentLayoutExtensibilityForwarding +- (ASTraitCollection *)asyncTraitCollection +{ + ASDN::MutexLocker l(_propertyLock); + return [ASTraitCollection traitCollectionWithASEnvironmentTraitCollection:self.environmentTraitCollection]; +} #if TARGET_OS_TV #pragma mark - UIFocusEnvironment Protocol (tvOS) @@ -2681,7 +2812,7 @@ ASEnvironmentLayoutExtensibilityForwarding - (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context { - return YES; + return NO; } - (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator diff --git a/AsyncDisplayKit/ASDisplayNodeExtras.h b/AsyncDisplayKit/ASDisplayNodeExtras.h index 97fe09c242..a0702a5bc6 100644 --- a/AsyncDisplayKit/ASDisplayNodeExtras.h +++ b/AsyncDisplayKit/ASDisplayNodeExtras.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNodeExtras.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import @@ -102,12 +104,12 @@ extern void ASDisplayNodePerformBlockOnEverySubnode(ASDisplayNode *node, void(^b /** Given a display node, traverses up the layer tree hierarchy, returning the first display node that passes block. */ -extern id _Nullable ASDisplayNodeFindFirstSupernode(ASDisplayNode * _Nullable node, BOOL (^block)(ASDisplayNode *node)); +extern ASDisplayNode * _Nullable ASDisplayNodeFindFirstSupernode(ASDisplayNode * _Nullable node, BOOL (^block)(ASDisplayNode *node)); /** Given a display node, traverses up the layer tree hierarchy, returning the first display node of kind class. */ -extern id _Nullable ASDisplayNodeFindFirstSupernodeOfClass(ASDisplayNode *start, Class c); +extern __kindof ASDisplayNode * _Nullable ASDisplayNodeFindFirstSupernodeOfClass(ASDisplayNode *start, Class c); /** * Given two nodes, finds their most immediate common parent. Used for geometry conversion methods. @@ -132,22 +134,22 @@ extern NSArray *ASDisplayNodeFindAllSubnodes(ASDisplayNode *sta /** Given a display node, traverses down the node hierarchy, returning all the display nodes of kind class. */ -extern NSArray *ASDisplayNodeFindAllSubnodesOfClass(ASDisplayNode *start, Class c); +extern NSArray<__kindof ASDisplayNode *> *ASDisplayNodeFindAllSubnodesOfClass(ASDisplayNode *start, Class c); /** Given a display node, traverses down the node hierarchy, returning the depth-first display node, including the start node that pass the block. */ -extern __kindof ASDisplayNode * ASDisplayNodeFindFirstNode(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node)); +extern __kindof ASDisplayNode * _Nullable ASDisplayNodeFindFirstNode(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node)); /** Given a display node, traverses down the node hierarchy, returning the depth-first display node, excluding the start node, that pass the block */ -extern __kindof ASDisplayNode * ASDisplayNodeFindFirstSubnode(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node)); +extern __kindof ASDisplayNode * _Nullable ASDisplayNodeFindFirstSubnode(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node)); /** Given a display node, traverses down the node hierarchy, returning the depth-first display node of kind class. */ -extern __kindof ASDisplayNode * ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNode *start, Class c); +extern __kindof ASDisplayNode * _Nullable ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNode *start, Class c); extern UIColor *ASDisplayNodeDefaultPlaceholderColor(); extern UIColor *ASDisplayNodeDefaultTintColor(); diff --git a/AsyncDisplayKit/ASDisplayNodeExtras.mm b/AsyncDisplayKit/ASDisplayNodeExtras.mm index b64ba06a44..46eb46daaf 100644 --- a/AsyncDisplayKit/ASDisplayNodeExtras.mm +++ b/AsyncDisplayKit/ASDisplayNodeExtras.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNodeExtras.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASDisplayNodeExtras.h" #import "ASDisplayNodeInternal.h" @@ -90,7 +92,7 @@ extern void ASDisplayNodePerformBlockOnEverySubnode(ASDisplayNode *node, void(^b } } -id ASDisplayNodeFindFirstSupernode(ASDisplayNode *node, BOOL (^block)(ASDisplayNode *node)) +ASDisplayNode *ASDisplayNodeFindFirstSupernode(ASDisplayNode *node, BOOL (^block)(ASDisplayNode *node)) { CALayer *layer = node.layer; @@ -105,7 +107,7 @@ id ASDisplayNodeFindFirstSupernode(ASDisplayNode *node, BOOL (^block)(ASDisplayN return nil; } -id ASDisplayNodeFindFirstSupernodeOfClass(ASDisplayNode *start, Class c) +__kindof ASDisplayNode *ASDisplayNodeFindFirstSupernodeOfClass(ASDisplayNode *start, Class c) { return ASDisplayNodeFindFirstSupernode(start, ^(ASDisplayNode *n) { return [n isKindOfClass:c]; @@ -156,7 +158,7 @@ extern NSArray *ASDisplayNodeFindAllSubnodes(ASDisplayNode *sta return list; } -extern NSArray *ASDisplayNodeFindAllSubnodesOfClass(ASDisplayNode *start, Class c) +extern NSArray<__kindof ASDisplayNode *> *ASDisplayNodeFindAllSubnodesOfClass(ASDisplayNode *start, Class c) { return ASDisplayNodeFindAllSubnodes(start, ^(ASDisplayNode *n) { return [n isKindOfClass:c]; @@ -180,17 +182,17 @@ static ASDisplayNode *_ASDisplayNodeFindFirstNode(ASDisplayNode *startNode, BOOL return nil; } -extern __kindof ASDisplayNode * ASDisplayNodeFindFirstNode(ASDisplayNode *startNode, BOOL (^block)(ASDisplayNode *node)) +extern __kindof ASDisplayNode *ASDisplayNodeFindFirstNode(ASDisplayNode *startNode, BOOL (^block)(ASDisplayNode *node)) { return _ASDisplayNodeFindFirstNode(startNode, YES, block); } -extern __kindof ASDisplayNode * ASDisplayNodeFindFirstSubnode(ASDisplayNode *startNode, BOOL (^block)(ASDisplayNode *node)) +extern __kindof ASDisplayNode *ASDisplayNodeFindFirstSubnode(ASDisplayNode *startNode, BOOL (^block)(ASDisplayNode *node)) { return _ASDisplayNodeFindFirstNode(startNode, NO, block); } -extern __kindof ASDisplayNode * ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNode *start, Class c) +extern __kindof ASDisplayNode *ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNode *start, Class c) { return ASDisplayNodeFindFirstSubnode(start, ^(ASDisplayNode *n) { return [n isKindOfClass:c]; diff --git a/AsyncDisplayKit/ASEditableTextNode.h b/AsyncDisplayKit/ASEditableTextNode.h index 22ba5822a0..92e720f211 100644 --- a/AsyncDisplayKit/ASEditableTextNode.h +++ b/AsyncDisplayKit/ASEditableTextNode.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASEditableTextNode.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/ASEditableTextNode.mm b/AsyncDisplayKit/ASEditableTextNode.mm index ba0b0b1f99..fda9fd6e52 100644 --- a/AsyncDisplayKit/ASEditableTextNode.mm +++ b/AsyncDisplayKit/ASEditableTextNode.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASEditableTextNode.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASEditableTextNode.h" @@ -36,6 +38,8 @@ @implementation ASPanningOverriddenUITextView +#if TARGET_OS_IOS + // tvOS doesn't support self.scrollsToTop - (BOOL)scrollEnabled { return _shouldBlockPanGesture; @@ -48,6 +52,7 @@ [super setScrollEnabled:YES]; } +#endif - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { @@ -187,8 +192,9 @@ { ASTextKitComponents *displayedComponents = [self isDisplayingPlaceholder] ? _placeholderTextKitComponents : _textKitComponents; CGSize textSize = [displayedComponents sizeForConstrainedWidth:constrainedSize.width]; - textSize = ceilSizeValue(textSize); - return CGSizeMake(constrainedSize.width, fminf(textSize.height, constrainedSize.height)); + CGFloat width = ceilf(textSize.width + _textContainerInset.left + _textContainerInset.right); + CGFloat height = ceilf(textSize.height + _textContainerInset.top + _textContainerInset.bottom); + return CGSizeMake(fminf(width, constrainedSize.width), fminf(height, constrainedSize.height)); } - (void)layout diff --git a/AsyncDisplayKit/ASEqualityHashHelpers.mm b/AsyncDisplayKit/ASEqualityHashHelpers.mm index decce0064c..817777673b 100644 --- a/AsyncDisplayKit/ASEqualityHashHelpers.mm +++ b/AsyncDisplayKit/ASEqualityHashHelpers.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASEqualityHashHelpers.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASEqualityHashHelpers.h" diff --git a/AsyncDisplayKit/ASImageNode+AnimatedImage.h b/AsyncDisplayKit/ASImageNode+AnimatedImage.h deleted file mode 100644 index 9e8126580e..0000000000 --- a/AsyncDisplayKit/ASImageNode+AnimatedImage.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ASImageNode+AnimatedImage.h -// AsyncDisplayKit -// -// Created by Garrett Moon on 3/22/16. -// Copyright Β© 2016 Facebook. All rights reserved. -// - -#import "ASImageNode.h" -#import "ASImageProtocols.h" - -@interface ASImageNode () -@property (atomic, assign) BOOL animatedImagePaused; -@property (nullable, atomic, strong) id animatedImage; -@end diff --git a/AsyncDisplayKit/ASImageNode+AnimatedImage.mm b/AsyncDisplayKit/ASImageNode+AnimatedImage.mm index ae296ab608..e51305a298 100644 --- a/AsyncDisplayKit/ASImageNode+AnimatedImage.mm +++ b/AsyncDisplayKit/ASImageNode+AnimatedImage.mm @@ -1,12 +1,16 @@ // -// ASImageNode+AnimatedImage.m +// ASImageNode+AnimatedImage.mm // AsyncDisplayKit // // Created by Garrett Moon on 3/22/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // -#import "ASImageNode+AnimatedImage.h" +#import "ASImageNode.h" #import "ASAssert.h" #import "ASImageProtocols.h" @@ -18,6 +22,8 @@ #import "ASInternalHelpers.h" #import "ASWeakProxy.h" +NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes; + @implementation ASImageNode (AnimatedImage) #pragma mark - GIF support @@ -25,9 +31,12 @@ - (void)setAnimatedImage:(id )animatedImage { ASDN::MutexLocker l(_animatedImageLock); - if (!ASObjectIsEqual(_animatedImage, animatedImage)) { - _animatedImage = animatedImage; + if (ASObjectIsEqual(_animatedImage, animatedImage)) { + return; } + + _animatedImage = animatedImage; + if (animatedImage != nil) { __weak ASImageNode *weakSelf = self; if ([animatedImage respondsToSelector:@selector(setCoverImageReadyCallback:)]) { @@ -36,6 +45,10 @@ }; } + if (animatedImage.playbackReady) { + [self animatedImageFileReady]; + } + animatedImage.playbackReadyCallback = ^{ [weakSelf animatedImageFileReady]; }; @@ -50,7 +63,7 @@ - (void)setAnimatedImagePaused:(BOOL)animatedImagePaused { - ASDN::MutexLocker l(_animatedImagePausedLock); + ASDN::MutexLocker l(_animatedImageLock); _animatedImagePaused = animatedImagePaused; ASPerformBlockOnMainThread(^{ if (animatedImagePaused) { @@ -63,7 +76,7 @@ - (BOOL)animatedImagePaused { - ASDN::MutexLocker l(_animatedImagePausedLock); + ASDN::MutexLocker l(_animatedImageLock); return _animatedImagePaused; } @@ -82,9 +95,30 @@ } } +- (NSString *)animatedImageRunLoopMode +{ + ASDN::MutexLocker l(_displayLinkLock); + return _animatedImageRunLoopMode; +} + +- (void)setAnimatedImageRunLoopMode:(NSString *)runLoopMode +{ + ASDN::MutexLocker l(_displayLinkLock); + + if (runLoopMode == nil) { + runLoopMode = ASAnimatedImageDefaultRunLoopMode; + } + + if (_displayLink != nil) { + [_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:_animatedImageRunLoopMode]; + [_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:runLoopMode]; + } + _animatedImageRunLoopMode = runLoopMode; +} + - (void)animatedImageFileReady { - dispatch_async(dispatch_get_main_queue(), ^{ + ASPerformBlockOnMainThread(^{ [self startAnimating]; }); } @@ -113,7 +147,7 @@ _displayLink = [CADisplayLink displayLinkWithTarget:[ASWeakProxy weakProxyWithTarget:self] selector:@selector(displayLinkFired:)]; _displayLink.frameInterval = self.animatedImage.frameInterval; - [_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; + [_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:_animatedImageRunLoopMode]; } else { _displayLink.paused = NO; } @@ -132,9 +166,9 @@ [self.animatedImage clearAnimatedImageCache]; } -- (void)visibilityDidChange:(BOOL)isVisible +- (void)visibleStateDidChange:(BOOL)isVisible { - [super visibilityDidChange:isVisible]; + [super visibleStateDidChange:isVisible]; ASDisplayNodeAssertMainThread(); if (isVisible) { @@ -147,18 +181,6 @@ } } -- (void)__enterHierarchy -{ - [super __enterHierarchy]; - [self startAnimating]; -} - -- (void)__exitHierarchy -{ - [super __exitHierarchy]; - [self stopAnimating]; -} - - (void)displayLinkFired:(CADisplayLink *)displayLink { ASDisplayNodeAssertMainThread(); diff --git a/AsyncDisplayKit/ASImageNode+tvOS.h b/AsyncDisplayKit/ASImageNode+tvOS.h new file mode 100644 index 0000000000..1589f3824a --- /dev/null +++ b/AsyncDisplayKit/ASImageNode+tvOS.h @@ -0,0 +1,19 @@ +// +// ASImageNode+tvOS.h +// AsyncDisplayKit +// +// Created by Aaron Schubert on 21/04/2016. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#if TARGET_OS_TV +#import + +@interface ASImageNode (tvOS) +@end +#endif + diff --git a/AsyncDisplayKit/ASImageNode+tvOS.m b/AsyncDisplayKit/ASImageNode+tvOS.m new file mode 100644 index 0000000000..26b7dd49b4 --- /dev/null +++ b/AsyncDisplayKit/ASImageNode+tvOS.m @@ -0,0 +1,188 @@ +// +// ASImageNode+tvOS.m +// AsyncDisplayKit +// +// Created by Aaron Schubert on 21/04/2016. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#if TARGET_OS_TV +#import "ASImageNode+tvOS.h" +#import +#import "ASDisplayNodeExtras.h" + +@implementation ASImageNode (tvOS) + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + [super touchesBegan:touches withEvent:event]; + self.isDefaultFocusAppearance = NO; + UIView *view = [self getView]; + CALayer *layer = view.layer; + + CGSize targetShadowOffset = CGSizeMake(0.0, self.bounds.size.height/8); + [layer removeAllAnimations]; + [CATransaction begin]; + [CATransaction setCompletionBlock:^{ + layer.shadowOffset = targetShadowOffset; + }]; + + CABasicAnimation *shadowOffsetAnimation = [CABasicAnimation animationWithKeyPath:@"shadowOffset"]; + shadowOffsetAnimation.toValue = [NSValue valueWithCGSize:targetShadowOffset]; + shadowOffsetAnimation.duration = 0.4; + shadowOffsetAnimation.removedOnCompletion = NO; + shadowOffsetAnimation.fillMode = kCAFillModeForwards; + shadowOffsetAnimation.timingFunction = [CAMediaTimingFunction functionWithName:@"easeOut"]; + [layer addAnimation:shadowOffsetAnimation forKey:@"shadowOffset"]; + [CATransaction commit]; + + CABasicAnimation *shadowOpacityAnimation = [CABasicAnimation animationWithKeyPath:@"shadowOpacity"]; + shadowOpacityAnimation.toValue = [NSNumber numberWithFloat:0.45]; + shadowOpacityAnimation.duration = 0.4; + shadowOpacityAnimation.removedOnCompletion = false; + shadowOpacityAnimation.fillMode = kCAFillModeForwards; + shadowOpacityAnimation.timingFunction = [CAMediaTimingFunction functionWithName:@"easeOut"]; + [layer addAnimation:shadowOpacityAnimation forKey:@"shadowOpacityAnimation"]; + + view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.25, 1.25); + + [CATransaction commit]; +} + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +{ + [super touchesMoved:touches withEvent:event]; + + // TODO: Clean up, and improve visuals. + + if (!self.isDefaultFocusAppearance) { + // This view may correspond to either self.view + // or our superview if we are in a ASCellNode + UIView *view = [self getView]; + + UITouch *touch = [touches anyObject]; + // Get the specific point that was touched + + // This is quite messy in it's current state so is not ready for production. + // The reason it is here is for others to contribute and to make it clear what is occuring. + + // We get the touch location in self.view because + // we are operating in that coordinate system. + // BUT we apply our transforms to *view since we want to apply + // the transforms to the root view (L: 107) + CGPoint point = [touch locationInView:self.view]; + float pitch = 0; + float yaw = 0; + BOOL topHalf = NO; + if (point.y > CGRectGetHeight(self.view.frame)) { + pitch = 15; + } else if (point.y < -CGRectGetHeight(self.view.frame)) { + pitch = -15; + } else { + pitch = (point.y/CGRectGetHeight(self.view.frame))*15; + } + if (pitch < 0) { + topHalf = YES; + } + + if (point.x > CGRectGetWidth(self.view.frame)) { + yaw = 10; + } else if (point.x < -CGRectGetWidth(self.view.frame)) { + yaw = -10; + } else { + yaw = (point.x/CGRectGetWidth(self.view.frame))*10; + } + if (!topHalf) { + if (yaw > 0) { + yaw = -yaw; + } else { + yaw = fabsf(yaw); + } + } + + CATransform3D pitchTransform = CATransform3DMakeRotation(GLKMathDegreesToRadians(pitch),1.0,0.0,0.0); + CATransform3D yawTransform = CATransform3DMakeRotation(GLKMathDegreesToRadians(yaw),0.0,1.0,0.0); + CATransform3D transform = CATransform3DConcat(pitchTransform, yawTransform); + CATransform3D scaleAndTransform = CATransform3DConcat(transform, CATransform3DMakeAffineTransform(CGAffineTransformScale(CGAffineTransformIdentity, 1.25, 1.25))); + + [UIView animateWithDuration:0.5 animations:^{ + view.layer.transform = scaleAndTransform; + }]; + } else { + [self setDefaultFocusAppearance]; + } +} + + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + [super touchesEnded:touches withEvent:event]; + [self finishTouches]; +} + +- (void)finishTouches +{ + if (!self.isDefaultFocusAppearance) { + UIView *view = [self getView]; + CALayer *layer = view.layer; + + CGSize targetShadowOffset = CGSizeMake(0.0, self.bounds.size.height/8); + CATransform3D targetScaleTransform = CATransform3DMakeScale(1.2, 1.2, 1.2); + [CATransaction begin]; + [CATransaction setCompletionBlock:^{ + layer.shadowOffset = targetShadowOffset; + }]; + [CATransaction commit]; + + [UIView animateWithDuration:0.4 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ + view.layer.transform = targetScaleTransform; + } completion:^(BOOL finished) { + if (finished) { + [layer removeAnimationForKey:@"shadowOffset"]; + [layer removeAnimationForKey:@"shadowOpacity"]; + } + }]; + } else { + [self setDefaultFocusAppearance]; + } +} + +- (void)setFocusedState +{ + UIView *view = [self getView]; + CALayer *layer = view.layer; + layer.shadowOffset = CGSizeMake(2, 10); + layer.shadowColor = [UIColor blackColor].CGColor; + layer.shadowRadius = 12.0; + layer.shadowOpacity = 0.45; + layer.shadowPath = [UIBezierPath bezierPathWithRect:self.layer.bounds].CGPath; + view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.25, 1.25); +} + +- (void)setDefaultFocusAppearance +{ + UIView *view = [self getView]; + CALayer *layer = view.layer; + view.transform = CGAffineTransformIdentity; + layer.shadowOpacity = 0; + layer.shadowOffset = CGSizeZero; + layer.shadowRadius = 0; + layer.shadowPath = nil; + [layer removeAnimationForKey:@"shadowOffset"]; + [layer removeAnimationForKey:@"shadowOpacity"]; + self.isDefaultFocusAppearance = YES; +} + +- (UIView *)getView +{ + // TODO: This needs to be re-visited to handle all possibilities. + // If we are inside a ASCellNode, then we need to apply our focus effects to the ASCellNode view/layer rather than the ASImageNode view/layer. + return ASDisplayNodeUltimateParentOfNode(self).view; +} + +@end +#endif diff --git a/AsyncDisplayKit/ASImageNode.h b/AsyncDisplayKit/ASImageNode.h index 394113a349..db581f6441 100644 --- a/AsyncDisplayKit/ASImageNode.h +++ b/AsyncDisplayKit/ASImageNode.h @@ -1,13 +1,17 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASImageNode.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import +#import "ASImageProtocols.h" + NS_ASSUME_NONNULL_BEGIN /** @@ -112,6 +116,44 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image); */ - (void)setNeedsDisplayWithCompletion:(void (^ _Nullable)(BOOL canceled))displayCompletionBlock; +#if TARGET_OS_TV +/** + * A bool to track if the current appearance of the node + * is the default focus appearance. + * Exposed here so the category methods can set it. + */ +@property (nonatomic, assign) BOOL isDefaultFocusAppearance; +#endif + +@end + +@interface ASImageNode (AnimatedImage) + +/** + * @abstract The animated image to playback + * + * @discussion Set this to an object which conforms to ASAnimatedImageProtocol + * to have the ASImageNode playback an animated image. + */ +@property (nullable, atomic, strong) id animatedImage; + +/** + * @abstract Pause the playback of an animated image. + * + * @discussion Set to YES to pause playback of an animated image and NO to resume + * playback. + */ +@property (atomic, assign) BOOL animatedImagePaused; + +/** + * @abstract The runloop mode used to animate the image. + * + * @discussion Defaults to NSRunLoopCommonModes. Another commonly used mode is NSDefaultRunLoopMode. + * Setting NSDefaultRunLoopMode will cause animation to pause while scrolling (if the ASImageNode is + * in a scroll view), which may improve scroll performance in some use cases. + */ +@property (atomic, strong) NSString *animatedImageRunLoopMode; + @end @@ -127,7 +169,7 @@ ASDISPLAYNODE_EXTERN_C_BEGIN * * @returns An ASImageNode image modification block. */ -asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlock(CGFloat borderWidth, UIColor *borderColor); +asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlock(CGFloat borderWidth, UIColor * _Nullable borderColor); /** * @abstract Image modification block that applies a tint color Γ  la UIImage configured with diff --git a/AsyncDisplayKit/ASImageNode.mm b/AsyncDisplayKit/ASImageNode.mm index 48033aba43..bb7762d285 100644 --- a/AsyncDisplayKit/ASImageNode.mm +++ b/AsyncDisplayKit/ASImageNode.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASImageNode.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASImageNode.h" @@ -16,7 +18,6 @@ #import #import #import -#import #import #import "ASImageNode+CGExtras.h" @@ -25,46 +26,18 @@ #import "ASInternalHelpers.h" #import "ASEqualityHelpers.h" -@interface _ASImageNodeDrawParameters : NSObject - -@property (nonatomic, retain) UIImage *image; -@property (nonatomic, assign) BOOL opaque; -@property (nonatomic, assign) CGRect bounds; -@property (nonatomic, assign) CGFloat contentsScale; -@property (nonatomic, strong) UIColor *backgroundColor; -@property (nonatomic, assign) UIViewContentMode contentMode; - -@end - -// TODO: eliminate explicit parameters with a set of keys copied from the node -@implementation _ASImageNodeDrawParameters - -- (instancetype)initWithImage:(UIImage *)image - bounds:(CGRect)bounds - opaque:(BOOL)opaque - contentsScale:(CGFloat)contentsScale - backgroundColor:(UIColor *)backgroundColor - contentMode:(UIViewContentMode)contentMode -{ - if (!(self = [self init])) - return nil; - - _image = image; - _opaque = opaque; - _bounds = bounds; - _contentsScale = contentsScale; - _backgroundColor = backgroundColor; - _contentMode = contentMode; - - return self; -} - -- (NSString *)description -{ - return [NSString stringWithFormat:@"<%@ : %p opaque:%@ bounds:%@ contentsScale:%.2f backgroundColor:%@ contentMode:%@>", [self class], self, @(self.opaque), NSStringFromCGRect(self.bounds), self.contentsScale, self.backgroundColor, ASDisplayNodeNSStringFromUIContentMode(self.contentMode)]; -} - -@end +struct ASImageNodeDrawParameters { + BOOL opaque; + CGRect bounds; + CGFloat contentsScale; + UIColor *backgroundColor; + UIViewContentMode contentMode; + BOOL cropEnabled; + BOOL forceUpscaling; + CGRect cropRect; + CGRect cropDisplayBounds; + asimagenode_modification_block_t imageModificationBlock; +}; @implementation ASImageNode { @@ -73,19 +46,33 @@ void (^_displayCompletionBlock)(BOOL canceled); ASDN::RecursiveMutex _imageLock; - + + // Drawing + ASImageNodeDrawParameters _drawParameter; + ASTextNode *_debugLabelNode; + // Cropping. BOOL _cropEnabled; // Defaults to YES. BOOL _forceUpscaling; //Defaults to NO. CGRect _cropRect; // Defaults to CGRectMake(0.5, 0.5, 0, 0) - CGRect _cropDisplayBounds; - - ASTextNode *_debugLabelNode; + CGRect _cropDisplayBounds; // Defaults to CGRectNull } @synthesize image = _image; @synthesize imageModificationBlock = _imageModificationBlock; +#pragma mark - NSObject + ++ (void)initialize +{ + [super initialize]; + + if (self != [ASImageNode class]) { + // Prevent custom drawing in subclasses + ASDisplayNodeAssert(!ASSubclassOverridesClassSelector([ASImageNode class], self, @selector(displayWithParameters:isCancelled:)), @"Subclass %@ must not override displayWithParameters:isCancelled: method. Custom drawing in %@ subclass is not supported.", NSStringFromClass(self), NSStringFromClass([ASImageNode class])); + } +} + - (instancetype)init { if (!(self = [super init])) @@ -95,12 +82,18 @@ self.contentsScale = ASScreenScale(); self.contentMode = UIViewContentModeScaleAspectFill; self.opaque = NO; + + // If no backgroundColor is set to the image node and it's a subview of UITableViewCell, UITableView is setting + // the opaque value of all subviews to YES if highlighting / selection is happening and does not set it back to the + // initial value. With setting a explicit backgroundColor we can prevent that change. + self.backgroundColor = [UIColor clearColor]; _cropEnabled = YES; _forceUpscaling = NO; _cropRect = CGRectMake(0.5, 0.5, 0, 0); _cropDisplayBounds = CGRectNull; _placeholderColor = ASDisplayNodeDefaultPlaceholderColor(); + _animatedImageRunLoopMode = ASAnimatedImageDefaultRunLoopMode; return self; } @@ -117,6 +110,8 @@ return nil; } +#pragma mark - Layout and Sizing + - (CGSize)calculateSizeThatFits:(CGSize)constrainedSize { ASDN::MutexLocker l(_imageLock); @@ -129,6 +124,8 @@ return CGSizeZero; } +#pragma mark - Setter / Getter + - (void)setImage:(UIImage *)image { _imageLock.lock(); @@ -141,7 +138,7 @@ if (image) { [self setNeedsDisplay]; - if ([ASImageNode shouldShowImageScalingOverlay]) { + if ([ASImageNode shouldShowImageScalingOverlay] && _debugLabelNode == nil) { ASPerformBlockOnMainThread(^{ _debugLabelNode = [[ASTextNode alloc] init]; _debugLabelNode.layerBacked = YES; @@ -170,50 +167,68 @@ self.placeholderEnabled = placeholderColor != nil; } +#pragma mark - Drawing + - (NSObject *)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer { - return [[_ASImageNodeDrawParameters alloc] initWithImage:self.image - bounds:self.bounds - opaque:self.opaque - contentsScale:self.contentsScaleForDisplay - backgroundColor:self.backgroundColor - contentMode:self.contentMode]; + ASDN::MutexLocker l(_imageLock); + + _drawParameter = { + .bounds = self.bounds, + .opaque = self.opaque, + .contentsScale = _contentsScaleForDisplay, + .backgroundColor = self.backgroundColor, + .contentMode = self.contentMode, + .cropEnabled = _cropEnabled, + .forceUpscaling = _forceUpscaling, + .cropRect = _cropRect, + .cropDisplayBounds = _cropDisplayBounds, + .imageModificationBlock = _imageModificationBlock + }; + + return nil; } - (NSDictionary *)debugLabelAttributes { - return @{ NSFontAttributeName: [UIFont systemFontOfSize:15.0], - NSForegroundColorAttributeName: [UIColor redColor] }; + return @{ + NSFontAttributeName: [UIFont systemFontOfSize:15.0], + NSForegroundColorAttributeName: [UIColor redColor] + }; } -- (UIImage *)displayWithParameters:(_ASImageNodeDrawParameters *)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelled +- (UIImage *)displayWithParameters:(id *)parameter isCancelled:(asdisplaynode_iscancelled_block_t)isCancelled { - UIImage *image = parameters.image; - if (!image) { + UIImage *image = self.image; + if (image == nil) { return nil; } + CGRect drawParameterBounds = CGRectZero; BOOL forceUpscaling = NO; - BOOL cropEnabled = NO; - BOOL isOpaque = parameters.opaque; - UIColor *backgroundColor = parameters.backgroundColor; - UIViewContentMode contentMode = parameters.contentMode; + BOOL cropEnabled = YES; + BOOL isOpaque = NO; + UIColor *backgroundColor = nil; + UIViewContentMode contentMode = UIViewContentModeScaleAspectFill; CGFloat contentsScale = 0.0; CGRect cropDisplayBounds = CGRectZero; CGRect cropRect = CGRectZero; asimagenode_modification_block_t imageModificationBlock; - + + ASDN::MutexLocker l(_imageLock); { - ASDN::MutexLocker l(_imageLock); + ASImageNodeDrawParameters drawParameter = _drawParameter; - // FIXME: There is a small risk of these values changing between the main thread creation of drawParameters, and the execution of this method. - // We should package these up into the draw parameters object. Might be easiest to create a struct for the non-objects and make it one property. - cropEnabled = _cropEnabled; - forceUpscaling = _forceUpscaling; - contentsScale = _contentsScaleForDisplay; - cropDisplayBounds = _cropDisplayBounds; - cropRect = _cropRect; - imageModificationBlock = _imageModificationBlock; + drawParameterBounds = drawParameter.bounds; + forceUpscaling = drawParameter.forceUpscaling; + cropEnabled = drawParameter.cropEnabled; + isOpaque = drawParameter.opaque; + backgroundColor = drawParameter.backgroundColor; + contentMode = drawParameter.contentMode; + contentsScale = drawParameter.contentsScale; + cropDisplayBounds = drawParameter.cropDisplayBounds; + cropRect = drawParameter.cropRect; + imageModificationBlock = drawParameter.imageModificationBlock; } if (_displayWithoutProcessing) { @@ -221,7 +236,7 @@ } BOOL hasValidCropBounds = cropEnabled && !CGRectIsNull(cropDisplayBounds) && !CGRectIsEmpty(cropDisplayBounds); - CGRect bounds = (hasValidCropBounds ? cropDisplayBounds : parameters.bounds); + CGRect bounds = (hasValidCropBounds ? cropDisplayBounds : drawParameterBounds); ASDisplayNodeContextModifier preContextBlock = self.willDisplayNodeContentWithRenderingContext; ASDisplayNodeContextModifier postContextBlock = self.didDisplayNodeContentWithRenderingContext; @@ -356,7 +371,6 @@ } } -#pragma mark - - (void)setNeedsDisplayWithCompletion:(void (^ _Nullable)(BOOL canceled))displayCompletionBlock { if (self.displaySuspended) { @@ -375,6 +389,7 @@ } #pragma mark - Cropping + - (BOOL)isCropEnabled { ASDN::MutexLocker l(_imageLock); @@ -459,6 +474,7 @@ } #pragma mark - Debug + - (void)layout { [super layout]; @@ -474,6 +490,7 @@ @end #pragma mark - Extras + extern asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlock(CGFloat borderWidth, UIColor *borderColor) { return ^(UIImage *originalImage) { diff --git a/AsyncDisplayKit/ASMapNode.h b/AsyncDisplayKit/ASMapNode.h index 201ef2170f..f7b7c6c014 100644 --- a/AsyncDisplayKit/ASMapNode.h +++ b/AsyncDisplayKit/ASMapNode.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASMapNode.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #if TARGET_OS_IOS diff --git a/AsyncDisplayKit/ASMapNode.mm b/AsyncDisplayKit/ASMapNode.mm index c44b0b0c78..c8c2599b38 100644 --- a/AsyncDisplayKit/ASMapNode.mm +++ b/AsyncDisplayKit/ASMapNode.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASMapNode.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #if TARGET_OS_IOS #import "ASMapNode.h" @@ -14,11 +16,13 @@ #import #import #import +#import @interface ASMapNode() { ASDN::RecursiveMutex _propertyLock; MKMapSnapshotter *_snapshotter; + BOOL _snapshotAfterLayout; NSArray *_annotations; CLLocationCoordinate2D _centerCoordinateOfMap; } @@ -56,6 +60,11 @@ } } +- (void)dealloc +{ + [self destroySnapshotter]; +} + - (void)setLayerBacked:(BOOL)layerBacked { ASDisplayNodeAssert(!self.isLiveMap, @"ASMapNode can not be layer backed whilst .liveMap = YES, set .liveMap = NO to use layer backing."); @@ -159,6 +168,16 @@ - (void)takeSnapshot { + // If our size is zero, we want to avoid calling a default sized snapshot. Set _snapshotAfterLayout to YES + // so if layout changes in the future, we'll try snapshotting again. + ASLayout *layout = self.calculatedLayout; + if (layout == nil || CGSizeEqualToSize(CGSizeZero, layout.size)) { + _snapshotAfterLayout = YES; + return; + } + + _snapshotAfterLayout = NO; + if (!_snapshotter) { [self setUpSnapshotter]; } @@ -167,12 +186,18 @@ return; } + __weak __typeof__(self) weakSelf = self; [_snapshotter startWithQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) completionHandler:^(MKMapSnapshot *snapshot, NSError *error) { + __typeof__(self) strongSelf = weakSelf; + if (!strongSelf) { + return; + } + if (!error) { UIImage *image = snapshot.image; - - if (_annotations.count > 0) { + NSArray *annotations = strongSelf.annotations; + if (annotations.count > 0) { // Only create a graphics context if we have annotations to draw. // The MKMapSnapshotter is currently not capable of rendering annotations automatically. @@ -186,7 +211,7 @@ UIImage *pinImage = pin.image; CGSize pinSize = pin.bounds.size; - for (id annotation in _annotations) { + for (id annotation in annotations) { CGPoint point = [snapshot pointForCoordinate:annotation.coordinate]; if (CGRectContainsPoint(finalImageRect, point)) { CGPoint pinCenterOffset = pin.centerOffset; @@ -202,14 +227,13 @@ UIGraphicsEndImageContext(); } - self.image = image; + strongSelf.image = image; } }]; } - (void)setUpSnapshotter { - ASDisplayNodeAssert(!CGSizeEqualToSize(CGSizeZero, self.calculatedSize), @"self.calculatedSize can not be zero. Make sure that you are setting a preferredFrameSize or wrapping ASMapNode in a ASRatioLayoutSpec or similar."); _snapshotter = [[MKMapSnapshotter alloc] initWithOptions:self.options]; } @@ -307,6 +331,15 @@ return size; } +- (void)calculatedLayoutDidChange +{ + [super calculatedLayoutDidChange]; + + if (_snapshotAfterLayout) { + [self takeSnapshot]; + } +} + // -layout isn't usually needed over -layoutSpecThatFits, but this way we can avoid a needless node wrapper for MKMapView. - (void)layout { diff --git a/AsyncDisplayKit/ASMultiplexImageNode.h b/AsyncDisplayKit/ASMultiplexImageNode.h index 73a74cbdeb..8e14b2807e 100644 --- a/AsyncDisplayKit/ASMultiplexImageNode.h +++ b/AsyncDisplayKit/ASMultiplexImageNode.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASMultiplexImageNode.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #if TARGET_OS_IOS @@ -117,13 +119,20 @@ typedef NS_ENUM(NSUInteger, ASMultiplexImageNodeErrorCode) { */ @property (nullable, nonatomic, readonly) ASImageIdentifier displayedImageIdentifier; +/** + * @abstract If the downloader implements progressive image rendering and this value is YES progressive renders of the + * image will be displayed as the image downloads. Regardless of this properties value, progress renders will + * only occur when the node is visible. Defaults to YES. + */ +@property (nonatomic, assign, readwrite) BOOL shouldRenderProgressImages; + #if TARGET_OS_IOS /** * @abstract The image manager that this image node should use when requesting images from the Photos framework. If this is `nil` (the default), then `PHImageManager.defaultManager` is used. * @see `+[NSURL URLWithAssetLocalIdentifier:targetSize:contentMode:options:]` below. */ -@property (nonatomic, strong) PHImageManager *imageManager; +@property (nullable, nonatomic, strong) PHImageManager *imageManager; #endif @end diff --git a/AsyncDisplayKit/ASMultiplexImageNode.mm b/AsyncDisplayKit/ASMultiplexImageNode.mm index b7d0c915b0..19145359ba 100644 --- a/AsyncDisplayKit/ASMultiplexImageNode.mm +++ b/AsyncDisplayKit/ASMultiplexImageNode.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASMultiplexImageNode.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #if TARGET_OS_IOS @@ -22,6 +24,7 @@ #import "ASPhotosFrameworkImageRequest.h" #import "ASEqualityHelpers.h" #import "ASInternalHelpers.h" +#import "ASDisplayNodeExtras.h" #if !AS_IOS8_SDK_OR_LATER #error ASMultiplexImageNode can be used on iOS 7, but must be linked against the iOS 8 SDK. @@ -84,6 +87,10 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent ASDN::RecursiveMutex _downloadIdentifierLock; id _downloadIdentifier; + // Properties + ASDN::RecursiveMutex _propertyLock; + BOOL _shouldRenderProgressImages; + //set on init only BOOL _downloaderSupportsNewProtocol; BOOL _downloaderImplementsSetProgress; @@ -185,6 +192,8 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent _cacheSupportsNewProtocol = [cache respondsToSelector:@selector(cachedImageWithURL:callbackQueue:completion:)]; _cacheSupportsClearing = [cache respondsToSelector:@selector(clearFetchedImageFromCacheWithURL:)]; + _shouldRenderProgressImages = YES; + self.shouldBypassEnsureDisplay = YES; return self; @@ -288,11 +297,11 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent } } -/* visibilityDidChange in ASNetworkImageNode has a very similar implementation. Changes here are likely necessary +/* visibileStateDidChange in ASNetworkImageNode has a very similar implementation. Changes here are likely necessary in ASNetworkImageNode as well. */ -- (void)visibilityDidChange:(BOOL)isVisible +- (void)visibleStateDidChange:(BOOL)isVisible { - [super visibilityDidChange:isVisible]; + [super visibleStateDidChange:isVisible]; if (_downloaderImplementsSetPriority) { ASDN::MutexLocker l(_downloadIdentifierLock); @@ -305,32 +314,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent } } - if (_downloaderImplementsSetProgress) { - ASDN::MutexLocker l(_downloadIdentifierLock); - - if (_downloadIdentifier != nil) { - __weak __typeof__(self) weakSelf = self; - ASImageDownloaderProgressImage progress = nil; - if (isVisible) { - progress = ^(UIImage * _Nonnull progressImage, id _Nullable downloadIdentifier) { - __typeof__(self) strongSelf = weakSelf; - if (strongSelf == nil) { - return; - } - - ASDN::MutexLocker l(strongSelf->_downloadIdentifierLock); - //Getting a result back for a different download identifier, download must not have been successfully canceled - if (ASObjectIsEqual(strongSelf->_downloadIdentifier, downloadIdentifier) == NO && downloadIdentifier != nil) { - return; - } - - strongSelf.image = progressImage; - }; - } - - [_downloader setProgressImageBlock:progress callbackQueue:dispatch_get_main_queue() withDownloadIdentifier:_downloadIdentifier]; - } - } + [self _updateProgressImageBlockOnDownloaderIfNeeded]; } #pragma mark - Core @@ -363,6 +347,27 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent #endif } + +- (void)setShouldRenderProgressImages:(BOOL)shouldRenderProgressImages +{ + ASDN::MutexLocker l(_propertyLock); + if (shouldRenderProgressImages == _shouldRenderProgressImages) { + return; + } + + _shouldRenderProgressImages = shouldRenderProgressImages; + + + ASDN::MutexUnlocker u(_propertyLock); + [self _updateProgressImageBlockOnDownloaderIfNeeded]; +} + +- (BOOL)shouldRenderProgressImages +{ + ASDN::MutexLocker l(_propertyLock); + return _shouldRenderProgressImages; +} + #pragma mark - #pragma mark - @@ -441,9 +446,6 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent - (void)_loadImageIdentifiers { - // Kill any in-flight downloads. - [self _setDownloadIdentifier:nil]; - // Grab the best possible image we can load right now. id bestImmediatelyAvailableImageIdentifier = nil; UIImage *bestImmediatelyAvailableImage = [self _bestImmediatelyAvailableImageFromDataSource:&bestImmediatelyAvailableImageIdentifier]; @@ -463,8 +465,12 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent } // Grab the best available image from the data source. + UIImage *existingImage = self.image; for (id imageIdentifier in _imageIdentifiers) { - UIImage *image = [_dataSource multiplexImageNode:self imageForImageIdentifier:imageIdentifier]; + // If this image is already loaded, don't request it from the data source again because + // the data source may generate a new instance of UIImage that returns NO for isEqual: + // and we'll end up in an infinite loading loop. + UIImage *image = ASObjectIsEqual(imageIdentifier, _loadedImageIdentifier) ? existingImage : [_dataSource multiplexImageNode:self imageForImageIdentifier:imageIdentifier]; if (image) { if (imageIdentifierOut) { *imageIdentifierOut = imageIdentifier; @@ -478,6 +484,43 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent } #pragma mark - + +/** + @note: This should be called without _downloadIdentifierLock held. We will lock + super to read our interface state and it's best to avoid acquiring both locks. + */ +- (void)_updateProgressImageBlockOnDownloaderIfNeeded +{ + BOOL shouldRenderProgressImages = self.shouldRenderProgressImages; + + // Read our interface state before locking so that we don't lock super while holding our lock. + ASInterfaceState interfaceState = self.interfaceState; + ASDN::MutexLocker l(_downloadIdentifierLock); + + if (!_downloaderImplementsSetProgress || _downloadIdentifier == nil) { + return; + } + + ASImageDownloaderProgressImage progress = nil; + if (shouldRenderProgressImages && ASInterfaceStateIncludesVisible(interfaceState)) { + __weak __typeof__(self) weakSelf = self; + progress = ^(UIImage * _Nonnull progressImage, CGFloat progress, id _Nullable downloadIdentifier) { + __typeof__(self) strongSelf = weakSelf; + if (strongSelf == nil) { + return; + } + + ASDN::MutexLocker l(strongSelf->_downloadIdentifierLock); + //Getting a result back for a different download identifier, download must not have been successfully canceled + if (ASObjectIsEqual(strongSelf->_downloadIdentifier, downloadIdentifier) == NO && downloadIdentifier != nil) { + return; + } + strongSelf.image = progressImage; + }; + } + [_downloader setProgressImageBlock:progress callbackQueue:dispatch_get_main_queue() withDownloadIdentifier:_downloadIdentifier]; +} + - (void)_clearImage { // Destruction of bigger images on the main thread can be expensive @@ -488,7 +531,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent BOOL shouldReleaseImageOnBackgroundThread = imageSize.width > kMinReleaseImageOnBackgroundSize.width || imageSize.height > kMinReleaseImageOnBackgroundSize.height; if (shouldReleaseImageOnBackgroundThread) { - ASPerformBlockOnBackgroundThread(^{ + ASPerformBlockOnDeallocationQueue(^{ image = nil; }); } @@ -823,6 +866,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent }]]; #pragma clang diagnostic pop } + [self _updateProgressImageBlockOnDownloaderIfNeeded]; }); } diff --git a/AsyncDisplayKit/ASNavigationController.h b/AsyncDisplayKit/ASNavigationController.h new file mode 100644 index 0000000000..0c82241894 --- /dev/null +++ b/AsyncDisplayKit/ASNavigationController.h @@ -0,0 +1,19 @@ +// +// ASNavigationController.h +// AsyncDisplayKit +// +// Created by Garrett Moon on 4/27/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import + +#import "ASVisibilityProtocols.h" + +@interface ASNavigationController : UINavigationController + +@end diff --git a/AsyncDisplayKit/ASNavigationController.m b/AsyncDisplayKit/ASNavigationController.m new file mode 100644 index 0000000000..bf97b765f5 --- /dev/null +++ b/AsyncDisplayKit/ASNavigationController.m @@ -0,0 +1,97 @@ +// +// ASNavigationController.m +// AsyncDisplayKit +// +// Created by Garrett Moon on 4/27/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import "ASNavigationController.h" + +@implementation ASNavigationController +{ + BOOL _parentManagesVisibilityDepth; + NSInteger _visibilityDepth; +} + +ASVisibilityDidMoveToParentViewController; + +ASVisibilityViewWillAppear; + +ASVisibilityViewDidDisappearImplementation; + +ASVisibilitySetVisibilityDepth; + +ASVisibilityDepthImplementation; + +- (void)visibilityDepthDidChange +{ + for (UIViewController *viewController in self.viewControllers) { + if ([viewController conformsToProtocol:@protocol(ASVisibilityDepth)]) { + [(id )viewController visibilityDepthDidChange]; + } + } +} + +- (NSInteger)visibilityDepthOfChildViewController:(UIViewController *)childViewController +{ + NSUInteger viewControllerIndex = [self.viewControllers indexOfObject:childViewController]; + NSAssert(viewControllerIndex != NSNotFound, @"childViewController is not in the navigation stack."); + + if (viewControllerIndex == self.viewControllers.count - 1) { + //view controller is at the top, just return our own visibility depth. + return [self visibilityDepth]; + } else if (viewControllerIndex == 0) { + //view controller is the root view controller. Can be accessed by holding the back button. + return [self visibilityDepth] + 1; + } + + return [self visibilityDepth] + self.viewControllers.count - 1 - viewControllerIndex; +} + +#pragma mark - UIKit overrides + +- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated +{ + NSArray *viewControllers = [super popToViewController:viewController animated:animated]; + [self visibilityDepthDidChange]; + return viewControllers; +} + +- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated +{ + NSArray *viewControllers = [super popToRootViewControllerAnimated:animated]; + [self visibilityDepthDidChange]; + return viewControllers; +} + +- (void)setViewControllers:(NSArray *)viewControllers +{ + [super setViewControllers:viewControllers]; + [self visibilityDepthDidChange]; +} + +- (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated +{ + [super setViewControllers:viewControllers animated:animated]; + [self visibilityDepthDidChange]; +} + +- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated +{ + [super pushViewController:viewController animated:animated]; + [self visibilityDepthDidChange]; +} + +- (UIViewController *)popViewControllerAnimated:(BOOL)animated +{ + UIViewController *viewController = [super popViewControllerAnimated:animated]; + [self visibilityDepthDidChange]; + return viewController; +} + +@end diff --git a/AsyncDisplayKit/ASNetworkImageNode.h b/AsyncDisplayKit/ASNetworkImageNode.h index bb867f576c..1998d984bb 100644 --- a/AsyncDisplayKit/ASNetworkImageNode.h +++ b/AsyncDisplayKit/ASNetworkImageNode.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASNetworkImageNode.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import @@ -45,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN /** * The delegate, which must conform to the protocol. */ -@property (atomic, weak, readwrite) id delegate; +@property (nullable, atomic, weak, readwrite) id delegate; /** * A placeholder image to display while the URL is loading. @@ -73,6 +75,24 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, assign, readwrite) BOOL shouldCacheImage; +/** + * If the downloader implements progressive image rendering and this value is YES progressive renders of the + * image will be displayed as the image downloads. Regardless of this properties value, progress renders will + * only occur when the node is visible. Defaults to YES. + */ +@property (nonatomic, assign, readwrite) BOOL shouldRenderProgressImages; + +/** + * The image quality of the current image. This is a number between 0 and 1 and can be used to track + * progressive progress. Calculated by dividing number of bytes / expected number of total bytes. + */ +@property (nonatomic, assign, readonly) CGFloat currentImageQuality; + +/** + * The image quality (value between 0 and 1) of the last image that completed displaying. + */ +@property (nonatomic, assign, readonly) CGFloat renderedImageQuality; + @end @@ -82,6 +102,7 @@ NS_ASSUME_NONNULL_BEGIN * notifications such as finished decoding and downloading an image. */ @protocol ASNetworkImageNodeDelegate +@optional /** * Notification that the image node finished downloading an image. @@ -93,8 +114,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)imageNode:(ASNetworkImageNode *)imageNode didLoadImage:(UIImage *)image; -@optional - /** * Notification that the image node started to load * diff --git a/AsyncDisplayKit/ASNetworkImageNode.mm b/AsyncDisplayKit/ASNetworkImageNode.mm index 6a8e37cbdb..fbfea44213 100755 --- a/AsyncDisplayKit/ASNetworkImageNode.mm +++ b/AsyncDisplayKit/ASNetworkImageNode.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASNetworkImageNode.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASNetworkImageNode.h" @@ -15,7 +17,7 @@ #import "ASThread.h" #import "ASInternalHelpers.h" #import "ASImageContainerProtocolCategories.h" -#import "ASImageNode+AnimatedImage.h" +#import "ASDisplayNodeExtras.h" #if PIN_REMOTE_IMAGE #import "ASPINRemoteImageDownloader.h" @@ -39,17 +41,23 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; id _downloadIdentifier; BOOL _imageLoaded; - + CGFloat _currentImageQuality; + CGFloat _renderedImageQuality; + + // TODO: Move this to flags BOOL _delegateSupportsDidStartFetchingData; BOOL _delegateSupportsDidFailWithError; - BOOL _delegateSupportsImageNodeDidFinishDecoding; + BOOL _delegateSupportsDidFinishDecoding; + BOOL _delegateSupportsDidLoadImage; + BOOL _shouldRenderProgressImages; + //set on init only BOOL _downloaderSupportsNewProtocol; BOOL _downloaderImplementsSetProgress; BOOL _downloaderImplementsSetPriority; BOOL _downloaderImplementsAnimatedImage; - + BOOL _cacheSupportsNewProtocol; BOOL _cacheSupportsClearing; BOOL _cacheSupportsSynchronousFetch; @@ -81,6 +89,7 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; _cacheSupportsSynchronousFetch = [cache respondsToSelector:@selector(synchronouslyFetchedCachedImageWithURL:)]; _shouldCacheImage = YES; + _shouldRenderProgressImages = YES; self.shouldBypassEnsureDisplay = YES; return self; @@ -120,9 +129,17 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; _URL = URL; - if (reset || _URL == nil) + BOOL hasURL = _URL == nil; + if (reset || hasURL) { self.image = _defaultImage; - + /* We want to maintain the order that currentImageQuality is set regardless of the calling thread, + so always use a dispatch_async to ensure that we queue the operations in the correct order. + (see comment in displayDidFinish) */ + dispatch_async(dispatch_get_main_queue(), ^{ + self.currentImageQuality = hasURL ? 0.0 : 1.0; + }); + } + if (self.interfaceState & ASInterfaceStateFetchData) { [self fetchData]; } @@ -145,6 +162,13 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; _defaultImage = defaultImage; if (!_imageLoaded) { + BOOL hasURL = _URL == nil; + /* We want to maintain the order that currentImageQuality is set regardless of the calling thread, + so always use a dispatch_async to ensure that we queue the operations in the correct order. + (see comment in displayDidFinish) */ + dispatch_async(dispatch_get_main_queue(), ^{ + self.currentImageQuality = hasURL ? 0.0 : 1.0; + }); _lock.unlock(); // Locking: it is important to release _lock before entering setImage:, as it needs to release the lock before -invalidateCalculatedLayout. // If we continue to hold the lock here, it will still be locked until the next unlock() call, causing a possible deadlock with @@ -161,6 +185,30 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; return _defaultImage; } +- (void)setCurrentImageQuality:(CGFloat)currentImageQuality +{ + ASDN::MutexLocker l(_lock); + _currentImageQuality = currentImageQuality; +} + +- (CGFloat)currentImageQuality +{ + ASDN::MutexLocker l(_lock); + return _currentImageQuality; +} + +- (void)setRenderedImageQuality:(CGFloat)renderedImageQuality +{ + ASDN::MutexLocker l(_lock); + _renderedImageQuality = renderedImageQuality; +} + +- (CGFloat)renderedImageQuality +{ + ASDN::MutexLocker l(_lock); + return _renderedImageQuality; +} + - (void)setDelegate:(id)delegate { ASDN::MutexLocker l(_lock); @@ -168,7 +216,8 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; _delegateSupportsDidStartFetchingData = [delegate respondsToSelector:@selector(imageNodeDidStartFetchingData:)]; _delegateSupportsDidFailWithError = [delegate respondsToSelector:@selector(imageNode:didFailWithError:)]; - _delegateSupportsImageNodeDidFinishDecoding = [delegate respondsToSelector:@selector(imageNodeDidFinishDecoding:)]; + _delegateSupportsDidFinishDecoding = [delegate respondsToSelector:@selector(imageNodeDidFinishDecoding:)]; + _delegateSupportsDidLoadImage = [delegate respondsToSelector:@selector(imageNode:didLoadImage:)]; } - (id)delegate @@ -177,6 +226,26 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; return _delegate; } +- (void)setShouldRenderProgressImages:(BOOL)shouldRenderProgressImages +{ + ASDN::MutexLocker l(_lock); + if (shouldRenderProgressImages == _shouldRenderProgressImages) { + return; + } + + _shouldRenderProgressImages = shouldRenderProgressImages; + + + ASDN::MutexUnlocker u(_lock); + [self _updateProgressImageBlockOnDownloaderIfNeeded]; +} + +- (BOOL)shouldRenderProgressImages +{ + ASDN::MutexLocker l(_lock); + return _shouldRenderProgressImages; +} + - (BOOL)placeholderShouldPersist { ASDN::MutexLocker l(_lock); @@ -196,10 +265,14 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; if (result) { self.image = result; _imageLoaded = YES; + dispatch_async(dispatch_get_main_queue(), ^{ + _currentImageQuality = 1.0; + }); } } } + // TODO: Consider removing this; it predates ASInterfaceState, which now ensures that even non-range-managed nodes get a -fetchData call. [self fetchData]; if (self.image == nil && _downloaderImplementsSetPriority) { @@ -210,14 +283,14 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; } } -/* visibilityDidChange in ASMultiplexImageNode has a very similar implementation. Changes here are likely necessary +/* visibileStateDidChange in ASMultiplexImageNode has a very similar implementation. Changes here are likely necessary in ASMultiplexImageNode as well. */ -- (void)visibilityDidChange:(BOOL)isVisible +- (void)visibleStateDidChange:(BOOL)isVisible { - [super visibilityDidChange:isVisible]; - + [super visibleStateDidChange:isVisible]; + if (_downloaderImplementsSetPriority) { - ASDN::MutexLocker l(_lock); + _lock.lock(); if (_downloadIdentifier != nil) { if (isVisible) { [_downloader setPriority:ASImageDownloaderPriorityVisible withDownloadIdentifier:_downloadIdentifier]; @@ -225,33 +298,11 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; [_downloader setPriority:ASImageDownloaderPriorityPreload withDownloadIdentifier:_downloadIdentifier]; } } + _lock.unlock(); } - - if (_downloaderImplementsSetProgress) { - ASDN::MutexLocker l(_lock); - - if (_downloadIdentifier != nil) { - __weak __typeof__(self) weakSelf = self; - ASImageDownloaderProgressImage progress = nil; - if (isVisible) { - progress = ^(UIImage * _Nonnull progressImage, id _Nullable downloadIdentifier) { - __typeof__(self) strongSelf = weakSelf; - if (strongSelf == nil) { - return; - } - - ASDN::MutexLocker l(_lock); - //Getting a result back for a different download identifier, download must not have been successfully canceled - if (ASObjectIsEqual(strongSelf->_downloadIdentifier, downloadIdentifier) == NO && downloadIdentifier != nil) { - return; - } - - strongSelf.image = progressImage; - }; - } - [_downloader setProgressImageBlock:progress callbackQueue:dispatch_get_main_queue() withDownloadIdentifier:_downloadIdentifier]; - } - } + + // This method has to be called without _lock held + [self _updateProgressImageBlockOnDownloaderIfNeeded]; } - (void)clearFetchedData @@ -281,6 +332,45 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; #pragma mark - Private methods -- only call with lock. +/** + @note: This should be called without _lock held. We will lock + super to read our interface state and it's best to avoid acquiring both locks. + */ +- (void)_updateProgressImageBlockOnDownloaderIfNeeded +{ + BOOL shouldRenderProgressImages = self.shouldRenderProgressImages; + + // Read our interface state before locking so that we don't lock super while holding our lock. + ASInterfaceState interfaceState = self.interfaceState; + ASDN::MutexLocker l(_lock); + + if (!_downloaderImplementsSetProgress || _downloadIdentifier == nil) { + return; + } + + ASImageDownloaderProgressImage progress = nil; + if (shouldRenderProgressImages && ASInterfaceStateIncludesVisible(interfaceState)) { + __weak __typeof__(self) weakSelf = self; + progress = ^(UIImage * _Nonnull progressImage, CGFloat progress, id _Nullable downloadIdentifier) { + __typeof__(self) strongSelf = weakSelf; + if (strongSelf == nil) { + return; + } + + ASDN::MutexLocker l(strongSelf->_lock); + //Getting a result back for a different download identifier, download must not have been successfully canceled + if (ASObjectIsEqual(strongSelf->_downloadIdentifier, downloadIdentifier) == NO && downloadIdentifier != nil) { + return; + } + strongSelf.image = progressImage; + dispatch_async(dispatch_get_main_queue(), ^{ + strongSelf->_currentImageQuality = progress; + }); + }; + } + [_downloader setProgressImageBlock:progress callbackQueue:dispatch_get_main_queue() withDownloadIdentifier:_downloadIdentifier]; +} + - (void)_clearImage { // Destruction of bigger images on the main thread can be expensive @@ -291,13 +381,16 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; BOOL shouldReleaseImageOnBackgroundThread = imageSize.width > kMinReleaseImageOnBackgroundSize.width || imageSize.height > kMinReleaseImageOnBackgroundSize.height; if (shouldReleaseImageOnBackgroundThread) { - ASPerformBlockOnBackgroundThread(^{ + ASPerformBlockOnDeallocationQueue(^{ image = nil; }); } self.animatedImage = nil; self.image = _defaultImage; _imageLoaded = NO; + dispatch_async(dispatch_get_main_queue(), ^{ + self.currentImageQuality = 0.0; + }); } - (void)_cancelImageDownload @@ -317,7 +410,7 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; - (void)_downloadImageWithCompletion:(void (^)(id imageContainer, NSError*, id downloadIdentifier))finished { ASPerformBlockOnBackgroundThread(^{ - ASDN::MutexLocker l(_lock); + _lock.lock(); if (_downloaderSupportsNewProtocol) { _downloadIdentifier = [_downloader downloadImageWithURL:_URL callbackQueue:dispatch_get_main_queue() @@ -340,6 +433,11 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; }]; #pragma clang diagnostic pop } + _lock.unlock(); + + // This method has to be called without _lock held + [self _updateProgressImageBlockOnDownloaderIfNeeded]; + }); } @@ -364,19 +462,44 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; } else { // First try to load the path directly, for efficiency assuming a developer who // doesn't want caching is trying to be as minimal as possible. - self.image = [UIImage imageWithContentsOfFile:_URL.path]; - if (!self.image) { + UIImage *nonAnimatedImage = [UIImage imageWithContentsOfFile:_URL.path]; + if (nonAnimatedImage == nil) { // If we couldn't find it, execute an -imageNamed:-like search so we can find resources even if the // extension is not provided in the path. This allows the same path to work regardless of shouldCacheImage. NSString *filename = [[NSBundle mainBundle] pathForResource:_URL.path.lastPathComponent ofType:nil]; - if (filename) { - self.image = [UIImage imageWithContentsOfFile:filename]; + if (filename != nil) { + nonAnimatedImage = [UIImage imageWithContentsOfFile:filename]; } } + + // If the file may be an animated gif and then created an animated image. + id animatedImage = nil; + if (_downloaderImplementsAnimatedImage) { + NSData *data = [NSData dataWithContentsOfURL:_URL]; + animatedImage = [_downloader animatedImageWithData:data]; + + if ([animatedImage respondsToSelector:@selector(isDataSupported:)] && [animatedImage isDataSupported:data] == NO) { + animatedImage = nil; + } + } + + if (animatedImage != nil) { + self.animatedImage = animatedImage; + } else { + self.image = nonAnimatedImage; + } } - + _imageLoaded = YES; - [_delegate imageNode:self didLoadImage:self.image]; + /* We want to maintain the order that currentImageQuality is set regardless of the calling thread, + so always use a dispatch_async to ensure that we queue the operations in the correct order. + (see comment in displayDidFinish) */ + dispatch_async(dispatch_get_main_queue(), ^{ + self.currentImageQuality = 1.0; + }); + if (_delegateSupportsDidLoadImage) { + [_delegate imageNode:self didLoadImage:self.image]; + } }); } } else { @@ -387,36 +510,36 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; return; } - { - ASDN::MutexLocker l(strongSelf->_lock); - - //Getting a result back for a different download identifier, download must not have been successfully canceled - if (ASObjectIsEqual(strongSelf->_downloadIdentifier, downloadIdentifier) == NO && downloadIdentifier != nil) { - return; - } - - if (imageContainer != nil) { - strongSelf->_imageLoaded = YES; - if ([imageContainer asdk_animatedImageData] && _downloaderImplementsAnimatedImage) { - strongSelf.animatedImage = [_downloader animatedImageWithData:[imageContainer asdk_animatedImageData]]; - } else { - strongSelf.image = [imageContainer asdk_image]; - } - } - - strongSelf->_downloadIdentifier = nil; - - strongSelf->_cacheUUID = nil; + ASDN::MutexLocker l(strongSelf->_lock); + + //Getting a result back for a different download identifier, download must not have been successfully canceled + if (ASObjectIsEqual(strongSelf->_downloadIdentifier, downloadIdentifier) == NO && downloadIdentifier != nil) { + return; } - { - ASDN::MutexLocker l(strongSelf->_lock); - if (imageContainer != nil) { + if (imageContainer != nil) { + strongSelf->_imageLoaded = YES; + if ([imageContainer asdk_animatedImageData] && _downloaderImplementsAnimatedImage) { + strongSelf.animatedImage = [_downloader animatedImageWithData:[imageContainer asdk_animatedImageData]]; + } else { + strongSelf.image = [imageContainer asdk_image]; + } + dispatch_async(dispatch_get_main_queue(), ^{ + strongSelf->_currentImageQuality = 1.0; + }); + } + + strongSelf->_downloadIdentifier = nil; + + strongSelf->_cacheUUID = nil; + + if (imageContainer != nil) { + if (strongSelf->_delegateSupportsDidLoadImage) { [strongSelf->_delegate imageNode:strongSelf didLoadImage:strongSelf.image]; } - else if (error && _delegateSupportsDidFailWithError) { - [strongSelf->_delegate imageNode:strongSelf didFailWithError:error]; - } + } + else if (error && strongSelf->_delegateSupportsDidFailWithError) { + [strongSelf->_delegate imageNode:strongSelf didFailWithError:error]; } }; @@ -426,14 +549,14 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; void (^cacheCompletion)(id ) = ^(id imageContainer) { // If the cache UUID changed, that means this request was cancelled. - if (![_cacheUUID isEqual:cacheUUID]) { + if (!ASObjectIsEqual(_cacheUUID, cacheUUID)) { return; } - if ([imageContainer asdk_image] == NULL && _downloader != nil) { + if ([imageContainer asdk_image] == nil && _downloader != nil) { [self _downloadImageWithCompletion:finished]; } else { - finished(imageContainer, NULL, nil); + finished(imageContainer, nil, nil); } }; @@ -460,13 +583,22 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; #pragma mark - ASDisplayNode+Subclasses -- (void)asyncdisplaykit_asyncTransactionContainerStateDidChange +- (void)displayDidFinish { - if (self.asyncdisplaykit_asyncTransactionContainerState == ASAsyncTransactionContainerStateNoTransactions) { - ASDN::MutexLocker l(_lock); - if (self.layer.contents != nil && _delegateSupportsImageNodeDidFinishDecoding) { - [self.delegate imageNodeDidFinishDecoding:self]; - } + [super displayDidFinish]; + + ASDN::MutexLocker l(_lock); + if (_delegateSupportsDidFinishDecoding && self.layer.contents != nil) { + /* We store the image quality in _currentImageQuality whenever _image is set. On the following displayDidFinish, we'll know that + _currentImageQuality is the quality of the image that has just finished rendering. In order for this to be accurate, we + need to be sure we are on main thread when we set _currentImageQuality. Otherwise, it is possible for _currentImageQuality + to be modified at a point where it is too late to cancel the main thread's previous display (the final sentinel check has passed), + but before the displayDidFinish of the previous display pass is called. In this situation, displayDidFinish would be called and we + would set _renderedImageQuality to the new _currentImageQuality, but the actual quality of the rendered image should be the previous + value stored in _currentImageQuality. */ + + _renderedImageQuality = _currentImageQuality; + [self.delegate imageNodeDidFinishDecoding:self]; } } diff --git a/AsyncDisplayKit/ASPagerFlowLayout.h b/AsyncDisplayKit/ASPagerFlowLayout.h index 9b784107a6..63b1d0d186 100644 --- a/AsyncDisplayKit/ASPagerFlowLayout.h +++ b/AsyncDisplayKit/ASPagerFlowLayout.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Levi McCallum on 2/12/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/ASPagerFlowLayout.m b/AsyncDisplayKit/ASPagerFlowLayout.m index dcb89a4008..c958b084d5 100644 --- a/AsyncDisplayKit/ASPagerFlowLayout.m +++ b/AsyncDisplayKit/ASPagerFlowLayout.m @@ -3,33 +3,70 @@ // AsyncDisplayKit // // Created by Levi McCallum on 2/12/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASPagerFlowLayout.h" -@interface ASPagerFlowLayout () - -@property (strong, nonatomic) NSIndexPath *currentIndexPath; +@interface ASPagerFlowLayout () { + BOOL _didRotate; + CGRect _cachedCollectionViewBounds; + NSIndexPath *_currentIndexPath; +} @end @implementation ASPagerFlowLayout -- (void)invalidateLayout +- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity { - self.currentIndexPath = [self _indexPathForVisiblyCenteredItem]; - [super invalidateLayout]; + NSInteger currentPage = ceil(proposedContentOffset.x / self.collectionView.bounds.size.width); + _currentIndexPath = [NSIndexPath indexPathForItem:currentPage inSection:0]; + + return [super targetContentOffsetForProposedContentOffset:proposedContentOffset withScrollingVelocity:velocity]; } + +- (void)prepareForAnimatedBoundsChange:(CGRect)oldBounds +{ + // Cache the current page if a rotation did happen. This happens before the rotation animation + // is occuring and the bounds changed so we use this as an opportunity to cache the current index path + if (_cachedCollectionViewBounds.size.width != self.collectionView.bounds.size.width) { + _cachedCollectionViewBounds = self.collectionView.bounds; + + // Figurring out current page based on the old bounds visible space + CGRect visibleRect = oldBounds; + + CGFloat visibleXCenter = CGRectGetMidX(visibleRect); + NSArray *layoutAttributes = [self layoutAttributesForElementsInRect:visibleRect]; + for (UICollectionViewLayoutAttributes *attributes in layoutAttributes) { + if ([attributes representedElementCategory] == UICollectionElementCategoryCell && attributes.center.x == visibleXCenter) { + _currentIndexPath = attributes.indexPath; + break; + } + } + + _didRotate = YES; + } + + [super prepareForAnimatedBoundsChange:oldBounds]; +} - (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset { - if (self.currentIndexPath) { - return [self _targetContentOffsetForItemAtIndexPath:self.currentIndexPath - proposedContentOffset:proposedContentOffset]; - } - - return [super targetContentOffsetForProposedContentOffset:proposedContentOffset]; + // Don't mess around if the user is interacting with the page node. Although if just a rotation happened we should + // try to use the current index path to not end up setting the target content offset to something in between pages + if (_didRotate || (!self.collectionView.isDecelerating && !self.collectionView.isTracking)) { + _didRotate = NO; + if (_currentIndexPath) { + return [self _targetContentOffsetForItemAtIndexPath:_currentIndexPath proposedContentOffset:proposedContentOffset]; + } + } + + return [super targetContentOffsetForProposedContentOffset:proposedContentOffset]; } - (CGPoint)_targetContentOffsetForItemAtIndexPath:(NSIndexPath *)indexPath proposedContentOffset:(CGPoint)proposedContentOffset @@ -37,35 +74,20 @@ if ([self _dataSourceIsEmpty]) { return proposedContentOffset; } - UICollectionViewLayoutAttributes *attributes = [self layoutAttributesForItemAtIndexPath:indexPath]; - CGFloat xOffset = (self.collectionView.bounds.size.width - attributes.frame.size.width) / 2; - return CGPointMake(attributes.frame.origin.x - xOffset, proposedContentOffset.y); -} - -- (NSIndexPath *)_indexPathForVisiblyCenteredItem -{ - CGRect visibleRect = [self _visibleRect]; - CGFloat visibleXCenter = CGRectGetMidX(visibleRect); - NSArray *layoutAttributes = [self layoutAttributesForElementsInRect:visibleRect]; - for (UICollectionViewLayoutAttributes *attributes in layoutAttributes) { - if ([attributes representedElementCategory] == UICollectionElementCategoryCell && attributes.center.x == visibleXCenter) { - return attributes.indexPath; - } + + UICollectionViewLayoutAttributes *attributes = [self layoutAttributesForItemAtIndexPath:_currentIndexPath]; + if (attributes == nil) { + return proposedContentOffset; } - return nil; + + CGFloat xOffset = (CGRectGetWidth(self.collectionView.bounds) - CGRectGetWidth(attributes.frame)) / 2.0; + return CGPointMake(attributes.frame.origin.x - xOffset, proposedContentOffset.y); } - (BOOL)_dataSourceIsEmpty { - return ([self.collectionView numberOfSections] == 0 || [self.collectionView numberOfItemsInSection:0] == 0); -} - -- (CGRect)_visibleRect -{ - CGRect visibleRect; - visibleRect.origin = self.collectionView.contentOffset; - visibleRect.size = self.collectionView.bounds.size; - return visibleRect; + return ([self.collectionView numberOfSections] == 0 || + [self.collectionView numberOfItemsInSection:0] == 0); } @end diff --git a/AsyncDisplayKit/ASPagerNode.h b/AsyncDisplayKit/ASPagerNode.h index 7b64836928..2f9809da79 100644 --- a/AsyncDisplayKit/ASPagerNode.h +++ b/AsyncDisplayKit/ASPagerNode.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Levi McCallum on 12/7/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import @@ -11,7 +15,8 @@ @class ASPagerNode; @class ASPagerFlowLayout; -@protocol ASPagerNodeDataSource +#define ASPagerNodeDataSource ASPagerDataSource +@protocol ASPagerDataSource /** * This method replaces -collectionView:numberOfItemsInSection: @@ -65,26 +70,33 @@ @end -@interface ASPagerNode : ASCollectionNode - -// Configures a default horizontal, paging flow layout with 0 inter-item spacing. -- (instancetype)init; - -// Initializer with custom-configured flow layout properties. -- (instancetype)initWithCollectionViewLayout:(ASPagerFlowLayout *)flowLayout; - -// Data Source is required, and uses a different protocol from ASCollectionNode. -- (void)setDataSource:(id )dataSource; -- (id )dataSource; - -// Delegate is optional, and uses the same protocol as ASCollectionNode. -// This includes UIScrollViewDelegate as well as most methods from UICollectionViewDelegate, like willDisplay... -@property (nonatomic, weak) id delegate; - -// The underlying ASCollectionView object. -@property (nonatomic, readonly) ASCollectionView *view; - -- (void)scrollToPageAtIndex:(NSInteger)index animated:(BOOL)animated; +@protocol ASPagerDelegate @end +@interface ASPagerNode : ASCollectionNode + +/// Configures a default horizontal, paging flow layout with 0 inter-item spacing. +- (instancetype)init; + +/// Initializer with custom-configured flow layout properties. +- (instancetype)initWithCollectionViewLayout:(ASPagerFlowLayout *)flowLayout; + +/// Data Source is required, and uses a different protocol from ASCollectionNode. +- (void)setDataSource:(id )dataSource; +- (id )dataSource; + +// Delegate is optional, and uses the same protocol as ASCollectionNode. +// This includes UIScrollViewDelegate as well as most methods from UICollectionViewDelegate, like willDisplay... +@property (nonatomic, weak) id delegate; + +/// The underlying ASCollectionView object. +@property (nonatomic, readonly) ASCollectionView *view; + +/// Returns the current page index +@property (nonatomic, assign, readonly) NSInteger currentPageIndex; + +/// Scroll the contents of the receiver to ensure that the page is visible +- (void)scrollToPageAtIndex:(NSInteger)index animated:(BOOL)animated; + +@end diff --git a/AsyncDisplayKit/ASPagerNode.m b/AsyncDisplayKit/ASPagerNode.m index 52e33bc8fa..2c6cd4b32e 100644 --- a/AsyncDisplayKit/ASPagerNode.m +++ b/AsyncDisplayKit/ASPagerNode.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Levi McCallum on 12/7/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASPagerNode.h" @@ -26,6 +30,8 @@ @implementation ASPagerNode @dynamic view, delegate, dataSource; +#pragma mark - Lifecycle + - (instancetype)init { ASPagerFlowLayout *flowLayout = [[ASPagerFlowLayout alloc] init]; @@ -46,6 +52,8 @@ return self; } +#pragma mark - ASDisplayNode + - (void)didLoad { [super didLoad]; @@ -75,6 +83,13 @@ [self setTuningParameters:fullPreloadParams forRangeMode:ASLayoutRangeModeFull rangeType:ASLayoutRangeTypeFetchData]; } +#pragma mark - Getters / Setters + +- (NSInteger)currentPageIndex +{ + return (self.view.contentOffset.x / CGRectGetWidth(self.view.bounds)); +} + #pragma mark - Helpers - (void)scrollToPageAtIndex:(NSInteger)index animated:(BOOL)animated @@ -111,12 +126,12 @@ #pragma mark - Data Source Proxy -- (id )dataSource +- (id )dataSource { return _pagerDataSource; } -- (void)setDataSource:(id )pagerDataSource +- (void)setDataSource:(id )pagerDataSource { if (pagerDataSource != _pagerDataSource) { _pagerDataSource = pagerDataSource; diff --git a/AsyncDisplayKit/ASRunLoopQueue.h b/AsyncDisplayKit/ASRunLoopQueue.h index 7335528a2c..37b0031eda 100644 --- a/AsyncDisplayKit/ASRunLoopQueue.h +++ b/AsyncDisplayKit/ASRunLoopQueue.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Rahul Malik on 3/7/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/ASRunLoopQueue.mm b/AsyncDisplayKit/ASRunLoopQueue.mm index a18f7a8a70..693f01dc75 100644 --- a/AsyncDisplayKit/ASRunLoopQueue.mm +++ b/AsyncDisplayKit/ASRunLoopQueue.mm @@ -1,9 +1,13 @@ // -// ASRunLoopQueue.m +// ASRunLoopQueue.mm // AsyncDisplayKit // // Created by Rahul Malik on 3/7/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASRunLoopQueue.h" diff --git a/AsyncDisplayKit/ASScrollNode.h b/AsyncDisplayKit/ASScrollNode.h index 32733ffed0..00faced970 100644 --- a/AsyncDisplayKit/ASScrollNode.h +++ b/AsyncDisplayKit/ASScrollNode.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASScrollNode.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/ASScrollNode.m b/AsyncDisplayKit/ASScrollNode.m index afead9ba8a..aed6d8379e 100644 --- a/AsyncDisplayKit/ASScrollNode.m +++ b/AsyncDisplayKit/ASScrollNode.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASScrollNode.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASScrollNode.h" #import "_ASDisplayLayer.h" diff --git a/AsyncDisplayKit/ASTabBarController.h b/AsyncDisplayKit/ASTabBarController.h new file mode 100644 index 0000000000..b07b70ba80 --- /dev/null +++ b/AsyncDisplayKit/ASTabBarController.h @@ -0,0 +1,19 @@ +// +// ASTabBarController.h +// AsyncDisplayKit +// +// Created by Garrett Moon on 5/10/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import + +#import "ASVisibilityProtocols.h" + +@interface ASTabBarController : UITabBarController + +@end diff --git a/AsyncDisplayKit/ASTabBarController.m b/AsyncDisplayKit/ASTabBarController.m new file mode 100644 index 0000000000..65b31d8137 --- /dev/null +++ b/AsyncDisplayKit/ASTabBarController.m @@ -0,0 +1,74 @@ +// +// ASTabBarController.m +// AsyncDisplayKit +// +// Created by Garrett Moon on 5/10/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import "ASTabBarController.h" + +@implementation ASTabBarController +{ + BOOL _parentManagesVisibilityDepth; + NSInteger _visibilityDepth; +} + +ASVisibilityDidMoveToParentViewController; + +ASVisibilityViewWillAppear; + +ASVisibilityViewDidDisappearImplementation; + +ASVisibilitySetVisibilityDepth; + +ASVisibilityDepthImplementation; + +- (void)visibilityDepthDidChange +{ + for (UIViewController *viewController in self.viewControllers) { + if ([viewController conformsToProtocol:@protocol(ASVisibilityDepth)]) { + [(id )viewController visibilityDepthDidChange]; + } + } +} + +- (NSInteger)visibilityDepthOfChildViewController:(UIViewController *)childViewController +{ + if (self.selectedViewController == childViewController) { + return [self visibilityDepth]; + } + return [self visibilityDepth] + 1; +} + +#pragma mark - UIKit overrides + +- (void)setViewControllers:(NSArray<__kindof UIViewController *> *)viewControllers +{ + [super setViewControllers:viewControllers]; + [self visibilityDepthDidChange]; +} + +- (void)setViewControllers:(NSArray<__kindof UIViewController *> *)viewControllers animated:(BOOL)animated +{ + [super setViewControllers:viewControllers animated:animated]; + [self visibilityDepthDidChange]; +} + +- (void)setSelectedIndex:(NSUInteger)selectedIndex +{ + [super setSelectedIndex:selectedIndex]; + [self visibilityDepthDidChange]; +} + +- (void)setSelectedViewController:(__kindof UIViewController *)selectedViewController +{ + [super setSelectedViewController:selectedViewController]; + [self visibilityDepthDidChange]; +} + +@end diff --git a/AsyncDisplayKit/ASTableNode.h b/AsyncDisplayKit/ASTableNode.h index 13d5c88fa8..795e2ef95a 100644 --- a/AsyncDisplayKit/ASTableNode.h +++ b/AsyncDisplayKit/ASTableNode.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Steven Ramkumar on 11/4/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/ASTableNode.m b/AsyncDisplayKit/ASTableNode.mm similarity index 85% rename from AsyncDisplayKit/ASTableNode.m rename to AsyncDisplayKit/ASTableNode.mm index 366209bf15..e5b09fea11 100644 --- a/AsyncDisplayKit/ASTableNode.m +++ b/AsyncDisplayKit/ASTableNode.mm @@ -1,15 +1,21 @@ // -// ASTableNode.m +// ASTableNode.mm // AsyncDisplayKit // // Created by Steven Ramkumar on 11/4/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // -#import "ASFlowLayoutController.h" -#import "ASTableViewInternal.h" +#import "ASEnvironmentInternal.h" #import "ASDisplayNode+Subclasses.h" +#import "ASFlowLayoutController.h" +#import "ASInternalHelpers.h" #import "ASRangeControllerUpdateRangeProtocol+Beta.h" +#import "ASTableViewInternal.h" @interface _ASTablePendingState : NSObject @property (weak, nonatomic) id delegate; @@ -20,7 +26,11 @@ @end @interface ASTableNode () -@property (nonatomic) _ASTablePendingState *pendingState; +{ + ASDN::RecursiveMutex _environmentStateLock; +} + +@property (nonatomic, strong) _ASTablePendingState *pendingState; @end @interface ASTableView () @@ -68,7 +78,7 @@ ASTableView *view = self.view; view.tableNode = self; - + if (_pendingState) { _ASTablePendingState *pendingState = _pendingState; self.pendingState = nil; @@ -139,9 +149,9 @@ } #if ASRangeControllerLoggingEnabled -- (void)visibilityDidChange:(BOOL)isVisible +- (void)visibleStateDidChange:(BOOL)isVisible { - [super visibilityDidChange:isVisible]; + [super visibleStateDidChange:isVisible]; NSLog(@"%@ - visible: %d", self, isVisible); } #endif @@ -158,4 +168,6 @@ [self.view clearFetchedData]; } +ASEnvironmentCollectionTableSetEnvironmentState(_environmentStateLock) + @end diff --git a/AsyncDisplayKit/ASTableView.h b/AsyncDisplayKit/ASTableView.h index fe1ac2a193..4ab4877121 100644 --- a/AsyncDisplayKit/ASTableView.h +++ b/AsyncDisplayKit/ASTableView.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTableView.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import @@ -134,6 +136,12 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)reloadDataImmediately; +/** + * Triggers a relayout of all nodes. + * + */ +- (void)relayoutItems; + /** * begins a batch of insert, delete reload and move operations. This method must be called from the main thread. */ @@ -285,9 +293,9 @@ NS_ASSUME_NONNULL_BEGIN /** * Similar to -visibleCells. * - * @returns an array containing the nodes being displayed on screen. + * @returns an array containing the cell nodes being displayed on screen. */ -- (NSArray *)visibleNodes; +- (NSArray *)visibleNodes; /** * YES to automatically adjust the contentOffset when cells are inserted or deleted "before" @@ -382,6 +390,17 @@ NS_ASSUME_NONNULL_BEGIN @optional +/** + * Informs the delegate that the table view will add the node + * at the given index path to the view hierarchy. + * + * @param tableView The sender. + * @param indexPath The index path of the row that will be displayed. + * + * @warning AsyncDisplayKit processes table view edits asynchronously. The index path + * passed into this method may not correspond to the same item in your data source + * if your data source has been updated since the last edit was processed. + */ - (void)tableView:(ASTableView *)tableView willDisplayNodeForRowAtIndexPath:(NSIndexPath *)indexPath; /** @@ -426,6 +445,10 @@ NS_ASSUME_NONNULL_BEGIN * Informs the delegate that the table view did remove the node which was previously * at the given index path from the view hierarchy. * + * @warning AsyncDisplayKit processes table view edits asynchronously. The index path + * passed into this method may not correspond to the same item in your data source + * if your data source has been updated since the last edit was processed. + * * This method is deprecated. Use @c tableView:didEndDisplayingNode:forRowAtIndexPath: instead. */ - (void)tableView:(ASTableView *)tableView didEndDisplayingNodeForRowAtIndexPath:(NSIndexPath *)indexPath ASDISPLAYNODE_DEPRECATED; diff --git a/AsyncDisplayKit/ASTableView.mm b/AsyncDisplayKit/ASTableView.mm index 6718932297..871589b49d 100644 --- a/AsyncDisplayKit/ASTableView.mm +++ b/AsyncDisplayKit/ASTableView.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTableView.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTableViewInternal.h" @@ -16,6 +18,7 @@ #import "ASDisplayNodeExtras.h" #import "ASDisplayNode+Beta.h" #import "ASDisplayNode+FrameworkPrivate.h" +#import "ASEnvironmentInternal.h" #import "ASInternalHelpers.h" #import "ASLayout.h" #import "ASLayoutController.h" @@ -88,7 +91,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; - (instancetype)_initWithTableView:(ASTableView *)tableView; @end -@interface ASTableView () +@interface ASTableView () { ASTableViewProxy *_proxyDataSource; ASTableViewProxy *_proxyDelegate; @@ -112,9 +115,27 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; BOOL _ignoreNodesConstrainedWidthChange; BOOL _queuedNodeHeightUpdate; BOOL _isDeallocating; - BOOL _dataSourceImplementsNodeBlockForRowAtIndexPath; - BOOL _asyncDelegateImplementsScrollviewDidScroll; NSMutableSet *_cellsForVisibilityUpdates; + + struct { + unsigned int asyncDelegateScrollViewDidScroll:1; + unsigned int asyncDelegateScrollViewWillBeginDragging:1; + unsigned int asyncDelegateScrollViewDidEndDragging:1; + unsigned int asyncDelegateTableViewWillDisplayNodeForRowAtIndexPath:1; + unsigned int asyncDelegateTableViewDidEndDisplayingNodeForRowAtIndexPath:1; + unsigned int asyncDelegateTableViewDidEndDisplayingNodeForRowAtIndexPathDeprecated:1; + unsigned int asyncDelegateScrollViewWillEndDraggingWithVelocityTargetContentOffset:1; + unsigned int asyncDelegateTableViewWillBeginBatchFetchWithContext:1; + unsigned int asyncDelegateShouldBatchFetchForTableView:1; + } _asyncDelegateFlags; + + struct { + unsigned int asyncDataSourceNumberOfSectionsInTableView:1; + unsigned int asyncDataSourceTableViewNodeBlockForRowAtIndexPath:1; + unsigned int asyncDataSourceTableViewNodeForRowAtIndexPath:1; + unsigned int asyncDataSourceTableViewLockDataSource:1; + unsigned int asyncDataSourceTableViewUnlockDataSource:1; + } _asyncDataSourceFlags; } @property (atomic, assign) BOOL asyncDataSourceLocked; @@ -159,6 +180,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; _dataController = [[dataControllerClass alloc] initWithAsyncDataFetching:NO]; _dataController.dataSource = self; _dataController.delegate = _rangeController; + _dataController.environmentDelegate = self; _layoutController.dataSource = _dataController; @@ -252,21 +274,27 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; { // Note: It's common to check if the value hasn't changed and short-circuit but we aren't doing that here to handle // the (common) case of nilling the asyncDataSource in the ViewController's dealloc. In this case our _asyncDataSource - // will return as nil (ARC magic) even though the _proxyDataSource still exists. It's really important to nil out - // super.dataSource in this case because calls to ASTableViewProxy will start failing and cause crashes. - - super.dataSource = nil; + // will return as nil (ARC magic) even though the _proxyDataSource still exists. It's really important to hold a strong + // reference to the old dataSource in this case because calls to ASTableViewProxy will start failing and cause crashes. + NS_VALID_UNTIL_END_OF_SCOPE id oldDataSource = self.dataSource; if (asyncDataSource == nil) { _asyncDataSource = nil; _proxyDataSource = _isDeallocating ? nil : [[ASTableViewProxy alloc] initWithTarget:nil interceptor:self]; - _dataSourceImplementsNodeBlockForRowAtIndexPath = NO; + + memset(&_asyncDataSourceFlags, 0, sizeof(_asyncDataSourceFlags)); } else { _asyncDataSource = asyncDataSource; - _dataSourceImplementsNodeBlockForRowAtIndexPath = [_asyncDataSource respondsToSelector:@selector(tableView:nodeBlockForRowAtIndexPath:)]; - // Data source must implement tableView:nodeBlockForRowAtIndexPath: or tableView:nodeForRowAtIndexPath: - ASDisplayNodeAssertTrue(_dataSourceImplementsNodeBlockForRowAtIndexPath || [_asyncDataSource respondsToSelector:@selector(tableView:nodeForRowAtIndexPath:)]); _proxyDataSource = [[ASTableViewProxy alloc] initWithTarget:_asyncDataSource interceptor:self]; + + _asyncDataSourceFlags.asyncDataSourceNumberOfSectionsInTableView = [_asyncDataSource respondsToSelector:@selector(numberOfSectionsInTableView:)]; + _asyncDataSourceFlags.asyncDataSourceTableViewNodeForRowAtIndexPath = [_asyncDataSource respondsToSelector:@selector(tableView:nodeForRowAtIndexPath:)]; + _asyncDataSourceFlags.asyncDataSourceTableViewNodeBlockForRowAtIndexPath = [_asyncDataSource respondsToSelector:@selector(tableView:nodeBlockForRowAtIndexPath:)]; + _asyncDataSourceFlags.asyncDataSourceTableViewLockDataSource = [_asyncDataSource respondsToSelector:@selector(tableViewLockDataSource:)]; + _asyncDataSourceFlags.asyncDataSourceTableViewUnlockDataSource = [_asyncDataSource respondsToSelector:@selector(tableViewUnlockDataSource:)]; + + // Data source must implement tableView:nodeBlockForRowAtIndexPath: or tableView:nodeForRowAtIndexPath: + ASDisplayNodeAssertTrue(_asyncDataSourceFlags.asyncDataSourceTableViewNodeBlockForRowAtIndexPath || _asyncDataSourceFlags.asyncDataSourceTableViewNodeForRowAtIndexPath); } super.dataSource = (id)_proxyDataSource; @@ -276,22 +304,28 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; { // Note: It's common to check if the value hasn't changed and short-circuit but we aren't doing that here to handle // the (common) case of nilling the asyncDelegate in the ViewController's dealloc. In this case our _asyncDelegate - // will return as nil (ARC magic) even though the _proxyDelegate still exists. It's really important to nil out - // super.delegate in this case because calls to ASTableViewProxy will start failing and cause crashes. - - // Order is important here, the asyncDelegate must be callable while nilling super.delegate to avoid random crashes - // in UIScrollViewAccessibility. - - super.delegate = nil; + // will return as nil (ARC magic) even though the _proxyDataSource still exists. It's really important to hold a strong + // reference to the old delegate in this case because calls to ASTableViewProxy will start failing and cause crashes. + NS_VALID_UNTIL_END_OF_SCOPE id oldDelegate = super.delegate; if (asyncDelegate == nil) { _asyncDelegate = nil; _proxyDelegate = _isDeallocating ? nil : [[ASTableViewProxy alloc] initWithTarget:nil interceptor:self]; - _asyncDelegateImplementsScrollviewDidScroll = NO; + + memset(&_asyncDelegateFlags, 0, sizeof(_asyncDelegateFlags)); } else { _asyncDelegate = asyncDelegate; - _asyncDelegateImplementsScrollviewDidScroll = [_asyncDelegate respondsToSelector:@selector(scrollViewDidScroll:)]; _proxyDelegate = [[ASTableViewProxy alloc] initWithTarget:_asyncDelegate interceptor:self]; + + _asyncDelegateFlags.asyncDelegateScrollViewDidScroll = [_asyncDelegate respondsToSelector:@selector(scrollViewDidScroll:)]; + _asyncDelegateFlags.asyncDelegateTableViewWillDisplayNodeForRowAtIndexPath = [_asyncDelegate respondsToSelector:@selector(tableView:willDisplayNodeForRowAtIndexPath:)]; + _asyncDelegateFlags.asyncDelegateTableViewDidEndDisplayingNodeForRowAtIndexPath = [_asyncDelegate respondsToSelector:@selector(tableView:didEndDisplayingNode:forRowAtIndexPath:)]; + _asyncDelegateFlags.asyncDelegateTableViewDidEndDisplayingNodeForRowAtIndexPathDeprecated = [_asyncDelegate respondsToSelector:@selector(tableView:didEndDisplayingNodeForRowAtIndexPath:)]; + _asyncDelegateFlags.asyncDelegateScrollViewWillEndDraggingWithVelocityTargetContentOffset = [_asyncDelegate respondsToSelector:@selector(scrollViewWillEndDragging:withVelocity:targetContentOffset:)]; + _asyncDelegateFlags.asyncDelegateTableViewWillBeginBatchFetchWithContext = [_asyncDelegate respondsToSelector:@selector(tableView:willBeginBatchFetchWithContext:)]; + _asyncDelegateFlags.asyncDelegateShouldBatchFetchForTableView = [_asyncDelegate respondsToSelector:@selector(shouldBatchFetchForTableView:)]; + _asyncDelegateFlags.asyncDelegateScrollViewWillBeginDragging = [_asyncDelegate respondsToSelector:@selector(scrollViewWillBeginDragging:)]; + _asyncDelegateFlags.asyncDelegateScrollViewDidEndDragging = [_asyncDelegate respondsToSelector:@selector(scrollViewDidEndDragging:willDecelerate:)]; } super.delegate = (id)_proxyDelegate; @@ -326,6 +360,11 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; [super reloadData]; } +- (void)relayoutItems +{ + [_dataController relayoutAllNodes]; +} + - (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType { [_layoutController setTuningParameters:tuningParameters forRangeMode:ASLayoutRangeModeFull rangeType:rangeType]; @@ -361,11 +400,11 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; return [_dataController indexPathForNode:cellNode]; } -- (NSArray *)visibleNodes +- (NSArray *)visibleNodes { - NSArray *indexPaths = [self indexPathsForVisibleRows]; - NSMutableArray *visibleNodes = [[NSMutableArray alloc] init]; - + NSArray *indexPaths = [self visibleNodeIndexPathsForRangeController:_rangeController]; + + NSMutableArray *visibleNodes = [NSMutableArray array]; for (NSIndexPath *indexPath in indexPaths) { ASCellNode *node = [self nodeForRowAtIndexPath:indexPath]; if (node) { @@ -584,7 +623,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; ASCellNode *cellNode = [cell node]; cellNode.scrollView = tableView; - if ([_asyncDelegate respondsToSelector:@selector(tableView:willDisplayNodeForRowAtIndexPath:)]) { + if (_asyncDelegateFlags.asyncDelegateTableViewWillDisplayNodeForRowAtIndexPath) { [_asyncDelegate tableView:self willDisplayNodeForRowAtIndexPath:indexPath]; } @@ -609,7 +648,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; [_rangeController visibleNodeIndexPathsDidChangeWithScrollDirection:[self scrollDirection]]; - if ([_asyncDelegate respondsToSelector:@selector(tableView:didEndDisplayingNode:forRowAtIndexPath:)]) { + if (_asyncDelegateFlags.asyncDelegateTableViewDidEndDisplayingNodeForRowAtIndexPath) { ASDisplayNodeAssertNotNil(cellNode, @"Expected node associated with removed cell not to be nil."); [_asyncDelegate tableView:self didEndDisplayingNode:cellNode forRowAtIndexPath:indexPath]; } @@ -620,7 +659,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - if ([_asyncDelegate respondsToSelector:@selector(tableView:didEndDisplayingNodeForRowAtIndexPath:)]) { + if (_asyncDelegateFlags.asyncDelegateTableViewDidEndDisplayingNodeForRowAtIndexPathDeprecated) { [_asyncDelegate tableView:self didEndDisplayingNodeForRowAtIndexPath:indexPath]; } #pragma clang diagnostic pop @@ -642,7 +681,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; inScrollView:scrollView withCellFrame:tableCell.frame]; } - if (_asyncDelegateImplementsScrollviewDidScroll) { + if (_asyncDelegateFlags.asyncDelegateScrollViewDidScroll) { [_asyncDelegate scrollViewDidScroll:scrollView]; } } @@ -659,11 +698,34 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; [self _beginBatchFetchingIfNeededWithScrollView:self forScrollDirection:[self scrollDirection] contentOffset:*targetContentOffset]; } - if ([_asyncDelegate respondsToSelector:@selector(scrollViewWillEndDragging:withVelocity:targetContentOffset:)]) { + if (_asyncDelegateFlags.asyncDelegateScrollViewWillEndDraggingWithVelocityTargetContentOffset) { [_asyncDelegate scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset]; } } +- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView +{ + for (_ASTableViewCell *tableViewCell in _cellsForVisibilityUpdates) { + [[tableViewCell node] cellNodeVisibilityEvent:ASCellNodeVisibilityEventWillBeginDragging + inScrollView:scrollView + withCellFrame:tableViewCell.frame]; + } + if (_asyncDelegateFlags.asyncDelegateScrollViewWillBeginDragging) { + [_asyncDelegate scrollViewWillBeginDragging:scrollView]; + } +} + +- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate +{ + for (_ASTableViewCell *tableViewCell in _cellsForVisibilityUpdates) { + [[tableViewCell node] cellNodeVisibilityEvent:ASCellNodeVisibilityEventDidEndDragging + inScrollView:scrollView + withCellFrame:tableViewCell.frame]; + } + if (_asyncDelegateFlags.asyncDelegateScrollViewDidEndDragging) { + [_asyncDelegate scrollViewDidEndDragging:scrollView willDecelerate:decelerate]; + } +} #pragma mark - Scroll Direction @@ -722,8 +784,8 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; - (BOOL)canBatchFetch { // if the delegate does not respond to this method, there is no point in starting to fetch - BOOL canFetch = [_asyncDelegate respondsToSelector:@selector(tableView:willBeginBatchFetchWithContext:)]; - if (canFetch && [_asyncDelegate respondsToSelector:@selector(shouldBatchFetchForTableView:)]) { + BOOL canFetch = _asyncDelegateFlags.asyncDelegateTableViewWillBeginBatchFetchWithContext; + if (canFetch && _asyncDelegateFlags.asyncDelegateShouldBatchFetchForTableView) { return [_asyncDelegate shouldBatchFetchForTableView:self]; } else { return canFetch; @@ -763,7 +825,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; - (void)_beginBatchFetching { [_batchContext beginBatchFetching]; - if ([_asyncDelegate respondsToSelector:@selector(tableView:willBeginBatchFetchWithContext:)]) { + if (_asyncDelegateFlags.asyncDelegateTableViewWillBeginBatchFetchWithContext) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [_asyncDelegate tableView:self willBeginBatchFetchWithContext:_batchContext]; }); @@ -787,10 +849,17 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; return @[]; } - NSArray *visibleIndexPaths = self.indexPathsForVisibleRows; + // In this case we cannot use indexPathsForVisibleRows in this case to get all the visible index paths as apparently + // in a grouped UITableView it would return index paths for cells that are over the edge of the visible area. + // Unfortunatly this means we never get a call for -tableView:cellForRowAtIndexPath: for that cells, but we will mark + // mark them as visible in the range controller + NSMutableArray *visibleIndexPaths = [NSMutableArray array]; + for (id cell in self.visibleCells) { + [visibleIndexPaths addObject:[self indexPathForCell:cell]]; + } if (_pendingVisibleIndexPath) { - NSMutableSet *indexPaths = [NSMutableSet setWithArray:self.indexPathsForVisibleRows]; + NSMutableSet *indexPaths = [NSMutableSet setWithArray:visibleIndexPaths]; BOOL (^isAfter)(NSIndexPath *, NSIndexPath *) = ^BOOL(NSIndexPath *indexPath, NSIndexPath *anchor) { if (!anchor || !indexPath) { @@ -826,7 +895,9 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; _pendingVisibleIndexPath = nil; // not contiguous, ignore. } else { [indexPaths addObject:_pendingVisibleIndexPath]; - visibleIndexPaths = [indexPaths.allObjects sortedArrayUsingSelector:@selector(compare:)]; + + [visibleIndexPaths removeAllObjects]; + [visibleIndexPaths addObjectsFromArray:[indexPaths.allObjects sortedArrayUsingSelector:@selector(compare:)]]; } } @@ -897,6 +968,11 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; } } +- (void)didCompleteUpdatesInRangeController:(ASRangeController *)rangeController +{ + [self _checkForBatchFetching]; +} + - (void)rangeController:(ASRangeController *)rangeController didInsertNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions { ASDisplayNodeAssertMainThread(); @@ -1013,7 +1089,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; self.asyncDataSourceLocked = YES; - if ([_asyncDataSource respondsToSelector:@selector(tableViewLockDataSource:)]) { + if (_asyncDataSourceFlags.asyncDataSourceTableViewLockDataSource) { [_asyncDataSource tableViewLockDataSource:self]; } } @@ -1024,7 +1100,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; self.asyncDataSourceLocked = NO; - if ([_asyncDataSource respondsToSelector:@selector(tableViewUnlockDataSource:)]) { + if (_asyncDataSourceFlags.asyncDataSourceTableViewUnlockDataSource) { [_asyncDataSource tableViewUnlockDataSource:self]; } } @@ -1036,13 +1112,23 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; - (NSUInteger)numberOfSectionsInDataController:(ASDataController *)dataController { - if ([_asyncDataSource respondsToSelector:@selector(numberOfSectionsInTableView:)]) { + if (_asyncDataSourceFlags.asyncDataSourceNumberOfSectionsInTableView) { return [_asyncDataSource numberOfSectionsInTableView:self]; } else { return 1; // default section number } } +#pragma mark - ASDataControllerEnvironmentDelegate + +- (id)dataControllerEnvironment +{ + if (self.tableNode) { + return self.tableNode; + } + return self.strongTableNode; +} + #pragma mark - _ASTableViewCellDelegate - (void)didLayoutSubviewsOfTableViewCell:(_ASTableViewCell *)tableViewCell diff --git a/AsyncDisplayKit/ASTableViewInternal.h b/AsyncDisplayKit/ASTableViewInternal.h index 3c1eb2f0c0..93cdca0fcb 100644 --- a/AsyncDisplayKit/ASTableViewInternal.h +++ b/AsyncDisplayKit/ASTableViewInternal.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Huy Nguyen on 26/10/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASTableNode.h" diff --git a/AsyncDisplayKit/ASTableViewProtocols.h b/AsyncDisplayKit/ASTableViewProtocols.h index ff2c441388..76403a5147 100644 --- a/AsyncDisplayKit/ASTableViewProtocols.h +++ b/AsyncDisplayKit/ASTableViewProtocols.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTableViewProtocols.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// NS_ASSUME_NONNULL_BEGIN diff --git a/AsyncDisplayKit/ASTextNode+Beta.h b/AsyncDisplayKit/ASTextNode+Beta.h index 564f5d1917..899b7d2175 100644 --- a/AsyncDisplayKit/ASTextNode+Beta.h +++ b/AsyncDisplayKit/ASTextNode+Beta.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Luke on 1/25/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // NS_ASSUME_NONNULL_BEGIN diff --git a/AsyncDisplayKit/ASTextNode.h b/AsyncDisplayKit/ASTextNode.h index f96bf51370..02eb204a33 100644 --- a/AsyncDisplayKit/ASTextNode.h +++ b/AsyncDisplayKit/ASTextNode.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextNode.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -34,19 +36,19 @@ typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle) { @interface ASTextNode : ASControlNode /** - @abstract The attributed string to show. + @abstract The styled text displayed by the node. @discussion Defaults to nil, no text is shown. For inline image attachments, add an attribute of key NSAttachmentAttributeName, with a value of an NSTextAttachment. */ -@property (nullable, nonatomic, copy) NSAttributedString *attributedString; +@property (nullable, nonatomic, copy) NSAttributedString *attributedText; #pragma mark - Truncation /** - @abstract The attributedString to use when the text must be truncated. + @abstract The attributedText to use when the text must be truncated. @discussion Defaults to a localized ellipsis character. */ -@property (nullable, nonatomic, copy) NSAttributedString *truncationAttributedString; +@property (nullable, nonatomic, copy) NSAttributedString *truncationAttributedText; /** @summary The second attributed string appended for truncation. @@ -270,4 +272,28 @@ typedef NS_ENUM(NSUInteger, ASTextNodeHighlightStyle) { @end +/** + * @abstract Text node deprecated properties + */ +@interface ASTextNode (Deprecated) + +/** + The attributedString and attributedText properties are equivalent, but attributedText is now the standard API + name in order to match UILabel and ASEditableTextNode. + + @see attributedText + */ +@property (nullable, nonatomic, copy) NSAttributedString *attributedString; + + +/** + The truncationAttributedString and truncationAttributedText properties are equivalent, but attributedText is now the + standard API name in order to match UILabel and ASEditableTextNode. + + @see truncationAttributedText + */ +@property (nullable, nonatomic, copy) NSAttributedString *truncationAttributedString; + +@end + NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/ASTextNode.mm b/AsyncDisplayKit/ASTextNode.mm index 8ec7a77a20..95d441452d 100644 --- a/AsyncDisplayKit/ASTextNode.mm +++ b/AsyncDisplayKit/ASTextNode.mm @@ -1,30 +1,29 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextNode.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextNode.h" #import "ASTextNode+Beta.h" +#include + #import -#import #import #import #import #import #import "ASTextKitCoreTextAdditions.h" -#import "ASTextKitComponents.h" -#import "ASTextKitFontSizeAdjuster.h" -#import "ASTextKitRenderer.h" #import "ASTextKitRenderer+Positioning.h" #import "ASTextKitShadower.h" #import "ASInternalHelpers.h" -#import "ASEqualityHelpers.h" #import "ASLayout.h" static const NSTimeInterval ASTextNodeHighlightFadeOutDuration = 0.15; @@ -33,27 +32,10 @@ static const CGFloat ASTextNodeHighlightLightOpacity = 0.11; static const CGFloat ASTextNodeHighlightDarkOpacity = 0.22; static NSString *ASTextNodeTruncationTokenAttributeName = @"ASTextNodeTruncationAttribute"; -@interface ASTextNodeDrawParameters : NSObject - -@property (nonatomic, assign, readonly) CGRect bounds; - -@property (nonatomic, strong, readonly) UIColor *backgroundColor; - -@end - -@implementation ASTextNodeDrawParameters - -- (instancetype)initWithBounds:(CGRect)bounds - backgroundColor:(UIColor *)backgroundColor -{ - if (self = [super init]) { - _bounds = bounds; - _backgroundColor = backgroundColor; - } - return self; -} - -@end +struct ASTextNodeDrawParameter { + CGRect bounds; + UIColor *backgroundColor; +}; @interface ASTextNode () @@ -67,25 +49,38 @@ static NSString *ASTextNodeTruncationTokenAttributeName = @"ASTextNodeTruncation NSArray *_exclusionPaths; - NSAttributedString *_composedTruncationString; + NSAttributedString *_composedTruncationText; NSString *_highlightedLinkAttributeName; id _highlightedLinkAttributeValue; + ASTextNodeHighlightStyle _highlightStyle; NSRange _highlightRange; ASHighlightOverlayLayer *_activeHighlightLayer; - ASDN::Mutex _rendererLock; + std::recursive_mutex _textLock; CGSize _constrainedSize; ASTextKitRenderer *_renderer; + ASTextNodeDrawParameter _drawParameter; + UILongPressGestureRecognizer *_longPressGestureRecognizer; } @dynamic placeholderEnabled; #pragma mark - NSObject ++ (void)initialize +{ + [super initialize]; + + if (self != [ASTextNode class]) { + // Prevent custom drawing in subclasses + ASDisplayNodeAssert(!ASSubclassOverridesClassSelector([ASTextNode class], self, @selector(drawRect:withParameters:isCancelled:isRasterizing:)), @"Subclass %@ must not override drawRect:withParameters:isCancelled:isRasterizing: method. Custom drawing in %@ subclass is not supported.", NSStringFromClass(self), NSStringFromClass([ASTextNode class])); + } +} + static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (instancetype)init @@ -105,7 +100,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; self.needsDisplayOnBoundsChange = YES; _truncationMode = NSLineBreakByWordWrapping; - _composedTruncationString = DefaultTruncationAttributedString(); + _composedTruncationText = DefaultTruncationAttributedString(); // The common case is for a text node to be non-opaque and blended over some background. self.opaque = NO; @@ -158,8 +153,10 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (NSString *)description { - NSString *plainString = [[_attributedString string] stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]]; - NSString *truncationString = [_composedTruncationString string]; + std::lock_guard l(_textLock); + + NSString *plainString = [[_attributedText string] stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]]; + NSString *truncationString = [_composedTruncationText string]; if (plainString.length > 50) plainString = [[plainString substringToIndex:50] stringByAppendingString:@"\u2026"]; return [NSString stringWithFormat:@"<%@: %p; text = \"%@\"; truncation string = \"%@\"; frame = %@; renderer = %p>", self.class, self, plainString, truncationString, self.nodeLoaded ? NSStringFromCGRect(self.layer.frame) : nil, _renderer]; @@ -193,10 +190,10 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (void)didLoad { [super didLoad]; - + // If we are view-backed and the delegate cares, support the long-press callback. SEL longPressCallback = @selector(textNode:longPressedLinkAttribute:value:atPoint:textRange:); - if (!self.isLayerBacked && [self.delegate respondsToSelector:longPressCallback]) { + if (!self.isLayerBacked && [_delegate respondsToSelector:longPressCallback]) { _longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(_handleLongPress:)]; _longPressGestureRecognizer.cancelsTouchesInView = self.longPressCancelsTouches; _longPressGestureRecognizer.delegate = self; @@ -225,7 +222,8 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (ASTextKitRenderer *)_rendererWithBounds:(CGRect)bounds { - ASDN::MutexLocker l(_rendererLock); + std::lock_guard l(_textLock); + if (_renderer == nil) { CGSize constrainedSize = _constrainedSize.width != -INFINITY ? _constrainedSize : bounds.size; _renderer = [[ASTextKitRenderer alloc] initWithTextKitAttributes:[self _rendererAttributes] @@ -236,9 +234,11 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (ASTextKitAttributes)_rendererAttributes { + std::lock_guard l(_textLock); + return { - .attributedString = _attributedString, - .truncationAttributedString = _composedTruncationString, + .attributedString = _attributedText, + .truncationAttributedString = _composedTruncationText, .lineBreakMode = _truncationMode, .maximumNumberOfLines = _maximumNumberOfLines, .exclusionPaths = _exclusionPaths, @@ -248,23 +248,6 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; }; } -- (void)_invalidateRenderer -{ - ASDN::MutexLocker l(_rendererLock); - - if (_renderer) { - // Destruction of the layout managers/containers/text storage is quite - // expensive, and can take some time, so we dispatch onto a bg queue to - // actually dealloc. - __block ASTextKitRenderer *renderer = _renderer; - - ASPerformBlockOnBackgroundThread(^{ - renderer = nil; - }); - _renderer = nil; - } -} - - (void)_invalidateRendererIfNeeded { [self _invalidateRendererIfNeededForBoundsSize:self.threadSafeBounds.size]; @@ -273,19 +256,41 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (void)_invalidateRendererIfNeededForBoundsSize:(CGSize)boundsSize { if ([self _needInvalidateRendererForBoundsSize:boundsSize]) { - // Our bounds of frame have changed to a size that is not identical to our constraining size, + // Our bounds have changed to a size that is not identical to our constraining size, // so our previous layout information is invalid, and TextKit may draw at the // incorrect origin. - _constrainedSize = CGSizeMake(-INFINITY, -INFINITY); + { + std::lock_guard l(_textLock); + _constrainedSize = CGSizeMake(-INFINITY, -INFINITY); + } [self _invalidateRenderer]; } } +- (void)_invalidateRenderer +{ + std::lock_guard l(_textLock); + + if (_renderer) { + // Destruction of the layout managers/containers/text storage is quite + // expensive, and can take some time, so we dispatch onto a bg queue to + // actually dealloc. + __block ASTextKitRenderer *renderer = _renderer; + + ASPerformBlockOnDeallocationQueue(^{ + renderer = nil; + }); + _renderer = nil; + } +} + #pragma mark - Layout and Sizing - (BOOL)_needInvalidateRendererForBoundsSize:(CGSize)boundsSize { - if (!_renderer) { + std::lock_guard l(_textLock); + + if (_renderer == nil) { return YES; } @@ -317,7 +322,11 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (void)calculatedLayoutDidChange { + [super calculatedLayoutDidChange]; + ASLayout *layout = self.calculatedLayout; + + std::lock_guard l(_textLock); if (layout != nil) { _constrainedSize = layout.size; _renderer.constrainedSize = layout.size; @@ -329,6 +338,8 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; ASDisplayNodeAssert(constrainedSize.width >= 0, @"Constrained width for text (%f) is too narrow", constrainedSize.width); ASDisplayNodeAssert(constrainedSize.height >= 0, @"Constrained height for text (%f) is too short", constrainedSize.height); + std::lock_guard l(_textLock); + _constrainedSize = constrainedSize; // Instead of invalidating the renderer, in case this is a new call with a different constrained size, @@ -337,11 +348,11 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; [self setNeedsDisplay]; - CGSize size = [[self _renderer] size]; - if (self.attributedString.length > 0) { + CGSize size = [self _renderer].size; + if (_attributedText.length > 0) { CGFloat screenScale = ASScreenScale(); - self.ascender = round([[_attributedString attribute:NSFontAttributeName atIndex:0 effectiveRange:NULL] ascender] * screenScale)/screenScale; - self.descender = round([[_attributedString attribute:NSFontAttributeName atIndex:_attributedString.length - 1 effectiveRange:NULL] descender] * screenScale)/screenScale; + self.ascender = round([[_attributedText attribute:NSFontAttributeName atIndex:0 effectiveRange:NULL] ascender] * screenScale)/screenScale; + self.descender = round([[_attributedText attribute:NSFontAttributeName atIndex:_attributedText.length - 1 effectiveRange:NULL] descender] * screenScale)/screenScale; if (_renderer.currentScaleFactor > 0 && _renderer.currentScaleFactor < 1.0) { // while not perfect, this is a good estimate of what the ascender of the scaled font will be. self.ascender *= _renderer.currentScaleFactor; @@ -353,28 +364,30 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; #pragma mark - Modifying User Text -- (void)setAttributedString:(NSAttributedString *)attributedString +- (void)setAttributedText:(NSAttributedString *)attributedText { - if (attributedString == nil) { - attributedString = [[NSAttributedString alloc] initWithString:@"" attributes:nil]; + std::lock_guard l(_textLock); + + if (attributedText == nil) { + attributedText = [[NSAttributedString alloc] initWithString:@"" attributes:nil]; } - if (ASObjectIsEqual(attributedString, _attributedString)) { + if (ASObjectIsEqual(attributedText, _attributedText)) { return; } - _attributedString = ASCleanseAttributedStringOfCoreTextAttributes(attributedString); + _attributedText = ASCleanseAttributedStringOfCoreTextAttributes(attributedText); - if (_attributedString.length > 0) { + if (_attributedText.length > 0) { CGFloat screenScale = ASScreenScale(); - self.ascender = round([[_attributedString attribute:NSFontAttributeName atIndex:0 effectiveRange:NULL] ascender] * screenScale)/screenScale; - self.descender = round([[_attributedString attribute:NSFontAttributeName atIndex:_attributedString.length - 1 effectiveRange:NULL] descender] * screenScale)/screenScale; + self.ascender = round([[_attributedText attribute:NSFontAttributeName atIndex:0 effectiveRange:NULL] ascender] * screenScale)/screenScale; + self.descender = round([[_attributedText attribute:NSFontAttributeName atIndex:_attributedText.length - 1 effectiveRange:NULL] descender] * screenScale)/screenScale; } // Sync the truncation string with attributes from the updated _attributedString // Without this, the size calculation of the text with truncation applied will - // not take into account the attributes of attributedString in the last line - [self _updateComposedTruncationString]; + // not take into account the attributes of attributedText in the last line + [self _updateComposedTruncationText]; // We need an entirely new renderer [self _invalidateRenderer]; @@ -383,17 +396,19 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; [self invalidateCalculatedLayout]; [self setNeedsDisplay]; - - self.accessibilityLabel = _attributedString.string; - - // We're an accessibility element by default if there is a string. - self.isAccessibilityElement = _attributedString.length != 0; + + + // Accessiblity + self.accessibilityLabel = _attributedText.string; + self.isAccessibilityElement = (_attributedText.length != 0); // We're an accessibility element by default if there is a string. } #pragma mark - Text Layout - (void)setExclusionPaths:(NSArray *)exclusionPaths { + std::lock_guard l(_textLock); + if (ASObjectIsEqual(exclusionPaths, _exclusionPaths)) { return; } @@ -406,34 +421,51 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (NSArray *)exclusionPaths { + std::lock_guard l(_textLock); + return _exclusionPaths; } #pragma mark - Drawing -- (void)drawRect:(CGRect)bounds withParameters:(ASTextNodeDrawParameters *)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing +- (NSObject *)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer { + std::lock_guard l(_textLock); + + _drawParameter = { + .backgroundColor = self.backgroundColor, + .bounds = self.bounds + }; + return nil; +} + + +- (void)drawRect:(CGRect)bounds withParameters:(id )p isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing; +{ + std::lock_guard l(_textLock); + + ASTextNodeDrawParameter drawParameter = _drawParameter; + CGRect drawParameterBounds = drawParameter.bounds; + UIColor *backgroundColor = isRasterizing ? nil : drawParameter.backgroundColor; + CGContextRef context = UIGraphicsGetCurrentContext(); ASDisplayNodeAssert(context, @"This is no good without a context."); CGContextSaveGState(context); - ASTextKitRenderer *renderer = [self _rendererWithBounds:parameters.bounds]; + ASTextKitRenderer *renderer = [self _rendererWithBounds:drawParameterBounds]; UIEdgeInsets shadowPadding = [self shadowPaddingWithRenderer:renderer]; - CGPoint boundsOrigin = parameters.bounds.origin; + CGPoint boundsOrigin = drawParameterBounds.origin; CGPoint textOrigin = CGPointMake(boundsOrigin.x - shadowPadding.left, boundsOrigin.y - shadowPadding.top); // Fill background - if (!isRasterizing) { - UIColor *backgroundColor = parameters.backgroundColor; - if (backgroundColor) { - [backgroundColor setFill]; - UIRectFillUsingBlendMode(CGContextGetClipBoundingBox(context), kCGBlendModeCopy); - } + if (backgroundColor != nil) { + [backgroundColor setFill]; + UIRectFillUsingBlendMode(CGContextGetClipBoundingBox(context), kCGBlendModeCopy); } // Draw shadow - [[renderer shadower] setShadowInContext:context]; + [renderer.shadower setShadowInContext:context]; // Draw text bounds.origin = textOrigin; @@ -442,11 +474,6 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; CGContextRestoreGState(context); } -- (NSObject *)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer -{ - return [[ASTextNodeDrawParameters alloc] initWithBounds:self.threadSafeBounds backgroundColor:self.backgroundColor]; -} - #pragma mark - Attributes - (id)linkAttributeValueAtPoint:(CGPoint)point @@ -466,9 +493,13 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; inAdditionalTruncationMessage:(out BOOL *)inAdditionalTruncationMessageOut forHighlighting:(BOOL)highlighting { + ASDisplayNodeAssertMainThread(); + + std::lock_guard l(_textLock); + ASTextKitRenderer *renderer = [self _renderer]; - NSRange visibleRange = renderer.visibleRanges[0]; - NSAttributedString *attributedString = _attributedString; + NSRange visibleRange = renderer.firstVisibleRange; + NSAttributedString *attributedString = _attributedText; NSRange clampedRange = NSIntersectionRange(visibleRange, NSMakeRange(0, attributedString.length)); // Check in a 9-point region around the actual touch point so we make sure @@ -558,6 +589,8 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { + ASDisplayNodeAssertMainThread(); + if (gestureRecognizer == _longPressGestureRecognizer) { // Don't allow long press on truncation message if ([self _pendingTruncationTap]) { @@ -565,8 +598,8 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; } // Ask our delegate if a long-press on an attribute is relevant - if ([self.delegate respondsToSelector:@selector(textNode:shouldLongPressLinkAttribute:value:atPoint:)]) { - return [self.delegate textNode:self + if ([_delegate respondsToSelector:@selector(textNode:shouldLongPressLinkAttribute:value:atPoint:)]) { + return [_delegate textNode:self shouldLongPressLinkAttribute:_highlightedLinkAttributeName value:_highlightedLinkAttributeValue atPoint:[gestureRecognizer locationInView:self.view]]; @@ -587,8 +620,24 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; #pragma mark - Highlighting +- (ASTextNodeHighlightStyle)highlightStyle +{ + std::lock_guard l(_textLock); + + return _highlightStyle; +} + +- (void)setHighlightStyle:(ASTextNodeHighlightStyle)highlightStyle +{ + std::lock_guard l(_textLock); + + _highlightStyle = highlightStyle; +} + - (NSRange)highlightRange { + ASDisplayNodeAssertMainThread(); + return _highlightRange; } @@ -615,7 +664,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; if (_activeHighlightLayer) { if (animated) { - __unsafe_unretained CALayer *weakHighlightLayer = _activeHighlightLayer; + __weak CALayer *weakHighlightLayer = _activeHighlightLayer; _activeHighlightLayer = nil; weakHighlightLayer.opacity = 0.0; @@ -668,7 +717,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; NSMutableArray *converted = [NSMutableArray arrayWithCapacity:highlightRects.count]; for (NSValue *rectValue in highlightRects) { UIEdgeInsets shadowPadding = _renderer.shadower.shadowPadding; - CGRect rendererRect = [[self class] _adjustRendererRect:rectValue.CGRectValue forShadowPadding:shadowPadding]; + CGRect rendererRect = ASTextNodeAdjustRenderRectForShadowPadding(rectValue.CGRectValue, shadowPadding); CGRect highlightedRect = [self.layer convertRect:rendererRect toLayer:highlightTargetLayer]; // We set our overlay layer's frame to the bounds of the highlight target layer. @@ -705,6 +754,8 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (void)_clearHighlightIfNecessary { + ASDisplayNodeAssertMainThread(); + if ([self _pendingLinkTap] || [self _pendingTruncationTap]) { [self setHighlightRange:NSMakeRange(0, 0) animated:YES]; } @@ -722,29 +773,12 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; #pragma mark - Text rects -+ (CGRect)_adjustRendererRect:(CGRect)rendererRect forShadowPadding:(UIEdgeInsets)shadowPadding -{ +static CGRect ASTextNodeAdjustRenderRectForShadowPadding(CGRect rendererRect, UIEdgeInsets shadowPadding) { rendererRect.origin.x -= shadowPadding.left; rendererRect.origin.y -= shadowPadding.top; return rendererRect; } -- (NSArray *)_rectsForTextRange:(NSRange)textRange measureOption:(ASTextKitRendererMeasureOption)measureOption -{ - NSArray *rects = [[self _renderer] rectsForTextRange:textRange measureOption:measureOption]; - NSMutableArray *adjustedRects = [NSMutableArray array]; - - for (NSValue *rectValue in rects) { - CGRect rect = [rectValue CGRectValue]; - rect = [self.class _adjustRendererRect:rect forShadowPadding:self.shadowPadding]; - - NSValue *adjustedRectValue = [NSValue valueWithCGRect:rect]; - [adjustedRects addObject:adjustedRectValue]; - } - - return adjustedRects; -} - - (NSArray *)rectsForTextRange:(NSRange)textRange { return [self _rectsForTextRange:textRange measureOption:ASTextKitRendererMeasureOptionCapHeight]; @@ -755,22 +789,46 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; return [self _rectsForTextRange:textRange measureOption:ASTextKitRendererMeasureOptionBlock]; } +- (NSArray *)_rectsForTextRange:(NSRange)textRange measureOption:(ASTextKitRendererMeasureOption)measureOption +{ + std::lock_guard l(_textLock); + + NSArray *rects = [[self _renderer] rectsForTextRange:textRange measureOption:measureOption]; + NSMutableArray *adjustedRects = [NSMutableArray array]; + + for (NSValue *rectValue in rects) { + CGRect rect = [rectValue CGRectValue]; + rect = ASTextNodeAdjustRenderRectForShadowPadding(rect, self.shadowPadding); + + NSValue *adjustedRectValue = [NSValue valueWithCGRect:rect]; + [adjustedRects addObject:adjustedRectValue]; + } + + return adjustedRects; +} + - (CGRect)trailingRect { + std::lock_guard l(_textLock); + CGRect rect = [[self _renderer] trailingRect]; - return [self.class _adjustRendererRect:rect forShadowPadding:self.shadowPadding]; + return ASTextNodeAdjustRenderRectForShadowPadding(rect, self.shadowPadding); } - (CGRect)frameForTextRange:(NSRange)textRange { + std::lock_guard l(_textLock); + CGRect frame = [[self _renderer] frameForTextRange:textRange]; - return [self.class _adjustRendererRect:frame forShadowPadding:self.shadowPadding]; + return ASTextNodeAdjustRenderRectForShadowPadding(frame, self.shadowPadding); } #pragma mark - Placeholders - (void)setPlaceholderColor:(UIColor *)placeholderColor { + std::lock_guard l(_textLock); + _placeholderColor = placeholderColor; // prevent placeholders if we don't have a color @@ -782,14 +840,20 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; // FIXME: Replace this implementation with reusable CALayers that have .backgroundColor set. // This would completely eliminate the memory and performance cost of the backing store. CGSize size = self.calculatedSize; + if (CGSizeEqualToSize(size, CGSizeZero)) { + return nil; + } + + std::lock_guard l(_textLock); + UIGraphicsBeginImageContext(size); [self.placeholderColor setFill]; ASTextKitRenderer *renderer = [self _renderer]; - NSRange textRange = renderer.visibleRanges[0]; + NSRange visibleRange = renderer.firstVisibleRange; // cap height is both faster and creates less subpixel blending - NSArray *lineRects = [self _rectsForTextRange:textRange measureOption:ASTextKitRendererMeasureOptionLineHeight]; + NSArray *lineRects = [self _rectsForTextRange:visibleRange measureOption:ASTextKitRendererMeasureOptionLineHeight]; // fill each line with the placeholder color for (NSValue *rectValue in lineRects) { @@ -808,8 +872,10 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; #pragma mark - Touch Handling --(BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event +- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { + ASDisplayNodeAssertMainThread(); + if (!_passthroughNonlinkTouches) { return [super pointInside:point withEvent:event]; } @@ -838,9 +904,11 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - [super touchesBegan:touches withEvent:event]; - ASDisplayNodeAssertMainThread(); + + std::lock_guard l(_textLock); + + [super touchesBegan:touches withEvent:event]; CGPoint point = [[touches anyObject] locationInView:self.view]; @@ -858,7 +926,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; BOOL linkCrossesVisibleRange = (lastCharIndex > range.location) && (lastCharIndex < NSMaxRange(range) - 1); if (inAdditionalTruncationMessage) { - NSRange visibleRange = [self _renderer].visibleRanges[0]; + NSRange visibleRange = [self _renderer].firstVisibleRange; NSRange truncationMessageRange = [self _additionalTruncationMessageRangeWithVisibleRange:visibleRange]; [self _setHighlightRange:truncationMessageRange forAttributeName:ASTextNodeTruncationTokenAttributeName value:nil animated:YES]; } else if (range.length && !linkCrossesVisibleRange && linkAttributeValue != nil && linkAttributeName != nil) { @@ -869,15 +937,17 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { + ASDisplayNodeAssertMainThread(); [super touchesCancelled:touches withEvent:event]; - + [self _clearHighlightIfNecessary]; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + ASDisplayNodeAssertMainThread(); [super touchesEnded:touches withEvent:event]; - + if ([self _pendingLinkTap] && [_delegate respondsToSelector:@selector(textNode:tappedLinkAttribute:value:atPoint:textRange:)]) { CGPoint point = [[touches anyObject] locationInView:self.view]; [_delegate textNode:self tappedLinkAttribute:_highlightedLinkAttributeName value:_highlightedLinkAttributeValue atPoint:point textRange:_highlightRange]; @@ -894,6 +964,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { + ASDisplayNodeAssertMainThread(); [super touchesMoved:touches withEvent:event]; UITouch *touch = [touches anyObject]; @@ -919,22 +990,28 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (void)_handleLongPress:(UILongPressGestureRecognizer *)longPressRecognizer { + ASDisplayNodeAssertMainThread(); + // Respond to long-press when it begins, not when it ends. if (longPressRecognizer.state == UIGestureRecognizerStateBegan) { - if ([self.delegate respondsToSelector:@selector(textNode:longPressedLinkAttribute:value:atPoint:textRange:)]) { + if ([_delegate respondsToSelector:@selector(textNode:longPressedLinkAttribute:value:atPoint:textRange:)]) { CGPoint touchPoint = [_longPressGestureRecognizer locationInView:self.view]; - [self.delegate textNode:self longPressedLinkAttribute:_highlightedLinkAttributeName value:_highlightedLinkAttributeValue atPoint:touchPoint textRange:_highlightRange]; + [_delegate textNode:self longPressedLinkAttribute:_highlightedLinkAttributeName value:_highlightedLinkAttributeValue atPoint:touchPoint textRange:_highlightRange]; } } } - (BOOL)_pendingLinkTap { + std::lock_guard l(_textLock); + return (_highlightedLinkAttributeValue != nil && ![self _pendingTruncationTap]) && _delegate != nil; } - (BOOL)_pendingTruncationTap { + std::lock_guard l(_textLock); + return [_highlightedLinkAttributeName isEqualToString:ASTextNodeTruncationTokenAttributeName]; } @@ -942,11 +1019,15 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (CGColorRef)shadowColor { + std::lock_guard l(_textLock); + return _shadowColor; } - (void)setShadowColor:(CGColorRef)shadowColor { + std::lock_guard l(_textLock); + if (_shadowColor != shadowColor) { if (shadowColor != NULL) { CGColorRetain(shadowColor); @@ -959,11 +1040,15 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (CGSize)shadowOffset { + std::lock_guard l(_textLock); + return _shadowOffset; } - (void)setShadowOffset:(CGSize)shadowOffset { + std::lock_guard l(_textLock); + if (!CGSizeEqualToSize(_shadowOffset, shadowOffset)) { _shadowOffset = shadowOffset; [self _invalidateRenderer]; @@ -973,11 +1058,15 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (CGFloat)shadowOpacity { + std::lock_guard l(_textLock); + return _shadowOpacity; } - (void)setShadowOpacity:(CGFloat)shadowOpacity { + std::lock_guard l(_textLock); + if (_shadowOpacity != shadowOpacity) { _shadowOpacity = shadowOpacity; [self _invalidateRenderer]; @@ -987,11 +1076,15 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (CGFloat)shadowRadius { + std::lock_guard l(_textLock); + return _shadowRadius; } - (void)setShadowRadius:(CGFloat)shadowRadius { + std::lock_guard l(_textLock); + if (_shadowRadius != shadowRadius) { _shadowRadius = shadowRadius; [self _invalidateRenderer]; @@ -1006,6 +1099,8 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (UIEdgeInsets)shadowPaddingWithRenderer:(ASTextKitRenderer *)renderer { + std::lock_guard l(_textLock); + return renderer.shadower.shadowPadding; } @@ -1021,28 +1116,34 @@ static NSAttributedString *DefaultTruncationAttributedString() return defaultTruncationAttributedString; } -- (void)setTruncationAttributedString:(NSAttributedString *)truncationAttributedString +- (void)setTruncationAttributedText:(NSAttributedString *)truncationAttributedText { - if (ASObjectIsEqual(_truncationAttributedString, truncationAttributedString)) { + std::lock_guard l(_textLock); + + if (ASObjectIsEqual(_truncationAttributedText, truncationAttributedText)) { return; } - _truncationAttributedString = [truncationAttributedString copy]; - [self _invalidateTruncationString]; + _truncationAttributedText = [truncationAttributedText copy]; + [self _invalidateTruncationText]; } - (void)setAdditionalTruncationMessage:(NSAttributedString *)additionalTruncationMessage { + std::lock_guard l(_textLock); + if (ASObjectIsEqual(_additionalTruncationMessage, additionalTruncationMessage)) { return; } _additionalTruncationMessage = [additionalTruncationMessage copy]; - [self _invalidateTruncationString]; + [self _invalidateTruncationText]; } - (void)setTruncationMode:(NSLineBreakMode)truncationMode { + std::lock_guard l(_textLock); + if (_truncationMode != truncationMode) { _truncationMode = truncationMode; [self _invalidateRenderer]; @@ -1052,12 +1153,16 @@ static NSAttributedString *DefaultTruncationAttributedString() - (BOOL)isTruncated { - NSRange visibleRange = [self _renderer].visibleRanges[0]; - return visibleRange.length < _attributedString.length; + std::lock_guard l(_textLock); + + ASTextKitRenderer *renderer = [self _renderer]; + return renderer.firstVisibleRange.length < _attributedText.length; } - (void)setPointSizeScaleFactors:(NSArray *)pointSizeScaleFactors { + std::lock_guard l(_textLock); + if ([_pointSizeScaleFactors isEqualToArray:pointSizeScaleFactors] == NO) { _pointSizeScaleFactors = pointSizeScaleFactors; [self _invalidateRenderer]; @@ -1066,28 +1171,34 @@ static NSAttributedString *DefaultTruncationAttributedString() - (void)setMaximumNumberOfLines:(NSUInteger)maximumNumberOfLines { - if (_maximumNumberOfLines != maximumNumberOfLines) { - _maximumNumberOfLines = maximumNumberOfLines; - [self _invalidateRenderer]; - [self setNeedsDisplay]; - } + std::lock_guard l(_textLock); + + if (_maximumNumberOfLines != maximumNumberOfLines) { + _maximumNumberOfLines = maximumNumberOfLines; + [self _invalidateRenderer]; + [self setNeedsDisplay]; + } } - (NSUInteger)lineCount { + std::lock_guard l(_textLock); + return [[self _renderer] lineCount]; } #pragma mark - Truncation Message -- (void)_updateComposedTruncationString +- (void)_updateComposedTruncationText { - _composedTruncationString = [self _prepareTruncationStringForDrawing:[self _composedTruncationString]]; + std::lock_guard l(_textLock); + + _composedTruncationText = [self _prepareTruncationStringForDrawing:[self _composedTruncationText]]; } -- (void)_invalidateTruncationString +- (void)_invalidateTruncationText { - [self _updateComposedTruncationString]; + [self _updateComposedTruncationText]; [self _invalidateRenderer]; [self setNeedsDisplay]; } @@ -1098,6 +1209,8 @@ static NSAttributedString *DefaultTruncationAttributedString() */ - (NSRange)_additionalTruncationMessageRangeWithVisibleRange:(NSRange)visibleRange { + std::lock_guard l(_textLock); + // Check if we even have an additional truncation message. if (!_additionalTruncationMessage) { return NSMakeRange(NSNotFound, 0); @@ -1109,8 +1222,7 @@ static NSAttributedString *DefaultTruncationAttributedString() NSUInteger additionalTruncationMessageLength = _additionalTruncationMessage.length; // We get the location of the truncation token, then add the length of the // truncation attributed string +1 for the space between. - NSRange range = NSMakeRange(truncationTokenIndex + _truncationAttributedString.length + 1, additionalTruncationMessageLength); - return range; + return NSMakeRange(truncationTokenIndex + _truncationAttributedText.length + 1, additionalTruncationMessageLength); } /** @@ -1118,24 +1230,26 @@ static NSAttributedString *DefaultTruncationAttributedString() * additional truncation message and a truncation attributed string, they will * be properly composed. */ -- (NSAttributedString *)_composedTruncationString +- (NSAttributedString *)_composedTruncationText { + std::lock_guard l(_textLock); + //If we have neither return the default - if (!_additionalTruncationMessage && !_truncationAttributedString) { - return _composedTruncationString; + if (!_additionalTruncationMessage && !_truncationAttributedText) { + return _composedTruncationText; } // Short circuit if we only have one or the other. if (!_additionalTruncationMessage) { - return _truncationAttributedString; + return _truncationAttributedText; } - if (!_truncationAttributedString) { + if (!_truncationAttributedText) { return _additionalTruncationMessage; } // If we've reached this point, both _additionalTruncationMessage and // _truncationAttributedString are present. Compose them. - NSMutableAttributedString *newComposedTruncationString = [[NSMutableAttributedString alloc] initWithAttributedString:_truncationAttributedString]; + NSMutableAttributedString *newComposedTruncationString = [[NSMutableAttributedString alloc] initWithAttributedString:_truncationAttributedText]; [newComposedTruncationString replaceCharactersInRange:NSMakeRange(newComposedTruncationString.length, 0) withString:@" "]; [newComposedTruncationString appendAttributedString:_additionalTruncationMessage]; return newComposedTruncationString; @@ -1148,12 +1262,14 @@ static NSAttributedString *DefaultTruncationAttributedString() */ - (NSAttributedString *)_prepareTruncationStringForDrawing:(NSAttributedString *)truncationString { + std::lock_guard l(_textLock); + truncationString = ASCleanseAttributedStringOfCoreTextAttributes(truncationString); NSMutableAttributedString *truncationMutableString = [truncationString mutableCopy]; // Grab the attributes from the full string - if (_attributedString.length > 0) { - NSAttributedString *originalString = _attributedString; - NSInteger originalStringLength = _attributedString.length; + if (_attributedText.length > 0) { + NSAttributedString *originalString = _truncationAttributedText; + NSInteger originalStringLength = _truncationAttributedText.length; // Add any of the original string's attributes to the truncation string, // but don't overwrite any of the truncation string's attributes NSDictionary *originalStringAttributes = [originalString attributesAtIndex:originalStringLength-1 effectiveRange:NULL]; @@ -1168,3 +1284,27 @@ static NSAttributedString *DefaultTruncationAttributedString() } @end + +@implementation ASTextNode (Deprecated) + +- (void)setAttributedString:(NSAttributedString *)attributedString +{ + self.attributedText = attributedString; +} + +- (NSAttributedString *)attributedString +{ + return self.attributedText; +} + +- (void)setTruncationAttributedString:(NSAttributedString *)truncationAttributedString +{ + self.truncationAttributedText = truncationAttributedString; +} + +- (NSAttributedString *)truncationAttributedString +{ + return self.truncationAttributedText; +} + +@end diff --git a/AsyncDisplayKit/ASVideoNode.h b/AsyncDisplayKit/ASVideoNode.h index 99768eb82c..1194266ef6 100644 --- a/AsyncDisplayKit/ASVideoNode.h +++ b/AsyncDisplayKit/ASVideoNode.h @@ -1,49 +1,137 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASVideoNode.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +#if TARGET_OS_IOS #import +#import @class AVAsset, AVPlayer, AVPlayerItem; @protocol ASVideoNodeDelegate; +typedef enum { + ASVideoNodePlayerStateUnknown, + ASVideoNodePlayerStateInitialLoading, + ASVideoNodePlayerStateReadyToPlay, + ASVideoNodePlayerStatePlaybackLikelyToKeepUpButNotPlaying, + ASVideoNodePlayerStatePlaying, + ASVideoNodePlayerStateLoading, + ASVideoNodePlayerStatePaused, + ASVideoNodePlayerStateFinished +} ASVideoNodePlayerState; + +NS_ASSUME_NONNULL_BEGIN + // IMPORTANT NOTES: // 1. Applications using ASVideoNode must link AVFoundation! (this provides the AV* classes below) // 2. This is a relatively new component of AsyncDisplayKit. It has many useful features, but // there is room for further expansion and optimization. Please report any issues or requests // in an issue on GitHub: https://github.com/facebook/AsyncDisplayKit/issues -@interface ASVideoNode : ASControlNode -@property (atomic, strong, readwrite) AVAsset *asset; -@property (atomic, strong, readonly) AVPlayer *player; -@property (atomic, strong, readonly) AVPlayerItem *currentItem; +@interface ASVideoNode : ASNetworkImageNode -// When autoplay is set to true, a video node will play when it has both loaded and entered the "visible" interfaceState. -// If it leaves the visible interfaceState it will pause but will resume once it has returned +- (void)play; +- (void)pause; +- (BOOL)isPlaying; + +@property (nullable, atomic, strong, readwrite) AVAsset *asset; + +@property (nullable, atomic, strong, readonly) AVPlayer *player; +@property (nullable, atomic, strong, readonly) AVPlayerItem *currentItem; + + +/** + * When shouldAutoplay is set to true, a video node will play when it has both loaded and entered the "visible" interfaceState. + * If it leaves the visible interfaceState it will pause but will resume once it has returned. + */ @property (nonatomic, assign, readwrite) BOOL shouldAutoplay; @property (nonatomic, assign, readwrite) BOOL shouldAutorepeat; @property (nonatomic, assign, readwrite) BOOL muted; +@property (nonatomic, assign, readwrite) BOOL shouldAggressivelyRecoverFromStall; +@property (nonatomic, assign, readonly) ASVideoNodePlayerState playerState; +//! Defaults to 1000 +@property (nonatomic, assign) int32_t periodicTimeObserverTimescale; + +//! Defaults to AVLayerVideoGravityResizeAspect @property (atomic) NSString *gravity; -@property (atomic) ASButtonNode *playButton; -@property (atomic, weak, readwrite) id delegate; - -- (void)play; -- (void)pause; - -- (BOOL)isPlaying; +@property (nullable, atomic, weak, readwrite) id delegate; @end -@protocol ASVideoNodeDelegate +@protocol ASVideoNodeDelegate @optional -- (void)videoPlaybackDidFinish:(ASVideoNode *)videoNode; -- (void)videoNodeWasTapped:(ASVideoNode *)videoNode; -@end +/** + * @abstract Delegate method invoked when the node's video has played to its end time. + * @param videoNode The video node has played to its end time. + */ +- (void)videoDidPlayToEnd:(ASVideoNode *)videoNode; +/** + * @abstract Delegate method invoked the node is tapped. + * @param videoNode The video node that was tapped. + * @discussion The video's play state is toggled if this method is not implemented. + */ +- (void)didTapVideoNode:(ASVideoNode *)videoNode; +/** + * @abstract Delegate method invoked when player changes state. + * @param videoNode The video node. + * @param state player state before this change. + * @param toState player new state. + * @discussion This method is called after each state change + */ +- (void)videoNode:(ASVideoNode *)videoNode willChangePlayerState:(ASVideoNodePlayerState)state toState:(ASVideoNodePlayerState)toState; +/** + * @abstract Ssks delegate if state change is allowed + * ASVideoNodePlayerStatePlaying or ASVideoNodePlayerStatePaused. + * asks delegate if state change is allowed. + * @param videoNode The video node. + * @param state player state that is going to be set. + * @discussion Delegate method invoked when player changes it's state to + * ASVideoNodePlayerStatePlaying or ASVideoNodePlayerStatePaused + * and asks delegate if state change is valid + */ +- (BOOL)videoNode:(ASVideoNode*)videoNode shouldChangePlayerStateTo:(ASVideoNodePlayerState)state; +/** + * @abstract Delegate method invoked when player playback time is updated. + * @param videoNode The video node. + * @param second current playback time in seconds. + */ +- (void)videoNode:(ASVideoNode *)videoNode didPlayToTimeInterval:(NSTimeInterval)timeInterval; +/** + * @abstract Delegate method invoked when the video player stalls. + * @param videoNode The video node that has experienced the stall + * @param second Current playback time when the stall happens + */ +- (void)videoNode:(ASVideoNode *)videoNode didStallAtTimeInterval:(NSTimeInterval)timeInterval; +/** + * @abstract Delegate method invoked when the video player starts the inital asset loading + * @param videoNode The videoNode + */ +- (void)videoNodeDidStartInitialLoading:(ASVideoNode *)videoNode; +/** + * @abstract Delegate method invoked when the video is done loading the asset and can start the playback + * @param videoNode The videoNode + */ +- (void)videoNodeDidFinishInitialLoading:(ASVideoNode *)videoNode; +/** + * @abstract Delegate method invoked when the video node has recovered from the stall + * @param videoNode The videoNode + */ +- (void)videoNodeDidRecoverFromStall:(ASVideoNode *)videoNode; +// Below are deprecated methods. To be removed in ASDK 2.0 release +- (void)videoPlaybackDidFinish:(ASVideoNode *)videoNode __deprecated; +- (void)videoNodeWasTapped:(ASVideoNode *)videoNode __deprecated; +- (void)videoNode:(ASVideoNode *)videoNode didPlayToSecond:(NSTimeInterval)second __deprecated; + +@end +NS_ASSUME_NONNULL_END +#endif \ No newline at end of file diff --git a/AsyncDisplayKit/ASVideoNode.mm b/AsyncDisplayKit/ASVideoNode.mm index d0c65e6ae6..379a70955b 100644 --- a/AsyncDisplayKit/ASVideoNode.mm +++ b/AsyncDisplayKit/ASVideoNode.mm @@ -1,222 +1,374 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - +// +// ASVideoNode.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +#if TARGET_OS_IOS #import "ASVideoNode.h" #import "ASDefaultPlayButton.h" +static BOOL ASAssetIsEqual(AVAsset *asset1, AVAsset *asset2) { + return ASObjectIsEqual(asset1, asset2) + || ([asset1 isKindOfClass:[AVURLAsset class]] + && [asset2 isKindOfClass:[AVURLAsset class]] + && ASObjectIsEqual(((AVURLAsset *)asset1).URL, ((AVURLAsset *)asset2).URL)); +} + +static UIViewContentMode ASContentModeFromVideoGravity(NSString *videoGravity) { + if ([videoGravity isEqualToString:AVLayerVideoGravityResizeAspectFill]) { + return UIViewContentModeScaleAspectFill; + } else if ([videoGravity isEqualToString:AVLayerVideoGravityResize]) { + return UIViewContentModeScaleToFill; + } else { + return UIViewContentModeScaleAspectFit; + } +} + +static void *ASVideoNodeContext = &ASVideoNodeContext; +static NSString * const kPlaybackLikelyToKeepUpKey = @"playbackLikelyToKeepUp"; +static NSString * const kplaybackBufferEmpty = @"playbackBufferEmpty"; +static NSString * const kStatus = @"status"; + @interface ASVideoNode () { ASDN::RecursiveMutex _videoLock; __weak id _delegate; - + struct { + unsigned int delegateVideNodeShouldChangePlayerStateTo:1; + unsigned int delegateVideoDidPlayToEnd:1; + unsigned int delegateDidTapVideoNode:1; + unsigned int delegateVideoNodeWillChangePlayerStateToState:1; + unsigned int delegateVideoNodeDidPlayToTimeInterval:1; + unsigned int delegateVideoNodeDidStartInitialLoading:1; + unsigned int delegateVideoNodeDidFinishInitialLoading:1; + unsigned int delegateVideoNodeDidStallAtTimeInterval:1; + unsigned int delegateVideoNodeDidRecoverFromStall:1; + + //Flags for deprecated methods + unsigned int delegateVideoPlaybackDidFinish_deprecated:1; + unsigned int delegateVideoNodeWasTapped_deprecated:1; + unsigned int delegateVideoNodeDidPlayToSecond_deprecated:1; + } _delegateFlags; + BOOL _shouldBePlaying; BOOL _shouldAutorepeat; BOOL _shouldAutoplay; - + BOOL _shouldAggressivelyRecoverFromStall; BOOL _muted; - + + ASVideoNodePlayerState _playerState; + AVAsset *_asset; - AVPlayerItem *_currentItem; + AVPlayerItem *_currentPlayerItem; AVPlayer *_player; - ASImageNode *_placeholderImageNode; + id _timeObserver; + int32_t _periodicTimeObserverTimescale; + CMTime _timeObserverInterval; - ASButtonNode *_playButton; ASDisplayNode *_playerNode; - ASDisplayNode *_spinner; NSString *_gravity; - - dispatch_queue_t _previewQueue; } @end @implementation ASVideoNode +// TODO: Support preview images with HTTP Live Streaming videos. + +#pragma mark - Construction and Layout + - (instancetype)init { if (!(self = [super init])) { return nil; } - - _previewQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0); - - self.playButton = [[ASDefaultPlayButton alloc] init]; - + self.gravity = AVLayerVideoGravityResizeAspect; - + _periodicTimeObserverTimescale = 10000; [self addTarget:self action:@selector(tapped) forControlEvents:ASControlNodeEventTouchUpInside]; - + return self; } -- (void)interfaceStateDidChange:(ASInterfaceState)newState fromState:(ASInterfaceState)oldState -{ - [super interfaceStateDidChange:newState fromState:oldState]; - - if (!(newState & ASInterfaceStateVisible)) { - if (oldState & ASInterfaceStateVisible) { - if (_shouldBePlaying) { - [self pause]; - _shouldBePlaying = YES; - } - [(UIActivityIndicatorView *)_spinner.view stopAnimating]; - [_spinner removeFromSupernode]; - } - } else { - if (_shouldBePlaying) { - [self play]; - } - } -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -{ - if ([change[@"new"] integerValue] == AVPlayerItemStatusReadyToPlay) { - if ([self.subnodes containsObject:_spinner]) { - [_spinner removeFromSupernode]; - _spinner = nil; - } - } - - if ([change[@"new"] integerValue] == AVPlayerItemStatusFailed) { - - } -} - -- (void)didPlayToEnd:(NSNotification *)notification -{ - if (ASObjectIsEqual([[notification object] asset], _asset)) { - if ([_delegate respondsToSelector:@selector(videoPlaybackDidFinish:)]) { - [_delegate videoPlaybackDidFinish:self]; - } - [_player seekToTime:CMTimeMakeWithSeconds(0, 1)]; - - if (_shouldAutorepeat) { - [self play]; - } else { - [self pause]; - } - } -} - -- (void)layout -{ - [super layout]; - - CGRect bounds = self.bounds; - - _placeholderImageNode.frame = bounds; - _playerNode.frame = bounds; - _playerNode.layer.frame = bounds; - - _playButton.frame = bounds; - - CGFloat horizontalDiff = (bounds.size.width - _playButton.bounds.size.width)/2; - CGFloat verticalDiff = (bounds.size.height - _playButton.bounds.size.height)/2; - _playButton.hitTestSlop = UIEdgeInsetsMake(-verticalDiff, -horizontalDiff, -verticalDiff, -horizontalDiff); - - _spinner.bounds = CGRectMake(0, 0, 44, 44); - _spinner.position = CGPointMake(bounds.size.width/2, bounds.size.height/2); -} - -- (void)didLoad -{ - [super didLoad]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didPlayToEnd:) name:AVPlayerItemDidPlayToEndTimeNotification object:nil]; - - if (_shouldBePlaying) { - _playerNode = [[ASDisplayNode alloc] initWithLayerBlock:^CALayer *{ - AVPlayerLayer *playerLayer = [[AVPlayerLayer alloc] init]; - if (!_player) { - _player = [AVPlayer playerWithPlayerItem:[[AVPlayerItem alloc] initWithAsset:_asset]]; - _player.muted = _muted; - } - playerLayer.player = _player; - playerLayer.videoGravity = [self gravity]; - return playerLayer; - }]; - - [self insertSubnode:_playerNode atIndex:0]; - } else { - dispatch_async(_previewQueue, ^{ - AVAssetImageGenerator *imageGenerator = [[AVAssetImageGenerator alloc] initWithAsset:_asset]; - imageGenerator.appliesPreferredTrackTransform = YES; - [imageGenerator generateCGImagesAsynchronouslyForTimes:@[[NSValue valueWithCMTime:CMTimeMake(0, 1)]] completionHandler:^(CMTime requestedTime, CGImageRef _Nullable image, CMTime actualTime, AVAssetImageGeneratorResult result, NSError * _Nullable error) { - UIImage *theImage = [UIImage imageWithCGImage:image]; - - _placeholderImageNode = [[ASImageNode alloc] init]; - _placeholderImageNode.layerBacked = YES; - _placeholderImageNode.image = theImage; - - if ([_gravity isEqualToString:AVLayerVideoGravityResize]) { - _placeholderImageNode.contentMode = UIViewContentModeRedraw; - } - if ([_gravity isEqualToString:AVLayerVideoGravityResizeAspect]) { - _placeholderImageNode.contentMode = UIViewContentModeScaleAspectFit; - } - if ([_gravity isEqual:AVLayerVideoGravityResizeAspectFill]) { - _placeholderImageNode.contentMode = UIViewContentModeScaleAspectFill; - } - - dispatch_async(dispatch_get_main_queue(), ^{ - _placeholderImageNode.frame = self.bounds; - [self insertSubnode:_placeholderImageNode atIndex:0]; - }); - }]; - }); - } -} - -- (void)tapped -{ - if (self.delegate && [self.delegate respondsToSelector:@selector(videoNodeWasTapped:)]) { - [self.delegate videoNodeWasTapped:self]; - } else { - if (_shouldBePlaying) { - [self pause]; - } else { - [self play]; - } - } -} - - (instancetype)initWithViewBlock:(ASDisplayNodeViewBlock)viewBlock didLoadBlock:(ASDisplayNodeDidLoadBlock)didLoadBlock { ASDisplayNodeAssertNotSupported(); return nil; } +- (ASDisplayNode *)constructPlayerNode +{ + ASVideoNode * __weak weakSelf = self; + + return [[ASDisplayNode alloc] initWithLayerBlock:^CALayer *{ + AVPlayerLayer *playerLayer = [[AVPlayerLayer alloc] init]; + playerLayer.player = weakSelf.player; + playerLayer.videoGravity = weakSelf.gravity; + return playerLayer; + }]; +} + +- (AVPlayerItem *)constructPlayerItem +{ + ASDN::MutexLocker l(_videoLock); + + if (_asset != nil) { + return [[AVPlayerItem alloc] initWithAsset:_asset]; + } + + return nil; +} + +- (void)prepareToPlayAsset:(AVAsset *)asset withKeys:(NSArray *)requestedKeys +{ + for (NSString *key in requestedKeys) { + NSError *error = nil; + AVKeyValueStatus keyStatus = [asset statusOfValueForKey:key error:&error]; + if (keyStatus == AVKeyValueStatusFailed) { + NSLog(@"Asset loading failed with error: %@", error); + } + } + + if (![asset isPlayable]) { + NSLog(@"Asset is not playable."); + return; + } + + AVPlayerItem *playerItem = [self constructPlayerItem]; + [self setCurrentItem:playerItem]; + + if (_player != nil) { + [_player replaceCurrentItemWithPlayerItem:playerItem]; + } else { + self.player = [AVPlayer playerWithPlayerItem:playerItem]; + } + + if (self.image == nil) { + [self generatePlaceholderImage]; + } + + __weak __typeof(self) weakSelf = self; + _timeObserverInterval = CMTimeMake(1, _periodicTimeObserverTimescale); + _timeObserver = [_player addPeriodicTimeObserverForInterval:_timeObserverInterval queue:NULL usingBlock:^(CMTime time){ + [weakSelf periodicTimeObserver:time]; + }]; +} + +- (void)addPlayerItemObservers:(AVPlayerItem *)playerItem +{ + [playerItem addObserver:self forKeyPath:kStatus options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:ASVideoNodeContext]; + [playerItem addObserver:self forKeyPath:kPlaybackLikelyToKeepUpKey options:NSKeyValueObservingOptionNew context:ASVideoNodeContext]; + [playerItem addObserver:self forKeyPath:kplaybackBufferEmpty options:NSKeyValueObservingOptionNew context:ASVideoNodeContext]; + + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter addObserver:self selector:@selector(didPlayToEnd:) name:AVPlayerItemDidPlayToEndTimeNotification object:playerItem]; + [notificationCenter addObserver:self selector:@selector(videoNodeDidStall:) name:AVPlayerItemPlaybackStalledNotification object:playerItem]; + [notificationCenter addObserver:self selector:@selector(errorWhilePlaying:) name:AVPlayerItemFailedToPlayToEndTimeNotification object:playerItem]; + [notificationCenter addObserver:self selector:@selector(errorWhilePlaying:) name:AVPlayerItemNewErrorLogEntryNotification object:playerItem]; +} + +- (void)removePlayerItemObservers:(AVPlayerItem *)playerItem +{ + @try { + [playerItem removeObserver:self forKeyPath:kStatus context:ASVideoNodeContext]; + [playerItem removeObserver:self forKeyPath:kPlaybackLikelyToKeepUpKey context:ASVideoNodeContext]; + [playerItem removeObserver:self forKeyPath:kplaybackBufferEmpty context:ASVideoNodeContext]; + } + @catch (NSException * __unused exception) { + NSLog(@"Unnecessary KVO removal"); + } + + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; + [notificationCenter removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:playerItem]; + [notificationCenter removeObserver:self name: AVPlayerItemPlaybackStalledNotification object:playerItem]; + [notificationCenter removeObserver:self name:AVPlayerItemFailedToPlayToEndTimeNotification object:playerItem]; + [notificationCenter removeObserver:self name:AVPlayerItemNewErrorLogEntryNotification object:playerItem]; +} + +- (void)layout +{ + [super layout]; + // The _playerNode wraps AVPlayerLayer, and therefore should extend across the entire bounds. + _playerNode.frame = self.bounds; +} + +- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize +{ + ASDN::MutexLocker l(_videoLock); + CGSize calculatedSize = constrainedSize; + + // if a preferredFrameSize is set, call the superclass to return that instead of using the image size. + if (CGSizeEqualToSize(self.preferredFrameSize, CGSizeZero) == NO) + calculatedSize = self.preferredFrameSize; + + // Prevent crashes through if infinite width or height + if (isinf(calculatedSize.width) || isinf(calculatedSize.height)) { + ASDisplayNodeAssert(NO, @"Infinite width or height in ASVideoNode"); + calculatedSize = CGSizeZero; + } + + if (_playerNode) { + _playerNode.preferredFrameSize = calculatedSize; + [_playerNode measure:calculatedSize]; + } + + return calculatedSize; +} + +- (void)generatePlaceholderImage +{ + ASVideoNode * __weak weakSelf = self; + AVAsset *asset = self.asset; + + [self imageAtTime:kCMTimeZero completionHandler:^(UIImage *image) { + ASPerformBlockOnMainThread(^{ + // Ensure the asset hasn't changed since the image request was made + if (ASAssetIsEqual(weakSelf.asset, asset)) { + [weakSelf setVideoPlaceholderImage:image]; + } + }); + }]; +} + +- (void)imageAtTime:(CMTime)imageTime completionHandler:(void(^)(UIImage *image))completionHandler +{ + ASPerformBlockOnBackgroundThread(^{ + AVAsset *asset = self.asset; + + // Skip the asset image generation if we don't have any tracks available that are capable of supporting it + NSArray* visualAssetArray = [asset tracksWithMediaCharacteristic:AVMediaCharacteristicVisual]; + if (visualAssetArray.count == 0) { + completionHandler(nil); + return; + } + + AVAssetImageGenerator *previewImageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:asset]; + previewImageGenerator.appliesPreferredTrackTransform = YES; + + [previewImageGenerator generateCGImagesAsynchronouslyForTimes:@[[NSValue valueWithCMTime:imageTime]] + completionHandler:^(CMTime requestedTime, CGImageRef image, CMTime actualTime, AVAssetImageGeneratorResult result, NSError *error) { + if (error != nil && result != AVAssetImageGeneratorCancelled) { + NSLog(@"Asset preview image generation failed with error: %@", error); + } + completionHandler(image ? [UIImage imageWithCGImage:image] : nil); + }]; + }); +} + +- (void)setVideoPlaceholderImage:(UIImage *)image +{ + ASDN::MutexLocker l(_videoLock); + if (image != nil) { + self.contentMode = ASContentModeFromVideoGravity(_gravity); + } + self.image = image; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + ASDN::MutexLocker l(_videoLock); + + if (object != _currentPlayerItem) { + return; + } + + if ([keyPath isEqualToString:kStatus]) { + if ([change[NSKeyValueChangeNewKey] integerValue] == AVPlayerItemStatusReadyToPlay) { + self.playerState = ASVideoNodePlayerStateReadyToPlay; + // If we don't yet have a placeholder image update it now that we should have data available for it + if (self.image == nil) { + [self generatePlaceholderImage]; + } + } + } else if ([keyPath isEqualToString:kPlaybackLikelyToKeepUpKey]) { + self.playerState = ASVideoNodePlayerStatePlaybackLikelyToKeepUpButNotPlaying; + if (_shouldBePlaying && (_shouldAggressivelyRecoverFromStall || [change[NSKeyValueChangeNewKey] boolValue]) && ASInterfaceStateIncludesVisible(self.interfaceState)) { + if (self.playerState == ASVideoNodePlayerStateLoading && _delegateFlags.delegateVideoNodeDidRecoverFromStall) { + [_delegate videoNodeDidRecoverFromStall:self]; + } + [self play]; // autoresume after buffer catches up + } + } else if ([keyPath isEqualToString:kplaybackBufferEmpty]) { + if (_shouldBePlaying && [change[NSKeyValueChangeNewKey] boolValue] == true && ASInterfaceStateIncludesVisible(self.interfaceState)) { + self.playerState = ASVideoNodePlayerStateLoading; + } + } +} + +- (void)tapped +{ + if (_delegateFlags.delegateDidTapVideoNode) { + [_delegate didTapVideoNode:self]; + + } else if (_delegateFlags.delegateVideoNodeWasTapped_deprecated) { + // TODO: This method is deprecated, remove in ASDK 2.0 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [_delegate videoNodeWasTapped:self]; +#pragma clang diagnostic pop + } else { + if (_shouldBePlaying) { + [self pause]; + } else { + [self play]; + } + } +} + - (void)fetchData { [super fetchData]; - - @try { - [_currentItem removeObserver:self forKeyPath:NSStringFromSelector(@selector(status))]; - } - @catch (NSException * __unused exception) { - NSLog(@"unnecessary removal in fetch data"); + + ASDN::MutexLocker l(_videoLock); + AVAsset *asset = self.asset; + // Return immediately if the asset is nil; + if (asset == nil || self.playerState == ASVideoNodePlayerStateInitialLoading) { + return; } - { - ASDN::MutexLocker l(_videoLock); - _currentItem = [[AVPlayerItem alloc] initWithAsset:_asset]; - [_currentItem addObserver:self forKeyPath:NSStringFromSelector(@selector(status)) options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:NULL]; + // FIXME: Nothing appears to prevent this method from sending the delegate notification / calling load on the asset + // multiple times, even after the asset is fully loaded and ready to play. There should probably be a playerState + // for NotLoaded or such, besides Unknown, so this can be easily checked before proceeding. + self.playerState = ASVideoNodePlayerStateInitialLoading; + if (_delegateFlags.delegateVideoNodeDidStartInitialLoading) { + [_delegate videoNodeDidStartInitialLoading:self]; + } + + NSArray *requestedKeys = @[@"playable"]; + [asset loadValuesAsynchronouslyForKeys:requestedKeys completionHandler:^{ + ASPerformBlockOnMainThread(^{ + if (_delegateFlags.delegateVideoNodeDidFinishInitialLoading) { + [_delegate videoNodeDidFinishInitialLoading:self]; + } + [self prepareToPlayAsset:asset withKeys:requestedKeys]; + }); + }]; +} - if (_player) { - [_player replaceCurrentItemWithPlayerItem:_currentItem]; - } else { - _player = [[AVPlayer alloc] initWithPlayerItem:_currentItem]; - _player.muted = _muted; - } +- (void)periodicTimeObserver:(CMTime)time +{ + NSTimeInterval timeInSeconds = CMTimeGetSeconds(time); + if (timeInSeconds <= 0) { + return; + } + + if (_delegateFlags.delegateVideoNodeDidPlayToTimeInterval) { + [_delegate videoNode:self didPlayToTimeInterval:timeInSeconds]; + + } else if (_delegateFlags.delegateVideoNodeDidPlayToSecond_deprecated) { + // TODO: This method is deprecated, remove in ASDK 2.0 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [_delegate videoNode:self didPlayToSecond:timeInSeconds]; +#pragma clang diagnostic pop } } @@ -226,74 +378,61 @@ { ASDN::MutexLocker l(_videoLock); - ((AVPlayerLayer *)_playerNode.layer).player = nil; - _player = nil; + + self.player = nil; + self.currentItem = nil; } } -- (void)visibilityDidChange:(BOOL)isVisible +- (void)visibleStateDidChange:(BOOL)isVisible { - [super visibilityDidChange:isVisible]; + [super visibleStateDidChange:isVisible]; ASDN::MutexLocker l(_videoLock); - if (_shouldAutoplay && _playerNode.isNodeLoaded) { - [self play]; - } else if (_shouldAutoplay) { - _shouldBePlaying = YES; - } if (isVisible) { - if (_playerNode.isNodeLoaded) { - if (!_player) { - _player = [AVPlayer playerWithPlayerItem:[[AVPlayerItem alloc] initWithAsset:_asset]]; - _player.muted = _muted; - } - ((AVPlayerLayer *)_playerNode.layer).player = _player; - } - - if (_shouldBePlaying) { + if (_shouldBePlaying || _shouldAutoplay) { [self play]; } + } else if (_shouldBePlaying) { + [self pause]; + _shouldBePlaying = YES; } } + #pragma mark - Video Properties -- (void)setPlayButton:(ASButtonNode *)playButton +- (void)setPlayerState:(ASVideoNodePlayerState)playerState { ASDN::MutexLocker l(_videoLock); - _playButton = playButton; + ASVideoNodePlayerState oldState = _playerState; - [self addSubnode:playButton]; + if (oldState == playerState) { + return; + } - [_playButton addTarget:self action:@selector(tapped) forControlEvents:ASControlNodeEventTouchUpInside]; -} - -- (ASButtonNode *)playButton -{ - ASDN::MutexLocker l(_videoLock); + if (_delegateFlags.delegateVideoNodeWillChangePlayerStateToState) { + [_delegate videoNode:self willChangePlayerState:oldState toState:playerState]; + } - return _playButton; + _playerState = playerState; } - (void)setAsset:(AVAsset *)asset { ASDN::MutexLocker l(_videoLock); - if (ASObjectIsEqual(asset, _asset) - || ([asset isKindOfClass:[AVURLAsset class]] - && [_asset isKindOfClass:[AVURLAsset class]] - && ASObjectIsEqual(((AVURLAsset *)asset).URL, ((AVURLAsset *)_asset).URL))) { + if (ASAssetIsEqual(asset, _asset)) { return; } - + + [self clearFetchedData]; + _asset = asset; - - // FIXME: Adopt -setNeedsFetchData when it is available - if (self.interfaceState & ASInterfaceStateFetchData) { - [self fetchData]; - } + + [self setNeedsDataFetch]; } - (AVAsset *)asset @@ -308,26 +447,57 @@ return _player; } +- (id)delegate{ + return _delegate; +} + +- (void)setDelegate:(id)delegate +{ + [super setDelegate:delegate]; + _delegate = delegate; + + if (_delegate == nil) { + memset(&_delegateFlags, 0, sizeof(_delegateFlags)); + } else { + _delegateFlags.delegateVideNodeShouldChangePlayerStateTo = [_delegate respondsToSelector:@selector(videoNode:shouldChangePlayerStateTo:)]; + _delegateFlags.delegateVideoDidPlayToEnd = [_delegate respondsToSelector:@selector(videoDidPlayToEnd:)]; + _delegateFlags.delegateDidTapVideoNode = [_delegate respondsToSelector:@selector(didTapVideoNode:)]; + _delegateFlags.delegateVideoNodeWillChangePlayerStateToState = [_delegate respondsToSelector:@selector(videoNode:willChangePlayerState:toState:)]; + _delegateFlags.delegateVideoNodeDidPlayToTimeInterval = [_delegate respondsToSelector:@selector(videoNode:didPlayToTimeInterval:)]; + _delegateFlags.delegateVideoNodeDidStartInitialLoading = [_delegate respondsToSelector:@selector(videoNodeDidStartInitialLoading:)]; + _delegateFlags.delegateVideoNodeDidFinishInitialLoading = [_delegate respondsToSelector:@selector(videoNodeDidFinishInitialLoading:)]; + _delegateFlags.delegateVideoNodeDidStallAtTimeInterval = [_delegate respondsToSelector:@selector(videoNode:didStallAtTimeInterval:)]; + _delegateFlags.delegateVideoNodeDidRecoverFromStall = [_delegate respondsToSelector:@selector(videoNodeDidRecoverFromStall:)]; + + // deprecated methods + _delegateFlags.delegateVideoPlaybackDidFinish_deprecated = [_delegate respondsToSelector:@selector(videoPlaybackDidFinish:)]; + _delegateFlags.delegateVideoNodeDidPlayToSecond_deprecated = [_delegate respondsToSelector:@selector(videoNode:didPlayToSecond:)]; + _delegateFlags.delegateVideoNodeWasTapped_deprecated = [_delegate respondsToSelector:@selector(videoNodeWasTapped:)]; + ASDisplayNodeAssert((_delegateFlags.delegateVideoDidPlayToEnd && _delegateFlags.delegateVideoPlaybackDidFinish_deprecated) == NO, @"Implemented both deprecated and non-deprecated methods - please remove videoPlaybackDidFinish, it's deprecated"); + ASDisplayNodeAssert((_delegateFlags.delegateVideoNodeDidPlayToTimeInterval && _delegateFlags.delegateVideoNodeDidPlayToSecond_deprecated) == NO, @"Implemented both deprecated and non-deprecated methods - please remove videoNodeWasTapped, it's deprecated"); + ASDisplayNodeAssert((_delegateFlags.delegateDidTapVideoNode && _delegateFlags.delegateVideoNodeWasTapped_deprecated) == NO, @"Implemented both deprecated and non-deprecated methods - please remove didPlayToSecond, it's deprecated"); + } +} + - (void)setGravity:(NSString *)gravity { ASDN::MutexLocker l(_videoLock); if (_playerNode.isNodeLoaded) { ((AVPlayerLayer *)_playerNode.layer).videoGravity = gravity; } + self.contentMode = ASContentModeFromVideoGravity(gravity); _gravity = gravity; } - (NSString *)gravity { ASDN::MutexLocker l(_videoLock); - return _gravity; } - (BOOL)muted { ASDN::MutexLocker l(_videoLock); - return _muted; } @@ -344,63 +514,49 @@ - (void)play { ASDN::MutexLocker l(_videoLock); - - if (!_spinner) { - _spinner = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{ - UIActivityIndicatorView *spinnnerView = [[UIActivityIndicatorView alloc] init]; - spinnnerView.color = [UIColor whiteColor]; + + if (![self isStateChangeValid:ASVideoNodePlayerStatePlaying]) { + return; + } + + if (_player == nil) { + [self setNeedsDataFetch]; + } + + if (_playerNode == nil) { + _playerNode = [self constructPlayerNode]; + + [self addSubnode:_playerNode]; + - return spinnnerView; - }]; + [self setNeedsLayout]; } - if (!_playerNode) { - _playerNode = [[ASDisplayNode alloc] initWithLayerBlock:^CALayer *{ - AVPlayerLayer *playerLayer = [[AVPlayerLayer alloc] init]; - if (!_player) { - _player = [AVPlayer playerWithPlayerItem:[[AVPlayerItem alloc] initWithAsset:_asset]]; - _player.muted = _muted; - } - playerLayer.player = _player; - playerLayer.videoGravity = [self gravity]; - return playerLayer; - }]; - - if ([self.subnodes containsObject:_playButton]) { - [self insertSubnode:_playerNode belowSubnode:_playButton]; - } else { - [self addSubnode:_playerNode]; - } - } [_player play]; _shouldBePlaying = YES; - - [UIView animateWithDuration:0.15 animations:^{ - _playButton.alpha = 0.0; - }]; - - if (![self ready] && _shouldBePlaying && (self.interfaceState & ASInterfaceStateVisible)) { - [self addSubnode:_spinner]; - [(UIActivityIndicatorView *)_spinner.view startAnimating]; + + if (![self ready]) { + self.playerState = ASVideoNodePlayerStateLoading; + } else { + self.playerState = ASVideoNodePlayerStatePlaying; } } - (BOOL)ready { - return _currentItem.status == AVPlayerItemStatusReadyToPlay; + return _currentPlayerItem.status == AVPlayerItemStatusReadyToPlay; } - (void)pause { ASDN::MutexLocker l(_videoLock); - + if (![self isStateChangeValid:ASVideoNodePlayerStatePaused]) { + return; + } + self.playerState = ASVideoNodePlayerStatePaused; [_player pause]; - [((UIActivityIndicatorView *)_spinner.view) stopAnimating]; _shouldBePlaying = NO; - [UIView animateWithDuration:0.15 animations:^{ - _playButton.alpha = 1.0; - }]; } - (BOOL)isPlaying @@ -410,24 +566,82 @@ return (_player.rate > 0 && !_player.error); } -#pragma mark - Property Accessors for Tests - -- (ASDisplayNode *)spinner +- (BOOL)isStateChangeValid:(ASVideoNodePlayerState)state { - ASDN::MutexLocker l(_videoLock); - return _spinner; + if (_delegateFlags.delegateVideNodeShouldChangePlayerStateTo) { + if (![_delegate videoNode:self shouldChangePlayerStateTo:state]) { + return NO; + } + } + return YES; } + +#pragma mark - Playback observers + +- (void)didPlayToEnd:(NSNotification *)notification +{ + self.playerState = ASVideoNodePlayerStateFinished; + if (_delegateFlags.delegateVideoDidPlayToEnd) { + [_delegate videoDidPlayToEnd:self]; + } else if (_delegateFlags.delegateVideoPlaybackDidFinish_deprecated) { + // TODO: This method is deprecated, remove in ASDK 2.0 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + [_delegate videoPlaybackDidFinish:self]; +#pragma clang diagnostic pop + } + [_player seekToTime:kCMTimeZero]; + + if (_shouldAutorepeat) { + [self play]; + } else { + [self pause]; + } +} + +- (void)videoNodeDidStall:(NSNotification *)notification +{ + self.playerState = ASVideoNodePlayerStateLoading; + if (_delegateFlags.delegateVideoNodeDidStallAtTimeInterval) { + [_delegate videoNode:self didStallAtTimeInterval:CMTimeGetSeconds(_player.currentItem.currentTime)]; + } +} + +- (void)errorWhilePlaying:(NSNotification *)notification +{ + if ([notification.name isEqualToString:AVPlayerItemFailedToPlayToEndTimeNotification]) { + NSLog(@"Failed to play video"); + } else if ([notification.name isEqualToString:AVPlayerItemNewErrorLogEntryNotification]) { + AVPlayerItem *item = (AVPlayerItem *)notification.object; + AVPlayerItemErrorLogEvent *logEvent = item.errorLog.events.lastObject; + NSLog(@"AVPlayerItem error log entry added for video with error %@ status %@", item.error, + (item.status == AVPlayerItemStatusFailed ? @"FAILED" : [NSString stringWithFormat:@"%ld", (long)item.status])); + NSLog(@"Item is %@", item); + + if (logEvent) { + NSLog(@"Log code %ld domain %@ comment %@", (long)logEvent.errorStatusCode, logEvent.errorDomain, logEvent.errorComment); + } + } +} + +#pragma mark - Internal Properties + - (AVPlayerItem *)currentItem { ASDN::MutexLocker l(_videoLock); - return _currentItem; + return _currentPlayerItem; } - (void)setCurrentItem:(AVPlayerItem *)currentItem { ASDN::MutexLocker l(_videoLock); - _currentItem = currentItem; + + [self removePlayerItemObservers:_currentPlayerItem]; + + _currentPlayerItem = currentItem; + + [self addPlayerItemObservers:currentItem]; } - (ASDisplayNode *)playerNode @@ -436,23 +650,42 @@ return _playerNode; } +- (void)setPlayerNode:(ASDisplayNode *)playerNode +{ + ASDN::MutexLocker l(_videoLock); + _playerNode = playerNode; + + [self setNeedsLayout]; +} + +- (void)setPlayer:(AVPlayer *)player +{ + ASDN::MutexLocker l(_videoLock); + _player = player; + player.muted = _muted; + ((AVPlayerLayer *)_playerNode.layer).player = player; +} + - (BOOL)shouldBePlaying { ASDN::MutexLocker l(_videoLock); return _shouldBePlaying; } +- (void)setShouldBePlaying:(BOOL)shouldBePlaying +{ + ASDN::MutexLocker l(_videoLock); + _shouldBePlaying = shouldBePlaying; +} + #pragma mark - Lifecycle - (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:nil]; - @try { - [_currentItem removeObserver:self forKeyPath:NSStringFromSelector(@selector(status))]; - } - @catch (NSException * __unused exception) { - NSLog(@"unnecessary removal in dealloc"); - } + [_player removeTimeObserver:_timeObserver]; + _timeObserver = nil; + [self removePlayerItemObservers:_currentPlayerItem]; } @end +#endif \ No newline at end of file diff --git a/AsyncDisplayKit/ASVideoPlayerNode.h b/AsyncDisplayKit/ASVideoPlayerNode.h new file mode 100644 index 0000000000..de07dada8e --- /dev/null +++ b/AsyncDisplayKit/ASVideoPlayerNode.h @@ -0,0 +1,164 @@ +// +// ASVideoPlayerNode.h +// AsyncDisplayKit +// +// Created by Erekle on 5/6/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#if TARGET_OS_IOS +#import +//#import +//#import +//#import + +@class AVAsset; +@protocol ASVideoPlayerNodeDelegate; + +typedef enum { + ASVideoPlayerNodeControlTypePlaybackButton, + ASVideoPlayerNodeControlTypeElapsedText, + ASVideoPlayerNodeControlTypeDurationText, + ASVideoPlayerNodeControlTypeScrubber, + ASVideoPlayerNodeControlTypeFlexGrowSpacer, +} ASVideoPlayerNodeControlType; + +NS_ASSUME_NONNULL_BEGIN + +@interface ASVideoPlayerNode : ASDisplayNode + +@property (nullable, atomic, weak) id delegate; + +@property (nonatomic, assign, readonly) CMTime duration; + +@property (nonatomic, assign) BOOL controlsDisabled; + +@property (nonatomic, assign, readonly) BOOL loadAssetWhenNodeBecomesVisible; + +#pragma mark - ASVideoNode property proxy +/** + * When shouldAutoplay is set to true, a video node will play when it has both loaded and entered the "visible" interfaceState. + * If it leaves the visible interfaceState it will pause but will resume once it has returned. + */ +@property (nonatomic, assign, readwrite) BOOL shouldAutoPlay; +@property (nonatomic, assign, readwrite) BOOL shouldAutoRepeat; +@property (nonatomic, assign, readwrite) BOOL muted; +@property (nonatomic, assign, readonly) ASVideoNodePlayerState playerState; +@property (nonatomic, assign, readwrite) BOOL shouldAggressivelyRecoverFromStall; + +//! Defaults to 100 +@property (nonatomic, assign) int32_t periodicTimeObserverTimescale; +//! Defaults to AVLayerVideoGravityResizeAspect +@property (atomic) NSString *gravity; + +- (instancetype)initWithUrl:(NSURL*)url; +- (instancetype)initWithAsset:(AVAsset*)asset; +- (instancetype)initWithUrl:(NSURL *)url loadAssetWhenNodeBecomesVisible:(BOOL)loadAssetWhenNodeBecomesVisible; +- (instancetype)initWithAsset:(AVAsset *)asset loadAssetWhenNodeBecomesVisible:(BOOL)loadAssetWhenNodeBecomesVisible; + +#pragma mark - Public API +- (void)seekToTime:(CGFloat)percentComplete; +- (void)play; +- (void)pause; +- (BOOL)isPlaying; + +@end + +#pragma mark - ASVideoPlayerNodeDelegate - +@protocol ASVideoPlayerNodeDelegate +@optional +/** + * @abstract Delegate method invoked before creating controlbar controls + * @param videoPlayer + */ +- (NSArray *)videoPlayerNodeNeededDefaultControls:(ASVideoPlayerNode*)videoPlayer; + +/** + * @abstract Delegate method invoked before creating default controls, asks delegate for custom controls dictionary. + * This dictionary must constain only ASDisplayNode subclass objects. + * @param videoPlayer + * @discussion - This method is invoked only when developer implements videoPlayerNodeLayoutSpec:forControls:forMaximumSize: + * and gives ability to add custom constrols to ASVideoPlayerNode, for example mute button. + */ +- (NSDictionary *)videoPlayerNodeCustomControls:(ASVideoPlayerNode*)videoPlayer; + +/** + * @abstract Delegate method invoked in layoutSpecThatFits: + * @param videoPlayer + * @param controls - Dictionary of controls which are used in videoPlayer; Dictionary keys are ASVideoPlayerNodeControlType + * @param maxSize - Maximum size for ASVideoPlayerNode + * @discussion - Developer can layout whole ASVideoPlayerNode as he wants. ASVideoNode is locked and it can't be changed + */ +- (ASLayoutSpec *)videoPlayerNodeLayoutSpec:(ASVideoPlayerNode *)videoPlayer + forControls:(NSDictionary *)controls + forMaximumSize:(CGSize)maxSize; + +#pragma mark Text delegate methods +/** + * @abstract Delegate method invoked before creating ASVideoPlayerNodeControlTypeElapsedText and ASVideoPlayerNodeControlTypeDurationText + * @param videoPlayer + * @param timeLabelType + */ +- (NSDictionary *)videoPlayerNodeTimeLabelAttributes:(ASVideoPlayerNode *)videoPlayerNode timeLabelType:(ASVideoPlayerNodeControlType)timeLabelType; +- (NSString *)videoPlayerNode:(ASVideoPlayerNode *)videoPlayerNode + timeStringForTimeLabelType:(ASVideoPlayerNodeControlType)timeLabelType + forTime:(CMTime)time; + +#pragma mark Scrubber delegate methods +- (UIColor *)videoPlayerNodeScrubberMaximumTrackTint:(ASVideoPlayerNode *)videoPlayer; +- (UIColor *)videoPlayerNodeScrubberMinimumTrackTint:(ASVideoPlayerNode *)videoPlayer; +- (UIColor *)videoPlayerNodeScrubberThumbTint:(ASVideoPlayerNode *)videoPlayer; +- (UIImage *)videoPlayerNodeScrubberThumbImage:(ASVideoPlayerNode *)videoPlayer; + +#pragma mark - Spinner delegate methods +- (UIColor *)videoPlayerNodeSpinnerTint:(ASVideoPlayerNode *)videoPlayer; + +#pragma mark - Playback button delegate methods +- (UIColor *)videoPlayerNodePlaybackButtonTint:(ASVideoPlayerNode *)videoPlayer; + + +#pragma mark ASVideoNodeDelegate proxy methods +/** + * @abstract Delegate method invoked when ASVideoPlayerNode is taped. + * @param videoPlayerNode The ASVideoPlayerNode that was tapped. + */ +- (void)didTapVideoPlayerNode:(ASVideoPlayerNode *)videoPlayer; +/** + * @abstract Delegate method invoked when ASVideoNode playback time is updated. + * @param videoPlayerNode The video player node + * @param second current playback time. + */ +- (void)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer didPlayToTime:(CMTime)time; + +/** + * @abstract Delegate method invoked when ASVideoNode changes state. + * @param videoPlayerNode The ASVideoPlayerNode whose ASVideoNode is changing state. + * @param state ASVideoNode state before this change. + * @param toSate ASVideoNode new state. + * @discussion This method is called after each state change + */ +- (void)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer willChangeVideoNodeState:(ASVideoNodePlayerState)state toVideoNodeState:(ASVideoNodePlayerState)toState; + +/** + * @abstract Delegate method is invoked when ASVideoNode decides to change state. + * @param videoPlayerNode The ASVideoPlayerNode whose ASVideoNode is changing state. + * @param state ASVideoNode that is going to be set. + * @discussion Delegate method invoked when player changes it's state to + * ASVideoNodePlayerStatePlaying or ASVideoNodePlayerStatePaused + * and asks delegate if state change is valid + */ +- (BOOL)videoPlayerNode:(ASVideoPlayerNode*)videoPlayer shouldChangeVideoNodeStateTo:(ASVideoNodePlayerState)state; + +/** + * @abstract Delegate method invoked when the ASVideoNode has played to its end time. + * @param videoPlayerNode The video node has played to its end time. + */ +- (void)videoPlayerNodeDidPlayToEnd:(ASVideoPlayerNode *)videoPlayer; + +@end +NS_ASSUME_NONNULL_END +#endif diff --git a/AsyncDisplayKit/ASVideoPlayerNode.mm b/AsyncDisplayKit/ASVideoPlayerNode.mm new file mode 100644 index 0000000000..cd880bcd4d --- /dev/null +++ b/AsyncDisplayKit/ASVideoPlayerNode.mm @@ -0,0 +1,805 @@ +// +// ASVideoPlayerNode.mm +// AsyncDisplayKit +// +// Created by Erekle on 5/6/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import "ASVideoPlayerNode.h" +#import "ASDefaultPlaybackButton.h" + +static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; + +@interface ASVideoPlayerNode() +{ + ASDN::RecursiveMutex _videoPlayerLock; + + __weak id _delegate; + + struct { + unsigned int delegateNeededDefaultControls:1; + unsigned int delegateCustomControls:1; + unsigned int delegateSpinnerTintColor:1; + unsigned int delegatePlaybackButtonTint:1; + unsigned int delegateScrubberMaximumTrackTintColor:1; + unsigned int delegateScrubberMinimumTrackTintColor:1; + unsigned int delegateScrubberThumbTintColor:1; + unsigned int delegateScrubberThumbImage:1; + unsigned int delegateTimeLabelAttributes:1; + unsigned int delegateTimeLabelAttributedString:1; + unsigned int delegateLayoutSpecForControls:1; + unsigned int delegateVideoNodeDidPlayToTime:1; + unsigned int delegateVideoNodeWillChangeState:1; + unsigned int delegateVideoNodeShouldChangeState:1; + unsigned int delegateVideoNodePlaybackDidFinish:1; + unsigned int delegateDidTapVideoPlayerNode:1; + } _delegateFlags; + + NSURL *_url; + AVAsset *_asset; + + ASVideoNode *_videoNode; + + NSArray *_neededDefaultControls; + + NSMutableDictionary *_cachedControls; + + ASDefaultPlaybackButton *_playbackButtonNode; + ASTextNode *_elapsedTextNode; + ASTextNode *_durationTextNode; + ASDisplayNode *_scrubberNode; + ASStackLayoutSpec *_controlFlexGrowSpacerSpec; + ASDisplayNode *_spinnerNode; + + BOOL _loadAssetWhenNodeBecomesVisible; + BOOL _isSeeking; + CMTime _duration; + + BOOL _controlsDisabled; + + BOOL _shouldAutoPlay; + BOOL _shouldAutoRepeat; + BOOL _muted; + int32_t _periodicTimeObserverTimescale; + NSString *_gravity; + + BOOL _shouldAggressivelyRecoverFromStall; + + UIColor *_defaultControlsColor; +} + +@end + +@implementation ASVideoPlayerNode +- (instancetype)init +{ + if (!(self = [super init])) { + return nil; + } + + [self _init]; + + return self; +} + +- (instancetype)initWithUrl:(NSURL*)url +{ + if (!(self = [super init])) { + return nil; + } + + _url = url; + _asset = [AVAsset assetWithURL:_url]; + _loadAssetWhenNodeBecomesVisible = YES; + + [self _init]; + + return self; +} + +- (instancetype)initWithAsset:(AVAsset *)asset +{ + if (!(self = [super init])) { + return nil; + } + + _asset = asset; + _loadAssetWhenNodeBecomesVisible = YES; + + [self _init]; + + return self; +} + +- (instancetype)initWithUrl:(NSURL *)url loadAssetWhenNodeBecomesVisible:(BOOL)loadAssetWhenNodeBecomesVisible +{ + if (!(self = [super init])) { + return nil; + } + + _url = url; + _asset = [AVAsset assetWithURL:_url]; + _loadAssetWhenNodeBecomesVisible = loadAssetWhenNodeBecomesVisible; + + [self _init]; + + return self; +} + +- (instancetype)initWithAsset:(AVAsset *)asset loadAssetWhenNodeBecomesVisible:(BOOL)loadAssetWhenNodeBecomesVisible +{ + if (!(self = [super init])) { + return nil; + } + + _asset = asset; + _loadAssetWhenNodeBecomesVisible = loadAssetWhenNodeBecomesVisible; + + [self _init]; + + return self; +} + +- (void)_init +{ + _defaultControlsColor = [UIColor whiteColor]; + _cachedControls = [[NSMutableDictionary alloc] init]; + + _videoNode = [[ASVideoNode alloc] init]; + _videoNode.delegate = self; + if (_loadAssetWhenNodeBecomesVisible == NO) { + _videoNode.asset = _asset; + } + [self addSubnode:_videoNode]; +} + +- (void)didLoad +{ + [super didLoad]; + { + ASDN::MutexLocker l(_videoPlayerLock); + [self createControls]; + } +} + +- (void)visibleStateDidChange:(BOOL)isVisible +{ + [super visibleStateDidChange:isVisible]; + + ASDN::MutexLocker l(_videoPlayerLock); + + if (isVisible && _loadAssetWhenNodeBecomesVisible && _asset != _videoNode.asset) { + _videoNode.asset = _asset; + } +} + +- (NSArray *)createDefaultControlElementArray +{ + if (_delegateFlags.delegateNeededDefaultControls) { + return [_delegate videoPlayerNodeNeededDefaultControls:self]; + } + + return @[ @(ASVideoPlayerNodeControlTypePlaybackButton), + @(ASVideoPlayerNodeControlTypeElapsedText), + @(ASVideoPlayerNodeControlTypeScrubber), + @(ASVideoPlayerNodeControlTypeDurationText) ]; +} + +#pragma mark - UI +- (void)createControls +{ + ASDN::MutexLocker l(_videoPlayerLock); + + if (_controlsDisabled) { + return; + } + + if (_neededDefaultControls == nil) { + _neededDefaultControls = [self createDefaultControlElementArray]; + } + + if (_cachedControls == nil) { + _cachedControls = [[NSMutableDictionary alloc] init]; + } + + for (id object in _neededDefaultControls) { + ASVideoPlayerNodeControlType type = (ASVideoPlayerNodeControlType)[object integerValue]; + switch (type) { + case ASVideoPlayerNodeControlTypePlaybackButton: + [self createPlaybackButton]; + break; + case ASVideoPlayerNodeControlTypeElapsedText: + [self createElapsedTextField]; + break; + case ASVideoPlayerNodeControlTypeDurationText: + [self createDurationTextField]; + break; + case ASVideoPlayerNodeControlTypeScrubber: + [self createScrubber]; + break; + case ASVideoPlayerNodeControlTypeFlexGrowSpacer: + [self createControlFlexGrowSpacer]; + break; + default: + break; + } + } + + if (_delegateFlags.delegateCustomControls && _delegateFlags.delegateLayoutSpecForControls) { + NSDictionary *customControls = [_delegate videoPlayerNodeCustomControls:self]; + for (id key in customControls) { + id node = customControls[key]; + if (![node isKindOfClass:[ASDisplayNode class]]) { + continue; + } + + [self addSubnode:node]; + [_cachedControls setObject:node forKey:key]; + } + } + + ASPerformBlockOnMainThread(^{ + ASDN::MutexLocker l(_videoPlayerLock); + [self setNeedsLayout]; + }); +} + +- (void)removeControls +{ + NSArray *controls = [_cachedControls allValues]; + [controls enumerateObjectsUsingBlock:^(ASDisplayNode *_Nonnull node, NSUInteger idx, BOOL * _Nonnull stop) { + [node removeFromSupernode]; + }]; + + [self cleanCachedControls]; +} + +- (void)cleanCachedControls +{ + [_cachedControls removeAllObjects]; + + _playbackButtonNode = nil; + _elapsedTextNode = nil; + _durationTextNode = nil; + _scrubberNode = nil; +} + +- (void)createPlaybackButton +{ + if (_playbackButtonNode == nil) { + _playbackButtonNode = [[ASDefaultPlaybackButton alloc] init]; + _playbackButtonNode.preferredFrameSize = CGSizeMake(16.0, 22.0); + if (_delegateFlags.delegatePlaybackButtonTint) { + _playbackButtonNode.tintColor = [_delegate videoPlayerNodePlaybackButtonTint:self]; + } else { + _playbackButtonNode.tintColor = _defaultControlsColor; + } + + if (_videoNode.playerState == ASVideoNodePlayerStatePlaying) { + _playbackButtonNode.buttonType = ASDefaultPlaybackButtonTypePause; + } + + [_playbackButtonNode addTarget:self action:@selector(didTapPlaybackButton:) forControlEvents:ASControlNodeEventTouchUpInside]; + [_cachedControls setObject:_playbackButtonNode forKey:@(ASVideoPlayerNodeControlTypePlaybackButton)]; + } + + [self addSubnode:_playbackButtonNode]; +} + +- (void)createElapsedTextField +{ + if (_elapsedTextNode == nil) { + _elapsedTextNode = [[ASTextNode alloc] init]; + _elapsedTextNode.attributedString = [self timeLabelAttributedStringForString:@"00:00" + forControlType:ASVideoPlayerNodeControlTypeElapsedText]; + _elapsedTextNode.truncationMode = NSLineBreakByClipping; + + [_cachedControls setObject:_elapsedTextNode forKey:@(ASVideoPlayerNodeControlTypeElapsedText)]; + } + [self addSubnode:_elapsedTextNode]; +} + +- (void)createDurationTextField +{ + if (_durationTextNode == nil) { + _durationTextNode = [[ASTextNode alloc] init]; + _durationTextNode.attributedString = [self timeLabelAttributedStringForString:@"00:00" + forControlType:ASVideoPlayerNodeControlTypeDurationText]; + _durationTextNode.truncationMode = NSLineBreakByClipping; + + [_cachedControls setObject:_durationTextNode forKey:@(ASVideoPlayerNodeControlTypeDurationText)]; + } + [self addSubnode:_durationTextNode]; +} + +- (void)createScrubber +{ + if (_scrubberNode == nil) { + _scrubberNode = [[ASDisplayNode alloc] initWithViewBlock:^UIView * _Nonnull{ + UISlider *slider = [[UISlider alloc] initWithFrame:CGRectZero]; + slider.minimumValue = 0.0; + slider.maximumValue = 1.0; + + if (_delegateFlags.delegateScrubberMinimumTrackTintColor) { + slider.minimumTrackTintColor = [_delegate videoPlayerNodeScrubberMinimumTrackTint:self]; + } + + if (_delegateFlags.delegateScrubberMaximumTrackTintColor) { + slider.maximumTrackTintColor = [_delegate videoPlayerNodeScrubberMaximumTrackTint:self]; + } + + if (_delegateFlags.delegateScrubberThumbTintColor) { + slider.thumbTintColor = [_delegate videoPlayerNodeScrubberThumbTint:self]; + } + + if (_delegateFlags.delegateScrubberThumbImage) { + UIImage *thumbImage = [_delegate videoPlayerNodeScrubberThumbImage:self]; + [slider setThumbImage:thumbImage forState:UIControlStateNormal]; + } + + + [slider addTarget:self action:@selector(beginSeek) forControlEvents:UIControlEventTouchDown]; + [slider addTarget:self action:@selector(endSeek) forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside|UIControlEventTouchCancel]; + [slider addTarget:self action:@selector(seekTimeDidChange:) forControlEvents:UIControlEventValueChanged]; + + return slider; + }]; + + _scrubberNode.flexShrink = YES; + + [_cachedControls setObject:_scrubberNode forKey:@(ASVideoPlayerNodeControlTypeScrubber)]; + } + + [self addSubnode:_scrubberNode]; +} + +- (void)createControlFlexGrowSpacer +{ + if (_controlFlexGrowSpacerSpec == nil) { + _controlFlexGrowSpacerSpec = [[ASStackLayoutSpec alloc] init]; + _controlFlexGrowSpacerSpec.flexGrow = YES; + } + + [_cachedControls setObject:_controlFlexGrowSpacerSpec forKey:@(ASVideoPlayerNodeControlTypeFlexGrowSpacer)]; +} + +- (void)updateDurationTimeLabel +{ + if (!_durationTextNode) { + return; + } + NSString *formattedDuration = [self timeStringForCMTime:_duration forTimeLabelType:ASVideoPlayerNodeControlTypeDurationText]; + _durationTextNode.attributedString = [self timeLabelAttributedStringForString:formattedDuration forControlType:ASVideoPlayerNodeControlTypeDurationText]; +} + +- (void)updateElapsedTimeLabel:(NSTimeInterval)seconds +{ + if (!_elapsedTextNode) { + return; + } + NSString *formatteElapsed = [self timeStringForCMTime:CMTimeMakeWithSeconds( seconds, _videoNode.periodicTimeObserverTimescale ) forTimeLabelType:ASVideoPlayerNodeControlTypeElapsedText]; + _elapsedTextNode.attributedString = [self timeLabelAttributedStringForString:formatteElapsed forControlType:ASVideoPlayerNodeControlTypeElapsedText]; +} + +- (NSAttributedString*)timeLabelAttributedStringForString:(NSString*)string forControlType:(ASVideoPlayerNodeControlType)controlType +{ + NSDictionary *options; + if (_delegateFlags.delegateTimeLabelAttributes) { + options = [_delegate videoPlayerNodeTimeLabelAttributes:self timeLabelType:controlType]; + } else { + options = @{ + NSFontAttributeName : [UIFont systemFontOfSize:12.0], + NSForegroundColorAttributeName: _defaultControlsColor + }; + } + + + NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:string attributes:options]; + + return attributedString; +} + +#pragma mark - ASVideoNodeDelegate +- (void)videoNode:(ASVideoNode *)videoNode willChangePlayerState:(ASVideoNodePlayerState)state toState:(ASVideoNodePlayerState)toState +{ + if (_delegateFlags.delegateVideoNodeWillChangeState) { + [_delegate videoPlayerNode:self willChangeVideoNodeState:state toVideoNodeState:toState]; + } + + if (toState == ASVideoNodePlayerStateReadyToPlay) { + _duration = _videoNode.currentItem.duration; + [self updateDurationTimeLabel]; + } + + if (toState == ASVideoNodePlayerStatePlaying) { + _playbackButtonNode.buttonType = ASDefaultPlaybackButtonTypePause; + [self removeSpinner]; + } else if (toState != ASVideoNodePlayerStatePlaybackLikelyToKeepUpButNotPlaying && toState != ASVideoNodePlayerStateReadyToPlay) { + _playbackButtonNode.buttonType = ASDefaultPlaybackButtonTypePlay; + } + + if (toState == ASVideoNodePlayerStateLoading || toState == ASVideoNodePlayerStateInitialLoading) { + [self showSpinner]; + } + + if (toState == ASVideoNodePlayerStateReadyToPlay || toState == ASVideoNodePlayerStatePaused || toState == ASVideoNodePlayerStatePlaybackLikelyToKeepUpButNotPlaying) { + [self removeSpinner]; + } +} + +- (BOOL)videoNode:(ASVideoNode *)videoNode shouldChangePlayerStateTo:(ASVideoNodePlayerState)state +{ + if (_delegateFlags.delegateVideoNodeShouldChangeState) { + return [_delegate videoPlayerNode:self shouldChangeVideoNodeStateTo:state]; + } + return YES; +} + +- (void)videoNode:(ASVideoNode *)videoNode didPlayToTimeInterval:(NSTimeInterval)timeInterval +{ + if (_delegateFlags.delegateVideoNodeDidPlayToTime) { + [_delegate videoPlayerNode:self didPlayToTime:_videoNode.player.currentTime]; + } + + if (_isSeeking) { + return; + } + + if (_elapsedTextNode) { + [self updateElapsedTimeLabel:timeInterval]; + } + + if (_scrubberNode) { + [(UISlider*)_scrubberNode.view setValue:( timeInterval / CMTimeGetSeconds(_duration) ) animated:NO]; + } +} + +- (void)videoDidPlayToEnd:(ASVideoNode *)videoNode +{ + if (_delegateFlags.delegateVideoNodePlaybackDidFinish) { + [_delegate videoPlayerNodeDidPlayToEnd:self]; + } +} + +- (void)didTapVideoNode:(ASVideoNode *)videoNode +{ + if (_delegateFlags.delegateDidTapVideoPlayerNode) { + [_delegate didTapVideoPlayerNode:self]; + } else { + [self togglePlayPause]; + } +} + +#pragma mark - Actions +- (void)togglePlayPause +{ + if (_videoNode.playerState == ASVideoNodePlayerStatePlaying) { + [_videoNode pause]; + } else { + [_videoNode play]; + } +} + +- (void)showSpinner +{ + ASDN::MutexLocker l(_videoPlayerLock); + + if (!_spinnerNode) { + _spinnerNode = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{ + UIActivityIndicatorView *spinnnerView = [[UIActivityIndicatorView alloc] init]; + spinnnerView.color = _defaultControlsColor; + if (_delegateFlags.delegateSpinnerTintColor) { + spinnnerView.color = [_delegate videoPlayerNodeSpinnerTint:self]; + } + return spinnnerView; + }]; + _spinnerNode.preferredFrameSize = CGSizeMake(44.0, 44.0); + + [self addSubnode:_spinnerNode]; + [self setNeedsLayout]; + } + [(UIActivityIndicatorView *)_spinnerNode.view startAnimating]; +} + +- (void)removeSpinner +{ + ASDN::MutexLocker l(_videoPlayerLock); + + if (!_spinnerNode) { + return; + } + [_spinnerNode removeFromSupernode]; + _spinnerNode = nil; +} + +- (void)didTapPlaybackButton:(ASControlNode*)node +{ + [self togglePlayPause]; +} + +- (void)beginSeek +{ + _isSeeking = YES; +} + +- (void)endSeek +{ + _isSeeking = NO; +} + +- (void)seekTimeDidChange:(UISlider*)slider +{ + CGFloat percentage = slider.value * 100; + [self seekToTime:percentage]; +} + +#pragma mark - Public API +- (void)seekToTime:(CGFloat)percentComplete +{ + CGFloat seconds = ( CMTimeGetSeconds(_duration) * percentComplete ) / 100; + + [self updateElapsedTimeLabel:seconds]; + [_videoNode.player seekToTime:CMTimeMakeWithSeconds(seconds, _videoNode.periodicTimeObserverTimescale)]; + + if (_videoNode.playerState != ASVideoNodePlayerStatePlaying) { + [self togglePlayPause]; + } +} + +- (void)play +{ + [_videoNode play]; +} + +- (void)pause +{ + [_videoNode pause]; +} + +- (BOOL)isPlaying +{ + return [_videoNode isPlaying]; +} + +- (NSArray *)controlsForLayoutSpec +{ + NSMutableArray *controls = [[NSMutableArray alloc] initWithCapacity:_cachedControls.count]; + + if (_cachedControls[ @(ASVideoPlayerNodeControlTypePlaybackButton) ]) { + [controls addObject:_cachedControls[ @(ASVideoPlayerNodeControlTypePlaybackButton) ]]; + } + + if (_cachedControls[ @(ASVideoPlayerNodeControlTypeElapsedText) ]) { + [controls addObject:_cachedControls[ @(ASVideoPlayerNodeControlTypeElapsedText) ]]; + } + + if (_cachedControls[ @(ASVideoPlayerNodeControlTypeScrubber) ]) { + [controls addObject:_cachedControls[ @(ASVideoPlayerNodeControlTypeScrubber) ]]; + } + + if (_cachedControls[ @(ASVideoPlayerNodeControlTypeDurationText) ]) { + [controls addObject:_cachedControls[ @(ASVideoPlayerNodeControlTypeDurationText) ]]; + } + + return controls; +} + +#pragma mark - Layout +- (ASLayoutSpec*)layoutSpecThatFits:(ASSizeRange)constrainedSize +{ + CGSize maxSize = constrainedSize.max; + if (!CGSizeEqualToSize(self.preferredFrameSize, CGSizeZero)) { + maxSize = self.preferredFrameSize; + } + + // Prevent crashes through if infinite width or height + if (isinf(maxSize.width) || isinf(maxSize.height)) { + ASDisplayNodeAssert(NO, @"Infinite width or height in ASVideoPlayerNode"); + maxSize = CGSizeZero; + } + _videoNode.preferredFrameSize = maxSize; + + ASLayoutSpec *layoutSpec; + + if (_delegateFlags.delegateLayoutSpecForControls) { + layoutSpec = [_delegate videoPlayerNodeLayoutSpec:self forControls:_cachedControls forMaximumSize:maxSize]; + } else { + layoutSpec = [self defaultLayoutSpecThatFits:maxSize]; + } + + NSMutableArray *children = [[NSMutableArray alloc] init]; + + if (_spinnerNode) { + ASCenterLayoutSpec *centerLayoutSpec = [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringXY sizingOptions:ASCenterLayoutSpecSizingOptionDefault child:_spinnerNode]; + centerLayoutSpec.sizeRange = ASRelativeSizeRangeMakeWithExactCGSize(maxSize); + [children addObject:centerLayoutSpec]; + } + + ASOverlayLayoutSpec *overlaySpec = [ASOverlayLayoutSpec overlayLayoutSpecWithChild:_videoNode overlay:layoutSpec]; + overlaySpec.sizeRange = ASRelativeSizeRangeMakeWithExactCGSize(maxSize); + + [children addObject:overlaySpec]; + + return [ASStaticLayoutSpec staticLayoutSpecWithChildren:children]; +} + +- (ASLayoutSpec*)defaultLayoutSpecThatFits:(CGSize)maxSize +{ + _scrubberNode.preferredFrameSize = CGSizeMake(maxSize.width, 44.0); + + ASLayoutSpec *spacer = [[ASLayoutSpec alloc] init]; + spacer.flexGrow = YES; + + ASStackLayoutSpec *controlbarSpec = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal + spacing:10.0 + justifyContent:ASStackLayoutJustifyContentStart + alignItems:ASStackLayoutAlignItemsCenter + children: [self controlsForLayoutSpec] ]; + controlbarSpec.alignSelf = ASStackLayoutAlignSelfStretch; + + UIEdgeInsets insets = UIEdgeInsetsMake(10.0, 10.0, 10.0, 10.0); + + ASInsetLayoutSpec *controlbarInsetSpec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:controlbarSpec]; + + controlbarInsetSpec.alignSelf = ASStackLayoutAlignSelfStretch; + + ASStackLayoutSpec *mainVerticalStack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical + spacing:0.0 + justifyContent:ASStackLayoutJustifyContentStart + alignItems:ASStackLayoutAlignItemsStart + children:@[spacer,controlbarInsetSpec]]; + + return mainVerticalStack; +} + +#pragma mark - Properties +- (id)delegate +{ + return _delegate; +} + +- (void)setDelegate:(id)delegate +{ + if (delegate == _delegate) { + return; + } + + _delegate = delegate; + + if (_delegate == nil) { + memset(&_delegateFlags, 0, sizeof(_delegateFlags)); + } else { + _delegateFlags.delegateNeededDefaultControls = [_delegate respondsToSelector:@selector(videoPlayerNodeNeededDefaultControls:)]; + _delegateFlags.delegateCustomControls = [_delegate respondsToSelector:@selector(videoPlayerNodeCustomControls:)]; + _delegateFlags.delegateSpinnerTintColor = [_delegate respondsToSelector:@selector(videoPlayerNodeSpinnerTint:)]; + _delegateFlags.delegateScrubberMaximumTrackTintColor = [_delegate respondsToSelector:@selector(videoPlayerNodeScrubberMaximumTrackTint:)]; + _delegateFlags.delegateScrubberMinimumTrackTintColor = [_delegate respondsToSelector:@selector(videoPlayerNodeScrubberMinimumTrackTint:)]; + _delegateFlags.delegateScrubberThumbTintColor = [_delegate respondsToSelector:@selector(videoPlayerNodeScrubberThumbTint:)]; + _delegateFlags.delegateScrubberThumbImage = [_delegate respondsToSelector:@selector(videoPlayerNodeScrubberThumbImage:)]; + _delegateFlags.delegateTimeLabelAttributes = [_delegate respondsToSelector:@selector(videoPlayerNodeTimeLabelAttributes:timeLabelType:)]; + _delegateFlags.delegateLayoutSpecForControls = [_delegate respondsToSelector:@selector(videoPlayerNodeLayoutSpec:forControls:forMaximumSize:)]; + _delegateFlags.delegateVideoNodeDidPlayToTime = [_delegate respondsToSelector:@selector(videoPlayerNode:didPlayToTime:)]; + _delegateFlags.delegateVideoNodeWillChangeState = [_delegate respondsToSelector:@selector(videoPlayerNode:willChangeVideoNodeState:toVideoNodeState:)]; + _delegateFlags.delegateVideoNodePlaybackDidFinish = [_delegate respondsToSelector:@selector(videoPlayerNodeDidPlayToEnd:)]; + _delegateFlags.delegateVideoNodeShouldChangeState = [_delegate respondsToSelector:@selector(videoPlayerNode:shouldChangeVideoNodeStateTo:)]; + _delegateFlags.delegateTimeLabelAttributedString = [_delegate respondsToSelector:@selector(videoPlayerNode:timeStringForTimeLabelType:forTime:)]; + _delegateFlags.delegatePlaybackButtonTint = [_delegate respondsToSelector:@selector(videoPlayerNodePlaybackButtonTint:)]; + _delegateFlags.delegateDidTapVideoPlayerNode = [_delegate respondsToSelector:@selector(didTapVideoPlayerNode:)]; + } +} + +- (void)setControlsDisabled:(BOOL)controlsDisabled +{ + if (_controlsDisabled == controlsDisabled) { + return; + } + + _controlsDisabled = controlsDisabled; + + if (_controlsDisabled && _cachedControls.count > 0) { + [self removeControls]; + } else if (!_controlsDisabled) { + [self createControls]; + } +} + +- (void)setShouldAutoPlay:(BOOL)shouldAutoPlay +{ + if (_shouldAutoPlay == shouldAutoPlay) { + return; + } + _shouldAutoPlay = shouldAutoPlay; + _videoNode.shouldAutoplay = _shouldAutoPlay; +} + +- (void)setShouldAutoRepeat:(BOOL)shouldAutoRepeat +{ + if (_shouldAutoRepeat == shouldAutoRepeat) { + return; + } + _shouldAutoRepeat = shouldAutoRepeat; + _videoNode.shouldAutorepeat = _shouldAutoRepeat; +} + +- (void)setMuted:(BOOL)muted +{ + if (_muted == muted) { + return; + } + _muted = muted; + _videoNode.muted = _muted; +} + +- (void)setPeriodicTimeObserverTimescale:(int32_t)periodicTimeObserverTimescale +{ + if (_periodicTimeObserverTimescale == periodicTimeObserverTimescale) { + return; + } + _periodicTimeObserverTimescale = periodicTimeObserverTimescale; + _videoNode.periodicTimeObserverTimescale = _periodicTimeObserverTimescale; +} + +- (NSString *)gravity +{ + if (_gravity == nil) { + _gravity = _videoNode.gravity; + } + return _gravity; +} + +- (void)setGravity:(NSString *)gravity +{ + if (_gravity == gravity) { + return; + } + _gravity = gravity; + _videoNode.gravity = _gravity; +} + +- (ASVideoNodePlayerState)playerState +{ + return _videoNode.playerState; +} + +- (BOOL)shouldAggressivelyRecoverFromStall +{ + return _videoNode.shouldAggressivelyRecoverFromStall; +} + +- (void)setShouldAggressivelyRecoverFromStall:(BOOL)shouldAggressivelyRecoverFromStall +{ + if (_shouldAggressivelyRecoverFromStall == shouldAggressivelyRecoverFromStall) { + return; + } + _shouldAggressivelyRecoverFromStall = shouldAggressivelyRecoverFromStall; + _videoNode.shouldAggressivelyRecoverFromStall = _shouldAggressivelyRecoverFromStall; +} + +#pragma mark - Helpers +- (NSString *)timeStringForCMTime:(CMTime)time forTimeLabelType:(ASVideoPlayerNodeControlType)type +{ + if (_delegateFlags.delegateTimeLabelAttributedString) { + return [_delegate videoPlayerNode:self timeStringForTimeLabelType:type forTime:time]; + } + + NSUInteger dTotalSeconds = CMTimeGetSeconds(time); + + NSUInteger dHours = floor(dTotalSeconds / 3600); + NSUInteger dMinutes = floor(dTotalSeconds % 3600 / 60); + NSUInteger dSeconds = floor(dTotalSeconds % 3600 % 60); + + NSString *videoDurationText; + if (dHours > 0) { + videoDurationText = [NSString stringWithFormat:@"%i:%02i:%02i", (int)dHours, (int)dMinutes, (int)dSeconds]; + } else { + videoDurationText = [NSString stringWithFormat:@"%02i:%02i", (int)dMinutes, (int)dSeconds]; + } + return videoDurationText; +} + +@end diff --git a/AsyncDisplayKit/ASViewController.h b/AsyncDisplayKit/ASViewController.h index d7286272b8..6222af8140 100644 --- a/AsyncDisplayKit/ASViewController.h +++ b/AsyncDisplayKit/ASViewController.h @@ -3,20 +3,52 @@ // AsyncDisplayKit // // Created by Huy Nguyen on 16/09/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import #import +#import + +@class ASTraitCollection; NS_ASSUME_NONNULL_BEGIN -@interface ASViewController<__covariant DisplayNodeType : ASDisplayNode *> : UIViewController +typedef ASTraitCollection * _Nonnull (^ASDisplayTraitsForTraitCollectionBlock)(UITraitCollection *traitCollection); +typedef ASTraitCollection * _Nonnull (^ASDisplayTraitsForTraitWindowSizeBlock)(CGSize windowSize); + +@interface ASViewController<__covariant DisplayNodeType : ASDisplayNode *> : UIViewController - (instancetype)initWithNode:(DisplayNodeType)node NS_DESIGNATED_INITIALIZER; @property (nonatomic, strong, readonly) DisplayNodeType node; +/** + * An optional context to pass along with an ASTraitCollection. + * This can be used to pass any internal state to all subnodes via the ASTraitCollection that is not + * included in UITraitCollection. This could range from more fine-tuned size classes to a class of + * constants that is based upon the new trait collection. + * + * Be aware that internally this context is held by a C struct which cannot retain the pointer. Therefore + * ASVC keeps a strong reference to the context to make sure that it stays alive. If you change this value + * it will propagate the change to the subnodes. + */ +@property (nonatomic, strong) id _Nullable traitCollectionContext; + +/** + * Set this block to customize the ASDisplayTraits returned when the VC transitions to the given traitCollection. + */ +@property (nonatomic, copy) ASDisplayTraitsForTraitCollectionBlock overrideDisplayTraitsWithTraitCollection; + +/** + * Set this block to customize the ASDisplayTraits returned when the VC transitions to the given window size. + */ +@property (nonatomic, copy) ASDisplayTraitsForTraitWindowSizeBlock overrideDisplayTraitsWithWindowSize; + /** * @abstract Passthrough property to the the .interfaceState of the node. * @return The current ASInterfaceState of the node, indicating whether it is visible and other situational properties. diff --git a/AsyncDisplayKit/ASViewController.m b/AsyncDisplayKit/ASViewController.m deleted file mode 100644 index db5b1e5b4d..0000000000 --- a/AsyncDisplayKit/ASViewController.m +++ /dev/null @@ -1,135 +0,0 @@ -// -// ASViewController.m -// AsyncDisplayKit -// -// Created by Huy Nguyen on 16/09/15. -// Copyright (c) 2015 Facebook. All rights reserved. -// - -#import "ASViewController.h" -#import "ASAssert.h" -#import "ASDimension.h" -#import "ASDisplayNode+FrameworkPrivate.h" -#import "ASDisplayNode+Beta.h" -#import "ASRangeControllerUpdateRangeProtocol+Beta.h" - -@implementation ASViewController -{ - BOOL _ensureDisplayed; - BOOL _automaticallyAdjustRangeModeBasedOnViewEvents; -} - -- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - ASDisplayNodeAssert(NO, @"ASViewController requires using -initWithNode:"); - return [self initWithNode:[[ASDisplayNode alloc] init]]; -} - -- (instancetype)initWithCoder:(NSCoder *)aDecoder -{ - ASDisplayNodeAssert(NO, @"ASViewController requires using -initWithNode:"); - return [self initWithNode:[[ASDisplayNode alloc] init]]; -} - -- (instancetype)initWithNode:(ASDisplayNode *)node -{ - if (!(self = [super initWithNibName:nil bundle:nil])) { - return nil; - } - - ASDisplayNodeAssertNotNil(node, @"Node must not be nil"); - ASDisplayNodeAssertTrue(!node.layerBacked); - _node = node; - - _automaticallyAdjustRangeModeBasedOnViewEvents = NO; - - return self; -} - -- (void)loadView -{ - ASDisplayNodeAssertTrue(!_node.layerBacked); - - // Apple applies a frame and autoresizing masks we need. Allocating a view is not - // nearly as expensive as adding and removing it from a hierarchy, and fortunately - // we can avoid that here. Enabling layerBacking on a single node in the hierarchy - // will have a greater performance benefit than the impact of this transient view. - [super loadView]; - UIView *view = self.view; - CGRect frame = view.frame; - UIViewAutoresizing autoresizingMask = view.autoresizingMask; - - // We have what we need, so now create and assign the view we actually want. - view = _node.view; - _node.frame = frame; - _node.autoresizingMask = autoresizingMask; - self.view = view; -} - -- (void)viewWillLayoutSubviews -{ - [super viewWillLayoutSubviews]; - [_node measureWithSizeRange:[self nodeConstrainedSize]]; -} - -- (void)viewDidLayoutSubviews -{ - if (_ensureDisplayed && self.neverShowPlaceholders) { - _ensureDisplayed = NO; - [self.node recursivelyEnsureDisplaySynchronously:YES]; - } - [super viewDidLayoutSubviews]; -} - -- (void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; - _ensureDisplayed = YES; - [_node measureWithSizeRange:[self nodeConstrainedSize]]; - [_node recursivelyFetchData]; - - [self updateCurrentRangeModeWithModeIfPossible:ASLayoutRangeModeFull]; -} - -- (void)viewDidDisappear:(BOOL)animated -{ - [super viewDidDisappear:animated]; - - [self updateCurrentRangeModeWithModeIfPossible:ASLayoutRangeModeMinimum]; -} - -#pragma mark - Automatic range mode - -- (BOOL)automaticallyAdjustRangeModeBasedOnViewEvents -{ - return _automaticallyAdjustRangeModeBasedOnViewEvents; -} - -- (void)setAutomaticallyAdjustRangeModeBasedOnViewEvents:(BOOL)automaticallyAdjustRangeModeBasedOnViewEvents -{ - _automaticallyAdjustRangeModeBasedOnViewEvents = automaticallyAdjustRangeModeBasedOnViewEvents; -} - -- (void)updateCurrentRangeModeWithModeIfPossible:(ASLayoutRangeMode)rangeMode -{ - if (!_automaticallyAdjustRangeModeBasedOnViewEvents) { return; } - if (![_node conformsToProtocol:@protocol(ASRangeControllerUpdateRangeProtocol)]) { return; } - - id updateRangeNode = (id)_node; - [updateRangeNode updateCurrentRangeWithMode:rangeMode]; -} - -#pragma mark - Layout Helpers - -- (ASSizeRange)nodeConstrainedSize -{ - CGSize viewSize = self.view.bounds.size; - return ASSizeRangeMake(viewSize, viewSize); -} - -- (ASInterfaceState)interfaceState -{ - return _node.interfaceState; -} - -@end diff --git a/AsyncDisplayKit/ASViewController.mm b/AsyncDisplayKit/ASViewController.mm new file mode 100644 index 0000000000..86417d08aa --- /dev/null +++ b/AsyncDisplayKit/ASViewController.mm @@ -0,0 +1,277 @@ +// +// ASViewController.mm +// AsyncDisplayKit +// +// Created by Huy Nguyen on 16/09/15. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import "ASViewController.h" +#import "ASAssert.h" +#import "ASAvailability.h" +#import "ASDimension.h" +#import "ASDisplayNodeInternal.h" +#import "ASDisplayNode+FrameworkPrivate.h" +#import "ASDisplayNode+Beta.h" +#import "ASTraitCollection.h" +#import "ASEnvironmentInternal.h" +#import "ASRangeControllerUpdateRangeProtocol+Beta.h" + +#define AS_LOG_VISIBILITY_CHANGES 0 + +@implementation ASViewController +{ + BOOL _ensureDisplayed; + BOOL _automaticallyAdjustRangeModeBasedOnViewEvents; + BOOL _parentManagesVisibilityDepth; + NSInteger _visibilityDepth; +} + +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + ASDisplayNodeAssert(NO, @"ASViewController requires using -initWithNode:"); + return [self initWithNode:[[ASDisplayNode alloc] init]]; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder +{ + ASDisplayNodeAssert(NO, @"ASViewController requires using -initWithNode:"); + return [self initWithNode:[[ASDisplayNode alloc] init]]; +} + +- (instancetype)initWithNode:(ASDisplayNode *)node +{ + if (!(self = [super initWithNibName:nil bundle:nil])) { + return nil; + } + + ASDisplayNodeAssertNotNil(node, @"Node must not be nil"); + ASDisplayNodeAssertTrue(!node.layerBacked); + _node = node; + + _automaticallyAdjustRangeModeBasedOnViewEvents = NO; + + return self; +} + +- (void)dealloc +{ + if (_traitCollectionContext != nil) { + // The setter will iterate through the VC's subnodes and replace the traitCollectionContext in their ASEnvironmentTraitCollection with nil. + // Since the VC holds the only strong reference to this context and we are in the process of destroying + // the VC, all the references in the subnodes will be unsafe unless we nil them out. More than likely all the subnodes will be dealloc'ed + // as part of the VC being dealloc'ed, but this is just to make extra sure. + self.traitCollectionContext = nil; + } +} + +- (void)loadView +{ + ASDisplayNodeAssertTrue(!_node.layerBacked); + + // Apple applies a frame and autoresizing masks we need. Allocating a view is not + // nearly as expensive as adding and removing it from a hierarchy, and fortunately + // we can avoid that here. Enabling layerBacking on a single node in the hierarchy + // will have a greater performance benefit than the impact of this transient view. + [super loadView]; + UIView *view = self.view; + CGRect frame = view.frame; + UIViewAutoresizing autoresizingMask = view.autoresizingMask; + + // We have what we need, so now create and assign the view we actually want. + view = _node.view; + _node.frame = frame; + _node.autoresizingMask = autoresizingMask; + self.view = view; + + // ensure that self.node has a valid trait collection before a subclass's implementation of viewDidLoad. + // Any subnodes added in viewDidLoad will then inherit the proper environment. + if (AS_AT_LEAST_IOS8) { + ASEnvironmentTraitCollection traitCollection = [self environmentTraitCollectionForUITraitCollection:self.traitCollection]; + [self progagateNewEnvironmentTraitCollection:traitCollection]; + } +} + +- (void)viewWillLayoutSubviews +{ + [super viewWillLayoutSubviews]; + [_node measureWithSizeRange:[self nodeConstrainedSize]]; +} + +- (void)viewDidLayoutSubviews +{ + if (_ensureDisplayed && self.neverShowPlaceholders) { + _ensureDisplayed = NO; + [self.node recursivelyEnsureDisplaySynchronously:YES]; + } + [super viewDidLayoutSubviews]; +} + +ASVisibilityDidMoveToParentViewController; + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + _ensureDisplayed = YES; + [_node measureWithSizeRange:[self nodeConstrainedSize]]; + [_node recursivelyFetchData]; + + if (_parentManagesVisibilityDepth == NO) { + [self setVisibilityDepth:0]; + } +} + +ASVisibilitySetVisibilityDepth; + +ASVisibilityViewDidDisappearImplementation; + +ASVisibilityDepthImplementation; + +- (void)visibilityDepthDidChange +{ + ASLayoutRangeMode rangeMode = ASLayoutRangeModeForVisibilityDepth(self.visibilityDepth); +#if AS_LOG_VISIBILITY_CHANGES + NSString *rangeModeString; + switch (rangeMode) { + case ASLayoutRangeModeMinimum: + rangeModeString = @"Minimum"; + break; + + case ASLayoutRangeModeFull: + rangeModeString = @"Full"; + break; + + case ASLayoutRangeModeVisibleOnly: + rangeModeString = @"Visible Only"; + break; + + case ASLayoutRangeModeLowMemory: + rangeModeString = @"Low Memory"; + break; + + default: + break; + } + NSLog(@"Updating visibility of:%@ to: %@ (visibility depth: %d)", self, rangeModeString, self.visibilityDepth); +#endif + [self updateCurrentRangeModeWithModeIfPossible:rangeMode]; +} + +#pragma mark - Automatic range mode + +- (BOOL)automaticallyAdjustRangeModeBasedOnViewEvents +{ + return _automaticallyAdjustRangeModeBasedOnViewEvents; +} + +- (void)setAutomaticallyAdjustRangeModeBasedOnViewEvents:(BOOL)automaticallyAdjustRangeModeBasedOnViewEvents +{ + _automaticallyAdjustRangeModeBasedOnViewEvents = automaticallyAdjustRangeModeBasedOnViewEvents; +} + +- (void)updateCurrentRangeModeWithModeIfPossible:(ASLayoutRangeMode)rangeMode +{ + if (!_automaticallyAdjustRangeModeBasedOnViewEvents) { return; } + if (![_node conformsToProtocol:@protocol(ASRangeControllerUpdateRangeProtocol)]) { + return; + } + + id updateRangeNode = (id)_node; + [updateRangeNode updateCurrentRangeWithMode:rangeMode]; +} + +#pragma mark - Layout Helpers + +- (ASSizeRange)nodeConstrainedSize +{ + CGSize viewSize = self.view.bounds.size; + return ASSizeRangeMake(viewSize, viewSize); +} + +- (ASInterfaceState)interfaceState +{ + return _node.interfaceState; +} + +#pragma mark - ASEnvironmentTraitCollection + +- (void)setTraitCollectionContext:(id)traitCollectionContext +{ + if (_traitCollectionContext != traitCollectionContext) { + // nil out the displayContext in the subnodes so they aren't hanging around with a dealloc'ed pointer don't set + // the new context yet as this will cause ASEnvironmentTraitCollectionIsEqualToASEnvironmentTraitCollection to fail + ASEnvironmentTraitCollectionUpdateDisplayContext(self.node, nil); + + _traitCollectionContext = traitCollectionContext; + } +} + +- (ASEnvironmentTraitCollection)environmentTraitCollectionForUITraitCollection:(UITraitCollection *)traitCollection +{ + if (self.overrideDisplayTraitsWithTraitCollection) { + ASTraitCollection *asyncTraitCollection = self.overrideDisplayTraitsWithTraitCollection(traitCollection); + self.traitCollectionContext = asyncTraitCollection.traitCollectionContext; + return [asyncTraitCollection environmentTraitCollection]; + } + + ASEnvironmentTraitCollection asyncTraitCollection = ASEnvironmentTraitCollectionFromUITraitCollection(traitCollection); + asyncTraitCollection.displayContext = self.traitCollectionContext; + return asyncTraitCollection; +} + +- (ASEnvironmentTraitCollection)environmentTraitCollectionForWindowSize:(CGSize)windowSize +{ + if (self.overrideDisplayTraitsWithWindowSize) { + ASTraitCollection *traitCollection = self.overrideDisplayTraitsWithWindowSize(windowSize); + self.traitCollectionContext = traitCollection.traitCollectionContext; + return [traitCollection environmentTraitCollection]; + } + return self.node.environmentTraitCollection; +} + +- (void)progagateNewEnvironmentTraitCollection:(ASEnvironmentTraitCollection)environmentTraitCollection +{ + ASEnvironmentState environmentState = self.node.environmentState; + ASEnvironmentTraitCollection oldEnvironmentTraitCollection = environmentState.environmentTraitCollection; + + if (ASEnvironmentTraitCollectionIsEqualToASEnvironmentTraitCollection(environmentTraitCollection, oldEnvironmentTraitCollection) == NO) { + environmentState.environmentTraitCollection = environmentTraitCollection; + self.node.environmentState = environmentState; + [self.node setNeedsLayout]; + + NSArray> *children = [self.node children]; + for (id child in children) { + ASEnvironmentStatePropagateDown(child, environmentState.environmentTraitCollection); + } + } +} + +- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection +{ + [super traitCollectionDidChange:previousTraitCollection]; + + ASEnvironmentTraitCollection environmentTraitCollection = [self environmentTraitCollectionForUITraitCollection:self.traitCollection]; + [self progagateNewEnvironmentTraitCollection:environmentTraitCollection]; +} + +- (void)willTransitionToTraitCollection:(UITraitCollection *)newCollection withTransitionCoordinator:(id)coordinator +{ + [super willTransitionToTraitCollection:newCollection withTransitionCoordinator:coordinator]; + + ASEnvironmentTraitCollection environmentTraitCollection = [self environmentTraitCollectionForUITraitCollection:newCollection]; + [self progagateNewEnvironmentTraitCollection:environmentTraitCollection]; +} + +- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator +{ + [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; + + ASEnvironmentTraitCollection environmentTraitCollection = [self environmentTraitCollectionForWindowSize:size]; + [self progagateNewEnvironmentTraitCollection:environmentTraitCollection]; +} + +@end diff --git a/AsyncDisplayKit/ASVisibilityProtocols.h b/AsyncDisplayKit/ASVisibilityProtocols.h new file mode 100644 index 0000000000..8193b76dc8 --- /dev/null +++ b/AsyncDisplayKit/ASVisibilityProtocols.h @@ -0,0 +1,108 @@ +// +// ASVisibilityProtocols.h +// AsyncDisplayKit +// +// Created by Garrett Moon on 4/27/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import "ASLayoutRangeType.h" + +#import "ASBaseDefines.h" + +@class UIViewController; + +ASDISPLAYNODE_EXTERN_C_BEGIN + +extern ASLayoutRangeMode ASLayoutRangeModeForVisibilityDepth(NSUInteger visibilityDepth); + +ASDISPLAYNODE_EXTERN_C_END + +@protocol ASVisibilityDepth + +/** + * @abstract Represents the number of user actions necessary to reach the view controller. An increased visibility + * depth indicates a higher number of user interactions for the view controller to be visible again. For example, + * an onscreen navigation controller's top view controller should have a visibility depth of 0. The view controller + * one from the top should have a visibility deptch of 1 as should the root view controller in the stack (because + * the user can hold the back button to pop to the root view controller). + * + * Visibility depth is used to automatically adjust ranges on range controllers (and thus free up memory) and can + * be used to reduce memory usage of other items as well. + */ +- (NSInteger)visibilityDepth; + + +- (void)visibilityDepthDidChange; + +@end + +/** + * @abstract Container view controllers should adopt this protocol to indicate that they will manage their child's + * visibilityDepth. For example, ASNavigationController adopts this protocol and manages its childrens visibility + * depth. + * + * If you adopt this protocol, you *must* also emit visibilityDepthDidChange messages to child view controllers. + * + * @param childViewController Expected to return the visibility depth of the child view controller. + */ +@protocol ASManagesChildVisibilityDepth + +- (NSInteger)visibilityDepthOfChildViewController:(UIViewController *)childViewController; + +@end + +#define ASVisibilitySetVisibilityDepth \ +- (void)setVisibilityDepth:(NSUInteger)visibilityDepth \ +{ \ + if (_visibilityDepth == visibilityDepth) { \ + return; \ + } \ + _visibilityDepth = visibilityDepth; \ + [self visibilityDepthDidChange]; \ +} + +#define ASVisibilityDepthImplementation \ +- (NSInteger)visibilityDepth \ +{ \ + if (self.parentViewController && _parentManagesVisibilityDepth == NO) { \ + _parentManagesVisibilityDepth = [self.parentViewController conformsToProtocol:@protocol(ASManagesChildVisibilityDepth)]; \ + } \ + \ + if (_parentManagesVisibilityDepth) { \ + return [(id )self.parentViewController visibilityDepthOfChildViewController:self]; \ + } \ + return _visibilityDepth; \ +} + +#define ASVisibilityViewDidDisappearImplementation \ +- (void)viewDidDisappear:(BOOL)animated \ +{ \ + [super viewDidDisappear:animated]; \ + \ + if (_parentManagesVisibilityDepth == NO) { \ + [self setVisibilityDepth:1]; \ + } \ +} + +#define ASVisibilityViewWillAppear \ +- (void)viewWillAppear:(BOOL)animated \ +{ \ + [super viewWillAppear:animated]; \ + \ + if (_parentManagesVisibilityDepth == NO) { \ + [self setVisibilityDepth:0]; \ + } \ +} + +#define ASVisibilityDidMoveToParentViewController \ +- (void)didMoveToParentViewController:(UIViewController *)parent \ +{ \ + [super didMoveToParentViewController:parent]; \ + _parentManagesVisibilityDepth = NO; \ + [self visibilityDepthDidChange]; \ +} diff --git a/AsyncDisplayKit/ASVisibilityProtocols.m b/AsyncDisplayKit/ASVisibilityProtocols.m new file mode 100644 index 0000000000..1b59dde807 --- /dev/null +++ b/AsyncDisplayKit/ASVisibilityProtocols.m @@ -0,0 +1,27 @@ +// +// ASVisibilityProtocols.m +// AsyncDisplayKit +// +// Created by Garrett Moon on 4/28/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import + +#import "ASVisibilityProtocols.h" + +ASLayoutRangeMode ASLayoutRangeModeForVisibilityDepth(NSUInteger visibilityDepth) +{ + if (visibilityDepth == 0) { + return ASLayoutRangeModeFull; + } else if (visibilityDepth == 1) { + return ASLayoutRangeModeMinimum; + } else if (visibilityDepth == 2) { + return ASLayoutRangeModeVisibleOnly; + } + return ASLayoutRangeModeLowMemory; +} \ No newline at end of file diff --git a/AsyncDisplayKit/AsyncDisplayKit+Debug.h b/AsyncDisplayKit/AsyncDisplayKit+Debug.h index b2667d1e65..09c20f2b66 100644 --- a/AsyncDisplayKit/AsyncDisplayKit+Debug.h +++ b/AsyncDisplayKit/AsyncDisplayKit+Debug.h @@ -3,12 +3,29 @@ // AsyncDisplayKit // // Created by Hannah Troisi on 3/7/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASControlNode.h" #import "ASImageNode.h" +@interface ASImageNode (Debugging) + +/** + * Enables an ASImageNode debug label that shows the ratio of pixels in the source image to those in + * the displayed bounds (including cropRect). This helps detect excessive image fetching / downscaling, + * as well as upscaling (such as providing a URL not suitable for a Retina device). For dev purposes only. + * @param enabled Specify YES to show the label on all ASImageNodes with non-1.0x source-to-bounds pixel ratio. + */ ++ (void)setShouldShowImageScalingOverlay:(BOOL)show; ++ (BOOL)shouldShowImageScalingOverlay; + +@end + @interface ASControlNode (Debugging) /** @@ -21,18 +38,7 @@ @param enable Specify YES to make this debug feature enabled when messaging the ASControlNode class. */ + (void)setEnableHitTestDebug:(BOOL)enable; ++ (BOOL)enableHitTestDebug; @end -@interface ASImageNode (Debugging) - -/** -* Enables an ASImageNode debug label that shows the ratio of pixels in the source image to those in -* the displayed bounds (including cropRect). This helps detect excessive image fetching / downscaling, -* as well as upscaling (such as providing a URL not suitable for a Retina device). For dev purposes only. -* @param enabled Specify YES to show the label on all ASImageNodes with non-1.0x source-to-bounds pixel ratio. -*/ -+ (void)setShouldShowImageScalingOverlay:(BOOL)show; -+ (BOOL)shouldShowImageScalingOverlay; - -@end diff --git a/AsyncDisplayKit/AsyncDisplayKit+Debug.m b/AsyncDisplayKit/AsyncDisplayKit+Debug.m index c0cd93a6ce..86d77e0f3b 100644 --- a/AsyncDisplayKit/AsyncDisplayKit+Debug.m +++ b/AsyncDisplayKit/AsyncDisplayKit+Debug.m @@ -3,11 +3,16 @@ // AsyncDisplayKit // // Created by Hannah Troisi on 3/7/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "AsyncDisplayKit+Debug.h" #import "ASDisplayNode+Subclasses.h" +#import "ASDisplayNodeExtras.h" static BOOL __shouldShowImageScalingOverlay = NO; @@ -24,3 +29,165 @@ static BOOL __shouldShowImageScalingOverlay = NO; } @end + +static BOOL __enableHitTestDebug = NO; + +@interface ASControlNode (DebuggingInternal) + +- (ASImageNode *)debugHighlightOverlay; + +@end + +@implementation ASControlNode (Debugging) + ++ (void)setEnableHitTestDebug:(BOOL)enable +{ + __enableHitTestDebug = enable; +} + ++ (BOOL)enableHitTestDebug +{ + return __enableHitTestDebug; +} + +// layout method required ONLY when hitTestDebug is enabled +- (void)layout +{ + [super layout]; + + if ([ASControlNode enableHitTestDebug]) { + + // Construct hitTestDebug highlight overlay frame indicating tappable area of a node, which can be restricted by two things: + + // (1) Any parent's tapable area (its own bounds + hitTestSlop) may restrict the desired tappable area expansion using + // hitTestSlop of a child as UIKit event delivery (hitTest:) will not search sub-hierarchies if one of our parents does + // not return YES for pointInside:. To circumvent this restriction, a developer will need to set / adjust the hitTestSlop + // on the limiting parent. This is indicated in the overlay by a dark GREEN edge. This is an ACTUAL restriction. + + // (2) Any parent's .clipToBounds. If a parent is clipping, we cannot show the overlay outside that area + // (although it still respond to touch). To indicate that the overlay cannot accurately display the true tappable area, + // the overlay will have an ORANGE edge. This is a VISUALIZATION restriction. + + CGRect intersectRect = UIEdgeInsetsInsetRect(self.bounds, [self hitTestSlop]); + UIRectEdge clippedEdges = UIRectEdgeNone; + UIRectEdge clipsToBoundsClippedEdges = UIRectEdgeNone; + CALayer *layer = self.layer; + CALayer *intersectLayer = layer; + CALayer *intersectSuperlayer = layer.superlayer; + + // FIXED: Stop climbing hierarchy if UIScrollView is encountered (its offset bounds origin may make it seem like our events + // will be clipped when scrolling will actually reveal them (because this process will not re-run due to scrolling)) + while (intersectSuperlayer && ![intersectSuperlayer.delegate respondsToSelector:@selector(contentOffset)]) { + + // Get parent's tappable area + CGRect parentHitRect = intersectSuperlayer.bounds; + BOOL parentClipsToBounds = NO; + + // If parent is a node, tappable area may be expanded by hitTestSlop + ASDisplayNode *parentNode = ASLayerToDisplayNode(intersectSuperlayer); + if (parentNode) { + UIEdgeInsets parentSlop = [parentNode hitTestSlop]; + + // If parent has hitTestSlop, expand tappable area (if parent doesn't clipToBounds) + if (!UIEdgeInsetsEqualToEdgeInsets(UIEdgeInsetsZero, parentSlop)) { + parentClipsToBounds = parentNode.clipsToBounds; + if (!parentClipsToBounds) { + parentHitRect = UIEdgeInsetsInsetRect(parentHitRect, [parentNode hitTestSlop]); + } + } + } + + // Convert our current rect to parent coordinates + CGRect intersectRectInParentCoordinates = [intersectSuperlayer convertRect:intersectRect fromLayer:intersectLayer]; + + // Intersect rect with the parent's tappable area rect + intersectRect = CGRectIntersection(parentHitRect, intersectRectInParentCoordinates); + if (!CGSizeEqualToSize(parentHitRect.size, intersectRectInParentCoordinates.size)) { + clippedEdges = [self setEdgesOfIntersectionForChildRect:intersectRectInParentCoordinates + parentRect:parentHitRect rectEdge:clippedEdges]; + if (parentClipsToBounds) { + clipsToBoundsClippedEdges = [self setEdgesOfIntersectionForChildRect:intersectRectInParentCoordinates + parentRect:parentHitRect rectEdge:clipsToBoundsClippedEdges]; + } + } + + // move up hierarchy + intersectLayer = intersectSuperlayer; + intersectSuperlayer = intersectLayer.superlayer; + } + + // produce final overlay image (or fill background if edges aren't restricted) + CGRect finalRect = [intersectLayer convertRect:intersectRect toLayer:layer]; + UIColor *fillColor = [[UIColor greenColor] colorWithAlphaComponent:0.4]; + + ASImageNode *debugOverlay = [self debugHighlightOverlay]; + + // determine if edges are clipped and if so, highlight the restricted edges + if (clippedEdges == UIRectEdgeNone) { + debugOverlay.backgroundColor = fillColor; + } else { + const CGFloat borderWidth = 2.0; + UIColor *borderColor = [[UIColor orangeColor] colorWithAlphaComponent:0.8]; + UIColor *clipsBorderColor = [UIColor colorWithRed:30/255.0 green:90/255.0 blue:50/255.0 alpha:0.7]; + CGRect imgRect = CGRectMake(0, 0, 2.0 * borderWidth + 1.0, 2.0 * borderWidth + 1.0); + + UIGraphicsBeginImageContext(imgRect.size); + + [fillColor setFill]; + UIRectFill(imgRect); + + [self drawEdgeIfClippedWithEdges:clippedEdges color:clipsBorderColor borderWidth:borderWidth imgRect:imgRect]; + [self drawEdgeIfClippedWithEdges:clipsToBoundsClippedEdges color:borderColor borderWidth:borderWidth imgRect:imgRect]; + + UIImage *debugHighlightImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + UIEdgeInsets edgeInsets = UIEdgeInsetsMake(borderWidth, borderWidth, borderWidth, borderWidth); + debugOverlay.image = [debugHighlightImage resizableImageWithCapInsets:edgeInsets resizingMode:UIImageResizingModeStretch]; + debugOverlay.backgroundColor = nil; + } + + debugOverlay.frame = finalRect; + } +} + +- (UIRectEdge)setEdgesOfIntersectionForChildRect:(CGRect)childRect parentRect:(CGRect)parentRect rectEdge:(UIRectEdge)rectEdge +{ + // determine which edges of childRect are outside parentRect (and thus will be clipped) + if (childRect.origin.y < parentRect.origin.y) { + rectEdge |= UIRectEdgeTop; + } + if (childRect.origin.x < parentRect.origin.x) { + rectEdge |= UIRectEdgeLeft; + } + if (CGRectGetMaxY(childRect) > CGRectGetMaxY(parentRect)) { + rectEdge |= UIRectEdgeBottom; + } + if (CGRectGetMaxX(childRect) > CGRectGetMaxX(parentRect)) { + rectEdge |= UIRectEdgeRight; + } + + return rectEdge; +} + +- (void)drawEdgeIfClippedWithEdges:(UIRectEdge)rectEdge color:(UIColor *)color borderWidth:(CGFloat)borderWidth imgRect:(CGRect)imgRect +{ + [color setFill]; + + // highlight individual edges of overlay if edge is restricted by parentRect + // so that the developer is aware that increasing hitTestSlop will not result in an expanded tappable area + if (rectEdge & UIRectEdgeTop) { + UIRectFill(CGRectMake(0.0, 0.0, imgRect.size.width, borderWidth)); + } + if (rectEdge & UIRectEdgeLeft) { + UIRectFill(CGRectMake(0.0, 0.0, borderWidth, imgRect.size.height)); + } + if (rectEdge & UIRectEdgeBottom) { + UIRectFill(CGRectMake(0.0, imgRect.size.height - borderWidth, imgRect.size.width, borderWidth)); + } + if (rectEdge & UIRectEdgeRight) { + UIRectFill(CGRectMake(imgRect.size.width - borderWidth, 0.0, borderWidth, imgRect.size.height)); + } +} + +@end diff --git a/AsyncDisplayKit/AsyncDisplayKit-Prefix.pch b/AsyncDisplayKit/AsyncDisplayKit-Prefix.pch index 625be4d28b..c2e8081429 100644 --- a/AsyncDisplayKit/AsyncDisplayKit-Prefix.pch +++ b/AsyncDisplayKit/AsyncDisplayKit-Prefix.pch @@ -7,3 +7,13 @@ #ifdef __OBJC__ #import #endif + + +// CocoaPods has a preproceessor macro for PIN_REMOTE_IMAGE, if already defined, okay +#ifndef PIN_REMOTE_IMAGE + +// For Carthage or manual builds, this will define PIN_REMOTE_IMAGE if the header is available in the +// search path e.g. they've dragged in the framework (technically this will not be able to detect if +// a user does not include the framework in the link binary with build step). +#define PIN_REMOTE_IMAGE __has_include() +#endif \ No newline at end of file diff --git a/AsyncDisplayKit/AsyncDisplayKit.h b/AsyncDisplayKit/AsyncDisplayKit.h index ad24302d62..0064993276 100644 --- a/AsyncDisplayKit/AsyncDisplayKit.h +++ b/AsyncDisplayKit/AsyncDisplayKit.h @@ -1,17 +1,18 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// AsyncDisplayKit.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import #import #import -#import #import #import #import @@ -35,6 +36,8 @@ #import #import +#import +#import #import #import @@ -78,6 +81,8 @@ #import #import #import +#import +#import #import diff --git a/AsyncDisplayKit/Details/ASAbstractLayoutController.h b/AsyncDisplayKit/Details/ASAbstractLayoutController.h index fbe09de2e0..09f590399e 100644 --- a/AsyncDisplayKit/Details/ASAbstractLayoutController.h +++ b/AsyncDisplayKit/Details/ASAbstractLayoutController.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASAbstractLayoutController.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/Details/ASAbstractLayoutController.mm b/AsyncDisplayKit/Details/ASAbstractLayoutController.mm index b7426bd1c5..9112108317 100644 --- a/AsyncDisplayKit/Details/ASAbstractLayoutController.mm +++ b/AsyncDisplayKit/Details/ASAbstractLayoutController.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASAbstractLayoutController.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASAbstractLayoutController.h" #import "ASAssert.h" @@ -47,8 +49,8 @@ extern BOOL ASRangeTuningParametersEqualToRangeTuningParameters(ASRangeTuningPar .trailingBufferScreenfuls = 0.25 }; _tuningParameters[ASLayoutRangeModeMinimum][ASLayoutRangeTypeFetchData] = { - .leadingBufferScreenfuls = 0.25, - .trailingBufferScreenfuls = 0.5 + .leadingBufferScreenfuls = 0.5, + .trailingBufferScreenfuls = 0.25 }; _tuningParameters[ASLayoutRangeModeVisibleOnly][ASLayoutRangeTypeDisplay] = { diff --git a/AsyncDisplayKit/Details/ASBasicImageDownloader.h b/AsyncDisplayKit/Details/ASBasicImageDownloader.h index 5d436e6d20..147a7a85ab 100644 --- a/AsyncDisplayKit/Details/ASBasicImageDownloader.h +++ b/AsyncDisplayKit/Details/ASBasicImageDownloader.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASBasicImageDownloader.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/ASBasicImageDownloader.mm b/AsyncDisplayKit/Details/ASBasicImageDownloader.mm index 1b546f1eaf..37f32d554a 100644 --- a/AsyncDisplayKit/Details/ASBasicImageDownloader.mm +++ b/AsyncDisplayKit/Details/ASBasicImageDownloader.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASBasicImageDownloader.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASBasicImageDownloader.h" diff --git a/AsyncDisplayKit/Details/ASBatchContext.h b/AsyncDisplayKit/Details/ASBatchContext.h index dc1986a792..2795219643 100644 --- a/AsyncDisplayKit/Details/ASBatchContext.h +++ b/AsyncDisplayKit/Details/ASBatchContext.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASBatchContext.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/ASBatchContext.mm b/AsyncDisplayKit/Details/ASBatchContext.mm index 4cb5b96f1b..7a5efa766b 100644 --- a/AsyncDisplayKit/Details/ASBatchContext.mm +++ b/AsyncDisplayKit/Details/ASBatchContext.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASBatchContext.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASBatchContext.h" diff --git a/AsyncDisplayKit/Details/ASChangeSetDataController.h b/AsyncDisplayKit/Details/ASChangeSetDataController.h index cc385a148f..fa24b28ae2 100644 --- a/AsyncDisplayKit/Details/ASChangeSetDataController.h +++ b/AsyncDisplayKit/Details/ASChangeSetDataController.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Huy Nguyen on 19/10/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/Details/ASChangeSetDataController.m b/AsyncDisplayKit/Details/ASChangeSetDataController.m index 1441965cb9..21fe2b8842 100644 --- a/AsyncDisplayKit/Details/ASChangeSetDataController.m +++ b/AsyncDisplayKit/Details/ASChangeSetDataController.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Huy Nguyen on 19/10/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASChangeSetDataController.h" diff --git a/AsyncDisplayKit/Details/ASCollectionDataController.h b/AsyncDisplayKit/Details/ASCollectionDataController.h index ec7a30635b..c1534ea827 100644 --- a/AsyncDisplayKit/Details/ASCollectionDataController.h +++ b/AsyncDisplayKit/Details/ASCollectionDataController.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCollectionDataController.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/ASCollectionDataController.mm b/AsyncDisplayKit/Details/ASCollectionDataController.mm index 7026024ff8..c29fef148f 100644 --- a/AsyncDisplayKit/Details/ASCollectionDataController.mm +++ b/AsyncDisplayKit/Details/ASCollectionDataController.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCollectionDataController.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASCollectionDataController.h" @@ -51,7 +53,9 @@ - (void)willReloadData { - [_pendingContexts enumerateKeysAndObjectsUsingBlock:^(NSString *kind, NSMutableArray *contexts, BOOL *stop) { + NSArray *keys = _pendingContexts.allKeys; + for (NSString *kind in keys) { + NSMutableArray *contexts = _pendingContexts[kind]; // Remove everything that existed before the reload, now that we're ready to insert replacements NSArray *indexPaths = [self indexPathsForEditingNodesOfKind:kind]; [self deleteNodesOfKind:kind atIndexPaths:indexPaths completion:nil]; @@ -72,7 +76,7 @@ [self insertNodes:nodes ofKind:kind atIndexPaths:indexPaths completion:nil]; }]; [_pendingContexts removeObjectForKey:kind]; - }]; + } } - (void)prepareForInsertSections:(NSIndexSet *)sections @@ -87,7 +91,9 @@ - (void)willInsertSections:(NSIndexSet *)sections { - [_pendingContexts enumerateKeysAndObjectsUsingBlock:^(NSString *kind, NSMutableArray *contexts, BOOL *stop) { + NSArray *keys = _pendingContexts.allKeys; + for (NSString *kind in keys) { + NSMutableArray *contexts = _pendingContexts[kind]; NSMutableArray *sectionArray = [NSMutableArray arrayWithCapacity:sections.count]; for (NSUInteger i = 0; i < sections.count; i++) { [sectionArray addObject:[NSMutableArray array]]; @@ -98,7 +104,7 @@ [self insertNodes:nodes ofKind:kind atIndexPaths:indexPaths completion:nil]; }]; [_pendingContexts removeObjectForKey:kind]; - }]; + } } - (void)willDeleteSections:(NSIndexSet *)sections @@ -122,7 +128,9 @@ - (void)willReloadSections:(NSIndexSet *)sections { - [_pendingContexts enumerateKeysAndObjectsUsingBlock:^(NSString *kind, NSMutableArray *contexts, BOOL *stop) { + NSArray *keys = _pendingContexts.allKeys; + for (NSString *kind in keys) { + NSMutableArray *contexts = _pendingContexts[kind]; NSArray *indexPaths = ASIndexPathsForMultidimensionalArrayAtIndexSet([self editingNodesOfKind:kind], sections); [self deleteNodesOfKind:kind atIndexPaths:indexPaths completion:nil]; // reinsert the elements @@ -130,7 +138,7 @@ [self insertNodes:nodes ofKind:kind atIndexPaths:indexPaths completion:nil]; }]; [_pendingContexts removeObjectForKey:kind]; - }]; + } } - (void)willMoveSection:(NSInteger)section toSection:(NSInteger)newSection @@ -150,40 +158,114 @@ } } +- (void)prepareForInsertRowsAtIndexPaths:(NSArray *)indexPaths +{ + for (NSString *kind in [self supplementaryKinds]) { + LOG(@"Populating elements of kind: %@, for index paths: %@", kind, indexPaths); + NSMutableArray *contexts = [NSMutableArray array]; + [self _populateSupplementaryNodesOfKind:kind atIndexPaths:indexPaths mutableContexts:contexts]; + _pendingContexts[kind] = contexts; + } +} + +- (void)willInsertRowsAtIndexPaths:(NSArray *)indexPaths +{ + NSArray *keys = _pendingContexts.allKeys; + for (NSString *kind in keys) { + NSMutableArray *contexts = _pendingContexts[kind]; + + [self batchLayoutNodesFromContexts:contexts ofKind:kind completion:^(NSArray *nodes, NSArray *indexPaths) { + [self insertNodes:nodes ofKind:kind atIndexPaths:indexPaths completion:nil]; + }]; + [_pendingContexts removeObjectForKey:kind]; + } +} + +- (void)willDeleteRowsAtIndexPaths:(NSArray *)indexPaths +{ + for (NSString *kind in [self supplementaryKinds]) { + NSArray *deletedIndexPaths = ASIndexPathsInMultidimensionalArrayIntersectingIndexPaths([self editingNodesOfKind:kind], indexPaths); + [self deleteNodesOfKind:kind atIndexPaths:deletedIndexPaths completion:nil]; + } +} + +- (void)prepareForReloadRowsAtIndexPaths:(NSArray *)indexPaths +{ + for (NSString *kind in [self supplementaryKinds]) { + NSMutableArray *contexts = [NSMutableArray array]; + [self _populateSupplementaryNodesOfKind:kind atIndexPaths:indexPaths mutableContexts:contexts]; + _pendingContexts[kind] = contexts; + } +} + +- (void)willReloadRowsAtIndexPaths:(NSArray *)indexPaths +{ + NSArray *keys = _pendingContexts.allKeys; + for (NSString *kind in keys) { + NSMutableArray *contexts = _pendingContexts[kind]; + + [self deleteNodesOfKind:kind atIndexPaths:indexPaths completion:nil]; + // reinsert the elements + [self batchLayoutNodesFromContexts:contexts ofKind:kind completion:^(NSArray *nodes, NSArray *indexPaths) { + [self insertNodes:nodes ofKind:kind atIndexPaths:indexPaths completion:nil]; + }]; + [_pendingContexts removeObjectForKey:kind]; + } +} + - (void)_populateSupplementaryNodesOfKind:(NSString *)kind withMutableContexts:(NSMutableArray *)contexts { + id environment = [self.environmentDelegate dataControllerEnvironment]; + ASEnvironmentTraitCollection environmentTraitCollection = environment.environmentTraitCollection; + NSUInteger sectionCount = [self.collectionDataSource dataController:self numberOfSectionsForSupplementaryNodeOfKind:kind]; for (NSUInteger i = 0; i < sectionCount; i++) { NSIndexPath *sectionIndexPath = [[NSIndexPath alloc] initWithIndex:i]; NSUInteger rowCount = [self.collectionDataSource dataController:self supplementaryNodesOfKind:kind inSection:i]; for (NSUInteger j = 0; j < rowCount; j++) { NSIndexPath *indexPath = [sectionIndexPath indexPathByAddingIndex:j]; - - ASCellNodeBlock supplementaryCellBlock; - if (_dataSourceImplementsSupplementaryNodeBlockOfKindAtIndexPath) { - supplementaryCellBlock = [self.collectionDataSource dataController:self supplementaryNodeBlockOfKind:kind atIndexPath:indexPath]; - } else { - ASCellNode *supplementaryNode = [self.collectionDataSource dataController:self supplementaryNodeOfKind:kind atIndexPath:indexPath]; - supplementaryCellBlock = ^{ return supplementaryNode; }; - } - - ASSizeRange constrainedSize = [self constrainedSizeForNodeOfKind:kind atIndexPath:indexPath]; - ASIndexedNodeContext *context = [[ASIndexedNodeContext alloc] initWithNodeBlock:supplementaryCellBlock - indexPath:indexPath - constrainedSize:constrainedSize]; - [contexts addObject:context]; + [self _populateSupplementaryNodeOfKind:kind atIndexPath:indexPath mutableContexts:contexts environmentTraitCollection:environmentTraitCollection]; } } } - (void)_populateSupplementaryNodesOfKind:(NSString *)kind withSections:(NSIndexSet *)sections mutableContexts:(NSMutableArray *)contexts { + id environment = [self.environmentDelegate dataControllerEnvironment]; + ASEnvironmentTraitCollection environmentTraitCollection = environment.environmentTraitCollection; + [sections enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { NSUInteger rowNum = [self.collectionDataSource dataController:self supplementaryNodesOfKind:kind inSection:idx]; NSIndexPath *sectionIndex = [[NSIndexPath alloc] initWithIndex:idx]; for (NSUInteger i = 0; i < rowNum; i++) { NSIndexPath *indexPath = [sectionIndex indexPathByAddingIndex:i]; + [self _populateSupplementaryNodeOfKind:kind atIndexPath:indexPath mutableContexts:contexts environmentTraitCollection:environmentTraitCollection]; + } + }]; +} +- (void)_populateSupplementaryNodesOfKind:(NSString *)kind atIndexPaths:(NSArray *)indexPaths mutableContexts:(NSMutableArray *)contexts +{ + id environment = [self.environmentDelegate dataControllerEnvironment]; + ASEnvironmentTraitCollection environmentTraitCollection = environment.environmentTraitCollection; + + NSMutableIndexSet *sections = [NSMutableIndexSet indexSet]; + for (NSIndexPath *indexPath in indexPaths) { + [sections addIndex:indexPath.section]; + } + + [sections enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { + NSUInteger rowNum = [self.collectionDataSource dataController:self supplementaryNodesOfKind:kind inSection:idx]; + NSIndexPath *sectionIndex = [[NSIndexPath alloc] initWithIndex:idx]; + for (NSUInteger i = 0; i < rowNum; i++) { + NSIndexPath *indexPath = [sectionIndex indexPathByAddingIndex:i]; + [self _populateSupplementaryNodeOfKind:kind atIndexPath:indexPath mutableContexts:contexts environmentTraitCollection:environmentTraitCollection]; + } + }]; +} + +- (void)_populateSupplementaryNodeOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath mutableContexts:(NSMutableArray *)contexts environmentTraitCollection:(ASEnvironmentTraitCollection)environmentTraitCollection +{ ASCellNodeBlock supplementaryCellBlock; if (_dataSourceImplementsSupplementaryNodeBlockOfKindAtIndexPath) { supplementaryCellBlock = [self.collectionDataSource dataController:self supplementaryNodeBlockOfKind:kind atIndexPath:indexPath]; @@ -195,10 +277,9 @@ ASSizeRange constrainedSize = [self constrainedSizeForNodeOfKind:kind atIndexPath:indexPath]; ASIndexedNodeContext *context = [[ASIndexedNodeContext alloc] initWithNodeBlock:supplementaryCellBlock indexPath:indexPath - constrainedSize:constrainedSize]; + constrainedSize:constrainedSize + environmentTraitCollection:environmentTraitCollection]; [contexts addObject:context]; - } - }]; } #pragma mark - Sizing query @@ -250,4 +331,4 @@ ASDisplayNodeAssertTrue(_dataSourceImplementsSupplementaryNodeBlockOfKindAtIndexPath || [self.collectionDataSource respondsToSelector:@selector(dataController:supplementaryNodeOfKind:atIndexPath:)]); } -@end \ No newline at end of file +@end diff --git a/AsyncDisplayKit/Details/ASCollectionInternal.h b/AsyncDisplayKit/Details/ASCollectionInternal.h index 55e99d6a36..d110b85634 100644 --- a/AsyncDisplayKit/Details/ASCollectionInternal.h +++ b/AsyncDisplayKit/Details/ASCollectionInternal.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Scott Goodson on 1/1/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASCollectionView.h" diff --git a/AsyncDisplayKit/Details/ASCollectionInternal.m b/AsyncDisplayKit/Details/ASCollectionInternal.m index 5acbc02b2e..e7f68bd978 100644 --- a/AsyncDisplayKit/Details/ASCollectionInternal.m +++ b/AsyncDisplayKit/Details/ASCollectionInternal.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Scott Goodson on 1/1/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASCollectionInternal.h" diff --git a/AsyncDisplayKit/Details/ASCollectionViewFlowLayoutInspector.h b/AsyncDisplayKit/Details/ASCollectionViewFlowLayoutInspector.h index cd640c3e2a..661f140628 100644 --- a/AsyncDisplayKit/Details/ASCollectionViewFlowLayoutInspector.h +++ b/AsyncDisplayKit/Details/ASCollectionViewFlowLayoutInspector.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCollectionViewFlowLayoutInspector.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once diff --git a/AsyncDisplayKit/Details/ASCollectionViewFlowLayoutInspector.m b/AsyncDisplayKit/Details/ASCollectionViewFlowLayoutInspector.m index 3fe377f3a3..f217571193 100644 --- a/AsyncDisplayKit/Details/ASCollectionViewFlowLayoutInspector.m +++ b/AsyncDisplayKit/Details/ASCollectionViewFlowLayoutInspector.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCollectionViewFlowLayoutInspector.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/ASCollectionViewLayoutController.h b/AsyncDisplayKit/Details/ASCollectionViewLayoutController.h index 632ba46bf8..4f2457e697 100644 --- a/AsyncDisplayKit/Details/ASCollectionViewLayoutController.h +++ b/AsyncDisplayKit/Details/ASCollectionViewLayoutController.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCollectionViewLayoutController.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/Details/ASCollectionViewLayoutController.mm b/AsyncDisplayKit/Details/ASCollectionViewLayoutController.mm index 62523a40be..f7e63f3d6e 100644 --- a/AsyncDisplayKit/Details/ASCollectionViewLayoutController.mm +++ b/AsyncDisplayKit/Details/ASCollectionViewLayoutController.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCollectionViewLayoutController.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASCollectionViewLayoutController.h" diff --git a/AsyncDisplayKit/Details/ASDataController+Subclasses.h b/AsyncDisplayKit/Details/ASDataController+Subclasses.h index 51b7548f50..d837540362 100644 --- a/AsyncDisplayKit/Details/ASDataController+Subclasses.h +++ b/AsyncDisplayKit/Details/ASDataController+Subclasses.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDataController+Subclasses.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once @@ -160,4 +162,70 @@ typedef void (^ASDataControllerCompletionBlock)(NSArray *nodes, NS */ - (void)willMoveSection:(NSInteger)section toSection:(NSInteger)newSection; +/** + * Notifies the subclass to perform setup before rows are inserted in the data controller. + * + * @discussion This method will be performed before the data controller enters its editing queue. + * The data source is locked at this point and accessing it is safe. Use this method to set up any nodes or + * data stores before entering into editing the backing store on a background thread. + * + * @param indexPaths Index paths for the rows to be inserted. + */ +- (void)prepareForInsertRowsAtIndexPaths:(NSArray *)indexPaths; + +/** + * Notifies the subclass that the data controller will insert new rows at the given index paths. + * + * @discussion This method will be performed on the data controller's editing background queue before the parent's + * concrete implementation. This is a great place to perform any additional transformations like supplementary views + * or header/footer nodes. + * + * @param indexPaths Index paths for the rows to be inserted. + */ +- (void)willInsertRowsAtIndexPaths:(NSArray *)indexPaths; + +/** + * Notifies the subclass to perform setup before rows are deleted in the data controller. + * + * @discussion This method will be performed before the data controller enters its editing queue. + * The data source is locked at this point and accessing it is safe. Use this method to set up any nodes or + * data stores before entering into editing the backing store on a background thread. + * + * @param indexPaths Index paths for the rows to be deleted. + */ +- (void)prepareForDeleteRowsAtIndexPaths:(NSArray *)indexPaths; + +/** + * Notifies the subclass that the data controller will delete rows at the given index paths. + * + * @discussion This method will be performed before the data controller enters its editing queue. + * The data source is locked at this point and accessing it is safe. Use this method to set up any nodes or + * data stores before entering into editing the backing store on a background thread. + * + * @param indexPaths Index paths for the rows to be deleted. + */ +- (void)willDeleteRowsAtIndexPaths:(NSArray *)indexPaths; + +/** + * Notifies the subclass to perform any work needed before the given rows will be reloaded. + * + * @discussion This method will be performed before the data controller enters its editing queue, usually on the main + * thread. The data source is locked at this point and accessing it is safe. Use this method to set up any nodes or + * data stores before entering into editing the backing store on a background thread. + * + * @param indexPaths Index paths for the rows to be reloaded. + */ +- (void)prepareForReloadRowsAtIndexPaths:(NSArray *)indexPaths; + +/** + * Notifies the subclass that the data controller will reload the rows at the given index paths. + * + * @discussion This method will be performed on the data controller's editing background queue before the parent's + * concrete implementation. This is a great place to perform any additional transformations like supplementary views + * or header/footer nodes. + * + * @param indexPaths Index paths for the rows to be reloaded. + */ +- (void)willReloadRowsAtIndexPaths:(NSArray *)indexPaths; + @end diff --git a/AsyncDisplayKit/Details/ASDataController.h b/AsyncDisplayKit/Details/ASDataController.h index 190119ed62..74ed8f0edb 100644 --- a/AsyncDisplayKit/Details/ASDataController.h +++ b/AsyncDisplayKit/Details/ASDataController.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDataController.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once @@ -17,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN @class ASCellNode; @class ASDataController; +@protocol ASEnvironment; typedef NSUInteger ASDataControllerAnimationOptions; @@ -64,6 +67,11 @@ FOUNDATION_EXPORT NSString * const ASDataControllerRowNodeKind; */ - (void)dataControllerUnlockDataSource; + +@end + +@protocol ASDataControllerEnvironmentDelegate +- (id)dataControllerEnvironment; @end /** @@ -122,6 +130,11 @@ FOUNDATION_EXPORT NSString * const ASDataControllerRowNodeKind; */ @property (nonatomic, weak) id delegate; +/** + * + */ +@property (nonatomic, weak) id environmentDelegate; + /** * Designated initializer. * diff --git a/AsyncDisplayKit/Details/ASDataController.mm b/AsyncDisplayKit/Details/ASDataController.mm index 9d8a2c81a7..296f67b81d 100644 --- a/AsyncDisplayKit/Details/ASDataController.mm +++ b/AsyncDisplayKit/Details/ASDataController.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDataController.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASDataController.h" @@ -13,6 +15,7 @@ #import "ASAssert.h" #import "ASCellNode.h" #import "ASDisplayNode.h" +#import "ASEnvironmentInternal.h" #import "ASFlowLayoutController.h" #import "ASInternalHelpers.h" #import "ASLayout.h" @@ -189,27 +192,33 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; for (NSUInteger j = 0; j < nodeCount; j += kASDataControllerSizingCountPerProcessor) { NSInteger batchCount = MIN(kASDataControllerSizingCountPerProcessor, nodeCount - j); - - __block NSArray *subarray; + // Allocate nodes concurrently. + __block NSArray *subarrayOfContexts; + __block NSArray *subarrayOfNodes; dispatch_block_t allocationBlock = ^{ + __strong ASIndexedNodeContext **allocatedContextBuffer = (__strong ASIndexedNodeContext **)calloc(batchCount, sizeof(ASIndexedNodeContext *)); __strong ASCellNode **allocatedNodeBuffer = (__strong ASCellNode **)calloc(batchCount, sizeof(ASCellNode *)); dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_apply(batchCount, queue, ^(size_t i) { unsigned long k = j + i; - ASCellNode *node = [contexts[k] allocateNode]; + ASIndexedNodeContext *context = contexts[k]; + ASCellNode *node = [context allocateNode]; if (node == nil) { ASDisplayNodeAssertNotNil(node, @"Node block created nil node; %@, %@", self, self.dataSource); node = [[ASCellNode alloc] init]; // Fallback to avoid crash for production apps. } allocatedNodeBuffer[i] = node; + allocatedContextBuffer[i] = context; }); - subarray = [[NSArray alloc] initWithObjects:allocatedNodeBuffer count:batchCount]; - + subarrayOfNodes = [NSArray arrayWithObjects:allocatedNodeBuffer count:batchCount]; + subarrayOfContexts = [NSArray arrayWithObjects:allocatedContextBuffer count:batchCount]; // Nil out buffer indexes to allow arc to free the stored cells. for (int i = 0; i < batchCount; i++) { + allocatedContextBuffer[i] = nil; allocatedNodeBuffer[i] = nil; } + free(allocatedContextBuffer); free(allocatedNodeBuffer); }; @@ -224,15 +233,15 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; }); dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER); - [self _layoutNodes:subarray fromContexts:contexts atIndexesOfRange:batchRange ofKind:kind]; + [self _layoutNodes:subarrayOfNodes fromContexts:subarrayOfContexts atIndexesOfRange:batchRange ofKind:kind]; } else { allocationBlock(); [_mainSerialQueue performBlockOnMainThread:^{ - [self _layoutNodes:subarray fromContexts:contexts atIndexesOfRange:batchRange ofKind:kind]; + [self _layoutNodes:subarrayOfNodes fromContexts:subarrayOfContexts atIndexesOfRange:batchRange ofKind:kind]; }]; } - [allocatedNodes addObjectsFromArray:subarray]; + [allocatedNodes addObjectsFromArray:subarrayOfNodes]; dispatch_group_async(layoutGroup, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ // We should already have measured loaded nodes before we left the main thread. Layout the remaining ones on a background thread. @@ -512,6 +521,9 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; */ - (NSArray *)_populateFromDataSourceWithSectionIndexSet:(NSIndexSet *)indexSet { + id environment = [self.environmentDelegate dataControllerEnvironment]; + ASEnvironmentTraitCollection environmentTraitCollection = environment.environmentTraitCollection; + NSMutableArray *contexts = [NSMutableArray array]; [indexSet enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { NSUInteger rowNum = [_dataSource dataController:self rowsInSection:idx]; @@ -519,10 +531,12 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; for (NSUInteger i = 0; i < rowNum; i++) { NSIndexPath *indexPath = [sectionIndex indexPathByAddingIndex:i]; ASCellNodeBlock nodeBlock = [_dataSource dataController:self nodeBlockAtIndexPath:indexPath]; + ASSizeRange constrainedSize = [self constrainedSizeForNodeOfKind:ASDataControllerRowNodeKind atIndexPath:indexPath]; [contexts addObject:[[ASIndexedNodeContext alloc] initWithNodeBlock:nodeBlock indexPath:indexPath - constrainedSize:constrainedSize]]; + constrainedSize:constrainedSize + environmentTraitCollection:environmentTraitCollection]]; } }]; return contexts; @@ -760,6 +774,36 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; // Optional template hook for subclasses (See ASDataController+Subclasses.h) } +- (void)prepareForInsertRowsAtIndexPaths:(NSArray *)indexPaths +{ + // Optional template hook for subclasses (See ASDataController+Subclasses.h) +} + +- (void)willInsertRowsAtIndexPaths:(NSArray *)indexPaths +{ + // Optional template hook for subclasses (See ASDataController+Subclasses.h) +} + +- (void)prepareForDeleteRowsAtIndexPaths:(NSArray *)indexPaths +{ + // Optional template hook for subclasses (See ASDataController+Subclasses.h) +} + +- (void)willDeleteRowsAtIndexPaths:(NSArray *)indexPaths +{ + // Optional template hook for subclasses (See ASDataController+Subclasses.h) +} + +- (void)prepareForReloadRowsAtIndexPaths:(NSArray *)indexPaths +{ + // Optional template hook for subclasses (See ASDataController+Subclasses.h) +} + +- (void)willReloadRowsAtIndexPaths:(NSArray *)indexPaths +{ + // Optional template hook for subclasses (See ASDataController+Subclasses.h) +} + #pragma mark - Row Editing (External API) - (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions @@ -770,20 +814,28 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; [_editingTransactionQueue waitUntilAllOperationsAreFinished]; - // sort indexPath to avoid messing up the index when inserting in several batches + // Sort indexPath to avoid messing up the index when inserting in several batches NSArray *sortedIndexPaths = [indexPaths sortedArrayUsingSelector:@selector(compare:)]; NSMutableArray *contexts = [[NSMutableArray alloc] initWithCapacity:indexPaths.count]; [self accessDataSourceWithBlock:^{ + id environment = [self.environmentDelegate dataControllerEnvironment]; + ASEnvironmentTraitCollection environmentTraitCollection = environment.environmentTraitCollection; + for (NSIndexPath *indexPath in sortedIndexPaths) { ASCellNodeBlock nodeBlock = [_dataSource dataController:self nodeBlockAtIndexPath:indexPath]; ASSizeRange constrainedSize = [self constrainedSizeForNodeOfKind:ASDataControllerRowNodeKind atIndexPath:indexPath]; [contexts addObject:[[ASIndexedNodeContext alloc] initWithNodeBlock:nodeBlock indexPath:indexPath - constrainedSize:constrainedSize]]; + constrainedSize:constrainedSize + environmentTraitCollection:environmentTraitCollection]]; } + [self prepareForInsertRowsAtIndexPaths:indexPaths]; + [_editingTransactionQueue addOperationWithBlock:^{ + [self willInsertRowsAtIndexPaths:indexPaths]; + LOG(@"Edit Transaction - insertRows: %@", indexPaths); [self _batchLayoutNodesFromContexts:contexts withAnimationOptions:animationOptions]; }]; @@ -799,11 +851,15 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; [_editingTransactionQueue waitUntilAllOperationsAreFinished]; - // sort indexPath in order to avoid messing up the index when deleting + // Sort indexPath in order to avoid messing up the index when deleting in several batches. // FIXME: Shouldn't deletes be sorted in descending order? NSArray *sortedIndexPaths = [indexPaths sortedArrayUsingSelector:@selector(compare:)]; + [self prepareForDeleteRowsAtIndexPaths:sortedIndexPaths]; + [_editingTransactionQueue addOperationWithBlock:^{ + [self willDeleteRowsAtIndexPaths:sortedIndexPaths]; + LOG(@"Edit Transaction - deleteRows: %@", indexPaths); [self _deleteNodesAtIndexPaths:sortedIndexPaths withAnimationOptions:animationOptions]; }]; @@ -822,21 +878,29 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; [self accessDataSourceWithBlock:^{ NSMutableArray *contexts = [[NSMutableArray alloc] initWithCapacity:indexPaths.count]; - // FIXME: This doesn't currently do anything + // Sort indexPath to avoid messing up the index when deleting // FIXME: Shouldn't deletes be sorted in descending order? - [indexPaths sortedArrayUsingSelector:@selector(compare:)]; + NSArray *sortedIndexPaths = [indexPaths sortedArrayUsingSelector:@selector(compare:)]; - for (NSIndexPath *indexPath in indexPaths) { + id environment = [self.environmentDelegate dataControllerEnvironment]; + ASEnvironmentTraitCollection environmentTraitCollection = environment.environmentTraitCollection; + + for (NSIndexPath *indexPath in sortedIndexPaths) { ASCellNodeBlock nodeBlock = [_dataSource dataController:self nodeBlockAtIndexPath:indexPath]; ASSizeRange constrainedSize = [self constrainedSizeForNodeOfKind:ASDataControllerRowNodeKind atIndexPath:indexPath]; [contexts addObject:[[ASIndexedNodeContext alloc] initWithNodeBlock:nodeBlock indexPath:indexPath - constrainedSize:constrainedSize]]; + constrainedSize:constrainedSize + environmentTraitCollection:environmentTraitCollection]]; } + [self prepareForReloadRowsAtIndexPaths:indexPaths]; + [_editingTransactionQueue addOperationWithBlock:^{ + [self willReloadRowsAtIndexPaths:indexPaths]; + LOG(@"Edit Transaction - reloadRows: %@", indexPaths); - [self _deleteNodesAtIndexPaths:indexPaths withAnimationOptions:animationOptions]; + [self _deleteNodesAtIndexPaths:sortedIndexPaths withAnimationOptions:animationOptions]; [self _batchLayoutNodesFromContexts:contexts withAnimationOptions:animationOptions]; }]; }]; @@ -855,7 +919,7 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; // (see _layoutNodes:atIndexPaths:withAnimationOptions:). [_editingTransactionQueue addOperationWithBlock:^{ [_mainSerialQueue performBlockOnMainThread:^{ - for (NSString *kind in [_completedNodes keyEnumerator]) { + for (NSString *kind in _completedNodes) { [self _relayoutNodesOfKind:kind]; } }]; @@ -991,9 +1055,9 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; - (void)dealloc { ASDisplayNodeAssertMainThread(); - [_completedNodes enumerateKeysAndObjectsUsingBlock:^(NSString *kind, NSMutableArray *nodes, BOOL *stop) { - [nodes enumerateObjectsUsingBlock:^(NSMutableArray *section, NSUInteger sectionIndex, BOOL *stop) { - [section enumerateObjectsUsingBlock:^(ASCellNode *node, NSUInteger rowIndex, BOOL *stop) { + [_completedNodes enumerateKeysAndObjectsUsingBlock:^(NSString *kind, NSMutableArray *sections, BOOL *stop) { + for (NSArray *section in sections) { + for (ASCellNode *node in section) { if (node.isNodeLoaded) { if (node.layerBacked) { [node.layer removeFromSuperlayer]; @@ -1001,8 +1065,8 @@ static void *kASSizingQueueContext = &kASSizingQueueContext; [node.view removeFromSuperview]; } } - }]; - }]; + } + } }]; } diff --git a/AsyncDisplayKit/Details/ASDealloc2MainObject.h b/AsyncDisplayKit/Details/ASDealloc2MainObject.h index 88c08ba9c0..652d42aa3a 100644 --- a/AsyncDisplayKit/Details/ASDealloc2MainObject.h +++ b/AsyncDisplayKit/Details/ASDealloc2MainObject.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDealloc2MainObject.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/ASDealloc2MainObject.m b/AsyncDisplayKit/Details/ASDealloc2MainObject.m index 4b734f70c7..243e9b17d0 100644 --- a/AsyncDisplayKit/Details/ASDealloc2MainObject.m +++ b/AsyncDisplayKit/Details/ASDealloc2MainObject.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDealloc2MainObject.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASDealloc2MainObject.h" diff --git a/AsyncDisplayKit/Details/ASDelegateProxy.h b/AsyncDisplayKit/Details/ASDelegateProxy.h index 8c4f6eaa5e..1f448aa44f 100644 --- a/AsyncDisplayKit/Details/ASDelegateProxy.h +++ b/AsyncDisplayKit/Details/ASDelegateProxy.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDelegateProxy.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/ASDelegateProxy.m b/AsyncDisplayKit/Details/ASDelegateProxy.m index 3034a83d86..b1f3310736 100644 --- a/AsyncDisplayKit/Details/ASDelegateProxy.m +++ b/AsyncDisplayKit/Details/ASDelegateProxy.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDelegateProxy.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASDelegateProxy.h" #import "ASTableView.h" @@ -26,6 +28,10 @@ // used for ASCellNode visibility selector == @selector(scrollViewDidScroll:) || + + // used for ASCellNode user interaction + selector == @selector(scrollViewWillBeginDragging:) || + selector == @selector(scrollViewDidEndDragging:willDecelerate:) || // used for ASRangeController visibility updates selector == @selector(tableView:willDisplayCell:forRowAtIndexPath:) || @@ -61,6 +67,10 @@ // used for ASCellNode visibility selector == @selector(scrollViewDidScroll:) || + + // used for ASCellNode user interaction + selector == @selector(scrollViewWillBeginDragging:) || + selector == @selector(scrollViewDidEndDragging:willDecelerate:) || // intercepted due to not being supported by ASCollectionView (prevent bugs caused by usage) selector == @selector(collectionView:canMoveItemAtIndexPath:) || @@ -77,11 +87,12 @@ - (BOOL)interceptsSelector:(SEL)selector { return ( - // handled by ASPagerNodeDataSource node<->cell machinery + // handled by ASPagerDataSource node<->cell machinery selector == @selector(collectionView:nodeForItemAtIndexPath:) || selector == @selector(collectionView:nodeBlockForItemAtIndexPath:) || selector == @selector(collectionView:numberOfItemsInSection:) || - selector == @selector(collectionView:constrainedSizeForNodeAtIndexPath:) + selector == @selector(collectionView:constrainedSizeForNodeAtIndexPath:) || + selector == @selector(scrollViewWillEndDragging:withVelocity:targetContentOffset:) ); } @@ -125,12 +136,45 @@ if (_target) { return [_target respondsToSelector:aSelector] ? _target : nil; } else { - [_interceptor proxyTargetHasDeallocated:self]; + // The _interceptor needs to be nilled out in this scenario. For that a strong reference needs to be created + // to be able to nil out the _interceptor but still let it know that the proxy target has deallocated + // We have to hold a strong reference to the interceptor as we have to nil it out and call the proxyTargetHasDeallocated + // The reason that the interceptor needs to be nilled out is that there maybe a change of a infinite loop, for example + // if a method will be called in the proxyTargetHasDeallocated: that again would trigger a whole new forwarding cycle + id interceptor = _interceptor; + _interceptor = nil; + [interceptor proxyTargetHasDeallocated:self]; + return nil; } } } +- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector +{ + // Check for a compiled definition for the selector + NSMethodSignature *methodSignature = nil; + if ([self interceptsSelector:aSelector]) { + methodSignature = [[_interceptor class] instanceMethodSignatureForSelector:aSelector]; + } else { + methodSignature = [[_target class] instanceMethodSignatureForSelector:aSelector]; + } + + // Unfortunately, in order to get this object to work properly, the use of a method which creates an NSMethodSignature + // from a C string. -methodSignatureForSelector is called when a compiled definition for the selector cannot be found. + // This is the place where we have to create our own dud NSMethodSignature. This is necessary because if this method + // returns nil, a selector not found exception is raised. The string argument to -signatureWithObjCTypes: outlines + // the return type and arguments to the message. To return a dud NSMethodSignature, pretty much any signature will + // suffice. Since the -forwardInvocation call will do nothing if the delegate does not respond to the selector, + // the dud NSMethodSignature simply gets us around the exception. + return methodSignature ?: [NSMethodSignature signatureWithObjCTypes:"@^v^c"]; +} + +- (void)forwardInvocation:(NSInvocation *)invocation +{ + // If we are down here this means _interceptor and _target where nil. Just don't do anything to prevent a crash +} + - (BOOL)interceptsSelector:(SEL)selector { ASDisplayNodeAssert(NO, @"This method must be overridden by subclasses."); diff --git a/AsyncDisplayKit/Details/ASEnvironment.h b/AsyncDisplayKit/Details/ASEnvironment.h index 6a42f18cbf..6c395aa18e 100644 --- a/AsyncDisplayKit/Details/ASEnvironment.h +++ b/AsyncDisplayKit/Details/ASEnvironment.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASEnvironment.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -14,6 +14,8 @@ #import "ASStackLayoutDefines.h" #import "ASRelativeSize.h" +@protocol ASEnvironment; +@class UITraitCollection; ASDISPLAYNODE_EXTERN_C_BEGIN NS_ASSUME_NONNULL_BEGIN @@ -59,17 +61,49 @@ typedef struct ASEnvironmentHierarchyState { unsigned layoutPending:1; // = NO } ASEnvironmentHierarchyState; +#pragma mark - ASEnvironmentDisplayTraits + +typedef struct ASEnvironmentTraitCollection { + CGFloat displayScale; + UIUserInterfaceSizeClass horizontalSizeClass; + UIUserInterfaceIdiom userInterfaceIdiom; + UIUserInterfaceSizeClass verticalSizeClass; + UIForceTouchCapability forceTouchCapability; + + // WARNING: + // This pointer is in a C struct and therefore not managed by ARC. It is + // an unsafe unretained pointer, so when you dereference it you better be + // sure that it is valid. + // + // Use displayContext when you wish to pass view context specific data along with the + // display traits to subnodes. This should be a piece of data owned by an + // ASViewController, which will ensure that the data is still valid when laying out + // its subviews. When the VC is dealloc'ed, the displayContext it created will also + // be dealloced but any subnodes that are hanging around (why would they be?) will now + // have a displayContext that points to a bad pointer. + // + // As an added precaution ASDisplayTraitsClearDisplayContext is called from ASVC's desctructor + // which will propagate a nil displayContext to its subnodes. + id __unsafe_unretained displayContext; +} ASEnvironmentTraitCollection; + +extern void ASEnvironmentTraitCollectionUpdateDisplayContext(id rootEnvironment, id _Nullable context); + +extern ASEnvironmentTraitCollection ASEnvironmentTraitCollectionFromUITraitCollection(UITraitCollection *traitCollection); +extern BOOL ASEnvironmentTraitCollectionIsEqualToASEnvironmentTraitCollection(ASEnvironmentTraitCollection lhs, ASEnvironmentTraitCollection rhs); #pragma mark - ASEnvironmentState typedef struct ASEnvironmentState { struct ASEnvironmentHierarchyState hierarchyState; struct ASEnvironmentLayoutOptionsState layoutOptionsState; + struct ASEnvironmentTraitCollection environmentTraitCollection; } ASEnvironmentState; extern ASEnvironmentState ASEnvironmentStateMakeDefault(); ASDISPLAYNODE_EXTERN_C_END +@class ASTraitCollection; #pragma mark - ASEnvironment @@ -88,11 +122,50 @@ ASDISPLAYNODE_EXTERN_C_END - (id _Nullable)parent; /// Returns all children of an object which class conforms to the ASEnvironment protocol -- (NSArray> *)children; +- (nullable NSArray> *)children; /// Classes should implement this method and return YES / NO dependent if upward propagation is enabled or not - (BOOL)supportsUpwardPropagation; +/// Classes should implement this method and return YES / NO dependent if downware propagation is enabled or not +- (BOOL)supportsTraitsCollectionPropagation; + +/// Returns an NSObject-representation of the environment's ASEnvironmentDisplayTraits +- (ASTraitCollection *)asyncTraitCollection; + +/// Returns a struct-representation of the environment's ASEnvironmentDisplayTraits. This only exists as a internal +/// convenience method. Users should access the trait collections through the NSObject based asyncTraitCollection API +- (ASEnvironmentTraitCollection)environmentTraitCollection; + +/// sets a trait collection on this environment state. +- (void)setEnvironmentTraitCollection:(ASEnvironmentTraitCollection)environmentTraitCollection; @end -NS_ASSUME_NONNULL_END \ No newline at end of file +// ASCollection/TableNodes don't actually have ASCellNodes as subnodes. Because of this we can't rely on display trait +// downward propagation via ASEnvironment. Instead if the new environmentState has displayTraits that are different from +// the cells', then we propagate downward explicitly and request a relayout. +// +// If there is any new downward propagating state, it should be added to this define. +// +// This logic is used in both ASCollectionNode and ASTableNode +#define ASEnvironmentCollectionTableSetEnvironmentState(lock) \ +- (void)setEnvironmentState:(ASEnvironmentState)environmentState\ +{\ + ASDN::MutexLocker l(lock);\ + ASEnvironmentTraitCollection oldTraits = self.environmentState.environmentTraitCollection;\ + [super setEnvironmentState:environmentState];\ + ASEnvironmentTraitCollection currentTraits = environmentState.environmentTraitCollection;\ + if (ASEnvironmentTraitCollectionIsEqualToASEnvironmentTraitCollection(currentTraits, oldTraits) == NO) {\ + ASPerformBlockOnMainThread(^{\ + NSArray *> *completedNodes = [self.view.dataController completedNodes];\ + for (NSArray *sectionArray in completedNodes) {\ + for (ASCellNode *cellNode in sectionArray) {\ + ASEnvironmentStatePropagateDown(cellNode, currentTraits);\ + [cellNode setNeedsLayout];\ + }\ + }\ + });\ + }\ +}\ + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Details/ASEnvironment.m b/AsyncDisplayKit/Details/ASEnvironment.m deleted file mode 100644 index f3b2039f8f..0000000000 --- a/AsyncDisplayKit/Details/ASEnvironment.m +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -#import "ASEnvironment.h" - -ASEnvironmentLayoutOptionsState _ASEnvironmentLayoutOptionsStateMakeDefault() -{ - return (ASEnvironmentLayoutOptionsState) { - // Default values can be defined in here - }; -} - -ASEnvironmentHierarchyState _ASEnvironmentHierarchyStateMakeDefault() -{ - return (ASEnvironmentHierarchyState) { - // Default values can be defined in here - }; -} - -ASEnvironmentState ASEnvironmentStateMakeDefault() -{ - return (ASEnvironmentState) { - .layoutOptionsState = _ASEnvironmentLayoutOptionsStateMakeDefault(), - .hierarchyState = _ASEnvironmentHierarchyStateMakeDefault() - }; -} \ No newline at end of file diff --git a/AsyncDisplayKit/Details/ASEnvironment.mm b/AsyncDisplayKit/Details/ASEnvironment.mm new file mode 100644 index 0000000000..77ffca7a0f --- /dev/null +++ b/AsyncDisplayKit/Details/ASEnvironment.mm @@ -0,0 +1,83 @@ +// +// ASEnvironment.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import "ASEnvironment.h" +#import "ASEnvironmentInternal.h" +#import + +ASEnvironmentLayoutOptionsState _ASEnvironmentLayoutOptionsStateMakeDefault() +{ + return (ASEnvironmentLayoutOptionsState) { + // Default values can be defined in here + }; +} + +ASEnvironmentHierarchyState _ASEnvironmentHierarchyStateMakeDefault() +{ + return (ASEnvironmentHierarchyState) { + // Default values can be defined in here + }; +} + +extern void ASEnvironmentTraitCollectionUpdateDisplayContext(id rootEnvironment, id context) +{ + ASEnvironmentState envState = [rootEnvironment environmentState]; + ASEnvironmentTraitCollection environmentTraitCollection = envState.environmentTraitCollection; + environmentTraitCollection.displayContext = context; + envState.environmentTraitCollection = environmentTraitCollection; + [rootEnvironment setEnvironmentState:envState]; + + for (id child in [rootEnvironment children]) { + ASEnvironmentStatePropagateDown(child, environmentTraitCollection); + } +} + +ASEnvironmentTraitCollection _ASEnvironmentTraitCollectionMakeDefault() +{ + return (ASEnvironmentTraitCollection) { + // Default values can be defined in here + }; +} + +ASEnvironmentTraitCollection ASEnvironmentTraitCollectionFromUITraitCollection(UITraitCollection *traitCollection) +{ + ASEnvironmentTraitCollection asyncTraitCollection; + if (AS_AT_LEAST_IOS8) { + asyncTraitCollection.displayScale = traitCollection.displayScale; + asyncTraitCollection.horizontalSizeClass = traitCollection.horizontalSizeClass; + asyncTraitCollection.verticalSizeClass = traitCollection.verticalSizeClass; + asyncTraitCollection.userInterfaceIdiom = traitCollection.userInterfaceIdiom; + if (AS_AT_LEAST_IOS9) { + asyncTraitCollection.forceTouchCapability = traitCollection.forceTouchCapability; + } + } + return asyncTraitCollection; +} + +BOOL ASEnvironmentTraitCollectionIsEqualToASEnvironmentTraitCollection(ASEnvironmentTraitCollection lhs, ASEnvironmentTraitCollection rhs) +{ + return + lhs.verticalSizeClass == rhs.verticalSizeClass && + lhs.horizontalSizeClass == rhs.horizontalSizeClass && + lhs.displayScale == rhs.displayScale && + lhs.userInterfaceIdiom == rhs.userInterfaceIdiom && + lhs.forceTouchCapability == rhs.forceTouchCapability && + lhs.displayContext == rhs.displayContext; +} + +ASEnvironmentState ASEnvironmentStateMakeDefault() +{ + return (ASEnvironmentState) { + .layoutOptionsState = _ASEnvironmentLayoutOptionsStateMakeDefault(), + .hierarchyState = _ASEnvironmentHierarchyStateMakeDefault(), + .environmentTraitCollection = _ASEnvironmentTraitCollectionMakeDefault() + }; +} + diff --git a/AsyncDisplayKit/Details/ASFlowLayoutController.h b/AsyncDisplayKit/Details/ASFlowLayoutController.h index a0845ed2d9..de87c11f4e 100644 --- a/AsyncDisplayKit/Details/ASFlowLayoutController.h +++ b/AsyncDisplayKit/Details/ASFlowLayoutController.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASFlowLayoutController.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/Details/ASFlowLayoutController.mm b/AsyncDisplayKit/Details/ASFlowLayoutController.mm index 500bc1ae51..cb754bb9bf 100644 --- a/AsyncDisplayKit/Details/ASFlowLayoutController.mm +++ b/AsyncDisplayKit/Details/ASFlowLayoutController.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASFlowLayoutController.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASFlowLayoutController.h" #import "ASAssert.h" diff --git a/AsyncDisplayKit/Details/ASHighlightOverlayLayer.h b/AsyncDisplayKit/Details/ASHighlightOverlayLayer.h index 6b5f7913ce..6f80b2996b 100644 --- a/AsyncDisplayKit/Details/ASHighlightOverlayLayer.h +++ b/AsyncDisplayKit/Details/ASHighlightOverlayLayer.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASHighlightOverlayLayer.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/ASHighlightOverlayLayer.mm b/AsyncDisplayKit/Details/ASHighlightOverlayLayer.mm index 1308fa4557..8398207d2f 100644 --- a/AsyncDisplayKit/Details/ASHighlightOverlayLayer.mm +++ b/AsyncDisplayKit/Details/ASHighlightOverlayLayer.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASHighlightOverlayLayer.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASHighlightOverlayLayer.h" diff --git a/AsyncDisplayKit/Details/ASImageContainerProtocolCategories.h b/AsyncDisplayKit/Details/ASImageContainerProtocolCategories.h index dfe9e163c2..f7a433faae 100644 --- a/AsyncDisplayKit/Details/ASImageContainerProtocolCategories.h +++ b/AsyncDisplayKit/Details/ASImageContainerProtocolCategories.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Garrett Moon on 3/18/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/Details/ASImageContainerProtocolCategories.m b/AsyncDisplayKit/Details/ASImageContainerProtocolCategories.m index 90b3da6f65..4c006a3636 100644 --- a/AsyncDisplayKit/Details/ASImageContainerProtocolCategories.m +++ b/AsyncDisplayKit/Details/ASImageContainerProtocolCategories.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Garrett Moon on 3/18/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASImageContainerProtocolCategories.h" diff --git a/AsyncDisplayKit/Details/ASImageProtocols.h b/AsyncDisplayKit/Details/ASImageProtocols.h index 3dc5568d06..676ef4196c 100644 --- a/AsyncDisplayKit/Details/ASImageProtocols.h +++ b/AsyncDisplayKit/Details/ASImageProtocols.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASImageProtocols.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import @@ -61,9 +63,18 @@ typedef void(^ASImageCacherCompletion)(id _Nullable i @end +/** + @param image The image that was downloaded, if the image could be successfully downloaded; nil otherwise. + @param error An error describing why the download of `URL` failed, if the download failed; nil otherwise. + @param downloadIdentifier The identifier for the download task that completed. + */ typedef void(^ASImageDownloaderCompletion)(id _Nullable image, NSError * _Nullable error, id _Nullable downloadIdentifier); + +/** + @param progress The progress of the download, in the range of (0.0, 1.0), inclusive. + */ typedef void(^ASImageDownloaderProgress)(CGFloat progress); -typedef void(^ASImageDownloaderProgressImage)(UIImage *progressImage, id _Nullable downloadIdentifier); +typedef void(^ASImageDownloaderProgressImage)(UIImage *progressImage, CGFloat progress, id _Nullable downloadIdentifier); typedef NS_ENUM(NSUInteger, ASImageDownloaderPriority) { ASImageDownloaderPriorityPreload = 0, @@ -98,10 +109,7 @@ typedef NS_ENUM(NSUInteger, ASImageDownloaderPriority) { @param URL The URL of the image to download. @param callbackQueue The queue to call `downloadProgressBlock` and `completion` on. @param downloadProgress The block to be invoked when the download of `URL` progresses. - @param progress The progress of the download, in the range of (0.0, 1.0), inclusive. @param completion The block to be invoked when the download has completed, or has failed. - @param image The image that was downloaded, if the image could be successfully downloaded; nil otherwise. - @param error An error describing why the download of `URL` failed, if the download failed; nil otherwise. @discussion This method is likely to be called on the main thread, so any custom implementations should make sure to background any expensive download operations. @result An opaque identifier to be used in canceling the download, via `cancelImageDownloadForIdentifier:`. You must retain the identifier if you wish to use it later. @@ -109,7 +117,7 @@ typedef NS_ENUM(NSUInteger, ASImageDownloaderPriority) { - (nullable id)downloadImageWithURL:(NSURL *)URL callbackQueue:(dispatch_queue_t)callbackQueue downloadProgress:(nullable ASImageDownloaderProgress)downloadProgress - completion:(nullable ASImageDownloaderCompletion)completion; + completion:(ASImageDownloaderCompletion)completion; /** @@ -136,21 +144,71 @@ withDownloadIdentifier:(id)downloadIdentifier; @protocol ASAnimatedImageProtocol +@optional + +/** + @abstract Should be called when the objects cover image is ready. + @param coverImageReadyCallback a block which receives the cover image. + */ @property (nonatomic, strong, readwrite) void (^coverImageReadyCallback)(UIImage *coverImage); +/** + @abstract Returns whether the supplied data contains a supported animated image format. + @param data the data to check if contains a supported animated image. + */ +- (BOOL)isDataSupported:(NSData *)data; + + @required +/** + @abstract Return the objects's cover image. + */ @property (nonatomic, readonly) UIImage *coverImage; +/** + @abstract Return a boolean to indicate that the cover image is ready. + */ @property (nonatomic, readonly) BOOL coverImageReady; +/** + @abstract Return the total duration of the animated image's playback. + */ @property (nonatomic, readonly) CFTimeInterval totalDuration; +/** + @abstract Return the interval at which playback should occur. Will be set to a CADisplayLink's frame interval. + */ @property (nonatomic, readonly) NSUInteger frameInterval; +/** + @abstract Return the total number of loops the animated image should play or 0 to loop infinitely. + */ @property (nonatomic, readonly) size_t loopCount; +/** + @abstract Return the total number of frames in the animated image. + */ @property (nonatomic, readonly) size_t frameCount; +/** + @abstract Return YES when playback is ready to occur. + */ @property (nonatomic, readonly) BOOL playbackReady; +/** + @abstract Return any error that has occured. Playback will be paused if this returns non-nil. + */ +@property (nonatomic, readonly) NSError *error; +/** + @abstract Should be called when playback is ready. + */ @property (nonatomic, strong, readwrite) dispatch_block_t playbackReadyCallback; +/** + @abstract Return the image at a given index. + */ - (CGImageRef)imageAtIndex:(NSUInteger)index; +/** + @abstract Return the duration at a given index. + */ - (CFTimeInterval)durationAtIndex:(NSUInteger)index; +/** + @abstract Clear any cached data. Called when playback is paused. + */ - (void)clearAnimatedImageCache; @end diff --git a/AsyncDisplayKit/Details/ASIndexPath.h b/AsyncDisplayKit/Details/ASIndexPath.h index fde2b24018..32ae9f9add 100644 --- a/AsyncDisplayKit/Details/ASIndexPath.h +++ b/AsyncDisplayKit/Details/ASIndexPath.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASIndexPath.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/Details/ASIndexPath.m b/AsyncDisplayKit/Details/ASIndexPath.m index d59a8bb8e1..8c2234e639 100644 --- a/AsyncDisplayKit/Details/ASIndexPath.m +++ b/AsyncDisplayKit/Details/ASIndexPath.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASIndexPath.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASIndexPath.h" diff --git a/AsyncDisplayKit/Details/ASIndexedNodeContext.h b/AsyncDisplayKit/Details/ASIndexedNodeContext.h index ed1d2f49ba..b970d3e997 100644 --- a/AsyncDisplayKit/Details/ASIndexedNodeContext.h +++ b/AsyncDisplayKit/Details/ASIndexedNodeContext.h @@ -3,19 +3,26 @@ // AsyncDisplayKit // // Created by Huy Nguyen on 2/28/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import +#import @interface ASIndexedNodeContext : NSObject @property (nonatomic, readonly, strong) NSIndexPath *indexPath; @property (nonatomic, readonly, assign) ASSizeRange constrainedSize; +@property (nonatomic, readonly, assign) ASEnvironmentTraitCollection environmentTraitCollection; - (instancetype)initWithNodeBlock:(ASCellNodeBlock)nodeBlock indexPath:(NSIndexPath *)indexPath - constrainedSize:(ASSizeRange)constrainedSize; + constrainedSize:(ASSizeRange)constrainedSize + environmentTraitCollection:(ASEnvironmentTraitCollection)environmentTraitCollection; /** * Returns a node allocated by executing node block. Node block will be nil out immediately. diff --git a/AsyncDisplayKit/Details/ASIndexedNodeContext.m b/AsyncDisplayKit/Details/ASIndexedNodeContext.mm similarity index 57% rename from AsyncDisplayKit/Details/ASIndexedNodeContext.m rename to AsyncDisplayKit/Details/ASIndexedNodeContext.mm index b6038137d6..a009d2cbcc 100644 --- a/AsyncDisplayKit/Details/ASIndexedNodeContext.m +++ b/AsyncDisplayKit/Details/ASIndexedNodeContext.mm @@ -1,12 +1,18 @@ // -// ASIndexedNodeContext.m +// ASIndexedNodeContext.mm // AsyncDisplayKit // // Created by Huy Nguyen on 2/28/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASIndexedNodeContext.h" +#import "ASEnvironmentInternal.h" +#import "ASCellNode.h" @interface ASIndexedNodeContext () @@ -19,7 +25,8 @@ - (instancetype)initWithNodeBlock:(ASCellNodeBlock)nodeBlock indexPath:(NSIndexPath *)indexPath - constrainedSize:(ASSizeRange)constrainedSize; + constrainedSize:(ASSizeRange)constrainedSize + environmentTraitCollection:(ASEnvironmentTraitCollection)environmentTraitCollection { NSAssert(nodeBlock != nil && indexPath != nil, @"Node block and index path must not be nil"); self = [super init]; @@ -27,6 +34,7 @@ _nodeBlock = nodeBlock; _indexPath = indexPath; _constrainedSize = constrainedSize; + _environmentTraitCollection = environmentTraitCollection; } return self; } @@ -36,6 +44,7 @@ NSAssert(_nodeBlock != nil, @"Node block is gone. Should not execute it more than once"); ASCellNode *node = _nodeBlock(); _nodeBlock = nil; + ASEnvironmentStatePropagateDown(node, _environmentTraitCollection); return node; } diff --git a/AsyncDisplayKit/Details/ASLayoutController.h b/AsyncDisplayKit/Details/ASLayoutController.h index 8cf34effd0..759c230e20 100644 --- a/AsyncDisplayKit/Details/ASLayoutController.h +++ b/AsyncDisplayKit/Details/ASLayoutController.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASLayoutController.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/ASLayoutRangeType.h b/AsyncDisplayKit/Details/ASLayoutRangeType.h index 1b1e3a3c16..9583a947d1 100644 --- a/AsyncDisplayKit/Details/ASLayoutRangeType.h +++ b/AsyncDisplayKit/Details/ASLayoutRangeType.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASLayoutRangeType.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/ASMainSerialQueue.h b/AsyncDisplayKit/Details/ASMainSerialQueue.h index 77e05d579e..30cf29bbaa 100644 --- a/AsyncDisplayKit/Details/ASMainSerialQueue.h +++ b/AsyncDisplayKit/Details/ASMainSerialQueue.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Garrett Moon on 12/11/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/Details/ASMainSerialQueue.mm b/AsyncDisplayKit/Details/ASMainSerialQueue.mm index 3112757af0..ffd46fc21e 100644 --- a/AsyncDisplayKit/Details/ASMainSerialQueue.mm +++ b/AsyncDisplayKit/Details/ASMainSerialQueue.mm @@ -1,9 +1,13 @@ // -// ASMainSerialQueue.m +// ASMainSerialQueue.mm // AsyncDisplayKit // // Created by Garrett Moon on 12/11/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASMainSerialQueue.h" diff --git a/AsyncDisplayKit/Details/ASMutableAttributedStringBuilder.h b/AsyncDisplayKit/Details/ASMutableAttributedStringBuilder.h index 4df67ada23..0fdda5b829 100644 --- a/AsyncDisplayKit/Details/ASMutableAttributedStringBuilder.h +++ b/AsyncDisplayKit/Details/ASMutableAttributedStringBuilder.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASMutableAttributedStringBuilder.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/ASMutableAttributedStringBuilder.m b/AsyncDisplayKit/Details/ASMutableAttributedStringBuilder.m index d8fbd2fb42..87072c36a6 100644 --- a/AsyncDisplayKit/Details/ASMutableAttributedStringBuilder.m +++ b/AsyncDisplayKit/Details/ASMutableAttributedStringBuilder.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASMutableAttributedStringBuilder.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASMutableAttributedStringBuilder.h" diff --git a/AsyncDisplayKit/Details/ASPINRemoteImageDownloader.h b/AsyncDisplayKit/Details/ASPINRemoteImageDownloader.h index 12c6b27376..1c2d4ee5f3 100644 --- a/AsyncDisplayKit/Details/ASPINRemoteImageDownloader.h +++ b/AsyncDisplayKit/Details/ASPINRemoteImageDownloader.h @@ -3,14 +3,29 @@ // AsyncDisplayKit // // Created by Garrett Moon on 2/5/16. -// Copyright Β© 2016 Facebook. All rights reserved. // +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#if PIN_REMOTE_IMAGE #import #import "ASImageProtocols.h" +#import + +NS_ASSUME_NONNULL_BEGIN @interface ASPINRemoteImageDownloader : NSObject -+ (instancetype)sharedDownloader; ++ (ASPINRemoteImageDownloader *)sharedDownloader; + +- (PINRemoteImageManager *)sharedPINRemoteImageManager; @end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/AsyncDisplayKit/Details/ASPINRemoteImageDownloader.m b/AsyncDisplayKit/Details/ASPINRemoteImageDownloader.m index 1716006f5f..99fad4ecc4 100644 --- a/AsyncDisplayKit/Details/ASPINRemoteImageDownloader.m +++ b/AsyncDisplayKit/Details/ASPINRemoteImageDownloader.m @@ -3,10 +3,14 @@ // AsyncDisplayKit // // Created by Garrett Moon on 2/5/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // -#ifdef PIN_REMOTE_IMAGE +#if PIN_REMOTE_IMAGE #import "ASPINRemoteImageDownloader.h" #import "ASAssert.h" @@ -56,6 +60,11 @@ return self.fileReady; } +- (BOOL)isDataSupported:(NSData *)data +{ + return [data pin_isGIF]; +} + @end #endif @@ -76,7 +85,23 @@ static PINRemoteImageManager *sharedPINRemoteImageManager = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ + #if PIN_ANIMATED_AVAILABLE + // Check that Carthage users have linked both PINRemoteImage & PINCache by testing for one file each + if (!(NSClassFromString(@"PINRemoteImageManager"))) { + NSException *e = [NSException + exceptionWithName:@"FrameworkSetupException" + reason:@"Missing the path to the PINRemoteImage framework." + userInfo:nil]; + @throw e; + } + if (!(NSClassFromString(@"PINCache"))) { + NSException *e = [NSException + exceptionWithName:@"FrameworkSetupException" + reason:@"Missing the path to the PINCache framework." + userInfo:nil]; + @throw e; + } sharedPINRemoteImageManager = [[PINRemoteImageManager alloc] initWithSessionConfiguration:nil alternativeRepresentationProvider:self]; #else sharedPINRemoteImageManager = [[PINRemoteImageManager alloc] initWithSessionConfiguration:nil]; @@ -96,8 +121,9 @@ - (id )synchronouslyFetchedCachedImageWithURL:(NSURL *)URL; { - NSString *key = [[self sharedPINRemoteImageManager] cacheKeyForURL:URL processorKey:nil]; - PINRemoteImageManagerResult *result = [[self sharedPINRemoteImageManager] synchronousImageFromCacheWithCacheKey:key options:PINRemoteImageManagerDownloadOptionsSkipDecode]; + PINRemoteImageManager *manager = [self sharedPINRemoteImageManager]; + NSString *key = [manager cacheKeyForURL:URL processorKey:nil]; + PINRemoteImageManagerResult *result = [manager synchronousImageFromCacheWithCacheKey:key options:PINRemoteImageManagerDownloadOptionsSkipDecode]; #if PIN_ANIMATED_AVAILABLE if (result.alternativeRepresentation) { return result.alternativeRepresentation; @@ -133,7 +159,18 @@ downloadProgress:(ASImageDownloaderProgress)downloadProgress completion:(ASImageDownloaderCompletion)completion; { - return [[self sharedPINRemoteImageManager] downloadImageWithURL:URL options:PINRemoteImageManagerDownloadOptionsSkipDecode completion:^(PINRemoteImageManagerResult *result) { + return [[self sharedPINRemoteImageManager] downloadImageWithURL:URL options:PINRemoteImageManagerDownloadOptionsSkipDecode progressDownload:^(int64_t completedBytes, int64_t totalBytes) { + if (downloadProgress == nil) { return; } + + /// If we're targeting the main queue and we're on the main thread, call immediately. + if (ASDisplayNodeThreadIsMain() && callbackQueue == dispatch_get_main_queue()) { + downloadProgress(totalBytes / (CGFloat)completedBytes); + } else { + dispatch_async(callbackQueue, ^{ + downloadProgress(totalBytes / (CGFloat)completedBytes); + }); + } + } completion:^(PINRemoteImageManagerResult * _Nonnull result) { /// If we're targeting the main queue and we're on the main thread, complete immediately. if (ASDisplayNodeThreadIsMain() && callbackQueue == dispatch_get_main_queue()) { #if PIN_ANIMATED_AVAILABLE @@ -174,7 +211,7 @@ if (progressBlock) { [[self sharedPINRemoteImageManager] setProgressImageCallback:^(PINRemoteImageManagerResult * _Nonnull result) { dispatch_async(callbackQueue, ^{ - progressBlock(result.image, result.UUID); + progressBlock(result.image, result.renderedImageQuality, result.UUID); }); } ofTaskWithUUID:downloadIdentifier]; } else { diff --git a/AsyncDisplayKit/Details/ASPhotosFrameworkImageRequest.h b/AsyncDisplayKit/Details/ASPhotosFrameworkImageRequest.h index 96c2f4b2ea..d54d17ba11 100644 --- a/AsyncDisplayKit/Details/ASPhotosFrameworkImageRequest.h +++ b/AsyncDisplayKit/Details/ASPhotosFrameworkImageRequest.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Adlai Holler on 9/25/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #if TARGET_OS_IOS #import diff --git a/AsyncDisplayKit/Details/ASPhotosFrameworkImageRequest.m b/AsyncDisplayKit/Details/ASPhotosFrameworkImageRequest.m index 1245e32547..79a1c060c3 100644 --- a/AsyncDisplayKit/Details/ASPhotosFrameworkImageRequest.m +++ b/AsyncDisplayKit/Details/ASPhotosFrameworkImageRequest.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Adlai Holler on 9/25/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #if TARGET_OS_IOS #import "ASPhotosFrameworkImageRequest.h" diff --git a/AsyncDisplayKit/Details/ASRangeController.h b/AsyncDisplayKit/Details/ASRangeController.h index bba570d0e6..c79124a961 100644 --- a/AsyncDisplayKit/Details/ASRangeController.h +++ b/AsyncDisplayKit/Details/ASRangeController.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASRangeController.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -144,6 +146,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)rangeController:(ASRangeController * )rangeController didEndUpdatesAnimated:(BOOL)animated completion:(void (^)(BOOL))completion; +/** + * Completed updates to cell node addition and removal. + * + * @param rangeController Sender. + */ +- (void)didCompleteUpdatesInRangeController:(ASRangeController *)rangeController; + /** * Called for nodes insertion. * diff --git a/AsyncDisplayKit/Details/ASRangeController.mm b/AsyncDisplayKit/Details/ASRangeController.mm index 7935564a3d..6c84935540 100644 --- a/AsyncDisplayKit/Details/ASRangeController.mm +++ b/AsyncDisplayKit/Details/ASRangeController.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASRangeController.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASRangeController.h" @@ -95,7 +97,7 @@ static UIApplicationState __ApplicationState = UIApplicationStateActive; { _scrollDirection = scrollDirection; - // Perform update immediately, so that cells receive a visibilityDidChange: call before their first pixel is visible. + // Perform update immediately, so that cells receive a visibleStateDidChange: call before their first pixel is visible. [self scheduleRangeUpdate]; } @@ -331,6 +333,7 @@ static UIApplicationState __ApplicationState = UIApplicationStateActive; [modifiedIndexPaths sortUsingSelector:@selector(compare:)]; NSLog(@"Range update complete; modifiedIndexPaths: %@", [self descriptionWithIndexPaths:modifiedIndexPaths]); #endif + [_delegate didCompleteUpdatesInRangeController:self]; } #pragma mark - Notification observers diff --git a/AsyncDisplayKit/Details/ASRangeControllerUpdateRangeProtocol+Beta.h b/AsyncDisplayKit/Details/ASRangeControllerUpdateRangeProtocol+Beta.h index 4f34cd1cef..09b10cd478 100644 --- a/AsyncDisplayKit/Details/ASRangeControllerUpdateRangeProtocol+Beta.h +++ b/AsyncDisplayKit/Details/ASRangeControllerUpdateRangeProtocol+Beta.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASRangeControllerUpdateRangeProtocol+Beta.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayoutRangeType.h" #import "ASViewController.h" diff --git a/AsyncDisplayKit/Details/ASScrollDirection.h b/AsyncDisplayKit/Details/ASScrollDirection.h index d0192e1408..7375e5d9be 100644 --- a/AsyncDisplayKit/Details/ASScrollDirection.h +++ b/AsyncDisplayKit/Details/ASScrollDirection.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASScrollDirection.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/ASScrollDirection.m b/AsyncDisplayKit/Details/ASScrollDirection.m index 778eabffbb..9e9a927c85 100644 --- a/AsyncDisplayKit/Details/ASScrollDirection.m +++ b/AsyncDisplayKit/Details/ASScrollDirection.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASScrollDirection.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASScrollDirection.h" diff --git a/AsyncDisplayKit/Details/ASThread.h b/AsyncDisplayKit/Details/ASThread.h index 38b534d374..c88437d4ae 100644 --- a/AsyncDisplayKit/Details/ASThread.h +++ b/AsyncDisplayKit/Details/ASThread.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASThread.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once diff --git a/AsyncDisplayKit/Details/ASTraitCollection.h b/AsyncDisplayKit/Details/ASTraitCollection.h new file mode 100644 index 0000000000..9524886d0f --- /dev/null +++ b/AsyncDisplayKit/Details/ASTraitCollection.h @@ -0,0 +1,55 @@ +// +// ASTraitCollection.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import +#import + +@interface ASTraitCollection : NSObject + +@property (nonatomic, assign, readonly) CGFloat displayScale; +@property (nonatomic, assign, readonly) UIUserInterfaceSizeClass horizontalSizeClass; +@property (nonatomic, assign, readonly) UIUserInterfaceIdiom userInterfaceIdiom; +@property (nonatomic, assign, readonly) UIUserInterfaceSizeClass verticalSizeClass; +@property (nonatomic, assign, readonly) UIForceTouchCapability forceTouchCapability; + +/** + * An optional context to pass along with an ASTraitCollection. + * This can be used to pass any internal state to all subnodes via the ASTraitCollection that is not + * included in UITraitCollection. This could range from more fine-tuned size classes to a class of + * constants that is based upon the new trait collection. + * + * Be aware that internally this context is held by a C struct which cannot retain the pointer. + * ASTraitCollection is generally a very short-lived class, existing only to provide a non-struct API + * to trait collections. When an ASTraitCollection is returned via one of ASViewController's 2 + * custom trait collection creation blocks, traitCollectionContext is assigned to the VC's traitCollectionContext. + * This makes sure that the VC is the owner of the context and ASEnvironmentTraitCollections will not + * have a reference to a dangling pointer. + */ +@property (nonatomic, strong, readonly) id traitCollectionContext; + + ++ (ASTraitCollection *)traitCollectionWithASEnvironmentTraitCollection:(ASEnvironmentTraitCollection)traits; + ++ (ASTraitCollection *)traitCollectionWithUITraitCollection:(UITraitCollection *)traitCollection + traitCollectionContext:(id)traitCollectionContext; + + ++ (ASTraitCollection *)traitCollectionWithDisplayScale:(CGFloat)displayScale + userInterfaceIdiom:(UIUserInterfaceIdiom)userInterfaceIdiom + horizontalSizeClass:(UIUserInterfaceSizeClass)horizontalSizeClass + verticalSizeClass:(UIUserInterfaceSizeClass)verticalSizeClass + forceTouchCapability:(UIForceTouchCapability)forceTouchCapability + traitCollectionContext:(id)traitCollectionContext; + + +- (ASEnvironmentTraitCollection)environmentTraitCollection; +- (BOOL)isEqualToTraitCollection:(ASTraitCollection *)traitCollection; + +@end diff --git a/AsyncDisplayKit/Details/ASTraitCollection.m b/AsyncDisplayKit/Details/ASTraitCollection.m new file mode 100644 index 0000000000..49fb94c780 --- /dev/null +++ b/AsyncDisplayKit/Details/ASTraitCollection.m @@ -0,0 +1,112 @@ +// +// ASTraitCollection.m +// AsyncDisplayKit +// +// Created by Ricky Cancro on 5/4/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import "ASTraitCollection.h" +#import +#import + +@implementation ASTraitCollection + +- (instancetype)initWithDisplayScale:(CGFloat)displayScale + userInterfaceIdiom:(UIUserInterfaceIdiom)userInterfaceIdiom + horizontalSizeClass:(UIUserInterfaceSizeClass)horizontalSizeClass + verticalSizeClass:(UIUserInterfaceSizeClass)verticalSizeClass + forceTouchCapability:(UIForceTouchCapability)forceTouchCapability + traitCollectionContext:(id)traitCollectionContext +{ + self = [super init]; + if (self) { + _displayScale = displayScale; + _userInterfaceIdiom = userInterfaceIdiom; + _horizontalSizeClass = horizontalSizeClass; + _verticalSizeClass = verticalSizeClass; + _forceTouchCapability = forceTouchCapability; + _traitCollectionContext = traitCollectionContext; + } + return self; +} + ++ (ASTraitCollection *)traitCollectionWithDisplayScale:(CGFloat)displayScale + userInterfaceIdiom:(UIUserInterfaceIdiom)userInterfaceIdiom + horizontalSizeClass:(UIUserInterfaceSizeClass)horizontalSizeClass + verticalSizeClass:(UIUserInterfaceSizeClass)verticalSizeClass + forceTouchCapability:(UIForceTouchCapability)forceTouchCapability + traitCollectionContext:(id)traitCollectionContext +{ + return [[[self class] alloc] initWithDisplayScale:displayScale + userInterfaceIdiom:userInterfaceIdiom + horizontalSizeClass:horizontalSizeClass + verticalSizeClass:verticalSizeClass + forceTouchCapability:forceTouchCapability + traitCollectionContext:traitCollectionContext]; +} + ++ (ASTraitCollection *)traitCollectionWithASEnvironmentTraitCollection:(ASEnvironmentTraitCollection)traits +{ + return [[[self class] alloc] initWithDisplayScale:traits.displayScale + userInterfaceIdiom:traits.userInterfaceIdiom + horizontalSizeClass:traits.horizontalSizeClass + verticalSizeClass:traits.verticalSizeClass + forceTouchCapability:traits.forceTouchCapability + traitCollectionContext:traits.displayContext]; + +} + ++ (ASTraitCollection *)traitCollectionWithUITraitCollection:(UITraitCollection *)traitCollection + traitCollectionContext:(id)traitCollectionContext +{ + ASTraitCollection *asyncTraitCollection = nil; + if (AS_AT_LEAST_IOS9) { + asyncTraitCollection = [[[self class] alloc] initWithDisplayScale:traitCollection.displayScale + userInterfaceIdiom:traitCollection.userInterfaceIdiom + horizontalSizeClass:traitCollection.horizontalSizeClass + verticalSizeClass:traitCollection.verticalSizeClass + forceTouchCapability:traitCollection.forceTouchCapability + traitCollectionContext:traitCollectionContext]; + } + else if (AS_AT_LEAST_IOS8) { + asyncTraitCollection = [[[self class] alloc] initWithDisplayScale:traitCollection.displayScale + userInterfaceIdiom:traitCollection.userInterfaceIdiom + horizontalSizeClass:traitCollection.horizontalSizeClass + verticalSizeClass:traitCollection.verticalSizeClass + forceTouchCapability:0 + traitCollectionContext:traitCollectionContext]; + } else { + asyncTraitCollection = [[[self class] alloc] init]; + } + + return asyncTraitCollection; +} + +- (ASEnvironmentTraitCollection)environmentTraitCollection +{ + return (ASEnvironmentTraitCollection) { + .displayScale = self.displayScale, + .horizontalSizeClass = self.horizontalSizeClass, + .userInterfaceIdiom = self.userInterfaceIdiom, + .verticalSizeClass = self.verticalSizeClass, + .forceTouchCapability = self.forceTouchCapability, + .displayContext = self.traitCollectionContext, + }; +} + +- (BOOL)isEqualToTraitCollection:(ASTraitCollection *)traitCollection +{ + return self.displayScale == traitCollection.displayScale && + self.horizontalSizeClass == traitCollection.horizontalSizeClass && + self.verticalSizeClass == traitCollection.verticalSizeClass && + self.userInterfaceIdiom == traitCollection.userInterfaceIdiom && + self.traitCollectionContext == traitCollection.traitCollectionContext && + self.forceTouchCapability == traitCollection.forceTouchCapability; +} + +@end diff --git a/AsyncDisplayKit/Details/ASWeakProxy.h b/AsyncDisplayKit/Details/ASWeakProxy.h index d0598bb647..1891085238 100644 --- a/AsyncDisplayKit/Details/ASWeakProxy.h +++ b/AsyncDisplayKit/Details/ASWeakProxy.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Garrett Moon on 4/12/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/Details/ASWeakProxy.m b/AsyncDisplayKit/Details/ASWeakProxy.m index e30f4e7e4f..506f274e7a 100644 --- a/AsyncDisplayKit/Details/ASWeakProxy.m +++ b/AsyncDisplayKit/Details/ASWeakProxy.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Garrett Moon on 4/12/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASWeakProxy.h" diff --git a/AsyncDisplayKit/Details/CGRect+ASConvenience.h b/AsyncDisplayKit/Details/CGRect+ASConvenience.h index 26ca6fd431..348a896e14 100644 --- a/AsyncDisplayKit/Details/CGRect+ASConvenience.h +++ b/AsyncDisplayKit/Details/CGRect+ASConvenience.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// CGRect+ASConvenience.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/Details/CGRect+ASConvenience.m b/AsyncDisplayKit/Details/CGRect+ASConvenience.m index d3be682c78..32ca3ca04d 100644 --- a/AsyncDisplayKit/Details/CGRect+ASConvenience.m +++ b/AsyncDisplayKit/Details/CGRect+ASConvenience.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// CGRect+ASConvenience.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "CGRect+ASConvenience.h" #import "ASScrollDirection.h" diff --git a/AsyncDisplayKit/Details/NSMutableAttributedString+TextKitAdditions.h b/AsyncDisplayKit/Details/NSMutableAttributedString+TextKitAdditions.h index cd2dd1eb47..0486bb28c2 100644 --- a/AsyncDisplayKit/Details/NSMutableAttributedString+TextKitAdditions.h +++ b/AsyncDisplayKit/Details/NSMutableAttributedString+TextKitAdditions.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// NSMutableAttributedString+TextKitAdditions.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/NSMutableAttributedString+TextKitAdditions.m b/AsyncDisplayKit/Details/NSMutableAttributedString+TextKitAdditions.m index 87f8221978..e28c014cc2 100644 --- a/AsyncDisplayKit/Details/NSMutableAttributedString+TextKitAdditions.m +++ b/AsyncDisplayKit/Details/NSMutableAttributedString+TextKitAdditions.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// NSMutableAttributedString+TextKitAdditions.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "NSMutableAttributedString+TextKitAdditions.h" diff --git a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransaction.h b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransaction.h index e26d76b98a..4441141295 100644 --- a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransaction.h +++ b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransaction.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASAsyncTransaction.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransaction.mm b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransaction.mm index 5869be4166..5342e34f33 100644 --- a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransaction.mm +++ b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransaction.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASAsyncTransaction.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "_ASAsyncTransaction.h" #import "_ASAsyncTransactionGroup.h" @@ -325,7 +327,7 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance() _callbackQueue = callbackQueue; _completionBlock = [completionBlock copy]; - _state = ASAsyncTransactionStateOpen; + __atomic_store_n(&_state, ASAsyncTransactionStateOpen, __ATOMIC_SEQ_CST); } return self; } @@ -333,7 +335,7 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance() - (void)dealloc { // Uncommitted transactions break our guarantees about releasing completion blocks on callbackQueue. - ASDisplayNodeAssert(_state != ASAsyncTransactionStateOpen, @"Uncommitted ASAsyncTransactions are not allowed"); + ASDisplayNodeAssert(__atomic_load_n(&_state, __ATOMIC_SEQ_CST) != ASAsyncTransactionStateOpen, @"Uncommitted ASAsyncTransactions are not allowed"); if (_group) { _group->release(); } @@ -358,7 +360,7 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance() completion:(asyncdisplaykit_async_transaction_operation_completion_block_t)completion { ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssert(_state == ASAsyncTransactionStateOpen, @"You can only add operations to open transactions"); + ASDisplayNodeAssert(__atomic_load_n(&_state, __ATOMIC_SEQ_CST) == ASAsyncTransactionStateOpen, @"You can only add operations to open transactions"); [self _ensureTransactionData]; @@ -366,7 +368,7 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance() [_operations addObject:operation]; _group->schedule(priority, queue, ^{ @autoreleasepool { - if (_state != ASAsyncTransactionStateCanceled) { + if (__atomic_load_n(&_state, __ATOMIC_SEQ_CST) != ASAsyncTransactionStateCanceled) { _group->enter(); block(^(id value){ operation.value = value; @@ -393,7 +395,7 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance() completion:(asyncdisplaykit_async_transaction_operation_completion_block_t)completion { ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssert(_state == ASAsyncTransactionStateOpen, @"You can only add operations to open transactions"); + ASDisplayNodeAssert(__atomic_load_n(&_state, __ATOMIC_SEQ_CST) == ASAsyncTransactionStateOpen, @"You can only add operations to open transactions"); [self _ensureTransactionData]; @@ -401,7 +403,7 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance() [_operations addObject:operation]; _group->schedule(priority, queue, ^{ @autoreleasepool { - if (_state != ASAsyncTransactionStateCanceled) { + if (__atomic_load_n(&_state, __ATOMIC_SEQ_CST) != ASAsyncTransactionStateCanceled) { operation.value = block(); } } @@ -420,15 +422,15 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance() - (void)cancel { ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssert(_state != ASAsyncTransactionStateOpen, @"You can only cancel a committed or already-canceled transaction"); - _state = ASAsyncTransactionStateCanceled; + ASDisplayNodeAssert(__atomic_load_n(&_state, __ATOMIC_SEQ_CST) != ASAsyncTransactionStateOpen, @"You can only cancel a committed or already-canceled transaction"); + __atomic_store_n(&_state, ASAsyncTransactionStateCanceled, __ATOMIC_SEQ_CST); } - (void)commit { ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssert(_state == ASAsyncTransactionStateOpen, @"You cannot double-commit a transaction"); - _state = ASAsyncTransactionStateCommitted; + ASDisplayNodeAssert(__atomic_load_n(&_state, __ATOMIC_SEQ_CST) == ASAsyncTransactionStateOpen, @"You cannot double-commit a transaction"); + __atomic_store_n(&_state, ASAsyncTransactionStateCommitted, __ATOMIC_SEQ_CST); if ([_operations count] == 0) { // Fast path: if a transaction was opened, but no operations were added, execute completion block synchronously. @@ -449,8 +451,8 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance() - (void)completeTransaction { - if (_state != ASAsyncTransactionStateComplete) { - BOOL isCanceled = (_state == ASAsyncTransactionStateCanceled); + if (__atomic_load_n(&_state, __ATOMIC_SEQ_CST) != ASAsyncTransactionStateComplete) { + BOOL isCanceled = (__atomic_load_n(&_state, __ATOMIC_SEQ_CST) == ASAsyncTransactionStateCanceled); for (ASDisplayNodeAsyncTransactionOperation *operation in _operations) { [operation callAndReleaseCompletionBlock:isCanceled]; } @@ -458,7 +460,7 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance() // Always set _state to Complete, even if we were cancelled, to block any extraneous // calls to this method that may have been scheduled for the next runloop // (e.g. if we needed to force one in this runloop with -waitUntilComplete, but another was already scheduled) - _state = ASAsyncTransactionStateComplete; + __atomic_store_n(&_state, ASAsyncTransactionStateComplete, __ATOMIC_SEQ_CST); if (_completionBlock) { _completionBlock(self, isCanceled); @@ -469,7 +471,7 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance() - (void)waitUntilComplete { ASDisplayNodeAssertMainThread(); - if (_state != ASAsyncTransactionStateComplete) { + if (__atomic_load_n(&_state, __ATOMIC_SEQ_CST) != ASAsyncTransactionStateComplete) { if (_group) { ASDisplayNodeAssertTrue(_callbackQueue == dispatch_get_main_queue()); _group->wait(); @@ -479,9 +481,9 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance() // commit ourselves via the group to avoid double-committing the transaction. // This is only necessary when forcing display work to complete before allowing the runloop // to continue, e.g. in the implementation of -[ASDisplayNode recursivelyEnsureDisplay]. - if (_state == ASAsyncTransactionStateOpen) { + if (__atomic_load_n(&_state, __ATOMIC_SEQ_CST) == ASAsyncTransactionStateOpen) { [_ASAsyncTransactionGroup commit]; - ASDisplayNodeAssert(_state != ASAsyncTransactionStateOpen, @"Transaction should not be open after committing group"); + ASDisplayNodeAssert(__atomic_load_n(&_state, __ATOMIC_SEQ_CST) != ASAsyncTransactionStateOpen, @"Transaction should not be open after committing group"); } // If we needed to commit the group above, -completeTransaction may have already been run. // It is designed to accommodate this by checking _state to ensure it is not complete. @@ -506,7 +508,7 @@ ASAsyncTransactionQueue & ASAsyncTransactionQueue::instance() - (NSString *)description { - return [NSString stringWithFormat:@"<_ASAsyncTransaction: %p - _state = %lu, _group = %p, _operations = %@>", self, (unsigned long)_state, _group, _operations]; + return [NSString stringWithFormat:@"<_ASAsyncTransaction: %p - _state = %lu, _group = %p, _operations = %@>", self, (unsigned long)__atomic_load_n(&_state, __ATOMIC_SEQ_CST), _group, _operations]; } @end diff --git a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer+Private.h b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer+Private.h index 690ce93cd6..ad0eb377c9 100644 --- a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer+Private.h +++ b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer+Private.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASAsyncTransactionContainer+Private.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer.h b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer.h index 9626418804..0d2d583771 100644 --- a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer.h +++ b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASAsyncTransactionContainer.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer.m b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer.m index fd2d02a6b2..58cd9ae7df 100644 --- a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer.m +++ b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionContainer.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASAsyncTransactionContainer.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "_ASAsyncTransactionContainer+Private.h" diff --git a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionGroup.h b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionGroup.h index 198cf3a7f6..ac816b2938 100644 --- a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionGroup.h +++ b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionGroup.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASAsyncTransactionGroup.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionGroup.m b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionGroup.m index 5749ab7591..d9827a139d 100644 --- a/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionGroup.m +++ b/AsyncDisplayKit/Details/Transactions/_ASAsyncTransactionGroup.m @@ -1,10 +1,12 @@ - /* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASAsyncTransactionGroup.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASAssert.h" @@ -82,8 +84,8 @@ static void _transactionGroupRunLoopObserverCallback(CFRunLoopObserverRef observ ASDisplayNodeAssertMainThread(); if ([_containerLayers count]) { - NSHashTable *containerLayersToCommit = [_containerLayers copy]; - [_containerLayers removeAllObjects]; + NSHashTable *containerLayersToCommit = _containerLayers; + _containerLayers = [NSHashTable hashTableWithOptions:NSPointerFunctionsObjectPointerPersonality]; for (CALayer *containerLayer in containerLayersToCommit) { // Note that the act of committing a transaction may open a new transaction, diff --git a/AsyncDisplayKit/Details/UICollectionViewLayout+ASConvenience.h b/AsyncDisplayKit/Details/UICollectionViewLayout+ASConvenience.h index 4710cbdf4b..e064a7d58e 100644 --- a/AsyncDisplayKit/Details/UICollectionViewLayout+ASConvenience.h +++ b/AsyncDisplayKit/Details/UICollectionViewLayout+ASConvenience.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// UICollectionViewLayout+ASConvenience.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/UICollectionViewLayout+ASConvenience.m b/AsyncDisplayKit/Details/UICollectionViewLayout+ASConvenience.m index 9098a96349..9bdb7b6c09 100644 --- a/AsyncDisplayKit/Details/UICollectionViewLayout+ASConvenience.m +++ b/AsyncDisplayKit/Details/UICollectionViewLayout+ASConvenience.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// UICollectionViewLayout+ASConvenience.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "UICollectionViewLayout+ASConvenience.h" diff --git a/AsyncDisplayKit/Details/UIView+ASConvenience.h b/AsyncDisplayKit/Details/UIView+ASConvenience.h index b10e8900b1..cb3e561414 100644 --- a/AsyncDisplayKit/Details/UIView+ASConvenience.h +++ b/AsyncDisplayKit/Details/UIView+ASConvenience.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// UIView+ASConvenience.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/_ASDisplayLayer.h b/AsyncDisplayKit/Details/_ASDisplayLayer.h index 2687de523c..6e8e81ebcc 100644 --- a/AsyncDisplayKit/Details/_ASDisplayLayer.h +++ b/AsyncDisplayKit/Details/_ASDisplayLayer.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASDisplayLayer.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/_ASDisplayLayer.mm b/AsyncDisplayKit/Details/_ASDisplayLayer.mm index e7316e8bd0..8fe1963538 100644 --- a/AsyncDisplayKit/Details/_ASDisplayLayer.mm +++ b/AsyncDisplayKit/Details/_ASDisplayLayer.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASDisplayLayer.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "_ASDisplayLayer.h" diff --git a/AsyncDisplayKit/Details/_ASDisplayView.h b/AsyncDisplayKit/Details/_ASDisplayView.h index d2049a6b14..4e52eb2892 100644 --- a/AsyncDisplayKit/Details/_ASDisplayView.h +++ b/AsyncDisplayKit/Details/_ASDisplayView.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASDisplayView.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/_ASDisplayView.mm b/AsyncDisplayKit/Details/_ASDisplayView.mm index 5c96f43ff2..ba0de48e0f 100644 --- a/AsyncDisplayKit/Details/_ASDisplayView.mm +++ b/AsyncDisplayKit/Details/_ASDisplayView.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASDisplayView.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "_ASDisplayView.h" diff --git a/AsyncDisplayKit/Details/_ASDisplayViewAccessiblity.h b/AsyncDisplayKit/Details/_ASDisplayViewAccessiblity.h index 2a4eca699d..0041d667bf 100644 --- a/AsyncDisplayKit/Details/_ASDisplayViewAccessiblity.h +++ b/AsyncDisplayKit/Details/_ASDisplayViewAccessiblity.h @@ -1,9 +1,11 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASDisplayViewAccessiblity.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Details/_ASDisplayViewAccessiblity.mm b/AsyncDisplayKit/Details/_ASDisplayViewAccessiblity.mm index b08296cee1..57ddef0d59 100644 --- a/AsyncDisplayKit/Details/_ASDisplayViewAccessiblity.mm +++ b/AsyncDisplayKit/Details/_ASDisplayViewAccessiblity.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASDisplayViewAccessiblity.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "_ASDisplayViewAccessiblity.h" #import "_ASDisplayView.h" diff --git a/AsyncDisplayKit/Layout/ASAsciiArtBoxCreator.h b/AsyncDisplayKit/Layout/ASAsciiArtBoxCreator.h index 18a925a780..78463d8e46 100644 --- a/AsyncDisplayKit/Layout/ASAsciiArtBoxCreator.h +++ b/AsyncDisplayKit/Layout/ASAsciiArtBoxCreator.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASAsciiArtBoxCreator.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Layout/ASAsciiArtBoxCreator.m b/AsyncDisplayKit/Layout/ASAsciiArtBoxCreator.m index 5f57b5aa86..e39f836aad 100644 --- a/AsyncDisplayKit/Layout/ASAsciiArtBoxCreator.m +++ b/AsyncDisplayKit/Layout/ASAsciiArtBoxCreator.m @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASAsciiArtBoxCreator.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASAsciiArtBoxCreator.h" diff --git a/AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.h b/AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.h index 9f04490cc3..7d02f100df 100644 --- a/AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.h +++ b/AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASBackgroundLayoutSpec.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.mm b/AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.mm index bbeac0b882..00201a79b9 100644 --- a/AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.mm +++ b/AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASBackgroundLayoutSpec.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASBackgroundLayoutSpec.h" @@ -14,7 +14,8 @@ #import "ASBaseDefines.h" #import "ASLayout.h" -static NSString * const kBackgroundChildKey = @"kBackgroundChildKey"; +static NSUInteger const kForegroundChildIndex = 0; +static NSUInteger const kBackgroundChildIndex = 1; @interface ASBackgroundLayoutSpec () @end @@ -28,7 +29,7 @@ static NSString * const kBackgroundChildKey = @"kBackgroundChildKey"; } ASDisplayNodeAssertNotNil(child, @"Child cannot be nil"); - [self setChild:child]; + [self setChild:child forIndex:kForegroundChildIndex]; self.background = background; return self; } @@ -55,28 +56,20 @@ static NSString * const kBackgroundChildKey = @"kBackgroundChildKey"; contentsLayout.position = CGPointZero; [sublayouts addObject:contentsLayout]; - return [ASLayout layoutWithLayoutableObject:self size:contentsLayout.size sublayouts:sublayouts]; + return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize + size:contentsLayout.size + sublayouts:sublayouts]; } - (void)setBackground:(id)background { - [super setChild:background forIdentifier:kBackgroundChildKey]; + [super setChild:background forIndex:kBackgroundChildIndex]; } - (id)background { - return [super childForIdentifier:kBackgroundChildKey]; -} - -- (void)setChildren:(NSArray *)children -{ - ASDisplayNodeAssert(NO, @"not supported by this layout spec"); -} - -- (NSArray *)children -{ - ASDisplayNodeAssert(NO, @"not supported by this layout spec"); - return nil; + return [super childForIndex:kBackgroundChildIndex]; } @end diff --git a/AsyncDisplayKit/Layout/ASCenterLayoutSpec.h b/AsyncDisplayKit/Layout/ASCenterLayoutSpec.h index 75a48443b7..346f7f69b9 100644 --- a/AsyncDisplayKit/Layout/ASCenterLayoutSpec.h +++ b/AsyncDisplayKit/Layout/ASCenterLayoutSpec.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASCenterLayoutSpec.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Layout/ASCenterLayoutSpec.mm b/AsyncDisplayKit/Layout/ASCenterLayoutSpec.mm index 147142db1c..8a8d7266d7 100644 --- a/AsyncDisplayKit/Layout/ASCenterLayoutSpec.mm +++ b/AsyncDisplayKit/Layout/ASCenterLayoutSpec.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASCenterLayoutSpec.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASCenterLayoutSpec.h" diff --git a/AsyncDisplayKit/Layout/ASDimension.h b/AsyncDisplayKit/Layout/ASDimension.h index 8a09eb5f2e..e0a043c632 100644 --- a/AsyncDisplayKit/Layout/ASDimension.h +++ b/AsyncDisplayKit/Layout/ASDimension.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASDimension.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once #import diff --git a/AsyncDisplayKit/Layout/ASDimension.mm b/AsyncDisplayKit/Layout/ASDimension.mm index 4c7fd0a42b..b07e223f87 100644 --- a/AsyncDisplayKit/Layout/ASDimension.mm +++ b/AsyncDisplayKit/Layout/ASDimension.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASDimension.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASDimension.h" #import "ASAssert.h" diff --git a/AsyncDisplayKit/Layout/ASInsetLayoutSpec.h b/AsyncDisplayKit/Layout/ASInsetLayoutSpec.h index aa320e947d..9584094226 100644 --- a/AsyncDisplayKit/Layout/ASInsetLayoutSpec.h +++ b/AsyncDisplayKit/Layout/ASInsetLayoutSpec.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASInsetLayoutSpec.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Layout/ASInsetLayoutSpec.mm b/AsyncDisplayKit/Layout/ASInsetLayoutSpec.mm index ce7e6b4ea9..685c1a29b0 100644 --- a/AsyncDisplayKit/Layout/ASInsetLayoutSpec.mm +++ b/AsyncDisplayKit/Layout/ASInsetLayoutSpec.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASInsetLayoutSpec.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASInsetLayoutSpec.h" @@ -91,7 +91,9 @@ static CGFloat centerInset(CGFloat outer, CGFloat inner) if (self.child == nil) { ASDisplayNodeAssert(NO, @"Inset spec measured without a child. The spec will do nothing."); - return [ASLayout layoutWithLayoutableObject:self size:CGSizeZero]; + return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize + size:CGSizeZero]; } ASLayout *sublayout = [self.child measureWithSizeRange:insetConstrainedSize]; @@ -112,18 +114,10 @@ static CGFloat centerInset(CGFloat outer, CGFloat inner) sublayout.position = CGPointMake(x, y); - return [ASLayout layoutWithLayoutableObject:self size:computedSize sublayouts:@[sublayout]]; -} - -- (void)setChildren:(NSArray *)children -{ - ASDisplayNodeAssert(NO, @"not supported by this layout spec"); -} - -- (NSArray *)children -{ - ASDisplayNodeAssert(NO, @"not supported by this layout spec"); - return nil; + return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize + size:computedSize + sublayouts:@[sublayout]]; } @end diff --git a/AsyncDisplayKit/Layout/ASLayout.h b/AsyncDisplayKit/Layout/ASLayout.h index af7b99ad23..7b23fd704b 100644 --- a/AsyncDisplayKit/Layout/ASLayout.h +++ b/AsyncDisplayKit/Layout/ASLayout.h @@ -1,18 +1,19 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASLayout.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once #import #import #import +#import NS_ASSUME_NONNULL_BEGIN @@ -20,7 +21,9 @@ extern CGPoint const CGPointNull; extern BOOL CGPointIsNull(CGPoint point); -/** Represents a computed immutable layout tree. */ +/** + * A node in the layout tree that represents the size and position of the object that created it (ASLayoutable). + */ @interface ASLayout : NSObject /** @@ -28,6 +31,11 @@ extern BOOL CGPointIsNull(CGPoint point); */ @property (nonatomic, weak, readonly) id layoutableObject; +/** + * The type of ASLayoutable that created this layout + */ +@property (nonatomic, readonly) ASLayoutableType type; + /** * Size of the current layout */ @@ -40,37 +48,49 @@ extern BOOL CGPointIsNull(CGPoint point); */ @property (nonatomic, readwrite) CGPoint position; +/** + * The size range that was use to determine the size of the layout. + */ +@property (nonatomic, readonly) ASSizeRange constrainedSizeRange; + /** * Array of ASLayouts. Each must have a valid non-null position. */ @property (nonatomic, readonly) NSArray *sublayouts; /** - * A list of sublayouts that were not already flattened. + * Mark the layout dirty for future regeneration. */ -@property (nonatomic, readonly) NSArray *immediateSublayouts; +@property (nonatomic, getter=isDirty) BOOL dirty; /** - * A boolean describing if the current layout has been flattened. + * @abstract Returns a valid frame for the current layout computed with the size and position. + * @discussion Clamps the layout's origin or position to 0 if any of the calculated values are infinite. */ -@property (nonatomic, readonly, getter=isFlattened) BOOL flattened; +@property (nonatomic, readonly) CGRect frame; /** - * Initializer. + * Designated initializer + */ +- (instancetype)initWithLayoutableObject:(id)layoutableObject + constrainedSizeRange:(ASSizeRange)sizeRange + size:(CGSize)size + position:(CGPoint)position + sublayouts:(NSArray *)sublayouts NS_DESIGNATED_INITIALIZER; + +/** + * Convenience class initializer for layout construction. * * @param layoutableObject The backing ASLayoutable object. - * - * @param size The size of this layout. - * - * @param position The position of this layout within its parent (if available). - * - * @param sublayouts Sublayouts belong to the new layout. + * @param size The size of this layout. + * @param position The position of this layout within its parent (if available). + * @param sublayouts Sublayouts belong to the new layout. */ + (instancetype)layoutWithLayoutableObject:(id)layoutableObject + constrainedSizeRange:(ASSizeRange)sizeRange size:(CGSize)size position:(CGPoint)position - sublayouts:(nullable NSArray *)sublayouts - flattened:(BOOL)flattened; + sublayouts:(nullable NSArray *)sublayouts; /** * Convenience initializer that has CGPointNull position. @@ -79,12 +99,11 @@ extern BOOL CGPointIsNull(CGPoint point); * or for creating a sublayout of which the position is yet to be determined. * * @param layoutableObject The backing ASLayoutable object. - * * @param size The size of this layout. - * * @param sublayouts Sublayouts belong to the new layout. */ + (instancetype)layoutWithLayoutableObject:(id)layoutableObject + constrainedSizeRange:(ASSizeRange)sizeRange size:(CGSize)size sublayouts:(nullable NSArray *)sublayouts; @@ -94,41 +113,35 @@ extern BOOL CGPointIsNull(CGPoint point); * or a sublayout of which the position is yet to be determined. * * @param layoutableObject The backing ASLayoutable object. - * * @param size The size of this layout. */ -+ (instancetype)layoutWithLayoutableObject:(id)layoutableObject size:(CGSize)size; ++ (instancetype)layoutWithLayoutableObject:(id)layoutableObject + constrainedSizeRange:(ASSizeRange)sizeRange + size:(CGSize)size; /** * Convenience initializer that is flattened and has CGPointNull position. * * @param layoutableObject The backing ASLayoutable object. - * * @param size The size of this layout. - * * @param sublayouts Sublayouts belong to the new layout. */ + (instancetype)flattenedLayoutWithLayoutableObject:(id)layoutableObject + constrainedSizeRange:(ASSizeRange)sizeRange size:(CGSize)size sublayouts:(nullable NSArray *)sublayouts; /** - * @abstract Evaluates a given predicate block against each object in the receiving layout tree - * and returns a new, 1-level deep layout containing the objects for which the predicate block returns true. - * - * @param predicateBlock The block is applied to a layout to be evaluated. - * The block takes 1 argument: evaluatedLayout - the layout to be evaluated. - * The block returns YES if evaluatedLayout evaluates to true, otherwise NO. - * - * @return A new, 1-level deep layout containing the layouts for which the predicate block returns true. + * Convenience initializer that creates a layout based on the values of the given layout, with a new position + * @param layout The layout to use to create the new layout + * @param position The position of the new layout */ -- (ASLayout *)flattenedLayoutUsingPredicateBlock:(BOOL (^)(ASLayout *evaluatedLayout))predicateBlock; ++ (instancetype)layoutWithLayout:(ASLayout *)layout position:(CGPoint)position; /** - * @abstract Returns a valid frame for the current layout computed with the size and position. - * @discussion Clamps the layout's origin or position to 0 if any of the calculated values are infinite. + * Traverses the existing layout tree and generates a new tree that represents only ASDisplayNode layouts */ -- (CGRect)frame; +- (ASLayout *)filteredNodeLayoutTree; @end diff --git a/AsyncDisplayKit/Layout/ASLayout.mm b/AsyncDisplayKit/Layout/ASLayout.mm index 3d710316ca..ca0033e8be 100644 --- a/AsyncDisplayKit/Layout/ASLayout.mm +++ b/AsyncDisplayKit/Layout/ASLayout.mm @@ -1,17 +1,20 @@ - /* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASLayout.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayout.h" + #import "ASAssert.h" -#import "ASLayoutSpecUtilities.h" +#import "ASDimension.h" #import "ASInternalHelpers.h" +#import "ASLayoutSpecUtilities.h" + #import CGPoint const CGPointNull = {NAN, NAN}; @@ -21,24 +24,35 @@ extern BOOL CGPointIsNull(CGPoint point) return isnan(point.x) && isnan(point.y); } +@interface ASLayout () + +/** + * A boolean describing if the current layout has been flattened. + */ +@property (nonatomic, getter=isFlattened) BOOL flattened; + +@end + @implementation ASLayout -+ (instancetype)layoutWithLayoutableObject:(id)layoutableObject - size:(CGSize)size - position:(CGPoint)position - sublayouts:(NSArray *)sublayouts - flattened:(BOOL)flattened +@dynamic frame, type; + +- (instancetype)initWithLayoutableObject:(id)layoutableObject + constrainedSizeRange:(ASSizeRange)sizeRange + size:(CGSize)size + position:(CGPoint)position + sublayouts:(NSArray *)sublayouts { - ASDisplayNodeAssert(layoutableObject, @"layoutableObject is required."); + self = [super init]; + if (self) { + NSParameterAssert(layoutableObject); #if DEBUG - for (ASLayout *sublayout in sublayouts) { - ASDisplayNodeAssert(!CGPointIsNull(sublayout.position), @"Invalid position is not allowed in sublayout."); - } + for (ASLayout *sublayout in sublayouts) { + ASDisplayNodeAssert(CGPointIsNull(sublayout.position) == NO, @"Invalid position is not allowed in sublayout."); + } #endif - - ASLayout *l = [super new]; - if (l) { - l->_layoutableObject = layoutableObject; + + _layoutableObject = layoutableObject; if (!isValidForLayout(size.width) || !isValidForLayout(size.height)) { ASDisplayNodeAssert(NO, @"layoutSize is invalid and unsafe to provide to Core Animation! Production will force to 0, 0. Size = %@, node = %@", NSStringFromCGSize(size), layoutableObject); @@ -46,85 +60,128 @@ extern BOOL CGPointIsNull(CGPoint point) } else { size = CGSizeMake(ASCeilPixelValue(size.width), ASCeilPixelValue(size.height)); } - l->_size = size; + _constrainedSizeRange = sizeRange; + _size = size; + _dirty = NO; if (CGPointIsNull(position) == NO) { - l->_position = CGPointMake(ASCeilPixelValue(position.x), ASCeilPixelValue(position.y)); + _position = CGPointMake(ASCeilPixelValue(position.x), ASCeilPixelValue(position.y)); } else { - l->_position = position; + _position = position; } - l->_sublayouts = [sublayouts copy]; - l->_flattened = flattened; - - NSMutableArray *result = [NSMutableArray array]; - for (ASLayout *sublayout in l->_sublayouts) { - if (!sublayout.isFlattened) { - [result addObject:sublayout]; - } - } - l->_immediateSublayouts = result; + _sublayouts = sublayouts != nil ? [sublayouts copy] : @[]; + _flattened = NO; } - return l; + return self; +} + +- (instancetype)init +{ + ASDisplayNodeAssert(NO, @"Use the designated initializer"); + return [self init]; +} + +#pragma mark - Class Constructors + ++ (instancetype)layoutWithLayoutableObject:(id)layoutableObject + constrainedSizeRange:(ASSizeRange)sizeRange + size:(CGSize)size + position:(CGPoint)position + sublayouts:(NSArray *)sublayouts +{ + return [[self alloc] initWithLayoutableObject:layoutableObject + constrainedSizeRange:sizeRange + size:size + position:position + sublayouts:sublayouts]; } + (instancetype)layoutWithLayoutableObject:(id)layoutableObject + constrainedSizeRange:(ASSizeRange)sizeRange size:(CGSize)size sublayouts:(NSArray *)sublayouts { - return [self layoutWithLayoutableObject:layoutableObject size:size position:CGPointNull sublayouts:sublayouts flattened:NO]; + return [self layoutWithLayoutableObject:layoutableObject + constrainedSizeRange:sizeRange + size:size + position:CGPointNull + sublayouts:sublayouts]; } -+ (instancetype)layoutWithLayoutableObject:(id)layoutableObject size:(CGSize)size ++ (instancetype)layoutWithLayoutableObject:(id)layoutableObject + constrainedSizeRange:(ASSizeRange)sizeRange + size:(CGSize)size { - return [self layoutWithLayoutableObject:layoutableObject size:size sublayouts:nil]; + return [self layoutWithLayoutableObject:layoutableObject + constrainedSizeRange:sizeRange + size:size + sublayouts:nil]; } + (instancetype)flattenedLayoutWithLayoutableObject:(id)layoutableObject + constrainedSizeRange:(ASSizeRange)sizeRange size:(CGSize)size sublayouts:(nullable NSArray *)sublayouts { - return [self layoutWithLayoutableObject:layoutableObject size:size position:CGPointNull sublayouts:sublayouts flattened:YES]; + return [self layoutWithLayoutableObject:layoutableObject + constrainedSizeRange:sizeRange + size:size + position:CGPointNull + sublayouts:sublayouts]; } -- (ASLayout *)flattenedLayoutUsingPredicateBlock:(BOOL (^)(ASLayout *))predicateBlock ++ (instancetype)layoutWithLayout:(ASLayout *)layout position:(CGPoint)position +{ + return [self layoutWithLayoutableObject:layout.layoutableObject + constrainedSizeRange:layout.constrainedSizeRange + size:layout.size + position:position + sublayouts:layout.sublayouts]; +} + +#pragma mark - Layout Flattening + +- (ASLayout *)filteredNodeLayoutTree { NSMutableArray *flattenedSublayouts = [NSMutableArray array]; struct Context { ASLayout *layout; CGPoint absolutePosition; - BOOL visited; - BOOL flattened; }; // Queue used to keep track of sublayouts while traversing this layout in a BFS fashion. std::queue queue; - queue.push({self, CGPointMake(0, 0), NO, NO}); + queue.push({self, CGPointMake(0, 0)}); while (!queue.empty()) { - Context &context = queue.front(); - if (context.visited) { - queue.pop(); - } else { - context.visited = YES; - - if (predicateBlock(context.layout)) { - [flattenedSublayouts addObject:[ASLayout layoutWithLayoutableObject:context.layout.layoutableObject - size:context.layout.size - position:context.absolutePosition - sublayouts:nil - flattened:context.flattened]]; - } - - for (ASLayout *sublayout in context.layout.sublayouts) { - // Mark layout trees that have already been flattened for future identification of immediate sublayouts - BOOL flattened = context.flattened ? : context.layout.flattened; - queue.push({sublayout, context.absolutePosition + sublayout.position, NO, flattened}); + Context context = queue.front(); + queue.pop(); + + if (self != context.layout && context.layout.type == ASLayoutableTypeDisplayNode) { + ASLayout *layout = [ASLayout layoutWithLayout:context.layout position:context.absolutePosition]; + layout.flattened = YES; + [flattenedSublayouts addObject:layout]; + } + + for (ASLayout *sublayout in context.layout.sublayouts) { + if (sublayout.isFlattened == NO) { + queue.push({sublayout, context.absolutePosition + sublayout.position}); } } } - return [ASLayout flattenedLayoutWithLayoutableObject:_layoutableObject size:_size sublayouts:flattenedSublayouts]; + return [ASLayout layoutWithLayoutableObject:_layoutableObject + constrainedSizeRange:_constrainedSizeRange + size:_size + sublayouts:flattenedSublayouts]; +} + +#pragma mark - Accessors + +- (ASLayoutableType)type +{ + return _layoutableObject.layoutableType; } - (CGRect)frame diff --git a/AsyncDisplayKit/Layout/ASLayoutSpec.h b/AsyncDisplayKit/Layout/ASLayoutSpec.h index dcb9b33246..97f9fe1ca8 100644 --- a/AsyncDisplayKit/Layout/ASLayoutSpec.h +++ b/AsyncDisplayKit/Layout/ASLayoutSpec.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASLayoutSpec.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import @@ -25,6 +25,9 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; +/** + * Parent of the layout spec + */ @property (nullable, nonatomic, weak) id parent; /** @@ -37,10 +40,9 @@ NS_ASSUME_NONNULL_BEGIN * only require a single child. * * For layout specs that require a known number of children (ASBackgroundLayoutSpec, for example) - * a subclass should use this method to set the "primary" child. It can then use setChild:forIdentifier: - * to set any other required children. Ideally a subclass would hide this from the user, and use the - * setChild:forIdentifier: internally. For example, ASBackgroundLayoutSpec exposes a backgroundChild - * property that behind the scenes is calling setChild:forIdentifier:. + * a subclass should use this method to set the "primary" child. This is actually the same as calling + * setChild:forIdentifier:0. All other children should be set by defining convenience methods + * that call setChild:forIdentifier behind the scenes. */ - (void)setChild:(id)child; @@ -49,19 +51,19 @@ NS_ASSUME_NONNULL_BEGIN * * @param child A child to be added. * - * @param identifier An identifier associated with the child. + * @param index An index associated with the child. * * @discussion Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the * responsibility of holding on to the spec children. Some layout specs, like ASInsetLayoutSpec, * only require a single child. * * For layout specs that require a known number of children (ASBackgroundLayoutSpec, for example) - * a subclass should use the setChild method to set the "primary" child. It can then use this method + * a subclass can use the setChild method to set the "primary" child. It should then use this method * to set any other required children. Ideally a subclass would hide this from the user, and use the - * setChild:forIdentifier: internally. For example, ASBackgroundLayoutSpec exposes a backgroundChild - * property that behind the scenes is calling setChild:forIdentifier:. + * setChild:forIndex: internally. For example, ASBackgroundLayoutSpec exposes a backgroundChild + * property that behind the scenes is calling setChild:forIndex:. */ -- (void)setChild:(id)child forIdentifier:(NSString *)identifier; +- (void)setChild:(id)child forIndex:(NSUInteger)index; /** * Adds childen to this layout spec. @@ -91,14 +93,16 @@ NS_ASSUME_NONNULL_BEGIN - (nullable id)child; /** - * Returns the child added to this layout spec using the given identifier. + * Returns the child added to this layout spec using the given index. * - * @param identifier An identifier associated withe the child. + * @param index An identifier associated withe the child. */ -- (nullable id)childForIdentifier:(NSString *)identifier; +- (nullable id)childForIndex:(NSUInteger)index; -/** Returns all children added to this layout spec. */ -- (NSArray> *)children; +/** + * Returns all children added to this layout spec. + */ +- (nullable NSArray> *)children; @end diff --git a/AsyncDisplayKit/Layout/ASLayoutSpec.mm b/AsyncDisplayKit/Layout/ASLayoutSpec.mm index 847b491e13..b0bd8ee8ed 100644 --- a/AsyncDisplayKit/Layout/ASLayoutSpec.mm +++ b/AsyncDisplayKit/Layout/ASLayoutSpec.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASLayoutSpec.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayoutSpec.h" @@ -17,25 +17,26 @@ #import "ASInternalHelpers.h" #import "ASLayout.h" #import "ASThread.h" - +#import "ASTraitCollection.h" #import +#import +#import -static NSString * const kDefaultChildKey = @"kDefaultChildKey"; -static NSString * const kDefaultChildrenKey = @"kDefaultChildrenKey"; +typedef std::map, std::less> ASChildMap; @interface ASLayoutSpec() { ASEnvironmentState _environmentState; ASDN::RecursiveMutex _propertyLock; + ASChildMap _children; } -@property (nonatomic, strong) NSMutableDictionary *layoutChildren; @end @implementation ASLayoutSpec // these dynamic properties all defined in ASLayoutOptionsPrivate.m -@dynamic spacingAfter, spacingBefore, flexGrow, flexShrink, flexBasis, alignSelf, ascender, descender, sizeRange, layoutPosition; -@synthesize layoutChildren = _layoutChildren; +@dynamic spacingAfter, spacingBefore, flexGrow, flexShrink, flexBasis, + alignSelf, ascender, descender, sizeRange, layoutPosition, layoutableType; @synthesize isFinalLayoutable = _isFinalLayoutable; - (instancetype)init @@ -45,15 +46,21 @@ static NSString * const kDefaultChildrenKey = @"kDefaultChildrenKey"; } _isMutable = YES; _environmentState = ASEnvironmentStateMakeDefault(); - return self; } +- (ASLayoutableType)layoutableType +{ + return ASLayoutableTypeLayoutSpec; +} + #pragma mark - Layout - (ASLayout *)measureWithSizeRange:(ASSizeRange)constrainedSize { - return [ASLayout layoutWithLayoutableObject:self size:constrainedSize.min]; + return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize + size:constrainedSize.min]; } - (id)finalLayoutable @@ -95,14 +102,6 @@ static NSString * const kDefaultChildrenKey = @"kDefaultChildrenKey"; return child; } -- (NSMutableDictionary *)layoutChildren -{ - if (!_layoutChildren) { - _layoutChildren = [NSMutableDictionary dictionary]; - } - return _layoutChildren; -} - - (void)setParent:(id)parent { // FIXME: Locking should be evaluated here. _parent is not widely used yet, though. @@ -113,51 +112,67 @@ static NSString * const kDefaultChildrenKey = @"kDefaultChildrenKey"; } } -- (void)setChild:(id)child; -{ - [self setChild:child forIdentifier:kDefaultChildKey]; -} - -- (void)setChild:(id)child forIdentifier:(NSString *)identifier +- (void)setChild:(id)child { ASDisplayNodeAssert(self.isMutable, @"Cannot set properties when layout spec is not mutable"); - id finalLayoutable = [self layoutableToAddFromLayoutable:child]; - self.layoutChildren[identifier] = finalLayoutable; - if ([finalLayoutable isKindOfClass:[ASLayoutSpec class]]) { - [(ASLayoutSpec *)finalLayoutable setParent:self]; // This will trigger upward propogation if needed. - } else if ([self supportsUpwardPropagation]) { - ASEnvironmentStatePropagateUp(self, finalLayoutable.environmentState.layoutOptionsState); // Probably an ASDisplayNode + if (child) { + id finalLayoutable = [self layoutableToAddFromLayoutable:child]; + if (finalLayoutable) { + _children[0] = finalLayoutable; + [self propagateUpLayoutable:finalLayoutable]; + } + } else { + _children.erase(0); } } -- (void)setChildren:(NSArray *)children +- (void)setChild:(id)child forIndex:(NSUInteger)index +{ + ASDisplayNodeAssert(self.isMutable, @"Cannot set properties when layout spec is not mutable"); + if (child) { + id finalLayoutable = [self layoutableToAddFromLayoutable:child]; + _children[index] = finalLayoutable; + } else { + _children.erase(index); + } + // TODO: Should we propagate up the layoutable at it could happen that multiple children will propagated up their + // layout options and one child will overwrite values from another child + // [self propagateUpLayoutable:finalLayoutable]; +} + +- (void)setChildren:(NSArray> *)children { ASDisplayNodeAssert(self.isMutable, @"Cannot set properties when layout spec is not mutable"); - NSMutableArray *finalChildren = [NSMutableArray arrayWithCapacity:children.count]; - for (id child in children) { - [finalChildren addObject:[self layoutableToAddFromLayoutable:child]]; - } - - self.layoutChildren[kDefaultChildrenKey] = [NSArray arrayWithArray:finalChildren]; + _children.clear(); + [children enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + _children[idx] = obj; + }]; } -- (id)childForIdentifier:(NSString *)identifier +- (id)childForIndex:(NSUInteger)index { - return self.layoutChildren[identifier]; + if (index < _children.size()) { + return _children[index]; + } + return nil; } - (id)child { - return self.layoutChildren[kDefaultChildKey]; + return _children[0]; } - (NSArray *)children { - return self.layoutChildren[kDefaultChildrenKey]; + std::vector children; + for (ASChildMap::iterator it = _children.begin(); it != _children.end(); ++it ) { + children.push_back(it->second); + } + + return [NSArray arrayWithObjects:&children[0] count:children.size()]; } - #pragma mark - ASEnvironment - (ASEnvironmentState)environmentState @@ -178,9 +193,39 @@ static NSString * const kDefaultChildrenKey = @"kDefaultChildrenKey"; return ASEnvironmentStatePropagationEnabled(); } +- (BOOL)supportsTraitsCollectionPropagation +{ + return ASEnvironmentStateTraitCollectionPropagationEnabled(); +} + +- (void)propagateUpLayoutable:(id)layoutable +{ + if ([layoutable isKindOfClass:[ASLayoutSpec class]]) { + [(ASLayoutSpec *)layoutable setParent:self]; // This will trigger upward propogation if needed. + } else if ([self supportsUpwardPropagation]) { + ASEnvironmentStatePropagateUp(self, layoutable.environmentState.layoutOptionsState); // Probably an ASDisplayNode + } +} + +- (ASEnvironmentTraitCollection)environmentTraitCollection +{ + return _environmentState.environmentTraitCollection; +} + +- (void)setEnvironmentTraitCollection:(ASEnvironmentTraitCollection)environmentTraitCollection +{ + _environmentState.environmentTraitCollection = environmentTraitCollection; +} + ASEnvironmentLayoutOptionsForwarding ASEnvironmentLayoutExtensibilityForwarding +- (ASTraitCollection *)asyncTraitCollection +{ + ASDN::MutexLocker l(_propertyLock); + return [ASTraitCollection traitCollectionWithASEnvironmentTraitCollection:self.environmentTraitCollection]; +} + @end @implementation ASLayoutSpec (Debugging) diff --git a/AsyncDisplayKit/Layout/ASLayoutValidation.h b/AsyncDisplayKit/Layout/ASLayoutValidation.h new file mode 100644 index 0000000000..d0db9bf18e --- /dev/null +++ b/AsyncDisplayKit/Layout/ASLayoutValidation.h @@ -0,0 +1,86 @@ +// +// ASLayoutValidation.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class ASLayout; + +// Enable or disable automatic layout validation +#define LAYOUT_VALIDATION 0 + +ASDISPLAYNODE_EXTERN_C_BEGIN + +extern void ASLayoutableValidateLayout(ASLayout *layout); + +ASDISPLAYNODE_EXTERN_C_END + +#pragma mark - ASLayoutableValidator + +@protocol ASLayoutableValidator +- (void)validateLayout:(ASLayout *)layout; +@end + +typedef void (^ASLayoutableBlockValidatorBlock)(id layout); + +@interface ASLayoutableBlockValidator : NSObject +@property (nonatomic, copy) ASLayoutableBlockValidatorBlock block; +- (instancetype)initWithBlock:(ASLayoutableBlockValidatorBlock)block NS_DESIGNATED_INITIALIZER; +- (instancetype)init NS_UNAVAILABLE; +@end + +/* + * ASLayoutables that have sizeRange or layoutPosition set needs to be wrapped into a ASStaticLayoutSpec. This + * validator checks if sublayouts has sizeRange or layoutPosition set and is wrapped in a ASStaticLayoutSpec + */ +@interface ASLayoutableStaticValidator : NSObject + +@end + +/* + * ASLayoutables that have spacingBefore, spacingAfter, flexGrow, flexShrink, flexBasis, alignSelf, ascender or descender + * set needs to be wrapped into a ASStackLayout. This validator checks if sublayouts has set one of this properties and + * asserts if it's not wrapped in a ASStackLayout if so. + */ +@interface ASLayoutableStackValidator : NSObject + +@end + +/* + * Not in use at the moment + */ +@interface ASLayoutablePreferredSizeValidator : NSObject + +@end + + +#pragma mark - ASLayoutableValidation + +@interface ASLayoutableValidation : NSObject + +/// Currently registered validators +@property (copy, nonatomic, readonly) NSArray> *validators; + +/// Start from given layout and validates each layout in the layout tree with registered validators +- (void)validateLayout:(ASLayout *)layout; + +/// Register a layout validator +- (void)registerValidator:(id)validator; + +/// Register a layout validator with a block. Method returns the registered ASLayoutableValidator object that can be used to store somewhere and unregister +- (id)registerValidatorWithBlock:(ASLayoutableBlockValidatorBlock)block; + +/// Unregister a validtor +- (void)unregisterValidator:(id)validator; +@end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Layout/ASLayoutValidation.mm b/AsyncDisplayKit/Layout/ASLayoutValidation.mm new file mode 100644 index 0000000000..1aa52133a9 --- /dev/null +++ b/AsyncDisplayKit/Layout/ASLayoutValidation.mm @@ -0,0 +1,229 @@ +// +// ASLayoutValidation.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import "ASLayoutValidation.h" +#import "ASLayout.h" +#import "ASDisplayNode.h" + +#import "ASStaticLayoutSpec.h" +#import "ASStackLayoutSpec.h" + +#import + +#pragma mark - Layout Validation + +void ASLayoutableValidateLayout(ASLayout *layout) { + ASLayoutableValidation *validation = [[ASLayoutableValidation alloc] init]; + [validation registerValidator:[[ASLayoutableStaticValidator alloc] init]]; + [validation registerValidator:[[ASLayoutableStackValidator alloc] init]]; + [validation validateLayout:layout]; +} + +#pragma mark - Helpers + +static NSString *ASLayoutValidationWrappingAssertMessage(SEL selector, id obj, Class cl) { + return [NSString stringWithFormat:@"%@ was set on %@. It is either unecessary or the node needs to be wrapped in a %@", NSStringFromSelector(selector), obj, NSStringFromClass(cl)]; +} + +#pragma mark - ASLayoutableBlockValidator + +@implementation ASLayoutableBlockValidator + +#pragma mark Lifecycle + +- (instancetype)initWithBlock:(ASLayoutableBlockValidatorBlock)block +{ + self = [super init]; + if (self) { + _block = [block copy]; + } + return self; +} + +#pragma mark + +- (void)validateLayout:(ASLayout *)layout +{ + if (self.block) { + self.block(layout); + } +} + +@end + +#pragma mark - ASLayoutableStaticValidator + +@implementation ASLayoutableStaticValidator + +- (void)validateLayout:(ASLayout *)layout +{ + for (ASLayout *sublayout in layout.sublayouts) { + id layoutable = layout.layoutableObject; + id sublayoutLayoutable = sublayout.layoutableObject; + + NSString *assertMessage = nil; + Class stackContainerClass = [ASStaticLayoutSpec class]; + + // Check for default sizeRange and layoutPosition + ASRelativeSizeRange sizeRange = sublayoutLayoutable.sizeRange; + ASRelativeSizeRange zeroSizeRange = ASRelativeSizeRangeMakeWithExactCGSize(CGSizeZero); + + // Currently setting the preferredFrameSize also updates the sizeRange. Create a size range based on the + // preferredFrameSize and check it if it's the same as the current sizeRange to be sure it was not changed manually + CGSize preferredFrameSize = CGSizeZero; + if ([sublayoutLayoutable respondsToSelector:@selector(preferredFrameSize)]) { + preferredFrameSize = [((ASDisplayNode *)sublayoutLayoutable) preferredFrameSize]; + } + ASRelativeSizeRange preferredFrameSizeRange = ASRelativeSizeRangeMakeWithExactCGSize(preferredFrameSize); + + if (ASRelativeSizeRangeEqualToRelativeSizeRange(sizeRange, zeroSizeRange) == NO && + ASRelativeSizeRangeEqualToRelativeSizeRange(sizeRange, preferredFrameSizeRange) == NO) { + assertMessage = ASLayoutValidationWrappingAssertMessage(@selector(sizeRange), sublayoutLayoutable, stackContainerClass); + } else if (!CGPointEqualToPoint(sublayoutLayoutable.layoutPosition, CGPointZero)) { + assertMessage = ASLayoutValidationWrappingAssertMessage(@selector(layoutPosition), sublayoutLayoutable, stackContainerClass); + } + + // Sublayout layoutable should be wrapped in a ASStaticLayoutSpec + if (assertMessage == nil || [layoutable isKindOfClass:stackContainerClass]) { + continue; + } + + ASDisplayNodeCAssert(NO, assertMessage); + } +} + +@end + + +#pragma mark - ASLayoutableStackValidator + +@implementation ASLayoutableStackValidator + +#pragma mark + +- (void)validateLayout:(ASLayout *)layout +{ + id layoutable = layout.layoutableObject; + for (ASLayout *sublayout in layout.sublayouts) { + id sublayoutLayoutable = sublayout.layoutableObject; + + NSString *assertMessage = nil; + Class stackContainerClass = [ASStackLayoutSpec class]; + + // Check if default values related to ASStackLayoutSpec have changed + if (sublayoutLayoutable.spacingBefore != 0) { + assertMessage = ASLayoutValidationWrappingAssertMessage(@selector(spacingBefore), sublayoutLayoutable, stackContainerClass); + } else if (sublayoutLayoutable.spacingAfter != 0) { + assertMessage = ASLayoutValidationWrappingAssertMessage(@selector(spacingAfter), sublayoutLayoutable, stackContainerClass); + } else if (sublayoutLayoutable.flexGrow == YES) { + assertMessage = ASLayoutValidationWrappingAssertMessage(@selector(flexGrow), sublayoutLayoutable, stackContainerClass); + } else if (sublayoutLayoutable.flexShrink == YES) { + assertMessage = ASLayoutValidationWrappingAssertMessage(@selector(flexShrink), sublayoutLayoutable, stackContainerClass); + } else if (!ASRelativeDimensionEqualToRelativeDimension(sublayoutLayoutable.flexBasis, ASRelativeDimensionUnconstrained) ) { + assertMessage = ASLayoutValidationWrappingAssertMessage(@selector(flexBasis), sublayoutLayoutable, stackContainerClass); + } else if (sublayoutLayoutable.alignSelf != ASStackLayoutAlignSelfAuto) { + assertMessage = ASLayoutValidationWrappingAssertMessage(@selector(alignSelf), sublayoutLayoutable, stackContainerClass); + } + + // Sublayout layoutable should be wrapped in a ASStackLayoutSpec + if (assertMessage == nil || [layoutable isKindOfClass:stackContainerClass]) { + continue; + } + + ASDisplayNodeCAssert(NO, assertMessage); + } +} + +@end + +#pragma mark ASLayoutablePreferredSizeValidator + +@implementation ASLayoutablePreferredSizeValidator + +#pragma mark + +- (void)validateLayout:(ASLayout *)layout +{ + // TODO: Implement validation that certain node classes need to have a preferredSize set e.g. ASVideoNode +} + +@end + + +#pragma mark - ASLayoutableValidation + +@interface ASLayoutableValidation () +@end + +@implementation ASLayoutableValidation { + NSMutableArray *_validators; +} + +#pragma mark Lifecycle + +- (instancetype)init +{ + self = [super init]; + if (self) { + _validators = [NSMutableArray array]; + } + return self; +} + +#pragma mark Validator Management + +- (NSArray> *)validators +{ + return [_validators copy]; +} + +- (void)registerValidator:(id)validator +{ + [_validators addObject:validator]; +} + +- (id)registerValidatorWithBlock:(ASLayoutableBlockValidatorBlock)block +{ + ASLayoutableBlockValidator *blockValidator = [[ASLayoutableBlockValidator alloc] initWithBlock:block]; + [_validators addObject:blockValidator]; + return blockValidator; +} + +- (void)unregisterValidator:(id)validator +{ + [_validators removeObject:validator]; +} + +#pragma mark Validation Process + +- (void)validateLayout:(ASLayout *)layout +{ + // Queue used to keep track of sublayouts while traversing this layout in a BFS fashion. + std::queue queue; + queue.push(layout); + + while (!queue.empty()) { + layout = queue.front(); + queue.pop(); + + // Validate layout with all registered validators + for (id validator in self.validators) { + [validator validateLayout:layout]; + } + + // Push sublayouts to queue for validation + for (id sublayout in [layout sublayouts]) { + queue.push(sublayout); + } + + } +} + +@end diff --git a/AsyncDisplayKit/Layout/ASLayoutable.h b/AsyncDisplayKit/Layout/ASLayoutable.h index 325a81535c..1199c89fdf 100644 --- a/AsyncDisplayKit/Layout/ASLayoutable.h +++ b/AsyncDisplayKit/Layout/ASLayoutable.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASLayoutable.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import @@ -21,6 +21,11 @@ @class ASLayout; @class ASLayoutSpec; +typedef NS_ENUM(NSUInteger, ASLayoutableType) { + ASLayoutableTypeLayoutSpec, + ASLayoutableTypeDisplayNode +}; + NS_ASSUME_NONNULL_BEGIN /** @@ -41,6 +46,8 @@ NS_ASSUME_NONNULL_BEGIN */ @protocol ASLayoutable +@property (nonatomic, readonly) ASLayoutableType layoutableType; + /** * @abstract Calculate a layout based on given size range. * @@ -50,7 +57,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (ASLayout *)measureWithSizeRange:(ASSizeRange)constrainedSize; - #pragma mark - Layout options from the Layoutable Protocols #pragma mark - ASStackLayoutable diff --git a/AsyncDisplayKit/Layout/ASLayoutable.mm b/AsyncDisplayKit/Layout/ASLayoutable.mm index 23fd59e9ff..0113150e84 100644 --- a/AsyncDisplayKit/Layout/ASLayoutable.mm +++ b/AsyncDisplayKit/Layout/ASLayoutable.mm @@ -1,9 +1,13 @@ // -// ASLayoutablePrivate.mm +// ASLayoutable.mm // AsyncDisplayKit // // Created by Huy Nguyen on 3/27/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASLayoutablePrivate.h" diff --git a/AsyncDisplayKit/Layout/ASLayoutableExtensibility.h b/AsyncDisplayKit/Layout/ASLayoutableExtensibility.h index 62cadd3ee2..7dce553996 100644 --- a/AsyncDisplayKit/Layout/ASLayoutableExtensibility.h +++ b/AsyncDisplayKit/Layout/ASLayoutableExtensibility.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Michael Schneider on 3/29/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/Layout/ASLayoutablePrivate.h b/AsyncDisplayKit/Layout/ASLayoutablePrivate.h index 84ed0fe81d..36031ca96f 100644 --- a/AsyncDisplayKit/Layout/ASLayoutablePrivate.h +++ b/AsyncDisplayKit/Layout/ASLayoutablePrivate.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASLayoutablePrivate.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -90,142 +90,112 @@ extern void ASLayoutableClearCurrentContext(); \ - (CGFloat)spacingAfter\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _environmentState.layoutOptionsState.spacingAfter;\ }\ \ - (void)setSpacingAfter:(CGFloat)spacingAfter\ {\ - _propertyLock.lock();\ _environmentState.layoutOptionsState.spacingAfter = spacingAfter;\ [self propagateUpLayoutOptionsState];\ - _propertyLock.unlock();\ }\ \ - (CGFloat)spacingBefore\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _environmentState.layoutOptionsState.spacingBefore;\ }\ \ - (void)setSpacingBefore:(CGFloat)spacingBefore\ {\ - _propertyLock.lock();\ _environmentState.layoutOptionsState.spacingBefore = spacingBefore;\ [self propagateUpLayoutOptionsState];\ - _propertyLock.unlock();\ }\ \ - (BOOL)flexGrow\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _environmentState.layoutOptionsState.flexGrow;\ }\ \ - (void)setFlexGrow:(BOOL)flexGrow\ {\ - _propertyLock.lock();\ _environmentState.layoutOptionsState.flexGrow = flexGrow;\ [self propagateUpLayoutOptionsState];\ - _propertyLock.unlock();\ }\ \ - (BOOL)flexShrink\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _environmentState.layoutOptionsState.flexShrink;\ }\ \ - (void)setFlexShrink:(BOOL)flexShrink\ {\ - _propertyLock.lock();\ _environmentState.layoutOptionsState.flexShrink = flexShrink;\ [self propagateUpLayoutOptionsState];\ - _propertyLock.unlock();\ }\ \ - (ASRelativeDimension)flexBasis\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _environmentState.layoutOptionsState.flexBasis;\ }\ \ - (void)setFlexBasis:(ASRelativeDimension)flexBasis\ {\ - _propertyLock.lock();\ _environmentState.layoutOptionsState.flexBasis = flexBasis;\ [self propagateUpLayoutOptionsState];\ - _propertyLock.unlock();\ }\ \ - (ASStackLayoutAlignSelf)alignSelf\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _environmentState.layoutOptionsState.alignSelf;\ }\ \ - (void)setAlignSelf:(ASStackLayoutAlignSelf)alignSelf\ {\ - _propertyLock.lock();\ _environmentState.layoutOptionsState.alignSelf = alignSelf;\ [self propagateUpLayoutOptionsState];\ - _propertyLock.unlock();\ }\ \ - (CGFloat)ascender\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _environmentState.layoutOptionsState.ascender;\ }\ \ - (void)setAscender:(CGFloat)ascender\ {\ - _propertyLock.lock();\ _environmentState.layoutOptionsState.ascender = ascender;\ [self propagateUpLayoutOptionsState];\ - _propertyLock.unlock();\ }\ \ - (CGFloat)descender\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _environmentState.layoutOptionsState.descender;\ }\ \ - (void)setDescender:(CGFloat)descender\ {\ - _propertyLock.lock();\ _environmentState.layoutOptionsState.descender = descender;\ [self propagateUpLayoutOptionsState];\ - _propertyLock.unlock();\ }\ \ - (ASRelativeSizeRange)sizeRange\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _environmentState.layoutOptionsState.sizeRange;\ }\ \ - (void)setSizeRange:(ASRelativeSizeRange)sizeRange\ {\ - _propertyLock.lock();\ _environmentState.layoutOptionsState.sizeRange = sizeRange;\ [self propagateUpLayoutOptionsState];\ - _propertyLock.unlock();\ }\ \ - (CGPoint)layoutPosition\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _environmentState.layoutOptionsState.layoutPosition;\ }\ \ - (void)setLayoutPosition:(CGPoint)layoutPosition\ {\ - _propertyLock.lock();\ _environmentState.layoutOptionsState.layoutPosition = layoutPosition;\ [self propagateUpLayoutOptionsState];\ - _propertyLock.unlock();\ }\ @@ -234,39 +204,30 @@ extern void ASLayoutableClearCurrentContext(); #define ASEnvironmentLayoutExtensibilityForwarding \ - (void)setLayoutOptionExtensionBool:(BOOL)value atIndex:(int)idx\ {\ - _propertyLock.lock();\ _ASEnvironmentLayoutOptionsExtensionSetBoolAtIndex(self, idx, value);\ - _propertyLock.unlock();\ }\ \ - (BOOL)layoutOptionExtensionBoolAtIndex:(int)idx\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _ASEnvironmentLayoutOptionsExtensionGetBoolAtIndex(self, idx);\ }\ \ - (void)setLayoutOptionExtensionInteger:(NSInteger)value atIndex:(int)idx\ {\ - _propertyLock.lock();\ _ASEnvironmentLayoutOptionsExtensionSetIntegerAtIndex(self, idx, value);\ - _propertyLock.unlock();\ }\ \ - (NSInteger)layoutOptionExtensionIntegerAtIndex:(int)idx\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _ASEnvironmentLayoutOptionsExtensionGetIntegerAtIndex(self, idx);\ }\ \ - (void)setLayoutOptionExtensionEdgeInsets:(UIEdgeInsets)value atIndex:(int)idx\ {\ - _propertyLock.lock();\ _ASEnvironmentLayoutOptionsExtensionSetEdgeInsetsAtIndex(self, idx, value);\ - _propertyLock.unlock();\ }\ \ - (UIEdgeInsets)layoutOptionExtensionEdgeInsetsAtIndex:(int)idx\ {\ - ASDN::MutexLocker l(_propertyLock);\ return _ASEnvironmentLayoutOptionsExtensionGetEdgeInsetsAtIndex(self, idx);\ }\ diff --git a/AsyncDisplayKit/Layout/ASOverlayLayoutSpec.h b/AsyncDisplayKit/Layout/ASOverlayLayoutSpec.h index 6e1c321bc7..e6b7c62f8b 100644 --- a/AsyncDisplayKit/Layout/ASOverlayLayoutSpec.h +++ b/AsyncDisplayKit/Layout/ASOverlayLayoutSpec.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASOverlayLayoutSpec.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Layout/ASOverlayLayoutSpec.mm b/AsyncDisplayKit/Layout/ASOverlayLayoutSpec.mm index ba580d08b1..669a5ad9eb 100644 --- a/AsyncDisplayKit/Layout/ASOverlayLayoutSpec.mm +++ b/AsyncDisplayKit/Layout/ASOverlayLayoutSpec.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASOverlayLayoutSpec.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASOverlayLayoutSpec.h" @@ -14,7 +14,8 @@ #import "ASBaseDefines.h" #import "ASLayout.h" -static NSString * const kOverlayChildKey = @"kOverlayChildKey"; +static NSUInteger const kUnderlayChildIndex = 0; +static NSUInteger const kOverlayChildIndex = 1; @implementation ASOverlayLayoutSpec @@ -25,7 +26,7 @@ static NSString * const kOverlayChildKey = @"kOverlayChildKey"; } ASDisplayNodeAssertNotNil(child, @"Child that will be overlayed on shouldn't be nil"); self.overlay = overlay; - [self setChild:child]; + [self setChild:child forIndex:kUnderlayChildIndex]; return self; } @@ -36,12 +37,12 @@ static NSString * const kOverlayChildKey = @"kOverlayChildKey"; - (void)setOverlay:(id)overlay { - [super setChild:overlay forIdentifier:kOverlayChildKey]; + [super setChild:overlay forIndex:kOverlayChildIndex]; } - (id)overlay { - return [super childForIdentifier:kOverlayChildKey]; + return [super childForIndex:kOverlayChildIndex]; } /** @@ -58,18 +59,10 @@ static NSString * const kOverlayChildKey = @"kOverlayChildKey"; [sublayouts addObject:overlayLayout]; } - return [ASLayout layoutWithLayoutableObject:self size:contentsLayout.size sublayouts:sublayouts]; -} - -- (void)setChildren:(NSArray *)children -{ - ASDisplayNodeAssert(NO, @"not supported by this layout spec"); -} - -- (NSArray *)children -{ - ASDisplayNodeAssert(NO, @"not supported by this layout spec"); - return nil; + return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize + size:contentsLayout.size + sublayouts:sublayouts]; } @end diff --git a/AsyncDisplayKit/Layout/ASRatioLayoutSpec.h b/AsyncDisplayKit/Layout/ASRatioLayoutSpec.h index f910982985..c596f9cdeb 100644 --- a/AsyncDisplayKit/Layout/ASRatioLayoutSpec.h +++ b/AsyncDisplayKit/Layout/ASRatioLayoutSpec.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASRatioLayoutSpec.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/Layout/ASRatioLayoutSpec.mm b/AsyncDisplayKit/Layout/ASRatioLayoutSpec.mm index 4e04d4ca05..2825101233 100644 --- a/AsyncDisplayKit/Layout/ASRatioLayoutSpec.mm +++ b/AsyncDisplayKit/Layout/ASRatioLayoutSpec.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASRatioLayoutSpec.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASRatioLayoutSpec.h" @@ -72,18 +72,10 @@ const ASSizeRange childRange = (bestSize == sizeOptions.end()) ? constrainedSize : ASSizeRangeMake(*bestSize, *bestSize); ASLayout *sublayout = [self.child measureWithSizeRange:childRange]; sublayout.position = CGPointZero; - return [ASLayout layoutWithLayoutableObject:self size:sublayout.size sublayouts:@[sublayout]]; -} - -- (void)setChildren:(NSArray *)children -{ - ASDisplayNodeAssert(NO, @"not supported by this layout spec"); -} - -- (NSArray *)children -{ - ASDisplayNodeAssert(NO, @"not supported by this layout spec"); - return nil; + return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize + size:sublayout.size + sublayouts:@[sublayout]]; } @end diff --git a/AsyncDisplayKit/Layout/ASRelativeLayoutSpec.h b/AsyncDisplayKit/Layout/ASRelativeLayoutSpec.h index ddc88c0664..d2130fe5bc 100644 --- a/AsyncDisplayKit/Layout/ASRelativeLayoutSpec.h +++ b/AsyncDisplayKit/Layout/ASRelativeLayoutSpec.h @@ -4,6 +4,11 @@ // // Created by Samuel Stow on 12/31/15. // +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Layout/ASRelativeLayoutSpec.mm b/AsyncDisplayKit/Layout/ASRelativeLayoutSpec.mm index 7a1a0ea5e0..d705297cc8 100644 --- a/AsyncDisplayKit/Layout/ASRelativeLayoutSpec.mm +++ b/AsyncDisplayKit/Layout/ASRelativeLayoutSpec.mm @@ -4,6 +4,11 @@ // // Created by Samuel Stow on 12/31/15. // +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASRelativeLayoutSpec.h" @@ -89,18 +94,10 @@ ASRoundPixelValue((size.height - sublayout.size.height) * yPosition) }; - return [ASLayout layoutWithLayoutableObject:self size:size sublayouts:@[sublayout]]; -} - -- (void)setChildren:(NSArray *)children -{ - ASDisplayNodeAssert(NO, @"not supported by this layout spec"); -} - -- (NSArray *)children -{ - ASDisplayNodeAssert(NO, @"not supported by this layout spec"); - return nil; + return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize + size:size + sublayouts:@[sublayout]]; } - (CGFloat)proportionOfAxisForAxisPosition:(ASRelativeLayoutSpecPosition)position diff --git a/AsyncDisplayKit/Layout/ASRelativeSize.h b/AsyncDisplayKit/Layout/ASRelativeSize.h index 1f08e92f56..479b865c43 100644 --- a/AsyncDisplayKit/Layout/ASRelativeSize.h +++ b/AsyncDisplayKit/Layout/ASRelativeSize.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASRelativeSize.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/Layout/ASRelativeSize.mm b/AsyncDisplayKit/Layout/ASRelativeSize.mm index 0410bb5a3c..9d08009f78 100644 --- a/AsyncDisplayKit/Layout/ASRelativeSize.mm +++ b/AsyncDisplayKit/Layout/ASRelativeSize.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASRelativeSize.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASRelativeSize.h" #import "ASAssert.h" diff --git a/AsyncDisplayKit/Layout/ASStackLayoutDefines.h b/AsyncDisplayKit/Layout/ASStackLayoutDefines.h index 48c0667a6b..a45eb8b62a 100644 --- a/AsyncDisplayKit/Layout/ASStackLayoutDefines.h +++ b/AsyncDisplayKit/Layout/ASStackLayoutDefines.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStackLayoutDefines.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASBaseDefines.h" diff --git a/AsyncDisplayKit/Layout/ASStackLayoutSpec.h b/AsyncDisplayKit/Layout/ASStackLayoutSpec.h index 2488160048..590c39bbf7 100644 --- a/AsyncDisplayKit/Layout/ASStackLayoutSpec.h +++ b/AsyncDisplayKit/Layout/ASStackLayoutSpec.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStackLayoutSpec.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/Layout/ASStackLayoutSpec.mm b/AsyncDisplayKit/Layout/ASStackLayoutSpec.mm index 26b6d449c7..e169cf488b 100644 --- a/AsyncDisplayKit/Layout/ASStackLayoutSpec.mm +++ b/AsyncDisplayKit/Layout/ASStackLayoutSpec.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStackLayoutSpec.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import @@ -121,21 +121,12 @@ _baselineRelativeArrangement = baselineRelativeArrangement; } -- (void)setChild:(id)child forIdentifier:(NSString *)identifier -{ - ASDisplayNodeAssert(NO, @"ASStackLayoutSpec only supports setChildren"); -} - -- (id)childForIdentifier:(NSString *)identifier -{ - ASDisplayNodeAssert(NO, @"ASStackLayoutSpec only supports children"); - return nil; -} - - (ASLayout *)measureWithSizeRange:(ASSizeRange)constrainedSize { if (self.children.count == 0) { - return [ASLayout layoutWithLayoutableObject:self size:constrainedSize.min]; + return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize + size:constrainedSize.min]; } ASStackLayoutSpecStyle style = {.direction = _direction, .spacing = _spacing, .justifyContent = _justifyContent, .alignItems = _alignItems, .baselineRelativeArrangement = _baselineRelativeArrangement}; @@ -174,6 +165,7 @@ } return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize size:ASSizeRangeClamp(constrainedSize, finalSize) sublayouts:sublayouts]; } diff --git a/AsyncDisplayKit/Layout/ASStackLayoutable.h b/AsyncDisplayKit/Layout/ASStackLayoutable.h index 9044a27585..ffd4251174 100644 --- a/AsyncDisplayKit/Layout/ASStackLayoutable.h +++ b/AsyncDisplayKit/Layout/ASStackLayoutable.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStackLayoutable.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/Layout/ASStaticLayoutSpec.h b/AsyncDisplayKit/Layout/ASStaticLayoutSpec.h index 44da4adf3d..934506955b 100644 --- a/AsyncDisplayKit/Layout/ASStaticLayoutSpec.h +++ b/AsyncDisplayKit/Layout/ASStaticLayoutSpec.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStaticLayoutSpec.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/Layout/ASStaticLayoutSpec.mm b/AsyncDisplayKit/Layout/ASStaticLayoutSpec.mm index a727376a57..a7e93805c0 100644 --- a/AsyncDisplayKit/Layout/ASStaticLayoutSpec.mm +++ b/AsyncDisplayKit/Layout/ASStaticLayoutSpec.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStaticLayoutSpec.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASStaticLayoutSpec.h" @@ -68,21 +68,11 @@ } return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize size:ASSizeRangeClamp(constrainedSize, size) sublayouts:sublayouts]; } -- (void)setChild:(id)child forIdentifier:(NSString *)identifier -{ - ASDisplayNodeAssert(NO, @"ASStaticLayoutSpec only supports setChildren"); -} - -- (id)childForIdentifier:(NSString *)identifier -{ - ASDisplayNodeAssert(NO, @"ASStaticLayoutSpec only supports children"); - return nil; -} - @end @implementation ASStaticLayoutSpec (ASEnvironment) diff --git a/AsyncDisplayKit/Layout/ASStaticLayoutable.h b/AsyncDisplayKit/Layout/ASStaticLayoutable.h index 8e5f6e6275..825b6ac40e 100644 --- a/AsyncDisplayKit/Layout/ASStaticLayoutable.h +++ b/AsyncDisplayKit/Layout/ASStaticLayoutable.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStaticLayoutable.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Private/ASBasicImageDownloaderInternal.h b/AsyncDisplayKit/Private/ASBasicImageDownloaderInternal.h index 210fe397a3..e2675beba9 100644 --- a/AsyncDisplayKit/Private/ASBasicImageDownloaderInternal.h +++ b/AsyncDisplayKit/Private/ASBasicImageDownloaderInternal.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASBasicImageDownloaderInternal.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// @interface ASBasicImageDownloaderContext : NSObject diff --git a/AsyncDisplayKit/Private/ASBatchFetching.h b/AsyncDisplayKit/Private/ASBatchFetching.h index 094a2c6c5d..2f9b8bbed8 100644 --- a/AsyncDisplayKit/Private/ASBatchFetching.h +++ b/AsyncDisplayKit/Private/ASBatchFetching.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASBatchFetching.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Private/ASBatchFetching.m b/AsyncDisplayKit/Private/ASBatchFetching.m index 6a8d9fc10d..0dd7cda675 100644 --- a/AsyncDisplayKit/Private/ASBatchFetching.m +++ b/AsyncDisplayKit/Private/ASBatchFetching.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASBatchFetching.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASBatchFetching.h" diff --git a/AsyncDisplayKit/Private/ASDefaultPlayButton.h b/AsyncDisplayKit/Private/ASDefaultPlayButton.h index aac725461e..08939784f7 100644 --- a/AsyncDisplayKit/Private/ASDefaultPlayButton.h +++ b/AsyncDisplayKit/Private/ASDefaultPlayButton.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Luke Parham on 1/27/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/Private/ASDefaultPlayButton.m b/AsyncDisplayKit/Private/ASDefaultPlayButton.m index 364b86a6e5..b64650235b 100644 --- a/AsyncDisplayKit/Private/ASDefaultPlayButton.m +++ b/AsyncDisplayKit/Private/ASDefaultPlayButton.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Luke Parham on 1/27/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASDefaultPlayButton.h" diff --git a/AsyncDisplayKit/Private/ASDefaultPlaybackButton.h b/AsyncDisplayKit/Private/ASDefaultPlaybackButton.h new file mode 100644 index 0000000000..29bacd257c --- /dev/null +++ b/AsyncDisplayKit/Private/ASDefaultPlaybackButton.h @@ -0,0 +1,20 @@ +// +// ASDefaultPlaybackButton.h +// AsyncDisplayKit +// +// Created by Erekle on 5/14/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import +typedef enum { + ASDefaultPlaybackButtonTypePlay, + ASDefaultPlaybackButtonTypePause +} ASDefaultPlaybackButtonType; +@interface ASDefaultPlaybackButton : ASControlNode +@property (nonatomic, assign) ASDefaultPlaybackButtonType buttonType; +@end diff --git a/AsyncDisplayKit/Private/ASDefaultPlaybackButton.m b/AsyncDisplayKit/Private/ASDefaultPlaybackButton.m new file mode 100644 index 0000000000..04c19ef3f6 --- /dev/null +++ b/AsyncDisplayKit/Private/ASDefaultPlaybackButton.m @@ -0,0 +1,85 @@ +// +// ASDefaultPlaybackButton.m +// AsyncDisplayKit +// +// Created by Erekle on 5/14/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import "ASDefaultPlaybackButton.h" +@interface ASDefaultPlaybackButton() +{ + ASDefaultPlaybackButtonType _buttonType; +} +@end + +@implementation ASDefaultPlaybackButton +- (instancetype)init +{ + if (!(self = [super init])) { + return nil; + } + + self.opaque = NO; + + return self; +} + +- (void)setButtonType:(ASDefaultPlaybackButtonType)buttonType +{ + ASDefaultPlaybackButtonType oldType = _buttonType; + _buttonType = buttonType; + + if (oldType != _buttonType) { + [self setNeedsDisplay]; + } +} + +- (nullable id)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer +{ + return @{ + @"buttonType" : [NSNumber numberWithInt:_buttonType], + @"color" : self.tintColor + }; +} + ++ (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing +{ + ASDefaultPlaybackButtonType buttonType = [parameters[@"buttonType"] intValue]; + UIColor *color = parameters[@"color"]; + + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextSaveGState(context); + UIBezierPath* bezierPath = [UIBezierPath bezierPath]; + if (buttonType == ASDefaultPlaybackButtonTypePlay) { + [bezierPath moveToPoint: CGPointMake(0, 0)]; + [bezierPath addLineToPoint: CGPointMake(0, bounds.size.height)]; + [bezierPath addLineToPoint: CGPointMake(bounds.size.width, bounds.size.height/2)]; + [bezierPath addLineToPoint: CGPointMake(0, 0)]; + [bezierPath closePath]; + } else if (buttonType == ASDefaultPlaybackButtonTypePause) { + CGFloat pauseSingleLineWidth = bounds.size.width / 3.0; + [bezierPath moveToPoint: CGPointMake(0, bounds.size.height)]; + [bezierPath addLineToPoint: CGPointMake(pauseSingleLineWidth, bounds.size.height)]; + [bezierPath addLineToPoint: CGPointMake(pauseSingleLineWidth, 0)]; + [bezierPath addLineToPoint: CGPointMake(0, 0)]; + [bezierPath addLineToPoint: CGPointMake(0, bounds.size.height)]; + [bezierPath closePath]; + [bezierPath moveToPoint: CGPointMake(pauseSingleLineWidth * 2, 0)]; + [bezierPath addLineToPoint: CGPointMake(pauseSingleLineWidth * 2, bounds.size.height)]; + [bezierPath addLineToPoint: CGPointMake(bounds.size.width, bounds.size.height)]; + [bezierPath addLineToPoint: CGPointMake(bounds.size.width, 0)]; + [bezierPath addLineToPoint: CGPointMake(pauseSingleLineWidth * 2, 0)]; + [bezierPath closePath]; + } + + [color setFill]; + [bezierPath fill]; + + CGContextRestoreGState(context); +} +@end diff --git a/AsyncDisplayKit/Private/ASDisplayNode+AsyncDisplay.mm b/AsyncDisplayKit/Private/ASDisplayNode+AsyncDisplay.mm index 862497b86a..6d25d63a43 100644 --- a/AsyncDisplayKit/Private/ASDisplayNode+AsyncDisplay.mm +++ b/AsyncDisplayKit/Private/ASDisplayNode+AsyncDisplay.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNode+AsyncDisplay.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "_ASCoreAnimationExtras.h" #import "_ASAsyncTransaction.h" diff --git a/AsyncDisplayKit/Private/ASDisplayNode+DebugTiming.h b/AsyncDisplayKit/Private/ASDisplayNode+DebugTiming.h index 5e1f6796db..d331bbf035 100644 --- a/AsyncDisplayKit/Private/ASDisplayNode+DebugTiming.h +++ b/AsyncDisplayKit/Private/ASDisplayNode+DebugTiming.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNode+DebugTiming.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Private/ASDisplayNode+DebugTiming.mm b/AsyncDisplayKit/Private/ASDisplayNode+DebugTiming.mm index 442c70a270..9e71de8574 100644 --- a/AsyncDisplayKit/Private/ASDisplayNode+DebugTiming.mm +++ b/AsyncDisplayKit/Private/ASDisplayNode+DebugTiming.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNode+DebugTiming.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASDisplayNode+DebugTiming.h" #import "ASDisplayNodeInternal.h" diff --git a/AsyncDisplayKit/Private/ASDisplayNode+FrameworkPrivate.h b/AsyncDisplayKit/Private/ASDisplayNode+FrameworkPrivate.h index 565593d37f..78ce6ce05e 100644 --- a/AsyncDisplayKit/Private/ASDisplayNode+FrameworkPrivate.h +++ b/AsyncDisplayKit/Private/ASDisplayNode+FrameworkPrivate.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNode+FrameworkPrivate.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// // // The following methods are ONLY for use by _ASDisplayLayer, _ASDisplayView, and ASDisplayNode. diff --git a/AsyncDisplayKit/Private/ASDisplayNode+UIViewBridge.mm b/AsyncDisplayKit/Private/ASDisplayNode+UIViewBridge.mm index f60a1258bb..c2c7b2ca3a 100644 --- a/AsyncDisplayKit/Private/ASDisplayNode+UIViewBridge.mm +++ b/AsyncDisplayKit/Private/ASDisplayNode+UIViewBridge.mm @@ -1,24 +1,20 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNode+UIViewBridge.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "_ASCoreAnimationExtras.h" #import "_ASPendingState.h" #import "ASInternalHelpers.h" -#import "ASAssert.h" #import "ASDisplayNodeInternal.h" -#import "ASDisplayNodeExtras.h" #import "ASDisplayNode+Subclasses.h" #import "ASDisplayNode+FrameworkPrivate.h" -#import "ASDisplayNode+Beta.h" -#import "ASEqualityHelpers.h" #import "ASPendingStateController.h" -#import "ASThread.h" -#import "ASTextNode.h" /** * The following macros are conveniences to help in the common tasks related to the bridging that ASDisplayNode does to UIView and CALayer. @@ -43,6 +39,7 @@ #if DISPLAYNODE_USE_LOCKS #define _bridge_prologue_read ASDN::MutexLocker l(_propertyLock); ASDisplayNodeAssertThreadAffinity(self) #define _bridge_prologue_write ASDN::MutexLocker l(_propertyLock) +#define _bridge_prologue_write_unlock ASDN::MutexUnlocker u(_propertyLock) #else #define _bridge_prologue_read ASDisplayNodeAssertThreadAffinity(self) #define _bridge_prologue_write @@ -105,7 +102,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo // Focus Engine - (BOOL)canBecomeFocused { - return YES; + return NO; } - (void)setNeedsFocusUpdate @@ -122,7 +119,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo - (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context { - return YES; + return NO; } - (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator @@ -239,11 +236,11 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo // For classes like ASTableNode, ASCollectionNode, ASScrollNode and similar - make sure UIView gets setFrame: struct ASDisplayNodeFlags flags = _flags; - BOOL setFrameDirectly = flags.synchronous && !flags.layerBacked; + BOOL specialPropertiesHandling = ASDisplayNodeNeedsSpecialPropertiesHandlingForFlags(flags); BOOL nodeLoaded = __loaded(self); BOOL isMainThread = ASDisplayNodeThreadIsMain(); - if (!setFrameDirectly) { + if (!specialPropertiesHandling) { BOOL canReadProperties = isMainThread || !nodeLoaded; if (canReadProperties) { // We don't have to set frame directly, and we can read current properties. @@ -337,7 +334,11 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo // The node is loaded and we're on main. // Quite the opposite of setNeedsDisplay, we must call __setNeedsLayout before messaging // the view or layer to ensure that measurement and implicitly added subnodes have been handled. + + // Calling __setNeedsLayout while holding the property lock can cause deadlocks + _bridge_prologue_write_unlock; [self __setNeedsLayout]; + _bridge_prologue_write; _messageToViewOrLayer(setNeedsLayout); } else if (__loaded(self)) { // The node is loaded but we're not on main. @@ -347,7 +348,9 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo [ASDisplayNodeGetPendingState(self) setNeedsLayout]; } else { // The node is not loaded and we're not on main. + _bridge_prologue_write_unlock; [self __setNeedsLayout]; + _bridge_prologue_write; } } @@ -582,7 +585,14 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo if (shouldApply) { CGColorRef oldBackgroundCGColor = _layer.backgroundColor; - _layer.backgroundColor = newBackgroundCGColor; + + BOOL specialPropertiesHandling = ASDisplayNodeNeedsSpecialPropertiesHandlingForFlags(_flags); + if (specialPropertiesHandling) { + _view.backgroundColor = newBackgroundColor; + } else { + _layer.backgroundColor = newBackgroundCGColor; + } + if (!CGColorEqualToColor(oldBackgroundCGColor, newBackgroundCGColor)) { [self setNeedsDisplay]; } diff --git a/AsyncDisplayKit/Private/ASDisplayNodeInternal.h b/AsyncDisplayKit/Private/ASDisplayNodeInternal.h index ae3f3c477a..ee3da6b041 100644 --- a/AsyncDisplayKit/Private/ASDisplayNodeInternal.h +++ b/AsyncDisplayKit/Private/ASDisplayNodeInternal.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNodeInternal.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// // // The following methods are ONLY for use by _ASDisplayLayer, _ASDisplayView, and ASDisplayNode. @@ -16,7 +18,7 @@ #import "ASSentinel.h" #import "ASThread.h" #import "_ASTransitionContext.h" -#import "ASDisplayNodeLayoutContext.h" +#import "ASLayoutTransition.h" #import "ASEnvironment.h" #include @@ -25,8 +27,10 @@ @class _ASDisplayLayer; @class _ASPendingState; @class ASSentinel; +struct ASDisplayNodeFlags; BOOL ASDisplayNodeSubclassOverridesSelector(Class subclass, SEL selector); +BOOL ASDisplayNodeNeedsSpecialPropertiesHandlingForFlags(ASDisplayNodeFlags flags); /// Get the pending view state for the node, creating one if needed. _ASPendingState *ASDisplayNodeGetPendingState(ASDisplayNode *node); @@ -71,6 +75,20 @@ FOUNDATION_EXPORT NSString * const ASRenderingEngineDidDisplayNodesScheduledBefo unsigned displaySuspended:1; unsigned shouldAnimateSizeChanges:1; unsigned hasCustomDrawingPriority:1; + + // Wrapped view handling + + // The layer contents should not be cleared in case the node is wrapping a UIImageView.UIImageView is specifically + // optimized for performance and does not use the usual way to provide the contents of the CALayer via the + // CALayerDelegate method that backs the UIImageView. + unsigned canClearContentsOfLayer:1; + + // Prevent calling setNeedsDisplay on a layer that backs a UIImageView. Usually calling setNeedsDisplay on a CALayer + // triggers a recreation of the contents of layer unfortunately calling it on a CALayer that backs a UIImageView + // it goes trough the normal flow to assign the contents to a layer via the CALayerDelegate methods. Unfortunately + // UIImageView does not do recreate the layer contents the usual way, it actually does not implement some of the + // methods at all instead it throws away the contents of the layer and nothing will show up. + unsigned canCallNeedsDisplayOfLayer:1; // whether custom drawing is enabled unsigned implementsInstanceDrawRect:1; @@ -80,7 +98,6 @@ FOUNDATION_EXPORT NSString * const ASRenderingEngineDidDisplayNodesScheduledBefo unsigned implementsDrawParameters:1; // internal state - unsigned isMeasured:1; unsigned isEnteringHierarchy:1; unsigned isExitingHierarchy:1; unsigned isInHierarchy:1; @@ -91,7 +108,9 @@ FOUNDATION_EXPORT NSString * const ASRenderingEngineDidDisplayNodesScheduledBefo ASDisplayNode * __weak _supernode; ASSentinel *_displaySentinel; - ASSentinel *_transitionSentinel; + + int32_t _transitionID; + BOOL _transitionInProgress; // This is the desired contentsScale, not the scale at which the layer's contents should be displayed CGFloat _contentsScaleForDisplay; @@ -99,8 +118,6 @@ FOUNDATION_EXPORT NSString * const ASRenderingEngineDidDisplayNodesScheduledBefo ASEnvironmentState _environmentState; ASLayout *_layout; - ASSizeRange _constrainedSize; - UIEdgeInsets _hitTestSlop; NSMutableArray *_subnodes; @@ -109,7 +126,7 @@ FOUNDATION_EXPORT NSString * const ASRenderingEngineDidDisplayNodesScheduledBefo BOOL _usesImplicitHierarchyManagement; int32_t _pendingTransitionID; - ASDisplayNodeLayoutContext *_pendingLayoutContext; + ASLayoutTransition *_pendingLayoutTransition; ASDisplayNodeViewBlock _viewBlock; ASDisplayNodeLayerBlock _layerBlock; @@ -224,4 +241,10 @@ FOUNDATION_EXPORT NSString * const ASRenderingEngineDidDisplayNodesScheduledBefo */ - (ASDisplayNode *)_supernodeWithClass:(Class)supernodeClass checkViewHierarchy:(BOOL)checkViewHierarchy; +/** + * Convenience method to access this node's trait collection struct. Externally, users should interact + * with the trait collection via ASTraitCollection + */ +- (ASEnvironmentTraitCollection)environmentTraitCollection; + @end diff --git a/AsyncDisplayKit/Private/ASEnvironmentInternal.h b/AsyncDisplayKit/Private/ASEnvironmentInternal.h index 9bd2c305d4..26f0747b81 100644 --- a/AsyncDisplayKit/Private/ASEnvironmentInternal.h +++ b/AsyncDisplayKit/Private/ASEnvironmentInternal.h @@ -1,18 +1,19 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASEnvironmentInternal.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASEnvironment.h" #pragma once BOOL ASEnvironmentStatePropagationEnabled(); +BOOL ASEnvironmentStateTraitCollectionPropagationEnabled(); #pragma mark - Set and get extensible values for layout options @@ -45,24 +46,26 @@ static const struct ASEnvironmentStateExtensions ASEnvironmentDefaultStateExtens static const struct ASEnvironmentLayoutOptionsState ASEnvironmentDefaultLayoutOptionsState = {}; ASEnvironmentState ASEnvironmentMergeObjectAndState(ASEnvironmentState environmentState, ASEnvironmentLayoutOptionsState state, ASEnvironmentStatePropagation propagation); - static const struct ASEnvironmentHierarchyState ASEnvironmentDefaultHierarchyState = {}; ASEnvironmentState ASEnvironmentMergeObjectAndState(ASEnvironmentState environmentState, ASEnvironmentHierarchyState state, ASEnvironmentStatePropagation propagation); +static const struct ASEnvironmentTraitCollection ASEnvironmentDefaultTraitCollection = {}; +ASEnvironmentState ASEnvironmentMergeObjectAndState(ASEnvironmentState environmentState, ASEnvironmentTraitCollection state, ASEnvironmentStatePropagation propagation); + #pragma mark - Propagation template void ASEnvironmentStatePropagateDown(id object, ASEnvironmentStateType state) { ASEnvironmentPerformBlockOnObjectAndChildren(object, ^(id node) { - object.environmentState = ASEnvironmentMergeObjectAndState(object.environmentState, state, ASEnvironmentStatePropagation::DOWN); + node.environmentState = ASEnvironmentMergeObjectAndState(node.environmentState, state, ASEnvironmentStatePropagation::DOWN); }); } template void ASEnvironmentStatePropagateUp(id object, ASEnvironmentStateType state) { ASEnvironmentPerformBlockOnObjectAndParents(object, ^(id node) { - object.environmentState = ASEnvironmentMergeObjectAndState(object.environmentState, state, ASEnvironmentStatePropagation::UP); + node.environmentState = ASEnvironmentMergeObjectAndState(node.environmentState, state, ASEnvironmentStatePropagation::UP); }); } diff --git a/AsyncDisplayKit/Private/ASEnvironmentInternal.mm b/AsyncDisplayKit/Private/ASEnvironmentInternal.mm index 83ea991b85..727b073b01 100644 --- a/AsyncDisplayKit/Private/ASEnvironmentInternal.mm +++ b/AsyncDisplayKit/Private/ASEnvironmentInternal.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASEnvironmentInternal.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASEnvironmentInternal.h" @@ -15,13 +15,18 @@ //#define LOG(...) NSLog(__VA_ARGS__) #define LOG(...) -#define AS_SUPPORT_PROPAGATION NO +#define AS_SUPPORT_PROPAGATION YES +#define AS_DOES_NOT_SUPPORT_PROPAGATION NO BOOL ASEnvironmentStatePropagationEnabled() { - return AS_SUPPORT_PROPAGATION; + return AS_DOES_NOT_SUPPORT_PROPAGATION; } +BOOL ASEnvironmentStateTraitCollectionPropagationEnabled() +{ + return AS_SUPPORT_PROPAGATION; +} #pragma mark - Traversing an ASEnvironment Tree @@ -106,15 +111,15 @@ UIEdgeInsets _ASEnvironmentLayoutOptionsExtensionGetEdgeInsetsAtIndex(id _animatedImage; BOOL _animatedImagePaused; + NSString *_animatedImageRunLoopMode; CADisplayLink *_displayLink; //accessed on main thread only diff --git a/AsyncDisplayKit/Private/ASImageNode+CGExtras.h b/AsyncDisplayKit/Private/ASImageNode+CGExtras.h index 0c4803c206..74471ad62d 100644 --- a/AsyncDisplayKit/Private/ASImageNode+CGExtras.h +++ b/AsyncDisplayKit/Private/ASImageNode+CGExtras.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASImageNode+CGExtras.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Private/ASImageNode+CGExtras.m b/AsyncDisplayKit/Private/ASImageNode+CGExtras.m index 1467bc0e14..b1912e6b2b 100644 --- a/AsyncDisplayKit/Private/ASImageNode+CGExtras.m +++ b/AsyncDisplayKit/Private/ASImageNode+CGExtras.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASImageNode+CGExtras.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASImageNode+CGExtras.h" diff --git a/AsyncDisplayKit/Private/ASInternalHelpers.h b/AsyncDisplayKit/Private/ASInternalHelpers.h index 79f500e77c..cff8c1fc53 100644 --- a/AsyncDisplayKit/Private/ASInternalHelpers.h +++ b/AsyncDisplayKit/Private/ASInternalHelpers.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASInternalHelpers.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #include #import @@ -17,8 +17,15 @@ ASDISPLAYNODE_EXTERN_C_BEGIN BOOL ASSubclassOverridesSelector(Class superclass, Class subclass, SEL selector); BOOL ASSubclassOverridesClassSelector(Class superclass, Class subclass, SEL selector); + +/// Dispatches the given block to the main queue if not already running on the main thread void ASPerformBlockOnMainThread(void (^block)()); -void ASPerformBlockOnBackgroundThread(void (^block)()); // DISPATCH_QUEUE_PRIORITY_DEFAULT + +/// Dispatches the given block to a background queue with priority of DISPATCH_QUEUE_PRIORITY_DEFAULT if not already run on a background queue +void ASPerformBlockOnBackgroundThread(void (^block)()); // DISPATCH_QUEUE_PRIORITY_DEFAULT + +/// Dispatches a block on to a serial queue that's main purpose is for deallocation of objects on a background thread +void ASPerformBlockOnDeallocationQueue(void (^block)()); CGFloat ASScreenScale(); diff --git a/AsyncDisplayKit/Private/ASInternalHelpers.mm b/AsyncDisplayKit/Private/ASInternalHelpers.mm index 40f6445434..4d4ccbbf74 100644 --- a/AsyncDisplayKit/Private/ASInternalHelpers.mm +++ b/AsyncDisplayKit/Private/ASInternalHelpers.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASInternalHelpers.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASInternalHelpers.h" @@ -52,6 +52,17 @@ void ASPerformBlockOnBackgroundThread(void (^block)()) } } +void ASPerformBlockOnDeallocationQueue(void (^block)()) +{ + static dispatch_queue_t queue; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + queue = dispatch_queue_create("org.AsyncDisplayKit.deallocationQueue", DISPATCH_QUEUE_SERIAL); + }); + + dispatch_async(queue, block); +} + CGFloat ASScreenScale() { static CGFloat __scale = 0.0; diff --git a/AsyncDisplayKit/Private/ASLayoutSpecUtilities.h b/AsyncDisplayKit/Private/ASLayoutSpecUtilities.h index 178b9655c0..384327060f 100644 --- a/AsyncDisplayKit/Private/ASLayoutSpecUtilities.h +++ b/AsyncDisplayKit/Private/ASLayoutSpecUtilities.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASLayoutSpecUtilities.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/Private/ASDisplayNodeLayoutContext.h b/AsyncDisplayKit/Private/ASLayoutTransition.h similarity index 50% rename from AsyncDisplayKit/Private/ASDisplayNodeLayoutContext.h rename to AsyncDisplayKit/Private/ASLayoutTransition.h index 2c5530cab2..c972f41aef 100644 --- a/AsyncDisplayKit/Private/ASDisplayNodeLayoutContext.h +++ b/AsyncDisplayKit/Private/ASLayoutTransition.h @@ -1,9 +1,13 @@ // -// ASDisplayNodeLayoutContext.h +// ASLayoutTransition.h // AsyncDisplayKit // // Created by Huy Nguyen on 3/8/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASDimension.h" @@ -12,19 +16,15 @@ @class ASDisplayNode; @class ASLayout; -@interface ASDisplayNodeLayoutContext : NSObject <_ASTransitionContextLayoutDelegate> +@interface ASLayoutTransition : NSObject <_ASTransitionContextLayoutDelegate> @property (nonatomic, readonly, weak) ASDisplayNode *node; @property (nonatomic, readonly, strong) ASLayout *pendingLayout; -@property (nonatomic, readonly, assign) ASSizeRange pendingConstrainedSize; @property (nonatomic, readonly, strong) ASLayout *previousLayout; -@property (nonatomic, readonly, assign) ASSizeRange previousConstrainedSize; - (instancetype)initWithNode:(ASDisplayNode *)node pendingLayout:(ASLayout *)pendingLayout - pendingConstrainedSize:(ASSizeRange)pendingConstrainedSize - previousLayout:(ASLayout *)previousLayout - previousConstrainedSize:(ASSizeRange)previousConstrainedSize; + previousLayout:(ASLayout *)previousLayout; - (void)applySubnodeInsertions; diff --git a/AsyncDisplayKit/Private/ASDisplayNodeLayoutContext.mm b/AsyncDisplayKit/Private/ASLayoutTransition.mm similarity index 85% rename from AsyncDisplayKit/Private/ASDisplayNodeLayoutContext.mm rename to AsyncDisplayKit/Private/ASLayoutTransition.mm index 797657ac09..560ac6135e 100644 --- a/AsyncDisplayKit/Private/ASDisplayNodeLayoutContext.mm +++ b/AsyncDisplayKit/Private/ASLayoutTransition.mm @@ -1,12 +1,16 @@ // -// ASDisplayNodeLayoutContext.mm +// ASLayoutTransition.mm // AsyncDisplayKit // // Created by Huy Nguyen on 3/8/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // -#import "ASDisplayNodeLayoutContext.h" +#import "ASLayoutTransition.h" #import "ASDisplayNode.h" #import "ASDisplayNodeInternal.h" @@ -18,7 +22,7 @@ #import "NSArray+Diffing.h" #import "ASEqualityHelpers.h" -@implementation ASDisplayNodeLayoutContext { +@implementation ASLayoutTransition { ASDN::RecursiveMutex _propertyLock; BOOL _calculatedSubnodeOperations; NSArray *_insertedSubnodes; @@ -29,17 +33,13 @@ - (instancetype)initWithNode:(ASDisplayNode *)node pendingLayout:(ASLayout *)pendingLayout - pendingConstrainedSize:(ASSizeRange)pendingConstrainedSize previousLayout:(ASLayout *)previousLayout - previousConstrainedSize:(ASSizeRange)previousConstrainedSize { self = [super init]; if (self) { _node = node; _pendingLayout = pendingLayout; - _pendingConstrainedSize = pendingConstrainedSize; _previousLayout = previousLayout; - _previousConstrainedSize = previousConstrainedSize; } return self; } @@ -48,9 +48,12 @@ { ASDN::MutexLocker l(_propertyLock); [self calculateSubnodeOperationsIfNeeded]; - for (NSUInteger i = 0; i < [_insertedSubnodes count]; i++) { + + NSUInteger i = 0; + for (ASDisplayNode *node in _insertedSubnodes) { NSUInteger p = _insertedSubnodePositions[i]; - [_node insertSubnode:_insertedSubnodes[i] atIndex:p]; + [_node insertSubnode:node atIndex:p]; + i += 1; } } @@ -58,8 +61,8 @@ { ASDN::MutexLocker l(_propertyLock); [self calculateSubnodeOperationsIfNeeded]; - for (NSUInteger i = 0; i < [_removedSubnodes count]; i++) { - [_removedSubnodes[i] removeFromSupernode]; + for (ASDisplayNode *subnode in _removedSubnodes) { + [subnode removeFromSupernode]; } } @@ -71,7 +74,7 @@ } if (_previousLayout) { NSIndexSet *insertions, *deletions; - [_previousLayout.immediateSublayouts asdk_diffWithArray:_pendingLayout.immediateSublayouts + [_previousLayout.sublayouts asdk_diffWithArray:_pendingLayout.sublayouts insertions:&insertions deletions:&deletions compareBlock:^BOOL(ASLayout *lhs, ASLayout *rhs) { @@ -84,7 +87,7 @@ &_removedSubnodes, &_removedSubnodePositions); } else { - NSIndexSet *indexes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [_pendingLayout.immediateSublayouts count])]; + NSIndexSet *indexes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [_pendingLayout.sublayouts count])]; findNodesInLayoutAtIndexes(_pendingLayout, indexes, &_insertedSubnodes, &_insertedSubnodePositions); _removedSubnodes = nil; } @@ -129,9 +132,9 @@ { ASDN::MutexLocker l(_propertyLock); if ([key isEqualToString:ASTransitionContextFromLayoutKey]) { - return _previousConstrainedSize; + return _previousLayout.constrainedSizeRange; } else if ([key isEqualToString:ASTransitionContextToLayoutKey]) { - return _pendingConstrainedSize; + return _pendingLayout.constrainedSizeRange; } else { return ASSizeRangeMake(CGSizeZero, CGSizeZero); } @@ -164,7 +167,7 @@ static inline void findNodesInLayoutAtIndexesWithFilteredNodes(ASLayout *layout, std::vector positions = std::vector(); NSUInteger idx = [indexes firstIndex]; while (idx != NSNotFound) { - ASDisplayNode *node = (ASDisplayNode *)layout.immediateSublayouts[idx].layoutableObject; + ASDisplayNode *node = (ASDisplayNode *)layout.sublayouts[idx].layoutableObject; ASDisplayNodeCAssert(node, @"A flattened layout must consist exclusively of node sublayouts"); // Ignore the odd case in which a non-node sublayout is accessed and the type cast fails if (node != nil) { diff --git a/AsyncDisplayKit/Private/ASMultidimensionalArrayUtils.h b/AsyncDisplayKit/Private/ASMultidimensionalArrayUtils.h index 756b1cc775..46529d3b2c 100644 --- a/AsyncDisplayKit/Private/ASMultidimensionalArrayUtils.h +++ b/AsyncDisplayKit/Private/ASMultidimensionalArrayUtils.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASMultidimensionalArrayUtils.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -47,7 +49,12 @@ extern NSArray *ASFindElementsInMultidimensionalArrayAtIndexPaths(NSMutableArray /** * Return all the index paths of mutable multidimensional array at given index set, in ascending order. */ -extern NSArray *ASIndexPathsForMultidimensionalArrayAtIndexSet(NSArray *MultidimensionalArray, NSIndexSet *indexSet); +extern NSArray *ASIndexPathsForMultidimensionalArrayAtIndexSet(NSArray *multidimensionalArray, NSIndexSet *indexSet); + +/** + * Return the index paths of the given multidimensional array that are present in the given index paths array. + */ +extern NSArray *ASIndexPathsInMultidimensionalArrayIntersectingIndexPaths(NSArray *multidimensionalArray, NSArray *indexPaths); /** * Return all the index paths of a two-dimensional array, in ascending order. diff --git a/AsyncDisplayKit/Private/ASMultidimensionalArrayUtils.mm b/AsyncDisplayKit/Private/ASMultidimensionalArrayUtils.mm index f939410d6d..5c7e437387 100644 --- a/AsyncDisplayKit/Private/ASMultidimensionalArrayUtils.mm +++ b/AsyncDisplayKit/Private/ASMultidimensionalArrayUtils.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASMultidimensionalArrayUtils.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASAssert.h" #import "ASMultidimensionalArrayUtils.h" @@ -39,7 +41,7 @@ static void ASRecursivelyUpdateMultidimensionalArrayAtIndexPaths(NSMutableArray } } -static void ASRecursivelyFindIndexPathsForMultidimensionalArray(NSObject *obj, NSIndexPath *curIndexPath, NSMutableArray *res) +static void ASRecursivelyFindIndexPathsForMultidimensionalArray(NSObject *obj, NSIndexPath *curIndexPath, NSMutableArray *res) { if (![obj isKindOfClass:[NSArray class]]) { [res addObject:curIndexPath]; @@ -53,6 +55,28 @@ static void ASRecursivelyFindIndexPathsForMultidimensionalArray(NSObject *obj, N } } +static BOOL ASElementExistsAtIndexPathForMultidimensionalArray(NSArray *array, NSIndexPath *indexPath) { + NSUInteger indexLength = indexPath.length; + ASDisplayNodeCAssert(indexLength != 0, @"Must have a non-zero indexPath length"); + NSUInteger firstIndex = [indexPath indexAtPosition:0]; + BOOL elementExists = firstIndex < array.count; + + if (indexLength == 1) { + return elementExists; + } + + if (!elementExists) { + return NO; + } + + NSUInteger indexesLength = indexLength - 1; + NSUInteger indexes[indexesLength]; + [indexPath getIndexes:indexes range:NSMakeRange(1, indexesLength)]; + NSIndexPath *indexPathByRemovingFirstIndex = [NSIndexPath indexPathWithIndexes:indexes length:indexesLength]; + + return ASElementExistsAtIndexPathForMultidimensionalArray(array[firstIndex], indexPathByRemovingFirstIndex); +} + #pragma mark - Public Methods NSObject *ASMultidimensionalArrayDeepMutableCopy(NSObject *obj) @@ -142,6 +166,18 @@ NSArray *ASIndexPathsForMultidimensionalArrayAtIndexSet(NSArray *multidimensiona return res; } +NSArray *ASIndexPathsInMultidimensionalArrayIntersectingIndexPaths(NSArray *multidimensionalArray, NSArray *indexPaths) +{ + NSMutableArray *res = [NSMutableArray array]; + for (NSIndexPath *indexPath in indexPaths) { + if (ASElementExistsAtIndexPathForMultidimensionalArray(multidimensionalArray, indexPath)) { + [res addObject:indexPath]; + } + } + + return res; +} + NSArray *ASIndexPathsForTwoDimensionalArray(NSArray * twoDimensionalArray) { NSMutableArray *result = [NSMutableArray array]; diff --git a/AsyncDisplayKit/Private/ASPendingStateController.h b/AsyncDisplayKit/Private/ASPendingStateController.h index fc82817909..fef12758ca 100644 --- a/AsyncDisplayKit/Private/ASPendingStateController.h +++ b/AsyncDisplayKit/Private/ASPendingStateController.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Adlai Holler on 1/7/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/Private/ASPendingStateController.mm b/AsyncDisplayKit/Private/ASPendingStateController.mm index 4f2574a786..7874924d36 100644 --- a/AsyncDisplayKit/Private/ASPendingStateController.mm +++ b/AsyncDisplayKit/Private/ASPendingStateController.mm @@ -1,9 +1,13 @@ // -// ASPendingStateController.m +// ASPendingStateController.mm // AsyncDisplayKit // // Created by Adlai Holler on 1/7/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASPendingStateController.h" diff --git a/AsyncDisplayKit/Private/ASSentinel.h b/AsyncDisplayKit/Private/ASSentinel.h index 09acb5862b..b8213a0bf7 100644 --- a/AsyncDisplayKit/Private/ASSentinel.h +++ b/AsyncDisplayKit/Private/ASSentinel.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASSentinel.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Private/ASSentinel.m b/AsyncDisplayKit/Private/ASSentinel.m index bf9ee4799e..01a172229c 100644 --- a/AsyncDisplayKit/Private/ASSentinel.m +++ b/AsyncDisplayKit/Private/ASSentinel.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASSentinel.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASSentinel.h" @@ -22,7 +24,7 @@ - (int32_t)increment { - return OSAtomicIncrement32(&_value); + return OSAtomicAdd32(1, &_value); } @end diff --git a/AsyncDisplayKit/Private/ASStackBaselinePositionedLayout.h b/AsyncDisplayKit/Private/ASStackBaselinePositionedLayout.h index 6f208e1b29..9b23393e63 100644 --- a/AsyncDisplayKit/Private/ASStackBaselinePositionedLayout.h +++ b/AsyncDisplayKit/Private/ASStackBaselinePositionedLayout.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStackBaselinePositionedLayout.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayout.h" #import "ASDimension.h" diff --git a/AsyncDisplayKit/Private/ASStackBaselinePositionedLayout.mm b/AsyncDisplayKit/Private/ASStackBaselinePositionedLayout.mm index 46df924adf..19b6167358 100644 --- a/AsyncDisplayKit/Private/ASStackBaselinePositionedLayout.mm +++ b/AsyncDisplayKit/Private/ASStackBaselinePositionedLayout.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStackBaselinePositionedLayout.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASStackBaselinePositionedLayout.h" diff --git a/AsyncDisplayKit/Private/ASStackLayoutSpecUtilities.h b/AsyncDisplayKit/Private/ASStackLayoutSpecUtilities.h index 1045bb8501..a5067a631e 100644 --- a/AsyncDisplayKit/Private/ASStackLayoutSpecUtilities.h +++ b/AsyncDisplayKit/Private/ASStackLayoutSpecUtilities.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStackLayoutSpecUtilities.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASStackLayoutSpec.h" diff --git a/AsyncDisplayKit/Private/ASStackPositionedLayout.h b/AsyncDisplayKit/Private/ASStackPositionedLayout.h index 2ff9e5260b..d28a97940b 100644 --- a/AsyncDisplayKit/Private/ASStackPositionedLayout.h +++ b/AsyncDisplayKit/Private/ASStackPositionedLayout.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStackPositionedLayout.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayout.h" #import "ASDimension.h" diff --git a/AsyncDisplayKit/Private/ASStackPositionedLayout.mm b/AsyncDisplayKit/Private/ASStackPositionedLayout.mm index cd18dd2157..2f13b23d6b 100644 --- a/AsyncDisplayKit/Private/ASStackPositionedLayout.mm +++ b/AsyncDisplayKit/Private/ASStackPositionedLayout.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStackPositionedLayout.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASStackPositionedLayout.h" diff --git a/AsyncDisplayKit/Private/ASStackUnpositionedLayout.h b/AsyncDisplayKit/Private/ASStackUnpositionedLayout.h index 4112af8e66..9e51e44801 100644 --- a/AsyncDisplayKit/Private/ASStackUnpositionedLayout.h +++ b/AsyncDisplayKit/Private/ASStackUnpositionedLayout.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStackUnpositionedLayout.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Private/ASStackUnpositionedLayout.mm b/AsyncDisplayKit/Private/ASStackUnpositionedLayout.mm index 57902a6b4e..7df078ae55 100644 --- a/AsyncDisplayKit/Private/ASStackUnpositionedLayout.mm +++ b/AsyncDisplayKit/Private/ASStackUnpositionedLayout.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStackUnpositionedLayout.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASStackUnpositionedLayout.h" @@ -303,7 +303,7 @@ static std::vector layoutChildrenAlongUnconstrainedStac const CGFloat exactStackDimension = ASRelativeDimensionResolve(flexBasis, stackDimension(style.direction, size)); if (useOptimizedFlexing && isFlexibleInBothDirections(child)) { - return { child, [ASLayout layoutWithLayoutableObject:child size:{0, 0}] }; + return { child, [ASLayout layoutWithLayoutableObject:child constrainedSizeRange:sizeRange size:{0, 0}] }; } else { return { child, diff --git a/AsyncDisplayKit/Private/ASWeakSet.h b/AsyncDisplayKit/Private/ASWeakSet.h index 2a72b19e9d..e44e68a1a5 100644 --- a/AsyncDisplayKit/Private/ASWeakSet.h +++ b/AsyncDisplayKit/Private/ASWeakSet.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Adlai Holler on 1/7/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/Private/ASWeakSet.m b/AsyncDisplayKit/Private/ASWeakSet.m index 95c4ad1275..62eccf61fa 100644 --- a/AsyncDisplayKit/Private/ASWeakSet.m +++ b/AsyncDisplayKit/Private/ASWeakSet.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Adlai Holler on 1/7/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASWeakSet.h" diff --git a/AsyncDisplayKit/Private/NSArray+Diffing.h b/AsyncDisplayKit/Private/NSArray+Diffing.h index a549d45f49..88658dba47 100644 --- a/AsyncDisplayKit/Private/NSArray+Diffing.h +++ b/AsyncDisplayKit/Private/NSArray+Diffing.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Levi McCallum on 1/29/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/Private/NSArray+Diffing.m b/AsyncDisplayKit/Private/NSArray+Diffing.m index f0989f8dd1..c34dfc2003 100644 --- a/AsyncDisplayKit/Private/NSArray+Diffing.m +++ b/AsyncDisplayKit/Private/NSArray+Diffing.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Levi McCallum on 1/29/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "NSArray+Diffing.h" @@ -50,30 +54,36 @@ - (NSIndexSet *)_asdk_commonIndexesWithArray:(NSArray *)array compareBlock:(BOOL (^)(id lhs, id rhs))comparison { NSAssert(comparison != nil, @"Comparison block is required"); - NSInteger lengths[self.count+1][array.count+1]; - for (NSInteger i = self.count; i >= 0; i--) { - for (NSInteger j = array.count; j >= 0; j--) { - if (i == self.count || j == array.count) { + + NSInteger selfCount = self.count; + NSInteger arrayCount = array.count; + + NSInteger lengths[selfCount+1][arrayCount+1]; + for (NSInteger i = 0; i <= selfCount; i++) { + for (NSInteger j = 0; j <= arrayCount; j++) { + if (i == 0 || j == 0) { lengths[i][j] = 0; - } else if (comparison(self[i], array[j])) { - lengths[i][j] = 1 + lengths[i+1][j+1]; + } else if (comparison(self[i-1], array[j-1])) { + lengths[i][j] = 1 + lengths[i-1][j-1]; } else { - lengths[i][j] = MAX(lengths[i+1][j], lengths[i][j+1]); + lengths[i][j] = MAX(lengths[i-1][j], lengths[i][j-1]); } } } NSMutableIndexSet *common = [NSMutableIndexSet indexSet]; - for (NSInteger i = 0, j = 0; i < self.count && j < array.count;) { - if (comparison(self[i], array[j])) { - [common addIndex:i]; - i++; j++; - } else if (lengths[i+1][j] >= lengths[i][j+1]) { - i++; + NSInteger i = selfCount, j = arrayCount; + while(i > 0 && j > 0) { + if (comparison(self[i-1], array[j-1])) { + [common addIndex:(i-1)]; + i--; j--; + } else if (lengths[i-1][j] > lengths[i][j-1]) { + i--; } else { - j++; + j--; } } + return common; } diff --git a/AsyncDisplayKit/Private/_AS-objc-internal.h b/AsyncDisplayKit/Private/_AS-objc-internal.h index a8087ab800..196b3c8239 100644 --- a/AsyncDisplayKit/Private/_AS-objc-internal.h +++ b/AsyncDisplayKit/Private/_AS-objc-internal.h @@ -1,15 +1,25 @@ +// +// _AS-objc-internal.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + /* * Copyright (c) 2009 Apple Inc. All Rights Reserved. - * + * * @APPLE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -17,7 +27,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_LICENSE_HEADER_END@ */ @@ -432,7 +442,7 @@ typedef enum { -(BOOL)_tryRetain { \ __typeof__(_rc_ivar) _prev; \ do { \ - _prev = _rc_ivar; \ + _prev = __atomic_load_n(&_rc_ivar, __ATOMIC_SEQ_CST);; \ if (_prev & 1) { \ return 0; \ } else if (_prev == -2) { \ @@ -444,12 +454,13 @@ typedef enum { return 1; \ } \ -(BOOL)_isDeallocating { \ - if (_rc_ivar == -2) { \ + __typeof__(_rc_ivar) _prev = __atomic_load_n(&_rc_ivar, __ATOMIC_SEQ_CST); \ + if (_prev == -2) { \ return 1; \ - } else if (_rc_ivar < -2) { \ + } else if (_prev < -2) { \ __builtin_trap(); /* BUG: over-release elsewhere */ \ } \ - return _rc_ivar & 1; \ + return _prev & 1; \ } #define _OBJC_SUPPORTED_INLINE_REFCNT_LOGIC(_rc_ivar, _dealloc2main) \ diff --git a/AsyncDisplayKit/Private/_ASCoreAnimationExtras.h b/AsyncDisplayKit/Private/_ASCoreAnimationExtras.h index 4e41338375..2998ea5f5a 100644 --- a/AsyncDisplayKit/Private/_ASCoreAnimationExtras.h +++ b/AsyncDisplayKit/Private/_ASCoreAnimationExtras.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASCoreAnimationExtras.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/Private/_ASCoreAnimationExtras.mm b/AsyncDisplayKit/Private/_ASCoreAnimationExtras.mm index a0c3b14ece..3456308183 100644 --- a/AsyncDisplayKit/Private/_ASCoreAnimationExtras.mm +++ b/AsyncDisplayKit/Private/_ASCoreAnimationExtras.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASCoreAnimationExtras.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "_ASCoreAnimationExtras.h" #import "ASEqualityHelpers.h" diff --git a/AsyncDisplayKit/Private/_ASHierarchyChangeSet.h b/AsyncDisplayKit/Private/_ASHierarchyChangeSet.h index 42c2fa71ab..6ec3b4ca75 100644 --- a/AsyncDisplayKit/Private/_ASHierarchyChangeSet.h +++ b/AsyncDisplayKit/Private/_ASHierarchyChangeSet.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Adlai Holler on 9/29/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/Private/_ASHierarchyChangeSet.m b/AsyncDisplayKit/Private/_ASHierarchyChangeSet.m index 07ef6b2ddb..c89fc99332 100644 --- a/AsyncDisplayKit/Private/_ASHierarchyChangeSet.m +++ b/AsyncDisplayKit/Private/_ASHierarchyChangeSet.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Adlai Holler on 9/29/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "_ASHierarchyChangeSet.h" diff --git a/AsyncDisplayKit/Private/_ASPendingState.h b/AsyncDisplayKit/Private/_ASPendingState.h index 8f6702465f..1636ea94d3 100644 --- a/AsyncDisplayKit/Private/_ASPendingState.h +++ b/AsyncDisplayKit/Private/_ASPendingState.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASPendingState.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -24,7 +26,7 @@ // Supports all of the properties included in the ASDisplayNodeViewProperties protocol -- (void)applyToView:(UIView *)view setFrameDirectly:(BOOL)setFrameDirectly; +- (void)applyToView:(UIView *)view withSpecialPropertiesHandling:(BOOL)setFrameDirectly; - (void)applyToLayer:(CALayer *)layer; + (_ASPendingState *)pendingViewStateFromLayer:(CALayer *)layer; diff --git a/AsyncDisplayKit/Private/_ASPendingState.mm b/AsyncDisplayKit/Private/_ASPendingState.mm index 78d06dac75..636e0c689d 100644 --- a/AsyncDisplayKit/Private/_ASPendingState.mm +++ b/AsyncDisplayKit/Private/_ASPendingState.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASPendingState.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "_ASPendingState.h" @@ -745,7 +747,7 @@ static UIColor *defaultTintColor = nil; ASPendingStateApplyMetricsToLayer(self, layer); } -- (void)applyToView:(UIView *)view setFrameDirectly:(BOOL)setFrameDirectly +- (void)applyToView:(UIView *)view withSpecialPropertiesHandling:(BOOL)specialPropertiesHandling { /* Use our convenience setters blah here instead of layer.blah @@ -789,8 +791,15 @@ static UIColor *defaultTintColor = nil; if (flags.setClipsToBounds) view.clipsToBounds = clipsToBounds; - if (flags.setBackgroundColor) - layer.backgroundColor = backgroundColor; + if (flags.setBackgroundColor) { + // We have to make sure certain nodes get the background color call directly set + if (specialPropertiesHandling) { + view.backgroundColor = [UIColor colorWithCGColor:backgroundColor]; + } else { + // Set the background color to the layer as in the UIView bridge we use this value as background color + layer.backgroundColor = backgroundColor; + } + } if (flags.setTintColor) view.tintColor = self.tintColor; @@ -907,8 +916,7 @@ static UIColor *defaultTintColor = nil; if (flags.setAccessibilityPath) view.accessibilityPath = accessibilityPath; - // For classes like ASTableNode, ASCollectionNode, ASScrollNode and similar - make sure UIView gets setFrame: - if (flags.setFrame && setFrameDirectly) { + if (flags.setFrame && specialPropertiesHandling) { // Frame is only defined when transform is identity because we explicitly diverge from CALayer behavior and define frame without transform #if DEBUG // Checking if the transform is identity is expensive, so disable when unnecessary. We have assertions on in Release, so DEBUG is the only way I know of. diff --git a/AsyncDisplayKit/Private/_ASScopeTimer.h b/AsyncDisplayKit/Private/_ASScopeTimer.h index 0412bc8399..04d63be0bf 100644 --- a/AsyncDisplayKit/Private/_ASScopeTimer.h +++ b/AsyncDisplayKit/Private/_ASScopeTimer.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// _ASScopeTimer.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once diff --git a/AsyncDisplayKit/TextKit/ASEqualityHashHelpers.h b/AsyncDisplayKit/TextKit/ASEqualityHashHelpers.h index c88106c893..c558e859dc 100644 --- a/AsyncDisplayKit/TextKit/ASEqualityHashHelpers.h +++ b/AsyncDisplayKit/TextKit/ASEqualityHashHelpers.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASEqualityHashHelpers.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/TextKit/ASLayoutManager.h b/AsyncDisplayKit/TextKit/ASLayoutManager.h index ec70890c95..b8a62b3ca5 100644 --- a/AsyncDisplayKit/TextKit/ASLayoutManager.h +++ b/AsyncDisplayKit/TextKit/ASLayoutManager.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2016-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASLayoutManager.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/TextKit/ASLayoutManager.m b/AsyncDisplayKit/TextKit/ASLayoutManager.m index b517403b0a..46252c3cab 100644 --- a/AsyncDisplayKit/TextKit/ASLayoutManager.m +++ b/AsyncDisplayKit/TextKit/ASLayoutManager.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2016-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASLayoutManager.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayoutManager.h" diff --git a/AsyncDisplayKit/TextKit/ASTextKitAttributes.h b/AsyncDisplayKit/TextKit/ASTextKitAttributes.h index 49dc9b92f3..178b49a013 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitAttributes.h +++ b/AsyncDisplayKit/TextKit/ASTextKitAttributes.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitAttributes.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once diff --git a/AsyncDisplayKit/TextKit/ASTextKitAttributes.mm b/AsyncDisplayKit/TextKit/ASTextKitAttributes.mm index e4b16f25a0..7f5f1ba1b4 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitAttributes.mm +++ b/AsyncDisplayKit/TextKit/ASTextKitAttributes.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitAttributes.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextKitAttributes.h" diff --git a/AsyncDisplayKit/TextKit/ASTextKitComponents.h b/AsyncDisplayKit/TextKit/ASTextKitComponents.h index 17f6c1f9cc..5acb59c491 100644 --- a/AsyncDisplayKit/TextKit/ASTextKitComponents.h +++ b/AsyncDisplayKit/TextKit/ASTextKitComponents.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextKitComponents.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/TextKit/ASTextKitComponents.m b/AsyncDisplayKit/TextKit/ASTextKitComponents.m index 4283e3993f..f12719e948 100644 --- a/AsyncDisplayKit/TextKit/ASTextKitComponents.m +++ b/AsyncDisplayKit/TextKit/ASTextKitComponents.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextKitComponents.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextKitComponents.h" diff --git a/AsyncDisplayKit/TextKit/ASTextKitContext.h b/AsyncDisplayKit/TextKit/ASTextKitContext.h index b9cd371c1e..ccd7bb0eb9 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitContext.h +++ b/AsyncDisplayKit/TextKit/ASTextKitContext.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitContext.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/TextKit/ASTextKitContext.mm b/AsyncDisplayKit/TextKit/ASTextKitContext.mm index 13a4f1ecee..7410ed9f45 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitContext.mm +++ b/AsyncDisplayKit/TextKit/ASTextKitContext.mm @@ -1,22 +1,22 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitContext.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextKitContext.h" -#import "ASThread.h" - #import "ASLayoutManager.h" +#import + @implementation ASTextKitContext { // All TextKit operations (even non-mutative ones) must be executed serially. - ASDN::Mutex _textKitMutex; + std::mutex _textKitMutex; NSLayoutManager *_layoutManager; NSTextStorage *_textStorage; @@ -35,8 +35,8 @@ { if (self = [super init]) { // Concurrently initialising TextKit components crashes (rdar://18448377) so we use a global lock. - static ASDN::Mutex __staticMutex; - ASDN::MutexLocker l(__staticMutex); + static std::mutex __static_mutex; + std::lock_guard l(__static_mutex); // Create the TextKit component stack with our default configuration. if (textStorageCreationBlock) { _textStorage = textStorageCreationBlock(attributedString); @@ -60,13 +60,13 @@ - (CGSize)constrainedSize { - ASDN::MutexLocker l(_textKitMutex); + std::lock_guard l(_textKitMutex); return _textContainer.size; } - (void)setConstrainedSize:(CGSize)constrainedSize { - ASDN::MutexLocker l(_textKitMutex); + std::lock_guard l(_textKitMutex); _textContainer.size = constrainedSize; } @@ -74,7 +74,7 @@ NSTextStorage *, NSTextContainer *))block { - ASDN::MutexLocker l(_textKitMutex); + std::lock_guard l(_textKitMutex); block(_layoutManager, _textStorage, _textContainer); } diff --git a/AsyncDisplayKit/TextKit/ASTextKitCoreTextAdditions.h b/AsyncDisplayKit/TextKit/ASTextKitCoreTextAdditions.h index 6fe202fa36..e43508c92e 100644 --- a/AsyncDisplayKit/TextKit/ASTextKitCoreTextAdditions.h +++ b/AsyncDisplayKit/TextKit/ASTextKitCoreTextAdditions.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextKitCoreTextAdditions.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/TextKit/ASTextKitCoreTextAdditions.m b/AsyncDisplayKit/TextKit/ASTextKitCoreTextAdditions.m index d2f7465349..5d0337cd5f 100644 --- a/AsyncDisplayKit/TextKit/ASTextKitCoreTextAdditions.m +++ b/AsyncDisplayKit/TextKit/ASTextKitCoreTextAdditions.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextKitCoreTextAdditions.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextKitCoreTextAdditions.h" diff --git a/AsyncDisplayKit/TextKit/ASTextKitEntityAttribute.h b/AsyncDisplayKit/TextKit/ASTextKitEntityAttribute.h index c87f30e6b5..7258d1031f 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitEntityAttribute.h +++ b/AsyncDisplayKit/TextKit/ASTextKitEntityAttribute.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitEntityAttribute.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/TextKit/ASTextKitEntityAttribute.m b/AsyncDisplayKit/TextKit/ASTextKitEntityAttribute.m index 63d0376975..fab55bce5d 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitEntityAttribute.m +++ b/AsyncDisplayKit/TextKit/ASTextKitEntityAttribute.m @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitEntityAttribute.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextKitEntityAttribute.h" diff --git a/AsyncDisplayKit/TextKit/ASTextKitFontSizeAdjuster.h b/AsyncDisplayKit/TextKit/ASTextKitFontSizeAdjuster.h index cd90726dd0..38009494d8 100644 --- a/AsyncDisplayKit/TextKit/ASTextKitFontSizeAdjuster.h +++ b/AsyncDisplayKit/TextKit/ASTextKitFontSizeAdjuster.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextKitFontSizeAdjuster.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import "ASTextKitAttributes.h" diff --git a/AsyncDisplayKit/TextKit/ASTextKitFontSizeAdjuster.mm b/AsyncDisplayKit/TextKit/ASTextKitFontSizeAdjuster.mm index 2ff6cf68d3..bf910a10de 100644 --- a/AsyncDisplayKit/TextKit/ASTextKitFontSizeAdjuster.mm +++ b/AsyncDisplayKit/TextKit/ASTextKitFontSizeAdjuster.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextKitFontSizeAdjuster.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextKitContext.h" #import "ASTextKitFontSizeAdjuster.h" diff --git a/AsyncDisplayKit/TextKit/ASTextKitRenderer+Positioning.h b/AsyncDisplayKit/TextKit/ASTextKitRenderer+Positioning.h index a0713e5790..48543b7193 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitRenderer+Positioning.h +++ b/AsyncDisplayKit/TextKit/ASTextKitRenderer+Positioning.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitRenderer+Positioning.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextKitRenderer.h" diff --git a/AsyncDisplayKit/TextKit/ASTextKitRenderer+Positioning.mm b/AsyncDisplayKit/TextKit/ASTextKitRenderer+Positioning.mm index 881abb9bf4..3a3abb5e47 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitRenderer+Positioning.mm +++ b/AsyncDisplayKit/TextKit/ASTextKitRenderer+Positioning.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitRenderer+Positioning.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextKitRenderer+Positioning.h" diff --git a/AsyncDisplayKit/TextKit/ASTextKitRenderer+TextChecking.h b/AsyncDisplayKit/TextKit/ASTextKitRenderer+TextChecking.h index 0e07ddf378..55a0f2d515 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitRenderer+TextChecking.h +++ b/AsyncDisplayKit/TextKit/ASTextKitRenderer+TextChecking.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitRenderer+TextChecking.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextKitRenderer.h" diff --git a/AsyncDisplayKit/TextKit/ASTextKitRenderer+TextChecking.mm b/AsyncDisplayKit/TextKit/ASTextKitRenderer+TextChecking.mm index bb9bd653b5..83fb9706bf 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitRenderer+TextChecking.mm +++ b/AsyncDisplayKit/TextKit/ASTextKitRenderer+TextChecking.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitRenderer+TextChecking.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextKitRenderer+TextChecking.h" @@ -59,7 +59,6 @@ NSAttributedString *truncationAttributedString = self.attributes.truncationAttributedString; // get the index of the last character, so we can handle text in the truncation token - NSRange visibleRange = self.truncater.visibleRanges[0]; __block NSRange truncationTokenRange = { NSNotFound, 0 }; [truncationAttributedString enumerateAttribute:ASTextKitTruncationAttributeName inRange:NSMakeRange(0, truncationAttributedString.length) @@ -75,6 +74,7 @@ truncationTokenRange = { 0, truncationAttributedString.length }; } + NSRange visibleRange = self.truncater.firstVisibleRange; truncationTokenRange.location += NSMaxRange(visibleRange); __block CGFloat minDistance = CGFLOAT_MAX; diff --git a/AsyncDisplayKit/TextKit/ASTextKitRenderer.h b/AsyncDisplayKit/TextKit/ASTextKitRenderer.h index e57c5dc174..17c9439e0a 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitRenderer.h +++ b/AsyncDisplayKit/TextKit/ASTextKitRenderer.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitRenderer.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -78,7 +78,7 @@ The character range from the original attributedString that is displayed by the renderer given the parameters in the initializer. */ -- (std::vector)visibleRanges; +@property (nonatomic, assign, readonly) std::vector visibleRanges; /** The number of lines shown in the string. @@ -86,3 +86,13 @@ - (NSUInteger)lineCount; @end + +@interface ASTextKitRenderer (ASTextKitRendererConvenience) + +/** + Returns the first visible range or an NSRange with location of NSNotFound and size of 0 if no first visible + range exists + */ +@property (nonatomic, assign, readonly) NSRange firstVisibleRange; + +@end diff --git a/AsyncDisplayKit/TextKit/ASTextKitRenderer.mm b/AsyncDisplayKit/TextKit/ASTextKitRenderer.mm index bc7d2c1069..05463f39e4 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitRenderer.mm +++ b/AsyncDisplayKit/TextKit/ASTextKitRenderer.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitRenderer.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextKitRenderer.h" @@ -137,25 +137,30 @@ static NSCharacterSet *_defaultAvoidTruncationCharacterSet() - (void)_calculateSize { - [self truncater]; // if we have no scale factors or an unconstrained width, there is no reason to try to adjust the font size if (isinf(_constrainedSize.width) == NO && [_attributes.pointSizeScaleFactors count] > 0) { _currentScaleFactor = [[self fontSizeAdjuster] scaleFactor]; } - // Force glyph generation and layout, which may not have happened yet (and isn't triggered by - // -usedRectForTextContainer:). __block NSTextStorage *scaledTextStorage = nil; BOOL isScaled = [self isScaled]; - [[self context] performBlockWithLockedTextKitComponents:^(NSLayoutManager *layoutManager, NSTextStorage *textStorage, NSTextContainer *textContainer) { - if (isScaled) { + if (isScaled) { + // apply the string scale before truncating or else we may truncate the string after we've done the work to shrink it. + [[self context] performBlockWithLockedTextKitComponents:^(NSLayoutManager *layoutManager, NSTextStorage *textStorage, NSTextContainer *textContainer) { NSMutableAttributedString *scaledString = [[NSMutableAttributedString alloc] initWithAttributedString:textStorage]; [ASTextKitFontSizeAdjuster adjustFontSizeForAttributeString:scaledString withScaleFactor:_currentScaleFactor]; scaledTextStorage = [[NSTextStorage alloc] initWithAttributedString:scaledString]; [textStorage removeLayoutManager:layoutManager]; [scaledTextStorage addLayoutManager:layoutManager]; - } + }]; + } + + [[self truncater] truncate]; + + // Force glyph generation and layout, which may not have happened yet (and isn't triggered by + // -usedRectForTextContainer:). + [[self context] performBlockWithLockedTextKitComponents:^(NSLayoutManager *layoutManager, NSTextStorage *textStorage, NSTextContainer *textContainer) { [layoutManager ensureLayoutForTextContainer:textContainer]; }]; @@ -251,7 +256,23 @@ static NSCharacterSet *_defaultAvoidTruncationCharacterSet() - (std::vector)visibleRanges { - return [self truncater].visibleRanges; + ASTextKitTailTruncater *truncater = [self truncater]; + [truncater truncate]; + return truncater.visibleRanges; +} + +@end + +@implementation ASTextKitRenderer (ASTextKitRendererConvenience) + +- (NSRange)firstVisibleRange +{ + std::vector visibleRanges = self.visibleRanges; + if (visibleRanges.size() > 0) { + return visibleRanges[0]; + } + + return NSMakeRange(0, 0); } @end diff --git a/AsyncDisplayKit/TextKit/ASTextKitShadower.h b/AsyncDisplayKit/TextKit/ASTextKitShadower.h index d4d510f3e9..e8997e08e2 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitShadower.h +++ b/AsyncDisplayKit/TextKit/ASTextKitShadower.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitShadower.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/TextKit/ASTextKitShadower.mm b/AsyncDisplayKit/TextKit/ASTextKitShadower.mm index 19eff36b36..5da2b55b75 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitShadower.mm +++ b/AsyncDisplayKit/TextKit/ASTextKitShadower.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitShadower.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextKitShadower.h" diff --git a/AsyncDisplayKit/TextKit/ASTextKitTailTruncater.h b/AsyncDisplayKit/TextKit/ASTextKitTailTruncater.h index 25b0fda98a..c0de25e368 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitTailTruncater.h +++ b/AsyncDisplayKit/TextKit/ASTextKitTailTruncater.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitTailTruncater.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKit/TextKit/ASTextKitTailTruncater.mm b/AsyncDisplayKit/TextKit/ASTextKitTailTruncater.mm index d48013a772..57a9eb2f27 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitTailTruncater.mm +++ b/AsyncDisplayKit/TextKit/ASTextKitTailTruncater.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitTailTruncater.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASAssert.h" @@ -20,7 +20,6 @@ NSCharacterSet *_avoidTailTruncationSet; } @synthesize visibleRanges = _visibleRanges; -@synthesize truncationStringRect = _truncationStringRect; - (instancetype)initWithContext:(ASTextKitContext *)context truncationAttributedString:(NSAttributedString *)truncationAttributedString @@ -30,8 +29,6 @@ _context = context; _truncationAttributedString = truncationAttributedString; _avoidTailTruncationSet = avoidTailTruncationSet; - - [self _truncate]; } return self; } @@ -153,7 +150,7 @@ } } -- (void)_truncate +- (void)truncate { [_context performBlockWithLockedTextKitComponents:^(NSLayoutManager *layoutManager, NSTextStorage *textStorage, NSTextContainer *textContainer) { NSUInteger originalStringLength = textStorage.length; @@ -187,4 +184,14 @@ }]; } +- (NSRange)firstVisibleRange +{ + std::vector visibleRanges = _visibleRanges; + if (visibleRanges.size() > 0) { + return visibleRanges[0]; + } + + return NSMakeRange(NSNotFound, 0); +} + @end diff --git a/AsyncDisplayKit/TextKit/ASTextKitTruncating.h b/AsyncDisplayKit/TextKit/ASTextKitTruncating.h index 946c378f36..952be079eb 100755 --- a/AsyncDisplayKit/TextKit/ASTextKitTruncating.h +++ b/AsyncDisplayKit/TextKit/ASTextKitTruncating.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASTextKitTruncating.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -14,10 +14,21 @@ #import "ASTextKitRenderer.h" +NS_ASSUME_NONNULL_BEGIN + @protocol ASTextKitTruncating +/** + The character range from the original attributedString that is displayed by the renderer given the parameters in the + initializer. + */ @property (nonatomic, assign, readonly) std::vector visibleRanges; -@property (nonatomic, assign, readonly) CGRect truncationStringRect; + +/** + Returns the first visible range or an NSRange with location of NSNotFound and size of 0 if no first visible + range exists + */ +@property (nonatomic, assign, readonly) NSRange firstVisibleRange; /** A truncater object is initialized with the full state of the text. It is a Single Responsibility Object that is @@ -30,7 +41,14 @@ The truncater should not store a strong reference to the context to prevent retain cycles. */ - (instancetype)initWithContext:(ASTextKitContext *)context - truncationAttributedString:(NSAttributedString *)truncationAttributedString - avoidTailTruncationSet:(NSCharacterSet *)avoidTailTruncationSet; + truncationAttributedString:(NSAttributedString * _Nullable)truncationAttributedString + avoidTailTruncationSet:(NSCharacterSet * _Nullable)avoidTailTruncationSet; + +/** + Actually do the truncation. + */ +- (void)truncate; @end + +NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/TextKit/ASTextNodeTypes.h b/AsyncDisplayKit/TextKit/ASTextNodeTypes.h index 800f23ae26..866824730e 100644 --- a/AsyncDisplayKit/TextKit/ASTextNodeTypes.h +++ b/AsyncDisplayKit/TextKit/ASTextNodeTypes.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextNodeTypes.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once diff --git a/AsyncDisplayKit/TextKit/ASTextNodeWordKerner.h b/AsyncDisplayKit/TextKit/ASTextNodeWordKerner.h index a98654cf27..7ef30af71a 100644 --- a/AsyncDisplayKit/TextKit/ASTextNodeWordKerner.h +++ b/AsyncDisplayKit/TextKit/ASTextNodeWordKerner.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextNodeWordKerner.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKit/TextKit/ASTextNodeWordKerner.m b/AsyncDisplayKit/TextKit/ASTextNodeWordKerner.m index f0ae6eea7f..2cf5cb7f41 100644 --- a/AsyncDisplayKit/TextKit/ASTextNodeWordKerner.m +++ b/AsyncDisplayKit/TextKit/ASTextNodeWordKerner.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextNodeWordKerner.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASTextNodeWordKerner.h" diff --git a/AsyncDisplayKit/_ASTransitionContext.h b/AsyncDisplayKit/_ASTransitionContext.h index c9d4cd7ff9..666aed281d 100644 --- a/AsyncDisplayKit/_ASTransitionContext.h +++ b/AsyncDisplayKit/_ASTransitionContext.h @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Levi McCallum on 2/4/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKit/_ASTransitionContext.m b/AsyncDisplayKit/_ASTransitionContext.m index 2474f3f395..e8ad4e8c14 100644 --- a/AsyncDisplayKit/_ASTransitionContext.m +++ b/AsyncDisplayKit/_ASTransitionContext.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Levi McCallum on 2/4/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "_ASTransitionContext.h" @@ -71,7 +75,7 @@ NSString * const ASTransitionContextToLayoutKey = @"org.asyncdisplaykit.ASTransi - (NSArray *)subnodesForKey:(NSString *)key { NSMutableArray *subnodes = [NSMutableArray array]; - for (ASLayout *sublayout in [self layoutForKey:key].immediateSublayouts) { + for (ASLayout *sublayout in [self layoutForKey:key].sublayouts) { [subnodes addObject:(ASDisplayNode *)sublayout.layoutableObject]; } return subnodes; diff --git a/AsyncDisplayKitTestHost/AppDelegate.h b/AsyncDisplayKitTestHost/AppDelegate.h index d3016ec231..90be689aea 100644 --- a/AsyncDisplayKitTestHost/AppDelegate.h +++ b/AsyncDisplayKitTestHost/AppDelegate.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// AppDelegate.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKitTestHost/AppDelegate.mm b/AsyncDisplayKitTestHost/AppDelegate.mm index 79640a07a8..f348d3a943 100644 --- a/AsyncDisplayKitTestHost/AppDelegate.mm +++ b/AsyncDisplayKitTestHost/AppDelegate.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// AppDelegate.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "AppDelegate.h" #import diff --git a/AsyncDisplayKitTestHost/main.m b/AsyncDisplayKitTestHost/main.m index 65c5c16fa8..d99695b526 100644 --- a/AsyncDisplayKitTestHost/main.m +++ b/AsyncDisplayKitTestHost/main.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// main.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import "AppDelegate.h" diff --git a/AsyncDisplayKitTests/ASBasicImageDownloaderContextTests.m b/AsyncDisplayKitTests/ASBasicImageDownloaderContextTests.m index 5fa9b155b2..a50067ab75 100644 --- a/AsyncDisplayKitTests/ASBasicImageDownloaderContextTests.m +++ b/AsyncDisplayKitTests/ASBasicImageDownloaderContextTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASBasicImageDownloaderContextTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import "ASBasicImageDownloaderInternal.h" diff --git a/AsyncDisplayKitTests/ASBasicImageDownloaderTests.m b/AsyncDisplayKitTests/ASBasicImageDownloaderTests.m index b3c772ae8a..3bfad70289 100644 --- a/AsyncDisplayKitTests/ASBasicImageDownloaderTests.m +++ b/AsyncDisplayKitTests/ASBasicImageDownloaderTests.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Victor Mayorov on 10/06/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKitTests/ASBatchFetchingTests.m b/AsyncDisplayKitTests/ASBatchFetchingTests.m index a69e7b1f00..a4c0b50209 100644 --- a/AsyncDisplayKitTests/ASBatchFetchingTests.m +++ b/AsyncDisplayKitTests/ASBatchFetchingTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASBatchFetchingTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKitTests/ASBridgedPropertiesTests.mm b/AsyncDisplayKitTests/ASBridgedPropertiesTests.mm index c95ec00542..f9afa96f2f 100644 --- a/AsyncDisplayKitTests/ASBridgedPropertiesTests.mm +++ b/AsyncDisplayKitTests/ASBridgedPropertiesTests.mm @@ -1,9 +1,13 @@ // -// ASBridgedPropertiesTests.m +// ASBridgedPropertiesTests.mm // AsyncDisplayKit // // Created by Adlai Holler on 1/7/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKitTests/ASCenterLayoutSpecSnapshotTests.mm b/AsyncDisplayKitTests/ASCenterLayoutSpecSnapshotTests.mm index bb38be0d18..406b25f679 100644 --- a/AsyncDisplayKitTests/ASCenterLayoutSpecSnapshotTests.mm +++ b/AsyncDisplayKitTests/ASCenterLayoutSpecSnapshotTests.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASCenterLayoutSpecSnapshotTests.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayoutSpecSnapshotTestsHelper.h" @@ -21,12 +21,6 @@ static const ASSizeRange kSize = {{100, 120}, {320, 160}}; @implementation ASCenterLayoutSpecSnapshotTests -- (void)setUp -{ - [super setUp]; - self.recordMode = NO; -} - - (void)testWithOptions { [self testWithCenteringOptions:ASCenterLayoutSpecCenteringNone sizingOptions:{}]; diff --git a/AsyncDisplayKitTests/ASCollectionViewFlowLayoutInspectorTests.m b/AsyncDisplayKitTests/ASCollectionViewFlowLayoutInspectorTests.m index c9c7910055..1e33f77cd6 100644 --- a/AsyncDisplayKitTests/ASCollectionViewFlowLayoutInspectorTests.m +++ b/AsyncDisplayKitTests/ASCollectionViewFlowLayoutInspectorTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASCollectionViewFlowLayoutInspectorTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import diff --git a/AsyncDisplayKitTests/ASCollectionViewTests.m b/AsyncDisplayKitTests/ASCollectionViewTests.m index 8c7f258a5a..4c7f84aec3 100644 --- a/AsyncDisplayKitTests/ASCollectionViewTests.m +++ b/AsyncDisplayKitTests/ASCollectionViewTests.m @@ -2,7 +2,10 @@ // ASCollectionViewTests.m // AsyncDisplayKit // -// Copyright (c) 2015 Facebook. All rights reserved. +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKitTests/ASControlNodeTests.m b/AsyncDisplayKitTests/ASControlNodeTests.m index 5b094ef0dd..d2d3172968 100644 --- a/AsyncDisplayKitTests/ASControlNodeTests.m +++ b/AsyncDisplayKitTests/ASControlNodeTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASControlNodeTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKitTests/ASDimensionTests.mm b/AsyncDisplayKitTests/ASDimensionTests.mm index 3c32fdea59..e4eee525b4 100644 --- a/AsyncDisplayKitTests/ASDimensionTests.mm +++ b/AsyncDisplayKitTests/ASDimensionTests.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASDimensionTests.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKitTests/ASDisplayLayerTests.m b/AsyncDisplayKitTests/ASDisplayLayerTests.m index a225bbf9a1..c0c2613d00 100644 --- a/AsyncDisplayKitTests/ASDisplayLayerTests.m +++ b/AsyncDisplayKitTests/ASDisplayLayerTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayLayerTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -225,7 +227,12 @@ static _ASDisplayLayerTestDelegateClassModes _class_modes; // DANGER: Don't use the delegate as the parameters in real code; this is not thread-safe and just for accounting in unit tests! + (void)drawRect:(CGRect)bounds withParameters:(_ASDisplayLayerTestDelegate *)delegate isCancelled:(asdisplaynode_iscancelled_block_t)sentinelBlock isRasterizing:(BOOL)isRasterizing { - delegate->_drawRectCount++; + __atomic_add_fetch(&delegate->_drawRectCount, 1, __ATOMIC_SEQ_CST); +} + +- (NSUInteger)drawRectCount +{ + return(__atomic_load_n(&_drawRectCount, __ATOMIC_SEQ_CST)); } - (void)dealloc @@ -265,9 +272,9 @@ static _ASDisplayLayerTestDelegateClassModes _class_modes; // make sure we don't lock up the tests indefinitely; fail after 1 sec by using an async barrier __block BOOL didHitBarrier = NO; dispatch_barrier_async([_ASDisplayLayer displayQueue], ^{ - didHitBarrier = YES; + __atomic_store_n(&didHitBarrier, YES, __ATOMIC_SEQ_CST); }); - XCTAssertTrue(ASDisplayNodeRunRunLoopUntilBlockIsTrue(^BOOL{ return didHitBarrier; })); + XCTAssertTrue(ASDisplayNodeRunRunLoopUntilBlockIsTrue(^BOOL{ return __atomic_load_n(&didHitBarrier, __ATOMIC_SEQ_CST); })); } - (void)waitForLayer:(_ASDisplayLayerTestLayer *)layer asyncDisplayCount:(NSUInteger)count @@ -461,7 +468,7 @@ static _ASDisplayLayerTestDelegateClassModes _class_modes; [asyncDelegate release]; } -- (void)testTransaction +/*- (void)testTransaction { _ASDisplayLayerTestDelegateMode delegateModes = _ASDisplayLayerTestDelegateModeDidDisplay | _ASDisplayLayerTestDelegateModeDrawParameters; [_ASDisplayLayerTestDelegate setClassModes:_ASDisplayLayerTestDelegateClassModeDisplay]; @@ -543,7 +550,7 @@ static _ASDisplayLayerTestDelegateClassModes _class_modes; [containerLayer release]; dispatch_release(displayAsyncLayer1Sema); -} +}*/ - (void)checkSuspendResume:(BOOL)displaysAsynchronously { diff --git a/AsyncDisplayKitTests/ASDisplayNodeAppearanceTests.m b/AsyncDisplayKitTests/ASDisplayNodeAppearanceTests.m index 5b0a0a753f..f350eb1b93 100644 --- a/AsyncDisplayKitTests/ASDisplayNodeAppearanceTests.m +++ b/AsyncDisplayKitTests/ASDisplayNodeAppearanceTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNodeAppearanceTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -58,11 +60,11 @@ static dispatch_block_t modifyMethodByAddingPrologueBlockAndReturnCleanupBlock(C @end // Conveniences for making nodes named a certain way -#define DeclareNodeNamed(n) ASDisplayNode *n = [[ASDisplayNode alloc] init]; n.name = @#n +#define DeclareNodeNamed(n) ASDisplayNode *n = [[[ASDisplayNode alloc] init] autorelease]; n.name = @#n #define DeclareViewNamed(v) UIView *v = viewWithName(@#v) static UIView *viewWithName(NSString *name) { - ASDisplayNode *n = [[ASDisplayNode alloc] init]; + ASDisplayNode *n = [[[ASDisplayNode alloc] init] autorelease]; n.name = name; return n.view; } @@ -128,7 +130,7 @@ static UIView *viewWithName(NSString *name) { - (void)checkAppearanceMethodsCalledWithRootNodeInWindowLayerBacked:(BOOL)isLayerBacked { // ASDisplayNode visibility does not change if modifying a hierarchy that is not in a window. So create one and add the superview to it. - UIWindow *window = [[UIWindow alloc] initWithFrame:CGRectZero]; + UIWindow *window = [[[UIWindow alloc] initWithFrame:CGRectZero] autorelease]; DeclareNodeNamed(n); DeclareViewNamed(superview); @@ -160,15 +162,12 @@ static UIView *viewWithName(NSString *name) { XCTAssertEqual([_willEnterHierarchyCounts countForObject:n], 1u, @"willEnterHierarchy not called when node's view added to hierarchy"); XCTAssertEqual([_didExitHierarchyCounts countForObject:n], 1u, @"didExitHierarchy erroneously called"); - - [superview release]; - [window release]; } - (void)checkManualAppearanceViewLoaded:(BOOL)isViewLoaded layerBacked:(BOOL)isLayerBacked { // ASDisplayNode visibility does not change if modifying a hierarchy that is not in a window. So create one and add the superview to it. - UIWindow *window = [[UIWindow alloc] initWithFrame:CGRectZero]; + UIWindow *window = [[[UIWindow alloc] initWithFrame:CGRectZero] autorelease]; DeclareNodeNamed(parent); DeclareNodeNamed(a); @@ -261,13 +260,13 @@ static UIView *viewWithName(NSString *name) { - (void)testSynchronousIntermediaryView { // Parent is a wrapper node for a scrollview - ASDisplayNode *parentSynchronousNode = [[ASDisplayNode alloc] initWithViewClass:[UIScrollView class]]; + ASDisplayNode *parentSynchronousNode = [[[ASDisplayNode alloc] initWithViewClass:[UIScrollView class]] autorelease]; DeclareNodeNamed(layerBackedNode); DeclareNodeNamed(viewBackedNode); layerBackedNode.layerBacked = YES; - UIWindow *window = [[UIWindow alloc] initWithFrame:CGRectZero]; + UIWindow *window = [[[UIWindow alloc] initWithFrame:CGRectZero] autorelease]; [parentSynchronousNode addSubnode:layerBackedNode]; [parentSynchronousNode addSubnode:viewBackedNode]; @@ -301,11 +300,6 @@ static UIView *viewWithName(NSString *name) { XCTAssertFalse(parentSynchronousNode.inHierarchy, @"Should not have changed"); XCTAssertFalse(layerBackedNode.inHierarchy, @"Should have been marked invisible when synchronous superview was removed from the window"); XCTAssertFalse(viewBackedNode.inHierarchy, @"Should have been marked invisible when synchronous superview was removed from the window"); - - [window release]; - [parentSynchronousNode release]; - [layerBackedNode release]; - [viewBackedNode release]; } - (void)checkMoveAcrossHierarchyLayerBacked:(BOOL)isLayerBacked useManualCalls:(BOOL)useManualDisable useNodeAPI:(BOOL)useNodeAPI diff --git a/AsyncDisplayKitTests/ASDisplayNodeImplicitHierarchyTests.m b/AsyncDisplayKitTests/ASDisplayNodeImplicitHierarchyTests.m index b54201dc8f..a701fa050b 100644 --- a/AsyncDisplayKitTests/ASDisplayNodeImplicitHierarchyTests.m +++ b/AsyncDisplayKitTests/ASDisplayNodeImplicitHierarchyTests.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Levi McCallum on 2/1/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import @@ -17,8 +21,6 @@ @interface ASSpecTestDisplayNode : ASDisplayNode -@property (copy, nonatomic) ASLayoutSpec * (^layoutSpecBlock)(ASSizeRange constrainedSize, NSNumber *layoutState); - /** Simple state identifier to allow control of current spec inside of the layoutSpecBlock */ @@ -37,11 +39,6 @@ return self; } -- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize -{ - return self.layoutSpecBlock(constrainedSize, _layoutState); -} - @end @interface ASDisplayNodeImplicitHierarchyTests : XCTestCase @@ -83,7 +80,7 @@ ASDisplayNode *node5 = [[ASDisplayNode alloc] init]; ASSpecTestDisplayNode *node = [[ASSpecTestDisplayNode alloc] init]; - node.layoutSpecBlock = ^(ASSizeRange constrainedSize, NSNumber *layoutState) { + node.layoutSpecBlock = ^(ASDisplayNode *weakNode, ASSizeRange constrainedSize) { ASStaticLayoutSpec *staticLayout = [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[node4]]; ASStackLayoutSpec *stack1 = [[ASStackLayoutSpec alloc] init]; @@ -109,8 +106,9 @@ ASDisplayNode *node3 = [[ASDisplayNode alloc] init]; ASSpecTestDisplayNode *node = [[ASSpecTestDisplayNode alloc] init]; - node.layoutSpecBlock = ^(ASSizeRange constrainedSize, NSNumber *layoutState){ - if ([layoutState isEqualToNumber:@1]) { + node.layoutSpecBlock = ^(ASDisplayNode *weakNode, ASSizeRange constrainedSize){ + ASSpecTestDisplayNode *strongNode = (ASSpecTestDisplayNode *)weakNode; + if ([strongNode.layoutState isEqualToNumber:@1]) { return [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[node1, node2]]; } else { ASStackLayoutSpec *stackLayout = [[ASStackLayoutSpec alloc] init]; diff --git a/AsyncDisplayKitTests/ASDisplayNodeTests.m b/AsyncDisplayKitTests/ASDisplayNodeTests.m index 36b01040bf..86529730f3 100644 --- a/AsyncDisplayKitTests/ASDisplayNodeTests.m +++ b/AsyncDisplayKitTests/ASDisplayNodeTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNodeTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -19,18 +21,18 @@ #import "ASCellNode.h" // Conveniences for making nodes named a certain way -#define DeclareNodeNamed(n) ASDisplayNode *n = [[ASDisplayNode alloc] init]; n.name = @#n +#define DeclareNodeNamed(n) ASDisplayNode *n = [[[ASDisplayNode alloc] init] autorelease]; n.name = @#n #define DeclareViewNamed(v) UIView *v = viewWithName(@#v) #define DeclareLayerNamed(l) CALayer *l = layerWithName(@#l) static UIView *viewWithName(NSString *name) { - ASDisplayNode *n = [[ASDisplayNode alloc] init]; + ASDisplayNode *n = [[[ASDisplayNode alloc] init] autorelease]; n.name = name; return n.view; } static CALayer *layerWithName(NSString *name) { - ASDisplayNode *n = [[ASDisplayNode alloc] init]; + ASDisplayNode *n = [[[ASDisplayNode alloc] init] autorelease]; n.layerBacked = YES; n.name = name; return n.layer; @@ -86,6 +88,12 @@ for (ASDisplayNode *n in @[ nodes ]) {\ @property (atomic, copy) void (^willDeallocBlock)(ASTestDisplayNode *node); @property (atomic, copy) CGSize(^calculateSizeBlock)(ASTestDisplayNode *node, CGSize size); @property (atomic) BOOL hasFetchedData; + +@property (atomic) BOOL displayRangeStateChangedToYES; +@property (atomic) BOOL displayRangeStateChangedToNO; + +@property (atomic) BOOL loadStateChangedToYES; +@property (atomic) BOOL loadStateChangedToNO; @end @interface ASTestResponderNode : ASTestDisplayNode @@ -110,10 +118,38 @@ for (ASDisplayNode *n in @[ nodes ]) {\ self.hasFetchedData = NO; } +- (void)displayStateDidChange:(BOOL)inDisplayState +{ + [super displayStateDidChange:inDisplayState]; + + if (inDisplayState) { + self.displayRangeStateChangedToYES = YES; + } else { + self.displayRangeStateChangedToNO = YES; + } +} + +- (void)loadStateDidChange:(BOOL)inLoadState +{ + [super loadStateDidChange:inLoadState]; + + if (inLoadState) { + self.loadStateChangedToYES = YES; + } else { + self.loadStateChangedToNO = YES; + } +} + - (void)dealloc { if (_willDeallocBlock) { _willDeallocBlock(self); + [_willDeallocBlock release]; + _willDeallocBlock = nil; + } + if (_calculateSizeBlock) { + [_calculateSizeBlock release]; + _calculateSizeBlock = nil; } [super dealloc]; } @@ -184,19 +220,19 @@ for (ASDisplayNode *n in @[ nodes ]) {\ } - (void)testOverriddenFirstResponderBehavior { - ASTestDisplayNode *node = [[ASTestResponderNode alloc] init]; + ASTestDisplayNode *node = [[[ASTestResponderNode alloc] init] autorelease]; XCTAssertTrue([node canBecomeFirstResponder]); XCTAssertTrue([node becomeFirstResponder]); } - (void)testDefaultFirstResponderBehavior { - ASTestDisplayNode *node = [[ASTestDisplayNode alloc] init]; + ASTestDisplayNode *node = [[[ASTestDisplayNode alloc] init] autorelease]; XCTAssertFalse([node canBecomeFirstResponder]); XCTAssertFalse([node becomeFirstResponder]); } - (void)testLayerBackedFirstResponderBehavior { - ASTestDisplayNode *node = [[ASTestResponderNode alloc] init]; + ASTestDisplayNode *node = [[[ASTestResponderNode alloc] init] autorelease]; node.layerBacked = YES; XCTAssertTrue([node canBecomeFirstResponder]); XCTAssertFalse([node becomeFirstResponder]); @@ -220,6 +256,8 @@ for (ASDisplayNode *n in @[ nodes ]) {\ [self executeOffThread:^{ node = [[ASDisplayNode alloc] init]; }]; + // executeOffThread: blocks until the background thread finishes executing. + node = [node autorelease]; // XXX This is very bad style. UIView *view = node.view; XCTAssertNotNil(view, @"Getting node's view on-thread should succeed."); @@ -227,7 +265,7 @@ for (ASDisplayNode *n in @[ nodes ]) {\ - (void)testNodeCreatedOffThreadWithExistingView { - UIView *view = [[UIDisplayNodeTestView alloc] init]; + UIView *view = [[[UIDisplayNodeTestView alloc] init] autorelease]; __block ASDisplayNode *node = nil; [self executeOffThread:^{ @@ -235,6 +273,8 @@ for (ASDisplayNode *n in @[ nodes ]) {\ return view; }]; }]; + // executeOffThread: blocks until the background thread finishes executing. + node = [node autorelease]; // XXX This is very bad style. XCTAssertFalse(node.layerBacked, @"Can't be layer backed"); XCTAssertTrue(node.synchronous, @"Node with plain view should be synchronous"); @@ -253,6 +293,9 @@ for (ASDisplayNode *n in @[ nodes ]) {\ return view; }]; }]; + // executeOffThread: blocks until the background thread finishes executing. + view = [view autorelease]; // XXX This is very bad style. + node = [node autorelease]; // XXX This is very bad style. XCTAssertNil(view, @"View block should not be invoked yet"); [node view]; @@ -263,10 +306,10 @@ for (ASDisplayNode *n in @[ nodes ]) {\ - (void)testNodeCreatedWithLazyAsyncView { - ASDisplayNode *node = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{ + ASDisplayNode *node = [[[ASDisplayNode alloc] initWithViewBlock:^UIView *{ XCTAssertTrue([NSThread isMainThread], @"View block must run on the main queue"); - return [[_ASDisplayView alloc] init]; - }]; + return [[[_ASDisplayView alloc] init] autorelease]; + }] autorelease]; XCTAssertThrows([node view], @"Externally provided views should be synchronous"); XCTAssertTrue(node.synchronous, @"Node with externally provided view should be synchronous"); @@ -601,7 +644,7 @@ for (ASDisplayNode *n in @[ nodes ]) {\ // Perform parallel updates of a standard UIView/CALayer and an ASDisplayNode and ensure they are equivalent. - (void)testDeriveFrameFromBoundsPositionAnchorPoint { - UIView *plainView = [[UIView alloc] initWithFrame:CGRectZero]; + UIView *plainView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease]; plainView.layer.anchorPoint = CGPointMake(0.25f, 0.75f); plainView.layer.position = CGPointMake(10, 20); plainView.layer.bounds = CGRectMake(0, 0, 60, 80); @@ -613,6 +656,8 @@ for (ASDisplayNode *n in @[ nodes ]) {\ node.bounds = CGRectMake(0, 0, 60, 80); node.position = CGPointMake(10, 20); }]; + // executeOffThread: blocks until the background thread finishes executing. + node = [node autorelease]; // XXX This is very bad style. XCTAssertTrue(CGRectEqualToRect(plainView.frame, node.frame), @"Node frame should match UIView frame before realization."); XCTAssertTrue(CGRectEqualToRect(plainView.frame, node.view.frame), @"Realized view frame should match UIView frame."); @@ -621,7 +666,7 @@ for (ASDisplayNode *n in @[ nodes ]) {\ // Perform parallel updates of a standard UIView/CALayer and an ASDisplayNode and ensure they are equivalent. - (void)testSetFrameSetsBoundsPosition { - UIView *plainView = [[UIView alloc] initWithFrame:CGRectZero]; + UIView *plainView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease]; plainView.layer.anchorPoint = CGPointMake(0.25f, 0.75f); plainView.layer.frame = CGRectMake(10, 20, 60, 80); @@ -631,6 +676,8 @@ for (ASDisplayNode *n in @[ nodes ]) {\ node.anchorPoint = CGPointMake(0.25f, 0.75f); node.frame = CGRectMake(10, 20, 60, 80); }]; + // executeOffThread: blocks until the background thread finishes executing. + node = [node autorelease]; // XXX This is very bad style. XCTAssertTrue(CGPointEqualToPoint(plainView.layer.position, node.position), @"Node position should match UIView position before realization."); XCTAssertTrue(CGRectEqualToRect(plainView.layer.bounds, node.bounds), @"Node bounds should match UIView bounds before realization."); @@ -891,7 +938,7 @@ for (ASDisplayNode *n in @[ nodes ]) {\ - (void)testDisplayNodePointConversionOnDeepHierarchies { - ASDisplayNode *node = [[ASDisplayNode alloc] init]; + ASDisplayNode *node = [[[ASDisplayNode alloc] init] autorelease]; // 7 deep (six below root); each one positioned at position = (1, 1) _addTonsOfSubnodes(node, 2, 6, ^(ASDisplayNode *createdNode) { @@ -1078,7 +1125,7 @@ static inline BOOL _CGPointEqualToPointWithEpsilon(CGPoint point1, CGPoint point - (void)testSubnodes { - ASDisplayNode *parent = [[ASDisplayNode alloc] init]; + ASDisplayNode *parent = [[[ASDisplayNode alloc] init] autorelease]; ASDisplayNode *nilNode = nil; XCTAssertNoThrow([parent addSubnode:nilNode], @"Don't try to add nil, but we'll deal."); XCTAssertNoThrow([parent addSubnode:parent], @"Not good, test that we recover"); @@ -1181,11 +1228,6 @@ static inline BOOL _CGPointEqualToPointWithEpsilon(CGPoint point1, CGPoint point XCTAssertNodesHaveParent(nilParent, a,d); //TODO: assert that things deallocate immediately and don't have latent autoreleases in here - [parent release]; - [a release]; - [b release]; - [c release]; - [d release]; } - (void)testInsertSubnodeAtIndexView @@ -1314,17 +1356,12 @@ static inline BOOL _CGPointEqualToPointWithEpsilon(CGPoint point1, CGPoint point XCTAssertNodesHaveParent(nilParent, d); //TODO: assert that things deallocate immediately and don't have latent autoreleases in here - [parent release]; - [a release]; - [b release]; - [c release]; - [d release]; } // This tests our resiliancy to having other views and layers inserted into our view or layer - (void)testInsertSubviewAtIndexWithMeddlingViewsAndLayersViewBacked { - ASDisplayNode *parent = [[ASDisplayNode alloc] init]; + ASDisplayNode *parent = [[[ASDisplayNode alloc] init] autorelease]; DeclareNodeNamed(a); DeclareNodeNamed(b); @@ -1359,12 +1396,6 @@ static inline BOOL _CGPointEqualToPointWithEpsilon(CGPoint point1, CGPoint point XCTAssertEqual(4u, parent.layer.sublayers.count, @"Should have the right sublayer count"); //TODO: assert that things deallocate immediately and don't have latent autoreleases in here - [parent release]; - [a release]; - [b release]; - [c release]; - [d release]; - [e release]; } - (void)testAppleBugInsertSubview @@ -1437,11 +1468,6 @@ static inline BOOL _CGPointEqualToPointWithEpsilon(CGPoint point1, CGPoint point XCTAssertEqual(4u, parent.layer.sublayers.count, @"Should have the right sublayer count"); //TODO: assert that things deallocate immediately and don't have latent autoreleases in here - [parent release]; - [a release]; - [b release]; - [c release]; - [d release]; } @@ -1520,10 +1546,6 @@ static inline BOOL _CGPointEqualToPointWithEpsilon(CGPoint point1, CGPoint point XCTAssertNodesHaveParent(parent, a, c, b); //TODO: assert that things deallocate immediately and don't have latent autoreleases in here - [parent release]; - [a release]; - [b release]; - [c release]; } - (void)testInsertSubnodeAboveWithView @@ -1602,10 +1624,57 @@ static inline BOOL _CGPointEqualToPointWithEpsilon(CGPoint point1, CGPoint point XCTAssertNodesHaveParent(parent, a, c, b); //TODO: assert that things deallocate immediately and don't have latent autoreleases in here - [parent release]; - [a release]; - [b release]; - [c release]; +} + +- (void)testRemoveFromViewBackedLoadedSupernode +{ + DeclareNodeNamed(a); + DeclareNodeNamed(b); + [b addSubnode:a]; + [a view]; + [b view]; + XCTAssertNodesLoaded(a, b); + XCTAssertEqual(a.supernode, b); + XCTAssertEqual(a.view.superview, b.view); + + [a removeFromSupernode]; + XCTAssertNil(a.supernode); + XCTAssertNil(a.view.superview); +} + +- (void)testRemoveFromLayerBackedLoadedSupernode +{ + DeclareNodeNamed(a); + a.layerBacked = YES; + DeclareNodeNamed(b); + b.layerBacked = YES; + [b addSubnode:a]; + [a layer]; + [b layer]; + XCTAssertNodesLoaded(a, b); + XCTAssertEqual(a.supernode, b); + XCTAssertEqual(a.layer.superlayer, b.layer); + + [a removeFromSupernode]; + XCTAssertNil(a.supernode); + XCTAssertNil(a.layer.superlayer); +} + +- (void)testRemoveLayerBackedFromViewBackedLoadedSupernode +{ + DeclareNodeNamed(a); + a.layerBacked = YES; + DeclareNodeNamed(b); + [b addSubnode:a]; + [a layer]; + [b view]; + XCTAssertNodesLoaded(a, b); + XCTAssertEqual(a.supernode, b); + XCTAssertEqual(a.layer.superlayer, b.layer); + + [a removeFromSupernode]; + XCTAssertNil(a.supernode); + XCTAssertNil(a.layer.superlayer); } - (void)testSubnodeAddedBeforeLoadingExternalView @@ -1621,6 +1690,9 @@ static inline BOOL _CGPointEqualToPointWithEpsilon(CGPoint point1, CGPoint point child = [[ASDisplayNode alloc] init]; [parent addSubnode:child]; }]; + // executeOffThread: blocks until the background thread finishes executing. + parent = [parent autorelease]; // XXX This is very bad style. + child = [child autorelease]; // XXX This is very bad style. XCTAssertEqual(1, parent.subnodes.count, @"Parent should have 1 subnode"); XCTAssertEqualObjects(parent, child.supernode, @"Child has the wrong parent"); @@ -1633,14 +1705,14 @@ static inline BOOL _CGPointEqualToPointWithEpsilon(CGPoint point1, CGPoint point - (void)testSubnodeAddedAfterLoadingExternalView { - UIView *view = [[UIDisplayNodeTestView alloc] init]; - ASDisplayNode *parent = [[ASDisplayNode alloc] initWithViewBlock:^{ + UIView *view = [[[UIDisplayNodeTestView alloc] init] autorelease]; + ASDisplayNode *parent = [[[ASDisplayNode alloc] initWithViewBlock:^{ return view; - }]; + }] autorelease]; [parent view]; - ASDisplayNode *child = [[ASDisplayNode alloc] init]; + ASDisplayNode *child = [[[ASDisplayNode alloc] init] autorelease]; [parent addSubnode:child]; XCTAssertEqual(1, parent.subnodes.count, @"Parent should have 1 subnode"); @@ -1770,7 +1842,7 @@ static inline BOOL _CGPointEqualToPointWithEpsilon(CGPoint point1, CGPoint point - (void)testInitWithViewClass { - ASDisplayNode *scrollNode = [[ASDisplayNode alloc] initWithViewClass:[UIScrollView class]]; + ASDisplayNode *scrollNode = [[[ASDisplayNode alloc] initWithViewClass:[UIScrollView class]] autorelease]; XCTAssertFalse(scrollNode.isLayerBacked, @"Can't be layer backed"); XCTAssertFalse(scrollNode.nodeLoaded, @"Shouldn't have a view yet"); @@ -1785,7 +1857,7 @@ static inline BOOL _CGPointEqualToPointWithEpsilon(CGPoint point1, CGPoint point - (void)testInitWithLayerClass { - ASDisplayNode *transformNode = [[ASDisplayNode alloc] initWithLayerClass:[CATransformLayer class]]; + ASDisplayNode *transformNode = [[[ASDisplayNode alloc] initWithLayerClass:[CATransformLayer class]] autorelease]; XCTAssertTrue(transformNode.isLayerBacked, @"Created with layer class => should be layer-backed by default"); XCTAssertFalse(transformNode.nodeLoaded, @"Shouldn't have a view yet"); @@ -1868,7 +1940,7 @@ static bool stringContainsPointer(NSString *description, const void *p) { - (void)testBounds { - ASDisplayNode *node = [[ASDisplayNode alloc] init]; + ASDisplayNode *node = [[[ASDisplayNode alloc] init] autorelease]; node.bounds = CGRectMake(1, 2, 3, 4); node.frame = CGRectMake(5, 6, 7, 8); @@ -1878,4 +1950,42 @@ static bool stringContainsPointer(NSString *description, const void *p) { XCTAssert(node.bounds.size.height == 8, @"Wrong ASDisplayNode.bounds.size.height"); } +- (void)testDidEnterDisplayIsCalledWhenNodesEnterDisplayRange +{ + ASTestDisplayNode *node = [[[ASTestDisplayNode alloc] init] autorelease]; + + [node recursivelySetInterfaceState:ASInterfaceStateDisplay]; + + XCTAssert([node displayRangeStateChangedToYES]); +} + +- (void)testDidExitDisplayIsCalledWhenNodesExitDisplayRange +{ + ASTestDisplayNode *node = [[[ASTestDisplayNode alloc] init] autorelease]; + + [node recursivelySetInterfaceState:ASInterfaceStateDisplay]; + [node recursivelySetInterfaceState:ASInterfaceStateFetchData]; + + XCTAssert([node displayRangeStateChangedToNO]); +} + +- (void)testDidEnterFetchDataIsCalledWhenNodesEnterFetchDataRange +{ + ASTestDisplayNode *node = [[[ASTestDisplayNode alloc] init] autorelease]; + + [node recursivelySetInterfaceState:ASInterfaceStateFetchData]; + + XCTAssert([node loadStateChangedToYES]); +} + +- (void)testDidExitFetchDataIsCalledWhenNodesExitFetchDataRange +{ + ASTestDisplayNode *node = [[[ASTestDisplayNode alloc] init] autorelease]; + + [node recursivelySetInterfaceState:ASInterfaceStateFetchData]; + [node recursivelySetInterfaceState:ASInterfaceStateDisplay]; + + XCTAssert([node loadStateChangedToNO]); +} + @end diff --git a/AsyncDisplayKitTests/ASDisplayNodeTestsHelper.h b/AsyncDisplayKitTests/ASDisplayNodeTestsHelper.h index 9c2a1fe524..7f1ad0b383 100644 --- a/AsyncDisplayKitTests/ASDisplayNodeTestsHelper.h +++ b/AsyncDisplayKitTests/ASDisplayNodeTestsHelper.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNodeTestsHelper.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKitTests/ASDisplayNodeTestsHelper.m b/AsyncDisplayKitTests/ASDisplayNodeTestsHelper.m index 18fb738035..728ffec66f 100644 --- a/AsyncDisplayKitTests/ASDisplayNodeTestsHelper.m +++ b/AsyncDisplayKitTests/ASDisplayNodeTestsHelper.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASDisplayNodeTestsHelper.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASDisplayNodeTestsHelper.h" diff --git a/AsyncDisplayKitTests/ASEditableTextNodeTests.m b/AsyncDisplayKitTests/ASEditableTextNodeTests.m new file mode 100644 index 0000000000..43d415ac51 --- /dev/null +++ b/AsyncDisplayKitTests/ASEditableTextNodeTests.m @@ -0,0 +1,107 @@ +// +// ASEditableTextNodeTests.m +// AsyncDisplayKit +// +// Created by Michael Schneider on 5/31/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import +#import + +static BOOL CGSizeEqualToSizeWithIn(CGSize size1, CGSize size2, CGFloat delta) +{ + return fabs(size1.width - size2.width) < delta && fabs(size1.height - size2.height) < delta; +} + +@interface ASEditableTextNodeTests : XCTestCase +@property (nonatomic, readwrite, strong) ASEditableTextNode *editableTextNode; +@property (nonatomic, readwrite, copy) NSAttributedString *attributedText; +@end + +@implementation ASEditableTextNodeTests + +- (void)setUp +{ + [super setUp]; + + _editableTextNode = [[ASEditableTextNode alloc] init]; + + NSMutableAttributedString *mas = [[NSMutableAttributedString alloc] initWithString:@"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."]; + NSMutableParagraphStyle *para = [NSMutableParagraphStyle new]; + para.alignment = NSTextAlignmentCenter; + para.lineSpacing = 1.0; + [mas addAttribute:NSParagraphStyleAttributeName value:para + range:NSMakeRange(0, mas.length - 1)]; + + // Vary the linespacing on the last line + NSMutableParagraphStyle *lastLinePara = [NSMutableParagraphStyle new]; + lastLinePara.alignment = para.alignment; + lastLinePara.lineSpacing = 5.0; + [mas addAttribute:NSParagraphStyleAttributeName value:lastLinePara + range:NSMakeRange(mas.length - 1, 1)]; + + _attributedText = mas; + _editableTextNode.attributedText = _attributedText; + +} + +#pragma mark - ASEditableTextNode + +- (void)testAllocASEditableTextNode +{ + ASEditableTextNode *node = [[ASEditableTextNode alloc] init]; + XCTAssertTrue([[node class] isSubclassOfClass:[ASEditableTextNode class]], @"ASTextNode alloc should return an instance of ASTextNode, instead returned %@", [node class]); +} + +#pragma mark - ASEditableTextNode + +- (void)testSetPreferredFrameSize +{ + CGSize preferredFrameSize = CGSizeMake(100, 100); + _editableTextNode.preferredFrameSize = preferredFrameSize; + + CGSize calculatedSize = [_editableTextNode measure:CGSizeZero]; + XCTAssertTrue(calculatedSize.width != preferredFrameSize.width, @"Calculated width (%f) should be equal than preferred width (%f)", calculatedSize.width, preferredFrameSize.width); + XCTAssertTrue(calculatedSize.width != preferredFrameSize.width, @"Calculated height (%f) should be equal than preferred height (%f)", calculatedSize.width, preferredFrameSize.width); + + _editableTextNode.preferredFrameSize = CGSizeZero; +} + +- (void)testCalculatedSizeIsGreaterThanOrEqualToConstrainedSize +{ + for (NSInteger i = 10; i < 500; i += 50) { + CGSize constrainedSize = CGSizeMake(i, i); + CGSize calculatedSize = [_editableTextNode measure:constrainedSize]; + XCTAssertTrue(calculatedSize.width <= constrainedSize.width, @"Calculated width (%f) should be less than or equal to constrained width (%f)", calculatedSize.width, constrainedSize.width); + XCTAssertTrue(calculatedSize.height <= constrainedSize.height, @"Calculated height (%f) should be less than or equal to constrained height (%f)", calculatedSize.height, constrainedSize.height); + } +} + +- (void)testRecalculationOfSizeIsSameAsOriginallyCalculatedSize +{ + for (NSInteger i = 10; i < 500; i += 50) { + CGSize constrainedSize = CGSizeMake(i, i); + CGSize calculatedSize = [_editableTextNode measure:constrainedSize]; + CGSize recalculatedSize = [_editableTextNode measure:calculatedSize]; + + XCTAssertTrue(CGSizeEqualToSizeWithIn(calculatedSize, recalculatedSize, 4.0), @"Recalculated size %@ should be same as original size %@", NSStringFromCGSize(recalculatedSize), NSStringFromCGSize(calculatedSize)); + } +} + +- (void)testRecalculationOfSizeIsSameAsOriginallyCalculatedFloatingPointSize +{ + for (CGFloat i = 10; i < 500; i *= 1.3) { + CGSize constrainedSize = CGSizeMake(i, i); + CGSize calculatedSize = [_editableTextNode measure:constrainedSize]; + CGSize recalculatedSize = [_editableTextNode measure:calculatedSize]; + + XCTAssertTrue(CGSizeEqualToSizeWithIn(calculatedSize, recalculatedSize, 11.0), @"Recalculated size %@ should be same as original size %@", NSStringFromCGSize(recalculatedSize), NSStringFromCGSize(calculatedSize)); + } +} + +@end diff --git a/AsyncDisplayKitTests/ASImageNodeSnapshotTests.m b/AsyncDisplayKitTests/ASImageNodeSnapshotTests.m index e5a48b5e5c..69d9e8bc7b 100644 --- a/AsyncDisplayKitTests/ASImageNodeSnapshotTests.m +++ b/AsyncDisplayKitTests/ASImageNodeSnapshotTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASImageNodeSnapshotTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASSnapshotTestCase.h" diff --git a/AsyncDisplayKitTests/ASInsetLayoutSpecSnapshotTests.mm b/AsyncDisplayKitTests/ASInsetLayoutSpecSnapshotTests.mm index 994acee8c4..867aa76cec 100644 --- a/AsyncDisplayKitTests/ASInsetLayoutSpecSnapshotTests.mm +++ b/AsyncDisplayKitTests/ASInsetLayoutSpecSnapshotTests.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASInsetLayoutSpecSnapshotTests.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayoutSpecSnapshotTestsHelper.h" @@ -45,12 +45,6 @@ static NSString *nameForInsets(UIEdgeInsets insets) @implementation ASInsetLayoutSpecSnapshotTests -- (void)setUp -{ - [super setUp]; - self.recordMode = NO; -} - - (void)testInsetsWithVariableSize { for (NSUInteger combination = 0; combination < 16; combination++) { diff --git a/AsyncDisplayKitTests/ASLayoutSpecSnapshotTestsHelper.h b/AsyncDisplayKitTests/ASLayoutSpecSnapshotTestsHelper.h index 362381ffee..fc64d11736 100644 --- a/AsyncDisplayKitTests/ASLayoutSpecSnapshotTestsHelper.h +++ b/AsyncDisplayKitTests/ASLayoutSpecSnapshotTestsHelper.h @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASLayoutSpecSnapshotTestsHelper.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASSnapshotTestCase.h" #import "ASDisplayNode+Subclasses.h" diff --git a/AsyncDisplayKitTests/ASLayoutSpecSnapshotTestsHelper.m b/AsyncDisplayKitTests/ASLayoutSpecSnapshotTestsHelper.m index 92895d5a9a..bb182aa4a7 100644 --- a/AsyncDisplayKitTests/ASLayoutSpecSnapshotTestsHelper.m +++ b/AsyncDisplayKitTests/ASLayoutSpecSnapshotTestsHelper.m @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASLayoutSpecSnapshotTestsHelper.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayoutSpecSnapshotTestsHelper.h" @@ -20,6 +20,12 @@ @implementation ASLayoutSpecSnapshotTestCase +- (void)setUp +{ + [super setUp]; + self.recordMode = NO; +} + - (void)testLayoutSpec:(ASLayoutSpec *)layoutSpec sizeRange:(ASSizeRange)sizeRange subnodes:(NSArray *)subnodes @@ -55,10 +61,11 @@ { ASLayout *layout = [layoutSpecUnderTest measureWithSizeRange:sizeRange]; layout.position = CGPointZero; - layout = [ASLayout layoutWithLayoutableObject:self size:layout.size sublayouts:@[layout]]; - _layoutUnderTest = [layout flattenedLayoutUsingPredicateBlock:^BOOL(ASLayout *evaluatedLayout) { - return [self.subnodes containsObject:(ASDisplayNode *)evaluatedLayout.layoutableObject]; - }]; + layout = [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:sizeRange + size:layout.size + sublayouts:@[layout]]; + _layoutUnderTest = [layout filteredNodeLayoutTree]; self.frame = CGRectMake(0, 0, _layoutUnderTest.size.width, _layoutUnderTest.size.height); [self measure:_layoutUnderTest.size]; } diff --git a/AsyncDisplayKitTests/ASMultiplexImageNodeTests.m b/AsyncDisplayKitTests/ASMultiplexImageNodeTests.m index 7fef1de042..9b7b325660 100644 --- a/AsyncDisplayKitTests/ASMultiplexImageNodeTests.m +++ b/AsyncDisplayKitTests/ASMultiplexImageNodeTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASMultiplexImageNodeTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -88,8 +90,22 @@ static BOOL ASRunRunLoopUntilBlockIsTrue(BOOL (^block)()) { [super setUp]; - _mockCache = [OCMockObject mockForProtocol:@protocol(ASImageCacheProtocol)]; - _mockDownloader = [OCMockObject mockForProtocol:@protocol(ASImageDownloaderProtocol)]; + _mockCache = [[OCMockObject mockForProtocol:@protocol(ASImageCacheProtocol)] retain]; + _mockDownloader = [[OCMockObject mockForProtocol:@protocol(ASImageDownloaderProtocol)] retain]; +} + +- (void)tearDown +{ + if(_mockCache) { + [_mockCache release]; + _mockCache = nil; + } + if(_mockDownloader) { + [_mockDownloader release]; + _mockDownloader = nil; + } + + [super tearDown]; } - (void)testDataSourceImageMethod diff --git a/AsyncDisplayKitTests/ASMutableAttributedStringBuilderTests.m b/AsyncDisplayKitTests/ASMutableAttributedStringBuilderTests.m index 9a43f5f434..e74167cd1a 100644 --- a/AsyncDisplayKitTests/ASMutableAttributedStringBuilderTests.m +++ b/AsyncDisplayKitTests/ASMutableAttributedStringBuilderTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASMutableAttributedStringBuilderTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKitTests/ASOverlayLayoutSpecSnapshotTests.mm b/AsyncDisplayKitTests/ASOverlayLayoutSpecSnapshotTests.mm index f024de9faa..0485605978 100644 --- a/AsyncDisplayKitTests/ASOverlayLayoutSpecSnapshotTests.mm +++ b/AsyncDisplayKitTests/ASOverlayLayoutSpecSnapshotTests.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASOverlayLayoutSpecSnapshotTests.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayoutSpecSnapshotTestsHelper.h" @@ -20,12 +20,6 @@ static const ASSizeRange kSize = {{320, 320}, {320, 320}}; @implementation ASOverlayLayoutSpecSnapshotTests -- (void)setUp -{ - [super setUp]; - self.recordMode = NO; -} - - (void)testOverlay { ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor blueColor]); diff --git a/AsyncDisplayKitTests/ASPhotosFrameworkImageRequestTests.m b/AsyncDisplayKitTests/ASPhotosFrameworkImageRequestTests.m index d6c641bd8a..ae9b2e4555 100644 --- a/AsyncDisplayKitTests/ASPhotosFrameworkImageRequestTests.m +++ b/AsyncDisplayKitTests/ASPhotosFrameworkImageRequestTests.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Adlai Holler on 9/25/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKitTests/ASRatioLayoutSpecSnapshotTests.mm b/AsyncDisplayKitTests/ASRatioLayoutSpecSnapshotTests.mm index 5345a84649..9cc878b6c5 100644 --- a/AsyncDisplayKitTests/ASRatioLayoutSpecSnapshotTests.mm +++ b/AsyncDisplayKitTests/ASRatioLayoutSpecSnapshotTests.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASRatioLayoutSpecSnapshotTests.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayoutSpecSnapshotTestsHelper.h" @@ -19,12 +19,6 @@ static const ASSizeRange kFixedSize = {{0, 0}, {100, 100}}; @implementation ASRatioLayoutSpecSnapshotTests -- (void)setUp -{ - [super setUp]; - self.recordMode = NO; -} - - (void)testRatioLayoutSpecWithRatio:(CGFloat)ratio childSize:(CGSize)childSize identifier:(NSString *)identifier { ASStaticSizeDisplayNode *subnode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]); diff --git a/AsyncDisplayKitTests/ASRelativeLayoutSpecSnapshotTests.mm b/AsyncDisplayKitTests/ASRelativeLayoutSpecSnapshotTests.mm index 213045ea68..fdbf3713b3 100644 --- a/AsyncDisplayKitTests/ASRelativeLayoutSpecSnapshotTests.mm +++ b/AsyncDisplayKitTests/ASRelativeLayoutSpecSnapshotTests.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASRelativeLayoutSpecSnapshotTests.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayoutSpecSnapshotTestsHelper.h" @@ -21,12 +21,6 @@ static const ASSizeRange kSize = {{100, 120}, {320, 160}}; @implementation ASRelativeLayoutSpecSnapshotTests -- (void)setUp -{ - [super setUp]; - self.recordMode = NO; -} - - (void)testWithOptions { diff --git a/AsyncDisplayKitTests/ASSnapshotTestCase.h b/AsyncDisplayKitTests/ASSnapshotTestCase.h index dae712c29b..5c1cf3d677 100644 --- a/AsyncDisplayKitTests/ASSnapshotTestCase.h +++ b/AsyncDisplayKitTests/ASSnapshotTestCase.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASSnapshotTestCase.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKitTests/ASSnapshotTestCase.mm b/AsyncDisplayKitTests/ASSnapshotTestCase.mm index 32c96590d6..1a68e47cfa 100644 --- a/AsyncDisplayKitTests/ASSnapshotTestCase.mm +++ b/AsyncDisplayKitTests/ASSnapshotTestCase.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASSnapshotTestCase.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASSnapshotTestCase.h" #import "ASDisplayNode+FrameworkPrivate.h" diff --git a/AsyncDisplayKitTests/ASStackLayoutSpecSnapshotTests.mm b/AsyncDisplayKitTests/ASStackLayoutSpecSnapshotTests.mm index d5ca9074aa..bf40f61133 100644 --- a/AsyncDisplayKitTests/ASStackLayoutSpecSnapshotTests.mm +++ b/AsyncDisplayKitTests/ASStackLayoutSpecSnapshotTests.mm @@ -1,12 +1,12 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ +// +// ASStackLayoutSpecSnapshotTests.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASLayoutSpecSnapshotTestsHelper.h" @@ -21,12 +21,6 @@ @implementation ASStackLayoutSpecSnapshotTests -- (void)setUp -{ - [super setUp]; - self.recordMode = NO; -} - #pragma mark - Utility methods static NSArray *defaultSubnodes() diff --git a/AsyncDisplayKitTests/ASStaticLayoutSpecSnapshotTests.m b/AsyncDisplayKitTests/ASStaticLayoutSpecSnapshotTests.m index 36efb324a3..b747dbb098 100644 --- a/AsyncDisplayKitTests/ASStaticLayoutSpecSnapshotTests.m +++ b/AsyncDisplayKitTests/ASStaticLayoutSpecSnapshotTests.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Huy Nguyen on 18/10/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import "ASLayoutSpecSnapshotTestsHelper.h" @@ -16,12 +20,6 @@ @implementation ASStaticLayoutSpecSnapshotTests -- (void)setUp -{ - [super setUp]; - self.recordMode = NO; -} - - (void)testSizingBehaviour { [self testWithSizeRange:ASSizeRangeMake(CGSizeMake(150, 200), CGSizeMake(FLT_MAX, FLT_MAX)) diff --git a/AsyncDisplayKitTests/ASTableViewTests.m b/AsyncDisplayKitTests/ASTableViewTests.m index 2949a16e2f..19a827ea28 100644 --- a/AsyncDisplayKitTests/ASTableViewTests.m +++ b/AsyncDisplayKitTests/ASTableViewTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTableViewTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKitTests/ASTableViewThrashTests.m b/AsyncDisplayKitTests/ASTableViewThrashTests.m new file mode 100644 index 0000000000..5d6fa8f637 --- /dev/null +++ b/AsyncDisplayKitTests/ASTableViewThrashTests.m @@ -0,0 +1,562 @@ +// +// ASTableViewThrashTests.m +// AsyncDisplayKit +// +// Created by Adlai Holler on 6/21/16. +// Copyright Β© 2016 Facebook. All rights reserved. +// + +@import XCTest; +#import + +// Set to 1 to use UITableView and see if the issue still exists. +#define USE_UIKIT_REFERENCE 0 + +#if USE_UIKIT_REFERENCE +#define TableView UITableView +#define kCellReuseID @"ASThrashTestCellReuseID" +#else +#define TableView ASTableView +#endif + +#define kInitialSectionCount 20 +#define kInitialItemCount 20 +#define kMinimumItemCount 5 +#define kMinimumSectionCount 3 +#define kFickleness 0.1 +#define kThrashingIterationCount 100 + +static NSString *ASThrashArrayDescription(NSArray *array) { + NSMutableString *str = [NSMutableString stringWithString:@"(\n"]; + NSInteger i = 0; + for (id obj in array) { + [str appendFormat:@"\t[%ld]: \"%@\",\n", i, obj]; + i += 1; + } + [str appendString:@")"]; + return str; +} + +static volatile int32_t ASThrashTestItemNextID = 1; +@interface ASThrashTestItem: NSObject +@property (nonatomic, readonly) NSInteger itemID; + +- (CGFloat)rowHeight; +@end + +@implementation ASThrashTestItem + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)init { + self = [super init]; + if (self != nil) { + _itemID = OSAtomicIncrement32(&ASThrashTestItemNextID); + } + return self; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super init]; + if (self != nil) { + _itemID = [aDecoder decodeIntegerForKey:@"itemID"]; + NSAssert(_itemID > 0, @"Failed to decode %@", self); + } + return self; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [aCoder encodeInteger:_itemID forKey:@"itemID"]; +} + ++ (NSMutableArray *)itemsWithCount:(NSInteger)count { + NSMutableArray *result = [NSMutableArray arrayWithCapacity:count]; + for (NSInteger i = 0; i < count; i += 1) { + [result addObject:[[ASThrashTestItem alloc] init]]; + } + return result; +} + +- (CGFloat)rowHeight { + return (self.itemID % 400) ?: 44; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"", (unsigned long)_itemID]; +} + +@end + +@interface ASThrashTestSection: NSObject +@property (nonatomic, strong, readonly) NSMutableArray *items; +@property (nonatomic, readonly) NSInteger sectionID; + +- (CGFloat)headerHeight; +@end + +static volatile int32_t ASThrashTestSectionNextID = 1; +@implementation ASThrashTestSection + +/// Create an array of sections with the given count ++ (NSMutableArray *)sectionsWithCount:(NSInteger)count { + NSMutableArray *result = [NSMutableArray arrayWithCapacity:count]; + for (NSInteger i = 0; i < count; i += 1) { + [result addObject:[[ASThrashTestSection alloc] initWithCount:kInitialItemCount]]; + } + return result; +} + +- (instancetype)initWithCount:(NSInteger)count { + self = [super init]; + if (self != nil) { + _sectionID = OSAtomicIncrement32(&ASThrashTestSectionNextID); + _items = [ASThrashTestItem itemsWithCount:count]; + } + return self; +} + +- (instancetype)init { + return [self initWithCount:0]; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super init]; + if (self != nil) { + _items = [aDecoder decodeObjectOfClass:[NSArray class] forKey:@"items"]; + _sectionID = [aDecoder decodeIntegerForKey:@"sectionID"]; + NSAssert(_sectionID > 0, @"Failed to decode %@", self); + } + return self; +} + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [aCoder encodeObject:_items forKey:@"items"]; + [aCoder encodeInteger:_sectionID forKey:@"sectionID"]; +} + +- (CGFloat)headerHeight { + return self.sectionID % 400 ?: 44; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"
", (unsigned long)_sectionID, (unsigned long)self.items.count]; +} + +- (id)copyWithZone:(NSZone *)zone { + ASThrashTestSection *copy = [[ASThrashTestSection alloc] init]; + copy->_sectionID = _sectionID; + copy->_items = [_items mutableCopy]; + return copy; +} + +- (BOOL)isEqual:(id)object { + if ([object isKindOfClass:[ASThrashTestSection class]]) { + return [(ASThrashTestSection *)object sectionID] == _sectionID; + } else { + return NO; + } +} + +@end + +#if !USE_UIKIT_REFERENCE +@interface ASThrashTestNode: ASCellNode +@property (nonatomic, strong) ASThrashTestItem *item; +@end + +@implementation ASThrashTestNode + +@end +#endif + +@interface ASThrashDataSource: NSObject +#if USE_UIKIT_REFERENCE + +#else + +#endif + +@property (nonatomic, strong, readonly) UIWindow *window; +@property (nonatomic, strong, readonly) TableView *tableView; +@property (nonatomic, strong) NSArray *data; +@end + + +@implementation ASThrashDataSource + +- (instancetype)initWithData:(NSArray *)data { + self = [super init]; + if (self != nil) { + _data = [[NSArray alloc] initWithArray:data copyItems:YES]; + _window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + _tableView = [[TableView alloc] initWithFrame:_window.bounds style:UITableViewStylePlain]; + [_window addSubview:_tableView]; +#if USE_UIKIT_REFERENCE + _tableView.dataSource = self; + _tableView.delegate = self; + [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kCellReuseID]; +#else + _tableView.asyncDelegate = self; + _tableView.asyncDataSource = self; + [_tableView reloadDataImmediately]; +#endif + [_tableView layoutIfNeeded]; + } + return self; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.data[section].items.count; +} + + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return self.data.count; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + return self.data[section].headerHeight; +} + +#if USE_UIKIT_REFERENCE + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + return [tableView dequeueReusableCellWithIdentifier:kCellReuseID forIndexPath:indexPath]; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + ASThrashTestItem *item = self.data[indexPath.section].items[indexPath.item]; + return item.rowHeight; +} + +#else + +- (ASCellNodeBlock)tableView:(ASTableView *)tableView nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath { + ASThrashTestItem *item = self.data[indexPath.section].items[indexPath.item]; + return ^{ + ASThrashTestNode *node = [[ASThrashTestNode alloc] init]; + node.item = item; + return node; + }; +} + +#endif + +@end + + +@implementation NSIndexSet (ASThrashHelpers) + +- (NSArray *)indexPathsInSection:(NSInteger)section { + NSMutableArray *result = [NSMutableArray arrayWithCapacity:self.count]; + [self enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop) { + [result addObject:[NSIndexPath indexPathForItem:idx inSection:section]]; + }]; + return result; +} + +/// `insertMode` means that for each index selected, the max goes up by one. ++ (NSMutableIndexSet *)randomIndexesLessThan:(NSInteger)max probability:(float)probability insertMode:(BOOL)insertMode { + NSMutableIndexSet *indexes = [[NSMutableIndexSet alloc] init]; + u_int32_t cutoff = probability * 100; + for (NSInteger i = 0; i < max; i++) { + if (arc4random_uniform(100) < cutoff) { + [indexes addIndex:i]; + if (insertMode) { + max += 1; + } + } + } + return indexes; +} + +@end + +static NSInteger ASThrashUpdateCurrentSerializationVersion = 1; + +@interface ASThrashUpdate : NSObject +@property (nonatomic, strong, readonly) NSArray *oldData; +@property (nonatomic, strong, readonly) NSMutableArray *data; +@property (nonatomic, strong, readonly) NSMutableIndexSet *deletedSectionIndexes; +@property (nonatomic, strong, readonly) NSMutableIndexSet *replacedSectionIndexes; +/// The sections used to replace the replaced sections. +@property (nonatomic, strong, readonly) NSMutableArray *replacingSections; +@property (nonatomic, strong, readonly) NSMutableIndexSet *insertedSectionIndexes; +@property (nonatomic, strong, readonly) NSMutableArray *insertedSections; +@property (nonatomic, strong, readonly) NSMutableArray *deletedItemIndexes; +@property (nonatomic, strong, readonly) NSMutableArray *replacedItemIndexes; +/// The items used to replace the replaced items. +@property (nonatomic, strong, readonly) NSMutableArray *> *replacingItems; +@property (nonatomic, strong, readonly) NSMutableArray *insertedItemIndexes; +@property (nonatomic, strong, readonly) NSMutableArray *> *insertedItems; + +- (instancetype)initWithData:(NSArray *)data; + ++ (ASThrashUpdate *)thrashUpdateWithBase64String:(NSString *)base64; +- (NSString *)base64Representation; +@end + +@implementation ASThrashUpdate + +- (instancetype)initWithData:(NSArray *)data { + self = [super init]; + if (self != nil) { + _data = [[NSMutableArray alloc] initWithArray:data copyItems:YES]; + _oldData = [[NSArray alloc] initWithArray:data copyItems:YES]; + + _deletedItemIndexes = [NSMutableArray array]; + _replacedItemIndexes = [NSMutableArray array]; + _insertedItemIndexes = [NSMutableArray array]; + _replacingItems = [NSMutableArray array]; + _insertedItems = [NSMutableArray array]; + + // Randomly reload some items + for (ASThrashTestSection *section in _data) { + NSMutableIndexSet *indexes = [NSIndexSet randomIndexesLessThan:section.items.count probability:kFickleness insertMode:NO]; + NSArray *newItems = [ASThrashTestItem itemsWithCount:indexes.count]; + [section.items replaceObjectsAtIndexes:indexes withObjects:newItems]; + [_replacingItems addObject:newItems]; + [_replacedItemIndexes addObject:indexes]; + } + + // Randomly replace some sections + _replacedSectionIndexes = [NSIndexSet randomIndexesLessThan:_data.count probability:kFickleness insertMode:NO]; + _replacingSections = [ASThrashTestSection sectionsWithCount:_replacedSectionIndexes.count]; + [_data replaceObjectsAtIndexes:_replacedSectionIndexes withObjects:_replacingSections]; + + // Randomly delete some items + [_data enumerateObjectsUsingBlock:^(ASThrashTestSection * _Nonnull section, NSUInteger idx, BOOL * _Nonnull stop) { + if (section.items.count >= kMinimumItemCount) { + NSMutableIndexSet *indexes = [NSIndexSet randomIndexesLessThan:section.items.count probability:kFickleness insertMode:NO]; + + /// Cannot reload & delete the same item. + [indexes removeIndexes:_replacedItemIndexes[idx]]; + + [section.items removeObjectsAtIndexes:indexes]; + [_deletedItemIndexes addObject:indexes]; + } else { + [_deletedItemIndexes addObject:[NSMutableIndexSet indexSet]]; + } + }]; + + // Randomly delete some sections + if (_data.count >= kMinimumSectionCount) { + _deletedSectionIndexes = [NSIndexSet randomIndexesLessThan:_data.count probability:kFickleness insertMode:NO]; + } else { + _deletedSectionIndexes = [NSMutableIndexSet indexSet]; + } + // Cannot replace & delete the same section. + [_deletedSectionIndexes removeIndexes:_replacedSectionIndexes]; + + // Cannot delete/replace item in deleted/replaced section + [_deletedSectionIndexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop) { + [_replacedItemIndexes[idx] removeAllIndexes]; + [_deletedItemIndexes[idx] removeAllIndexes]; + }]; + [_replacedSectionIndexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop) { + [_replacedItemIndexes[idx] removeAllIndexes]; + [_deletedItemIndexes[idx] removeAllIndexes]; + }]; + [_data removeObjectsAtIndexes:_deletedSectionIndexes]; + + // Randomly insert some sections + _insertedSectionIndexes = [NSIndexSet randomIndexesLessThan:(_data.count + 1) probability:kFickleness insertMode:YES]; + _insertedSections = [ASThrashTestSection sectionsWithCount:_insertedSectionIndexes.count]; + [_data insertObjects:_insertedSections atIndexes:_insertedSectionIndexes]; + + // Randomly insert some items + for (ASThrashTestSection *section in _data) { + // Only insert items into the old sections – not replaced/inserted sections. + if ([_oldData containsObject:section]) { + NSMutableIndexSet *indexes = [NSIndexSet randomIndexesLessThan:(section.items.count + 1) probability:kFickleness insertMode:YES]; + NSArray *newItems = [ASThrashTestItem itemsWithCount:indexes.count]; + [section.items insertObjects:newItems atIndexes:indexes]; + [_insertedItems addObject:newItems]; + [_insertedItemIndexes addObject:indexes]; + } else { + [_insertedItems addObject:@[]]; + [_insertedItemIndexes addObject:[NSMutableIndexSet indexSet]]; + } + } + } + return self; +} + ++ (BOOL)supportsSecureCoding { + return YES; +} + ++ (ASThrashUpdate *)thrashUpdateWithBase64String:(NSString *)base64 { + return [NSKeyedUnarchiver unarchiveObjectWithData:[[NSData alloc] initWithBase64EncodedString:base64 options:kNilOptions]]; +} + +- (NSString *)base64Representation { + return [[NSKeyedArchiver archivedDataWithRootObject:self] base64EncodedStringWithOptions:kNilOptions]; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + NSDictionary *dict = [self dictionaryWithValuesForKeys:@[ + @"oldData", + @"data", + @"deletedSectionIndexes", + @"replacedSectionIndexes", + @"replacingSections", + @"insertedSectionIndexes", + @"insertedSections", + @"deletedItemIndexes", + @"replacedItemIndexes", + @"replacingItems", + @"insertedItemIndexes", + @"insertedItems" + ]]; + [aCoder encodeObject:dict forKey:@"_dict"]; + [aCoder encodeInteger:ASThrashUpdateCurrentSerializationVersion forKey:@"_version"]; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super init]; + if (self != nil) { + NSAssert(ASThrashUpdateCurrentSerializationVersion == [aDecoder decodeIntegerForKey:@"_version"], @"This thrash update was archived from a different version and can't be read. Sorry."); + NSDictionary *dict = [aDecoder decodeObjectOfClass:[NSDictionary class] forKey:@"_dict"]; + [self setValuesForKeysWithDictionary:dict]; + } + return self; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"", self, ASThrashArrayDescription(_oldData), ASThrashArrayDescription(_deletedItemIndexes), _deletedSectionIndexes, ASThrashArrayDescription(_replacedItemIndexes), _replacedSectionIndexes, ASThrashArrayDescription(_insertedItemIndexes), _insertedSectionIndexes, ASThrashArrayDescription(_data)]; +} + +- (NSString *)logFriendlyBase64Representation { + return [NSString stringWithFormat:@"\n\n**********\nBase64 Representation:\n**********\n%@\n**********\nEnd Base64 Representation\n**********", self.base64Representation]; +} + +@end + +@interface ASTableViewThrashTests: XCTestCase +@end + +@implementation ASTableViewThrashTests { + // The current update, which will be logged in case of a failure. + ASThrashUpdate *_update; +} + +#pragma mark Overrides + +- (void)tearDown { + _update = nil; +} + +// NOTE: Despite the documentation, this is not always called if an exception is caught. +- (void)recordFailureWithDescription:(NSString *)description inFile:(NSString *)filePath atLine:(NSUInteger)lineNumber expected:(BOOL)expected { + [self logCurrentUpdateIfNeeded]; + [super recordFailureWithDescription:description inFile:filePath atLine:lineNumber expected:expected]; +} + +#pragma mark Test Methods + +- (void)testInitialDataRead { + ASThrashDataSource *ds = [[ASThrashDataSource alloc] initWithData:[ASThrashTestSection sectionsWithCount:kInitialSectionCount]]; + [self verifyDataSource:ds]; +} + +/// Replays the Base64 representation of an ASThrashUpdate from "ASThrashTestRecordedCase" file +- (void)DISABLED_testRecordedThrashCase { + NSURL *caseURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"ASThrashTestRecordedCase" withExtension:nil subdirectory:@"TestResources"]; + NSString *base64 = [NSString stringWithContentsOfURL:caseURL encoding:NSUTF8StringEncoding error:NULL]; + + _update = [ASThrashUpdate thrashUpdateWithBase64String:base64]; + if (_update == nil) { + return; + } + + ASThrashDataSource *ds = [[ASThrashDataSource alloc] initWithData:_update.oldData]; + [self applyUpdate:_update toDataSource:ds]; + [self verifyDataSource:ds]; +} + +- (void)DISABLED_testThrashingWildly { + for (NSInteger i = 0; i < kThrashingIterationCount; i++) { + [self setUp]; + ASThrashDataSource *ds = [[ASThrashDataSource alloc] initWithData:[ASThrashTestSection sectionsWithCount:kInitialSectionCount]]; + _update = [[ASThrashUpdate alloc] initWithData:ds.data]; + + [self applyUpdate:_update toDataSource:ds]; + [self verifyDataSource:ds]; + [self tearDown]; + } +} + +#pragma mark Helpers + +- (void)logCurrentUpdateIfNeeded { + if (_update != nil) { + NSLog(@"Failed update %@: %@", _update, _update.logFriendlyBase64Representation); + } +} + +- (void)applyUpdate:(ASThrashUpdate *)update toDataSource:(ASThrashDataSource *)dataSource { + TableView *tableView = dataSource.tableView; + + [tableView beginUpdates]; + dataSource.data = update.data; + + [tableView insertSections:update.insertedSectionIndexes withRowAnimation:UITableViewRowAnimationNone]; + + [tableView deleteSections:update.deletedSectionIndexes withRowAnimation:UITableViewRowAnimationNone]; + + [tableView reloadSections:update.replacedSectionIndexes withRowAnimation:UITableViewRowAnimationNone]; + + [update.insertedItemIndexes enumerateObjectsUsingBlock:^(NSMutableIndexSet * _Nonnull indexes, NSUInteger idx, BOOL * _Nonnull stop) { + NSArray *indexPaths = [indexes indexPathsInSection:idx]; + [tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone]; + }]; + + [update.deletedItemIndexes enumerateObjectsUsingBlock:^(NSMutableIndexSet * _Nonnull indexes, NSUInteger sec, BOOL * _Nonnull stop) { + NSArray *indexPaths = [indexes indexPathsInSection:sec]; + [tableView deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone]; + }]; + + [update.replacedItemIndexes enumerateObjectsUsingBlock:^(NSMutableIndexSet * _Nonnull indexes, NSUInteger sec, BOOL * _Nonnull stop) { + NSArray *indexPaths = [indexes indexPathsInSection:sec]; + [tableView reloadRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone]; + }]; + @try { + [tableView endUpdates]; +#if !USE_UIKIT_REFERENCE + [tableView waitUntilAllUpdatesAreCommitted]; +#endif + } @catch (NSException *exception) { + [self logCurrentUpdateIfNeeded]; + @throw exception; + } +} + +- (void)verifyDataSource:(ASThrashDataSource *)ds { + TableView *tableView = ds.tableView; + NSArray *data = [ds data]; + XCTAssertEqual(data.count, tableView.numberOfSections); + for (NSInteger i = 0; i < tableView.numberOfSections; i++) { + XCTAssertEqual([tableView numberOfRowsInSection:i], data[i].items.count); + XCTAssertEqual([tableView rectForHeaderInSection:i].size.height, data[i].headerHeight); + + for (NSInteger j = 0; j < [tableView numberOfRowsInSection:i]; j++) { + NSIndexPath *indexPath = [NSIndexPath indexPathForItem:j inSection:i]; + ASThrashTestItem *item = data[i].items[j]; +#if USE_UIKIT_REFERENCE + XCTAssertEqual([tableView rectForRowAtIndexPath:indexPath].size.height, item.rowHeight); +#else + ASThrashTestNode *node = (ASThrashTestNode *)[tableView nodeForRowAtIndexPath:indexPath]; + XCTAssertEqual(node.item, item); +#endif + } + } +} + +@end diff --git a/AsyncDisplayKitTests/ASTextKitCoreTextAdditionsTests.m b/AsyncDisplayKitTests/ASTextKitCoreTextAdditionsTests.m index 6fa7fd7aed..3421a6c840 100644 --- a/AsyncDisplayKitTests/ASTextKitCoreTextAdditionsTests.m +++ b/AsyncDisplayKitTests/ASTextKitCoreTextAdditionsTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextKitCoreTextAdditionsTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKitTests/ASTextKitTests.mm b/AsyncDisplayKitTests/ASTextKitTests.mm index 688113c27e..60b7765ed9 100644 --- a/AsyncDisplayKitTests/ASTextKitTests.mm +++ b/AsyncDisplayKitTests/ASTextKitTests.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextKitTests.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import @@ -81,7 +83,7 @@ static BOOL checkAttributes(const ASTextKitAttributes &attributes, const CGSize FBSnapshotTestController *controller = [[FBSnapshotTestController alloc] init]; UIImage *labelImage = UITextViewImageWithAttributes(attributes, constrainedSize, linkTextAttributes); UIImage *textKitImage = ASTextKitImageWithAttributes(attributes, constrainedSize); - return [controller compareReferenceImage:labelImage toImage:textKitImage error:nil]; + return [controller compareReferenceImage:labelImage toImage:textKitImage tolerance:0.0 error:nil]; } @implementation ASTextKitTests diff --git a/AsyncDisplayKitTests/ASTextKitTruncationTests.mm b/AsyncDisplayKitTests/ASTextKitTruncationTests.mm index d82ae0fd2d..bccddc916f 100644 --- a/AsyncDisplayKitTests/ASTextKitTruncationTests.mm +++ b/AsyncDisplayKitTests/ASTextKitTruncationTests.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextKitTruncationTests.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import @@ -53,7 +55,9 @@ ASTextKitTailTruncater *tailTruncater = [[ASTextKitTailTruncater alloc] initWithContext:context truncationAttributedString:nil avoidTailTruncationSet:nil]; + [tailTruncater truncate]; XCTAssert(NSEqualRanges(textKitVisibleRange, tailTruncater.visibleRanges[0])); + XCTAssert(NSEqualRanges(textKitVisibleRange, tailTruncater.firstVisibleRange)); } - (void)testSimpleTailTruncation @@ -71,6 +75,7 @@ ASTextKitTailTruncater *tailTruncater = [[ASTextKitTailTruncater alloc] initWithContext:context truncationAttributedString:[self _simpleTruncationAttributedString] avoidTailTruncationSet:[NSCharacterSet characterSetWithCharactersInString:@""]]; + [tailTruncater truncate]; __block NSString *drawnString; [context performBlockWithLockedTextKitComponents:^(NSLayoutManager *layoutManager, NSTextStorage *textStorage, NSTextContainer *textContainer) { drawnString = textStorage.string; @@ -78,6 +83,7 @@ NSString *expectedString = @"90's cray photo booth tote bag bespoke Carles. Plaid wayfarers..."; XCTAssertEqualObjects(expectedString, drawnString); XCTAssert(NSEqualRanges(NSMakeRange(0, 62), tailTruncater.visibleRanges[0])); + XCTAssert(NSEqualRanges(NSMakeRange(0, 62), tailTruncater.firstVisibleRange)); } - (void)testAvoidedCharTailWordBoundaryTruncation @@ -95,7 +101,7 @@ ASTextKitTailTruncater *tailTruncater = [[ASTextKitTailTruncater alloc] initWithContext:context truncationAttributedString:[self _simpleTruncationAttributedString] avoidTailTruncationSet:[NSCharacterSet characterSetWithCharactersInString:@"."]]; - (void)tailTruncater; + [tailTruncater truncate]; __block NSString *drawnString; [context performBlockWithLockedTextKitComponents:^(NSLayoutManager *layoutManager, NSTextStorage *textStorage, NSTextContainer *textContainer) { drawnString = textStorage.string; @@ -120,8 +126,7 @@ ASTextKitTailTruncater *tailTruncater = [[ASTextKitTailTruncater alloc] initWithContext:context truncationAttributedString:[self _simpleTruncationAttributedString] avoidTailTruncationSet:[NSCharacterSet characterSetWithCharactersInString:@"."]]; - // So Xcode doesn't yell at me for an unused var... - (void)tailTruncater; + [tailTruncater truncate]; __block NSString *drawnString; [context performBlockWithLockedTextKitComponents:^(NSLayoutManager *layoutManager, NSTextStorage *textStorage, NSTextContainer *textContainer) { drawnString = textStorage.string; @@ -131,6 +136,27 @@ XCTAssertEqualObjects(expectedString, drawnString); } +- (void)testHandleZeroSizeConstrainedSize +{ + CGSize constrainedSize = CGSizeZero; + NSAttributedString *attributedString = [self _sentenceAttributedString]; + + ASTextKitContext *context = [[ASTextKitContext alloc] initWithAttributedString:attributedString + lineBreakMode:NSLineBreakByWordWrapping + maximumNumberOfLines:0 + exclusionPaths:nil + constrainedSize:constrainedSize + layoutManagerCreationBlock:nil + layoutManagerDelegate:nil + textStorageCreationBlock:nil]; + ASTextKitTailTruncater *tailTruncater = [[ASTextKitTailTruncater alloc] initWithContext:context + truncationAttributedString:[self _simpleTruncationAttributedString] + avoidTailTruncationSet:nil]; + XCTAssertNoThrow([tailTruncater truncate]); + XCTAssert(tailTruncater.visibleRanges.size() == 0); + NSEqualRanges(NSMakeRange(0, 0), tailTruncater.firstVisibleRange); +} + - (void)testHandleZeroHeightConstrainedSize { CGSize constrainedSize = CGSizeMake(50, 0); @@ -144,9 +170,10 @@ layoutManagerDelegate:nil textStorageCreationBlock:nil]; - XCTAssertNoThrow([[ASTextKitTailTruncater alloc] initWithContext:context - truncationAttributedString:[self _simpleTruncationAttributedString] - avoidTailTruncationSet:[NSCharacterSet characterSetWithCharactersInString:@"."]]); + ASTextKitTailTruncater *tailTruncater = [[ASTextKitTailTruncater alloc] initWithContext:context + truncationAttributedString:[self _simpleTruncationAttributedString] + avoidTailTruncationSet:[NSCharacterSet characterSetWithCharactersInString:@"."]]; + XCTAssertNoThrow([tailTruncater truncate]); } @end diff --git a/AsyncDisplayKitTests/ASTextNodeTests.m b/AsyncDisplayKitTests/ASTextNodeTests.m index a5c03ca0b9..6990b786d5 100644 --- a/AsyncDisplayKitTests/ASTextNodeTests.m +++ b/AsyncDisplayKitTests/ASTextNodeTests.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextNodeTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import @@ -44,7 +46,7 @@ static BOOL CGSizeEqualToSizeWithIn(CGSize size1, CGSize size2, CGFloat delta) @interface ASTextNodeTests : XCTestCase @property (nonatomic, readwrite, strong) ASTextNode *textNode; -@property (nonatomic, readwrite, copy) NSAttributedString *attributedString; +@property (nonatomic, readwrite, copy) NSAttributedString *attributedText; @end @@ -80,8 +82,8 @@ static BOOL CGSizeEqualToSizeWithIn(CGSize size1, CGSize size2, CGFloat delta) [mas addAttribute:NSParagraphStyleAttributeName value:lastLinePara range:NSMakeRange(mas.length - 1, 1)]; - _attributedString = mas; - _textNode.attributedString = _attributedString; + _attributedText = mas; + _textNode.attributedText = _attributedText; } #pragma mark - ASTextNode @@ -97,8 +99,8 @@ static BOOL CGSizeEqualToSizeWithIn(CGSize size1, CGSize size2, CGFloat delta) - (void)testSettingTruncationMessage { NSAttributedString *truncation = [[NSAttributedString alloc] initWithString:@"..." attributes:nil]; - _textNode.truncationAttributedString = truncation; - XCTAssertTrue([_textNode.truncationAttributedString isEqualToAttributedString:truncation], @"Failed to set truncation message"); + _textNode.truncationAttributedText = truncation; + XCTAssertTrue([_textNode.truncationAttributedText isEqualToAttributedString:truncation], @"Failed to set truncation message"); } - (void)testSettingAdditionalTruncationMessage @@ -140,13 +142,22 @@ static BOOL CGSizeEqualToSizeWithIn(CGSize size1, CGSize size2, CGFloat delta) } } +- (void)testMeasureWithZeroSizeAndPlaceholder +{ + _textNode.placeholderEnabled = YES; + + XCTAssertNoThrow([_textNode measure:CGSizeZero], @"Measure with zero size and placeholder enabled should not throw an exception"); + XCTAssertNoThrow([_textNode measure:CGSizeMake(0, 100)], @"Measure with zero width and placeholder enabled should not throw an exception"); + XCTAssertNoThrow([_textNode measure:CGSizeMake(100, 0)], @"Measure with zero height and placeholder enabled should not throw an exception"); +} + - (void)testAccessibility { - _textNode.attributedString = _attributedString; + _textNode.attributedText = _attributedText; XCTAssertTrue(_textNode.isAccessibilityElement, @"Should be an accessibility element"); XCTAssertTrue(_textNode.accessibilityTraits == UIAccessibilityTraitStaticText, @"Should have static text accessibility trait, instead has %llu", _textNode.accessibilityTraits); - XCTAssertTrue([_textNode.accessibilityLabel isEqualToString:_attributedString.string], @"Accessibility label is incorrectly set to \n%@\n when it should be \n%@\n", _textNode.accessibilityLabel, _attributedString.string); + XCTAssertTrue([_textNode.accessibilityLabel isEqualToString:_attributedText.string], @"Accessibility label is incorrectly set to \n%@\n when it should be \n%@\n", _textNode.accessibilityLabel, _attributedText.string); } - (void)testLinkAttribute @@ -156,7 +167,7 @@ static BOOL CGSizeEqualToSizeWithIn(CGSize size1, CGSize size2, CGFloat delta) NSString *linkString = @"Link"; NSRange linkRange = NSMakeRange(0, linkString.length); NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:linkString attributes:@{ linkAttributeName : linkAttributeValue}]; - _textNode.attributedString = attributedString; + _textNode.attributedText = attributedString; _textNode.linkAttributeNames = @[linkAttributeName]; ASTextNodeTestDelegate *delegate = [ASTextNodeTestDelegate new]; @@ -178,7 +189,7 @@ static BOOL CGSizeEqualToSizeWithIn(CGSize size1, CGSize size2, CGFloat delta) NSString *linkString = @"Link notalink"; NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:linkString]; [attributedString addAttribute:linkAttributeName value:linkAttributeValue range:NSMakeRange(0, 4)]; - _textNode.attributedString = attributedString; + _textNode.attributedText = attributedString; _textNode.linkAttributeNames = @[linkAttributeName]; ASTextNodeTestDelegate *delegate = [ASTextNodeTestDelegate new]; diff --git a/AsyncDisplayKitTests/ASTextNodeWordKernerTests.mm b/AsyncDisplayKitTests/ASTextNodeWordKernerTests.mm index 2aba8a3748..111714dbf2 100644 --- a/AsyncDisplayKitTests/ASTextNodeWordKernerTests.mm +++ b/AsyncDisplayKitTests/ASTextNodeWordKernerTests.mm @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASTextNodeWordKernerTests.mm +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/AsyncDisplayKitTests/ASVideoNodeTests.m b/AsyncDisplayKitTests/ASVideoNodeTests.m index adabc9e705..f7c4a6b079 100644 --- a/AsyncDisplayKitTests/ASVideoNodeTests.m +++ b/AsyncDisplayKitTests/ASVideoNodeTests.m @@ -1,47 +1,50 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASVideoNodeTests.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +#import #import #import #import #import -@interface ASVideoNodeTests : XCTestCase +@interface ASVideoNodeTests : XCTestCase { ASVideoNode *_videoNode; AVURLAsset *_firstAsset; AVAsset *_secondAsset; + NSURL *_url; + NSArray *_requestedKeys; } @end +@interface ASNetworkImageNode () { + @public __weak id _delegate; +} +@end + + @interface ASVideoNode () { ASDisplayNode *_playerNode; AVPlayer *_player; } -@property (atomic) ASInterfaceState interfaceState; -@property (atomic) ASDisplayNode *spinner; -@property (atomic) ASDisplayNode *playerNode; -@property (atomic) BOOL shouldBePlaying; -- (void)setPlayerNode:(ASDisplayNode *)playerNode; -@end -@implementation ASVideoNode (Test) +@property (atomic, readwrite) ASInterfaceState interfaceState; +@property (atomic, readonly) ASDisplayNode *spinner; +@property (atomic, readwrite) ASDisplayNode *playerNode; +@property (atomic, readwrite) AVPlayer *player; +@property (atomic, readwrite) BOOL shouldBePlaying; -- (void)setPlayerNode:(ASDisplayNode *)playerNode -{ - _playerNode = playerNode; -} - -- (void)setPlayer:(AVPlayer *)player -{ - _player = player; -} +- (void)setVideoPlaceholderImage:(UIImage *)image; +- (void)prepareToPlayAsset:(AVAsset *)asset withKeys:(NSArray *)requestedKeys; @end @@ -52,100 +55,155 @@ _videoNode = [[ASVideoNode alloc] init]; _firstAsset = [AVURLAsset assetWithURL:[NSURL URLWithString:@"firstURL"]]; _secondAsset = [AVAsset assetWithURL:[NSURL URLWithString:@"secondURL"]]; -} - -- (void)testVideoNodeReplacesAVPlayerItemWhenNewURLIsSet -{ - _videoNode.interfaceState = ASInterfaceStateFetchData; - _videoNode.asset = _firstAsset; - - AVPlayerItem *item = [_videoNode currentItem]; - - _videoNode.asset = _secondAsset; - AVPlayerItem *secondItem = [_videoNode currentItem]; - - XCTAssertNotEqualObjects(item, secondItem); -} - -- (void)testVideoNodeDoesNotReplaceAVPlayerItemWhenSameURLIsSet -{ - _videoNode.interfaceState = ASInterfaceStateFetchData; - - _videoNode.asset = _firstAsset; - AVPlayerItem *item = [_videoNode currentItem]; - - _videoNode.asset = [AVAsset assetWithURL:_firstAsset.URL]; - AVPlayerItem *secondItem = [_videoNode currentItem]; - - XCTAssertEqualObjects(item, secondItem); -} - -- (void)testSpinnerDefaultsToNil -{ - XCTAssertNil(_videoNode.spinner); + _url = [NSURL URLWithString:@"testURL"]; + _requestedKeys = @[ @"playable" ]; } - (void)testOnPlayIfVideoIsNotReadyInitializeSpinnerAndAddAsSubnode { - _videoNode.interfaceState = ASInterfaceStateFetchData; _videoNode.asset = _firstAsset; - - [_videoNode play]; - - XCTAssertNotNil(_videoNode.spinner); + [self doOnPlayIfVideoIsNotReadyInitializeSpinnerAndAddAsSubnodeWithUrl]; } +- (void)testOnPlayIfVideoIsNotReadyInitializeSpinnerAndAddAsSubnodeWithUrl +{ + _videoNode.asset = [AVAsset assetWithURL:_url]; + [self doOnPlayIfVideoIsNotReadyInitializeSpinnerAndAddAsSubnodeWithUrl]; +} + +- (void)doOnPlayIfVideoIsNotReadyInitializeSpinnerAndAddAsSubnodeWithUrl +{ + _videoNode.interfaceState = ASInterfaceStateFetchData; + [_videoNode play]; +} + + - (void)testOnPauseSpinnerIsPausedIfPresent { - _videoNode.interfaceState = ASInterfaceStateFetchData; _videoNode.asset = _firstAsset; + [self doOnPauseSpinnerIsPausedIfPresentWithURL]; +} + +- (void)testOnPauseSpinnerIsPausedIfPresentWithURL +{ + _videoNode.asset = [AVAsset assetWithURL:_url]; + [self doOnPauseSpinnerIsPausedIfPresentWithURL]; +} + +- (void)doOnPauseSpinnerIsPausedIfPresentWithURL +{ + _videoNode.interfaceState = ASInterfaceStateFetchData; [_videoNode play]; - [_videoNode pause]; - - XCTAssertFalse(((UIActivityIndicatorView *)_videoNode.spinner.view).isAnimating); + } + - (void)testOnVideoReadySpinnerIsStoppedAndRemoved { - _videoNode.interfaceState = ASInterfaceStateFetchData; _videoNode.asset = _firstAsset; - - [_videoNode play]; - [_videoNode observeValueForKeyPath:@"status" ofObject:[_videoNode currentItem] change:@{@"new" : @(AVPlayerItemStatusReadyToPlay)} context:NULL]; - - XCTAssertFalse(((UIActivityIndicatorView *)_videoNode.spinner.view).isAnimating); + [self doOnVideoReadySpinnerIsStoppedAndRemovedWithURL]; } +- (void)testOnVideoReadySpinnerIsStoppedAndRemovedWithURL +{ + _videoNode.asset = [AVAsset assetWithURL:_url]; + [self doOnVideoReadySpinnerIsStoppedAndRemovedWithURL]; +} + +- (void)doOnVideoReadySpinnerIsStoppedAndRemovedWithURL +{ + _videoNode.interfaceState = ASInterfaceStateFetchData; + + [_videoNode play]; + [_videoNode observeValueForKeyPath:@"status" ofObject:[_videoNode currentItem] change:@{NSKeyValueChangeNewKey : @(AVPlayerItemStatusReadyToPlay)} context:NULL]; +} + + - (void)testPlayerDefaultsToNil { + _videoNode.asset = _firstAsset; XCTAssertNil(_videoNode.player); } -- (void)testPlayerIsCreatedInFetchData +- (void)testPlayerDefaultsToNilWithURL { - _videoNode.asset = _firstAsset; + _videoNode.asset = [AVAsset assetWithURL:_url]; + XCTAssertNil(_videoNode.player); +} +- (void)testPlayerIsCreatedAsynchronouslyInFetchData +{ + AVAsset *asset = _firstAsset; + + id assetMock = [OCMockObject partialMockForObject:asset]; + id videoNodeMock = [OCMockObject partialMockForObject:_videoNode]; + + [[[assetMock stub] andReturnValue:@YES] isPlayable]; + [[[videoNodeMock expect] andForwardToRealObject] prepareToPlayAsset:assetMock withKeys:_requestedKeys]; + + _videoNode.asset = assetMock; _videoNode.interfaceState = ASInterfaceStateFetchData; + [videoNodeMock verifyWithDelay:1.0f]; + + XCTAssertNotNil(_videoNode.player); +} + +- (void)testPlayerIsCreatedAsynchronouslyInFetchDataWithURL +{ + AVAsset *asset = [AVAsset assetWithURL:_url]; + + id assetMock = [OCMockObject partialMockForObject:asset]; + id videoNodeMock = [OCMockObject partialMockForObject:_videoNode]; + + [[[assetMock stub] andReturnValue:@YES] isPlayable]; + [[[videoNodeMock expect] andForwardToRealObject] prepareToPlayAsset:assetMock withKeys:_requestedKeys]; + + _videoNode.asset = assetMock; + _videoNode.interfaceState = ASInterfaceStateFetchData; + + [videoNodeMock verifyWithDelay:1.0f]; + XCTAssertNotNil(_videoNode.player); } - (void)testPlayerLayerNodeIsAddedOnDidLoadIfVisibleAndAutoPlaying { _videoNode.asset = _firstAsset; + [self doPlayerLayerNodeIsAddedOnDidLoadIfVisibleAndAutoPlayingWithURL]; +} +- (void)testPlayerLayerNodeIsAddedOnDidLoadIfVisibleAndAutoPlayingWithURL +{ + _videoNode.asset = [AVAsset assetWithURL:_url]; + [self doPlayerLayerNodeIsAddedOnDidLoadIfVisibleAndAutoPlayingWithURL]; +} + +- (void)doPlayerLayerNodeIsAddedOnDidLoadIfVisibleAndAutoPlayingWithURL +{ [_videoNode setInterfaceState:ASInterfaceStateNone]; [_videoNode didLoad]; XCTAssert(![_videoNode.subnodes containsObject:_videoNode.playerNode]); } + - (void)testPlayerLayerNodeIsNotAddedIfVisibleButShouldNotBePlaying { _videoNode.asset = _firstAsset; + [self doPlayerLayerNodeIsNotAddedIfVisibleButShouldNotBePlaying]; +} +- (void)testPlayerLayerNodeIsNotAddedIfVisibleButShouldNotBePlayingWithUrl +{ + _videoNode.asset = [AVAsset assetWithURL:_url]; + [self doPlayerLayerNodeIsNotAddedIfVisibleButShouldNotBePlaying]; +} + +- (void)doPlayerLayerNodeIsNotAddedIfVisibleButShouldNotBePlaying +{ [_videoNode pause]; [_videoNode setInterfaceState:ASInterfaceStateVisible | ASInterfaceStateDisplay]; [_videoNode didLoad]; @@ -157,6 +215,17 @@ - (void)testVideoStartsPlayingOnDidDidBecomeVisibleWhenShouldAutoplay { _videoNode.asset = _firstAsset; + [self doVideoStartsPlayingOnDidDidBecomeVisibleWhenShouldAutoplay]; +} + +- (void)testVideoStartsPlayingOnDidDidBecomeVisibleWhenShouldAutoplayWithURL +{ + _videoNode.asset = [AVAsset assetWithURL:_url]; + [self doVideoStartsPlayingOnDidDidBecomeVisibleWhenShouldAutoplay]; +} + +- (void)doVideoStartsPlayingOnDidDidBecomeVisibleWhenShouldAutoplay +{ _videoNode.shouldAutoplay = YES; _videoNode.playerNode = [[ASDisplayNode alloc] initWithLayerBlock:^CALayer *{ AVPlayerLayer *playerLayer = [[AVPlayerLayer alloc] init]; @@ -164,7 +233,7 @@ }]; _videoNode.playerNode.layer.frame = CGRectZero; - [_videoNode visibilityDidChange:YES]; + [_videoNode visibleStateDidChange:YES]; XCTAssertTrue(_videoNode.shouldBePlaying); } @@ -172,6 +241,17 @@ - (void)testVideoShouldPauseWhenItLeavesVisibleButShouldKnowPlayingShouldRestartLater { _videoNode.asset = _firstAsset; + [self doVideoShouldPauseWhenItLeavesVisibleButShouldKnowPlayingShouldRestartLater]; +} + +- (void)testVideoShouldPauseWhenItLeavesVisibleButShouldKnowPlayingShouldRestartLaterWithURL +{ + _videoNode.asset = [AVAsset assetWithURL:_url]; + [self doVideoShouldPauseWhenItLeavesVisibleButShouldKnowPlayingShouldRestartLater]; +} + +- (void)doVideoShouldPauseWhenItLeavesVisibleButShouldKnowPlayingShouldRestartLater +{ [_videoNode play]; [_videoNode interfaceStateDidChange:ASInterfaceStateNone fromState:ASInterfaceStateVisible]; @@ -180,9 +260,21 @@ XCTAssertTrue(_videoNode.shouldBePlaying); } + - (void)testVideoThatIsPlayingWhenItLeavesVisibleRangeStartsAgainWhenItComesBack { _videoNode.asset = _firstAsset; + [self doVideoThatIsPlayingWhenItLeavesVisibleRangeStartsAgainWhenItComesBack]; +} + +- (void)testVideoThatIsPlayingWhenItLeavesVisibleRangeStartsAgainWhenItComesBackWithURL +{ + _videoNode.asset = [AVAsset assetWithURL:_url]; + [self doVideoThatIsPlayingWhenItLeavesVisibleRangeStartsAgainWhenItComesBack]; +} + +- (void)doVideoThatIsPlayingWhenItLeavesVisibleRangeStartsAgainWhenItComesBack +{ [_videoNode play]; [_videoNode interfaceStateDidChange:ASInterfaceStateVisible fromState:ASInterfaceStateNone]; @@ -210,4 +302,129 @@ XCTAssertFalse(_videoNode.player.muted); } +- (void)testVideoThatDoesNotAutorepeatsShouldPauseOnPlaybackEnd +{ + id assetMock = [OCMockObject partialMockForObject:_firstAsset]; + [[[assetMock stub] andReturnValue:@YES] isPlayable]; + + _videoNode.asset = assetMock; + _videoNode.shouldAutorepeat = NO; + + [_videoNode didLoad]; + [_videoNode setInterfaceState:ASInterfaceStateVisible | ASInterfaceStateDisplay | ASInterfaceStateFetchData]; + [_videoNode prepareToPlayAsset:assetMock withKeys:_requestedKeys]; + [_videoNode play]; + + XCTAssertTrue(_videoNode.isPlaying); + + [[NSNotificationCenter defaultCenter] postNotificationName:AVPlayerItemDidPlayToEndTimeNotification object:_videoNode.currentItem]; + + XCTAssertFalse(_videoNode.isPlaying); + XCTAssertEqual(0, CMTimeGetSeconds(_videoNode.player.currentTime)); +} + +- (void)testVideoThatAutorepeatsShouldRepeatOnPlaybackEnd +{ + id assetMock = [OCMockObject partialMockForObject:_firstAsset]; + [[[assetMock stub] andReturnValue:@YES] isPlayable]; + + _videoNode.asset = assetMock; + _videoNode.shouldAutorepeat = YES; + + [_videoNode didLoad]; + [_videoNode setInterfaceState:ASInterfaceStateVisible | ASInterfaceStateDisplay | ASInterfaceStateFetchData]; + [_videoNode prepareToPlayAsset:assetMock withKeys:_requestedKeys]; + [_videoNode play]; + + [[NSNotificationCenter defaultCenter] postNotificationName:AVPlayerItemDidPlayToEndTimeNotification object:_videoNode.currentItem]; + + XCTAssertTrue(_videoNode.isPlaying); +} + +- (void)testVideoResumedWhenBufferIsLikelyToKeepUp +{ + id assetMock = [OCMockObject partialMockForObject:_firstAsset]; + [[[assetMock stub] andReturnValue:@YES] isPlayable]; + + _videoNode.asset = assetMock; + + [_videoNode setInterfaceState:ASInterfaceStateVisible | ASInterfaceStateDisplay | ASInterfaceStateFetchData]; + [_videoNode prepareToPlayAsset:assetMock withKeys:_requestedKeys]; + [_videoNode pause]; + _videoNode.shouldBePlaying = YES; + + XCTAssertFalse(_videoNode.isPlaying); + + [_videoNode observeValueForKeyPath:@"playbackLikelyToKeepUp" ofObject:[_videoNode currentItem] change:@{NSKeyValueChangeNewKey : @YES} context:NULL]; + + XCTAssertTrue(_videoNode.isPlaying); +} + +- (void)testSettingVideoGravityChangesPlaceholderContentMode +{ + [_videoNode setVideoPlaceholderImage:[[UIImage alloc] init]]; + XCTAssertEqual(UIViewContentModeScaleAspectFit, _videoNode.contentMode); + + _videoNode.gravity = AVLayerVideoGravityResize; + XCTAssertEqual(UIViewContentModeScaleToFill, _videoNode.contentMode); + + _videoNode.gravity = AVLayerVideoGravityResizeAspect; + XCTAssertEqual(UIViewContentModeScaleAspectFit, _videoNode.contentMode); + + _videoNode.gravity = AVLayerVideoGravityResizeAspectFill; + XCTAssertEqual(UIViewContentModeScaleAspectFill, _videoNode.contentMode); +} + +- (void)testChangingAssetsChangesPlaceholderImage +{ + UIImage *firstImage = [[UIImage alloc] init]; + + _videoNode.asset = _firstAsset; + [_videoNode setVideoPlaceholderImage:firstImage]; + XCTAssertEqual(firstImage, _videoNode.image); + + _videoNode.asset = _secondAsset; + XCTAssertNotEqual(firstImage, _videoNode.image); +} + +- (void)testClearingFetchedContentShouldClearAssetData +{ + AVAsset *asset = _firstAsset; + + id assetMock = [OCMockObject partialMockForObject:asset]; + id videoNodeMock = [OCMockObject partialMockForObject:_videoNode]; + + [[[assetMock stub] andReturnValue:@YES] isPlayable]; + [[[videoNodeMock expect] andForwardToRealObject] prepareToPlayAsset:assetMock withKeys:_requestedKeys]; + + _videoNode.asset = assetMock; + [_videoNode fetchData]; + [_videoNode setVideoPlaceholderImage:[[UIImage alloc] init]]; + + [videoNodeMock verifyWithDelay:1.0f]; + + XCTAssertNotNil(_videoNode.player); + XCTAssertNotNil(_videoNode.currentItem); + XCTAssertNotNil(_videoNode.image); + + [_videoNode clearFetchedData]; + XCTAssertNil(_videoNode.player); + XCTAssertNil(_videoNode.currentItem); + XCTAssertNil(_videoNode.image); +} + +- (void)testDelegateProperlySetForClassHierarchy +{ + _videoNode.delegate = self; + + XCTAssertTrue([_videoNode.delegate conformsToProtocol:@protocol(ASVideoNodeDelegate)]); + XCTAssertTrue([_videoNode.delegate conformsToProtocol:@protocol(ASNetworkImageNodeDelegate)]); + XCTAssertTrue([((ASNetworkImageNode*)_videoNode).delegate conformsToProtocol:@protocol(ASNetworkImageNodeDelegate)]); + XCTAssertTrue([((ASNetworkImageNode*)_videoNode)->_delegate conformsToProtocol:@protocol(ASNetworkImageNodeDelegate)]); + + XCTAssertEqual(_videoNode.delegate, self); + XCTAssertEqual(((ASNetworkImageNode*)_videoNode).delegate, self); + XCTAssertEqual(((ASNetworkImageNode*)_videoNode)->_delegate, self); +} + @end diff --git a/AsyncDisplayKitTests/ASWeakSetTests.m b/AsyncDisplayKitTests/ASWeakSetTests.m index 09779f3267..66063773c9 100644 --- a/AsyncDisplayKitTests/ASWeakSetTests.m +++ b/AsyncDisplayKitTests/ASWeakSetTests.m @@ -3,7 +3,11 @@ // AsyncDisplayKit // // Created by Adlai Holler on 1/7/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import diff --git a/AsyncDisplayKitTests/ArrayDiffingTests.m b/AsyncDisplayKitTests/ArrayDiffingTests.m index 636af90835..efe1e98444 100644 --- a/AsyncDisplayKitTests/ArrayDiffingTests.m +++ b/AsyncDisplayKitTests/ArrayDiffingTests.m @@ -3,20 +3,69 @@ // AsyncDisplayKit // // Created by Levi McCallum on 1/29/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. // #import #import "NSArray+Diffing.h" +@interface NSArray (ArrayDiffingTests) +- (NSIndexSet *)_asdk_commonIndexesWithArray:(NSArray *)array compareBlock:(BOOL (^)(id lhs, id rhs))comparison; +@end + @interface ArrayDiffingTests : XCTestCase @end @implementation ArrayDiffingTests -- (void)testDiffing { +- (void)testDiffingCommonIndexes +{ + NSArray *tests = @[ + @[ + @[@"bob", @"alice", @"dave"], + @[@"bob", @"alice", @"dave", @"gary"], + @[@0, @1, @2] + ], + @[ + @[@"bob", @"alice", @"dave"], + @[@"bob", @"gary", @"dave"], + @[@0, @2] + ], + @[ + @[@"bob", @"alice"], + @[@"gary", @"dave"], + @[], + ], + @[ + @[@"bob", @"alice", @"dave"], + @[], + @[], + ], + @[ + @[], + @[@"bob", @"alice", @"dave"], + @[], + ], + ]; + + for (NSArray *test in tests) { + NSIndexSet *indexSet = [test[0] _asdk_commonIndexesWithArray:test[1] compareBlock:^BOOL(id lhs, id rhs) { + return [lhs isEqual:rhs]; + }]; + + for (NSNumber *index in (NSArray *)test[2]) { + XCTAssert([indexSet containsIndex:[index integerValue]]); + } + } +} + +- (void)testDiffingInsertionsAndDeletions { NSArray *tests = @[ @[ @[@"bob", @"alice", @"dave"], diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testMinimumSizeRangeIsGivenToChildWhenNotCentering@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testMinimumSizeRangeIsGivenToChildWhenNotCentering@3x.png new file mode 100644 index 0000000000..3fb6feee42 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testMinimumSizeRangeIsGivenToChildWhenNotCentering@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithOptions@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithOptions@3x.png new file mode 100644 index 0000000000..c2bf62b078 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithOptions@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithOptions_CenteringX@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithOptions_CenteringX@3x.png new file mode 100644 index 0000000000..f1d9c2e52f Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithOptions_CenteringX@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithOptions_CenteringXCenteringY@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithOptions_CenteringXCenteringY@3x.png new file mode 100644 index 0000000000..8093c89761 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithOptions_CenteringXCenteringY@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithOptions_CenteringY@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithOptions_CenteringY@3x.png new file mode 100644 index 0000000000..7e824c2073 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithOptions_CenteringY@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithSizingOptions@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithSizingOptions@3x.png new file mode 100644 index 0000000000..c2bf62b078 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithSizingOptions@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithSizingOptions_SizingMinimumX@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithSizingOptions_SizingMinimumX@3x.png new file mode 100644 index 0000000000..6796058c28 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithSizingOptions_SizingMinimumX@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithSizingOptions_SizingMinimumXSizingMinimumY@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithSizingOptions_SizingMinimumXSizingMinimumY@3x.png new file mode 100644 index 0000000000..d4a15f979b Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithSizingOptions_SizingMinimumXSizingMinimumY@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithSizingOptions_SizingMinimumY@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithSizingOptions_SizingMinimumY@3x.png new file mode 100644 index 0000000000..802dbc7bca Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASCenterLayoutSpecSnapshotTests/testWithSizingOptions_SizingMinimumY@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASImageNodeSnapshotTests/testRenderLogoSquare@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASImageNodeSnapshotTests/testRenderLogoSquare@3x.png new file mode 100644 index 0000000000..97119f1dc2 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASImageNodeSnapshotTests/testRenderLogoSquare@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-10-10-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-10-10-10@3x.png new file mode 100644 index 0000000000..94b3687343 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-10-10-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-10-10-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-10-10-inf@3x.png new file mode 100644 index 0000000000..ff3ea416c7 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-10-10-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-10-inf-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-10-inf-10@3x.png new file mode 100644 index 0000000000..463944922b Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-10-inf-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-10-inf-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-10-inf-inf@3x.png new file mode 100644 index 0000000000..4367dcf7de Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-10-inf-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-inf-10-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-inf-10-10@3x.png new file mode 100644 index 0000000000..fe07dde6ca Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-inf-10-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-inf-10-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-inf-10-inf@3x.png new file mode 100644 index 0000000000..639e698109 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-inf-10-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-inf-inf-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-inf-inf-10@3x.png new file mode 100644 index 0000000000..b2c041116d Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-inf-inf-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-inf-inf-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-inf-inf-inf@3x.png new file mode 100644 index 0000000000..88d16405d2 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_10-inf-inf-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-10-10-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-10-10-10@3x.png new file mode 100644 index 0000000000..89c5baf629 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-10-10-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-10-10-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-10-10-inf@3x.png new file mode 100644 index 0000000000..98a3f5faab Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-10-10-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-10-inf-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-10-inf-10@3x.png new file mode 100644 index 0000000000..79c1dd46be Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-10-inf-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-10-inf-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-10-inf-inf@3x.png new file mode 100644 index 0000000000..651468da4d Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-10-inf-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-inf-10-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-inf-10-10@3x.png new file mode 100644 index 0000000000..9838114469 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-inf-10-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-inf-10-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-inf-10-inf@3x.png new file mode 100644 index 0000000000..b71a6ad440 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-inf-10-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-inf-inf-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-inf-inf-10@3x.png new file mode 100644 index 0000000000..4d863686b8 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-inf-inf-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-inf-inf-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-inf-inf-inf@3x.png new file mode 100644 index 0000000000..f517f65d5c Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithFixedSize_inf-inf-inf-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-0-0-0@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-0-0-0@3x.png new file mode 100644 index 0000000000..2dc72883af Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-0-0-0@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-0-0-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-0-0-inf@3x.png new file mode 100644 index 0000000000..2e94b4f983 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-0-0-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-0-inf-0@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-0-inf-0@3x.png new file mode 100644 index 0000000000..a23456fa40 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-0-inf-0@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-0-inf-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-0-inf-inf@3x.png new file mode 100644 index 0000000000..9def6b5706 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-0-inf-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-inf-0-0@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-inf-0-0@3x.png new file mode 100644 index 0000000000..b4fbf19ec1 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-inf-0-0@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-inf-0-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-inf-0-inf@3x.png new file mode 100644 index 0000000000..08d9a49f40 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-inf-0-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-inf-inf-0@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-inf-inf-0@3x.png new file mode 100644 index 0000000000..9b5689fa01 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-inf-inf-0@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-inf-inf-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-inf-inf-inf@3x.png new file mode 100644 index 0000000000..1202436035 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_0-inf-inf-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-0-0-0@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-0-0-0@3x.png new file mode 100644 index 0000000000..38a85d9317 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-0-0-0@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-0-0-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-0-0-inf@3x.png new file mode 100644 index 0000000000..abe3b38376 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-0-0-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-0-inf-0@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-0-inf-0@3x.png new file mode 100644 index 0000000000..54b8339994 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-0-inf-0@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-0-inf-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-0-inf-inf@3x.png new file mode 100644 index 0000000000..7021cf7fc6 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-0-inf-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-inf-0-0@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-inf-0-0@3x.png new file mode 100644 index 0000000000..2c9f2facff Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-inf-0-0@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-inf-0-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-inf-0-inf@3x.png new file mode 100644 index 0000000000..3fd9a4e1bb Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-inf-0-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-inf-inf-0@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-inf-inf-0@3x.png new file mode 100644 index 0000000000..f68b2bd9fe Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-inf-inf-0@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-inf-inf-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-inf-inf-inf@3x.png new file mode 100644 index 0000000000..f517f65d5c Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithInfinityAndZeroInsetValue_inf-inf-inf-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-10-10-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-10-10-10@3x.png new file mode 100644 index 0000000000..3004b336f2 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-10-10-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-10-10-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-10-10-inf@3x.png new file mode 100644 index 0000000000..a645e3dbd4 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-10-10-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-10-inf-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-10-inf-10@3x.png new file mode 100644 index 0000000000..8a01a112f5 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-10-inf-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-10-inf-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-10-inf-inf@3x.png new file mode 100644 index 0000000000..4367dcf7de Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-10-inf-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-inf-10-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-inf-10-10@3x.png new file mode 100644 index 0000000000..558fd84768 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-inf-10-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-inf-10-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-inf-10-inf@3x.png new file mode 100644 index 0000000000..10f466575a Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-inf-10-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-inf-inf-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-inf-inf-10@3x.png new file mode 100644 index 0000000000..b2c041116d Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-inf-inf-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-inf-inf-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-inf-inf-inf@3x.png new file mode 100644 index 0000000000..88d16405d2 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_10-inf-inf-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-10-10-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-10-10-10@3x.png new file mode 100644 index 0000000000..eb9cf61acb Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-10-10-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-10-10-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-10-10-inf@3x.png new file mode 100644 index 0000000000..98a3f5faab Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-10-10-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-10-inf-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-10-inf-10@3x.png new file mode 100644 index 0000000000..232924d3dd Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-10-inf-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-10-inf-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-10-inf-inf@3x.png new file mode 100644 index 0000000000..651468da4d Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-10-inf-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-inf-10-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-inf-10-10@3x.png new file mode 100644 index 0000000000..9838114469 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-inf-10-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-inf-10-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-inf-10-inf@3x.png new file mode 100644 index 0000000000..b71a6ad440 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-inf-10-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-inf-inf-10@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-inf-inf-10@3x.png new file mode 100644 index 0000000000..4d863686b8 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-inf-inf-10@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-inf-inf-inf@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-inf-inf-inf@3x.png new file mode 100644 index 0000000000..f517f65d5c Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASInsetLayoutSpecSnapshotTests/testInsetsWithVariableSize_inf-inf-inf-inf@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASOverlayLayoutSpecSnapshotTests/testOverlay@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASOverlayLayoutSpecSnapshotTests/testOverlay@3x.png new file mode 100644 index 0000000000..e9bb3f4098 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASOverlayLayoutSpecSnapshotTests/testOverlay@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASRatioLayoutSpecSnapshotTests/testRatioLayout_DoubleRatio@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASRatioLayoutSpecSnapshotTests/testRatioLayout_DoubleRatio@3x.png new file mode 100644 index 0000000000..099f811e66 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASRatioLayoutSpecSnapshotTests/testRatioLayout_DoubleRatio@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASRatioLayoutSpecSnapshotTests/testRatioLayout_HalfRatio@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASRatioLayoutSpecSnapshotTests/testRatioLayout_HalfRatio@3x.png new file mode 100644 index 0000000000..c8c49a5841 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASRatioLayoutSpecSnapshotTests/testRatioLayout_HalfRatio@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASRatioLayoutSpecSnapshotTests/testRatioLayout_SevenTimesRatio@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASRatioLayoutSpecSnapshotTests/testRatioLayout_SevenTimesRatio@3x.png new file mode 100644 index 0000000000..5fd4b9237d Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASRatioLayoutSpecSnapshotTests/testRatioLayout_SevenTimesRatio@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASRatioLayoutSpecSnapshotTests/testRatioLayout_TenTimesRatioWithItemTooBig@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASRatioLayoutSpecSnapshotTests/testRatioLayout_TenTimesRatioWithItemTooBig@3x.png new file mode 100644 index 0000000000..0121889335 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASRatioLayoutSpecSnapshotTests/testRatioLayout_TenTimesRatioWithItemTooBig@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignCenterWithFlexedMainDimension@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignCenterWithFlexedMainDimension@3x.png new file mode 100644 index 0000000000..013057b31f Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignCenterWithFlexedMainDimension@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignCenterWithIndefiniteCrossDimension@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignCenterWithIndefiniteCrossDimension@3x.png new file mode 100644 index 0000000000..042dfd0498 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignCenterWithIndefiniteCrossDimension@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedCenter@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedCenter@3x.png new file mode 100644 index 0000000000..70b2edb7ba Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedCenter@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedEnd@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedEnd@3x.png new file mode 100644 index 0000000000..e7de065228 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedEnd@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedStart@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedStart@3x.png new file mode 100644 index 0000000000..f37d2b443c Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedStart@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedStretchNoChildExceedsMin@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedStretchNoChildExceedsMin@3x.png new file mode 100644 index 0000000000..35954a4dbf Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedStretchNoChildExceedsMin@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedStretchOneChildExceedsMin@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedStretchOneChildExceedsMin@3x.png new file mode 100644 index 0000000000..51d8ffcf55 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testAlignedStretchOneChildExceedsMin@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testChildSpacing_spacingAfter@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testChildSpacing_spacingAfter@3x.png new file mode 100644 index 0000000000..cf50ce8f90 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testChildSpacing_spacingAfter@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testChildSpacing_spacingBalancedOut@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testChildSpacing_spacingBalancedOut@3x.png new file mode 100644 index 0000000000..d191cfbba2 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testChildSpacing_spacingBalancedOut@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testChildSpacing_spacingBefore@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testChildSpacing_spacingBefore@3x.png new file mode 100644 index 0000000000..22ce210dca Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testChildSpacing_spacingBefore@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testChildThatChangesCrossSizeWhenMainSizeIsFlexed@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testChildThatChangesCrossSizeWhenMainSizeIsFlexed@3x.png new file mode 100644 index 0000000000..45700fe8af Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testChildThatChangesCrossSizeWhenMainSizeIsFlexed@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testCrossAxisSizeBehaviors_fixedHeight@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testCrossAxisSizeBehaviors_fixedHeight@3x.png new file mode 100644 index 0000000000..98b75fc162 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testCrossAxisSizeBehaviors_fixedHeight@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testCrossAxisSizeBehaviors_variableHeight@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testCrossAxisSizeBehaviors_variableHeight@3x.png new file mode 100644 index 0000000000..12bfc63001 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testCrossAxisSizeBehaviors_variableHeight@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testCrossAxisStretchingOccursAfterStackAxisFlexing@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testCrossAxisStretchingOccursAfterStackAxisFlexing@3x.png new file mode 100644 index 0000000000..3e668e167d Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testCrossAxisStretchingOccursAfterStackAxisFlexing@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testEmptyStack@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testEmptyStack@3x.png new file mode 100644 index 0000000000..54ac8f2b5b Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testEmptyStack@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFixedFlexBasisAppliedWhenFlexingItems_overflow@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFixedFlexBasisAppliedWhenFlexingItems_overflow@3x.png new file mode 100644 index 0000000000..4f9ffc33ab Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFixedFlexBasisAppliedWhenFlexingItems_overflow@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFixedFlexBasisAppliedWhenFlexingItems_underflow@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFixedFlexBasisAppliedWhenFlexingItems_underflow@3x.png new file mode 100644 index 0000000000..dc22edc0aa Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFixedFlexBasisAppliedWhenFlexingItems_underflow@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFixedFlexBasisOverridesIntrinsicSizeForNonFlexingChildren@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFixedFlexBasisOverridesIntrinsicSizeForNonFlexingChildren@3x.png new file mode 100644 index 0000000000..312623d230 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFixedFlexBasisOverridesIntrinsicSizeForNonFlexingChildren@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFlexWithUnequalIntrinsicSizes_overflow@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFlexWithUnequalIntrinsicSizes_overflow@3x.png new file mode 100644 index 0000000000..a590ed923c Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFlexWithUnequalIntrinsicSizes_overflow@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFlexWithUnequalIntrinsicSizes_underflow@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFlexWithUnequalIntrinsicSizes_underflow@3x.png new file mode 100644 index 0000000000..c4db41e310 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testFlexWithUnequalIntrinsicSizes_underflow@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_horizontalBottomRight@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_horizontalBottomRight@3x.png new file mode 100644 index 0000000000..19e98d65b8 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_horizontalBottomRight@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_horizontalCenter@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_horizontalCenter@3x.png new file mode 100644 index 0000000000..36a78c6fe7 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_horizontalCenter@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_horizontalTopLeft@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_horizontalTopLeft@3x.png new file mode 100644 index 0000000000..ae763d07e3 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_horizontalTopLeft@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_verticalBottomRight@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_verticalBottomRight@3x.png new file mode 100644 index 0000000000..8ba43f0549 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_verticalBottomRight@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_verticalCenter@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_verticalCenter@3x.png new file mode 100644 index 0000000000..71df1cf208 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_verticalCenter@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_verticalTopLeft@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_verticalTopLeft@3x.png new file mode 100644 index 0000000000..2d2de74cb9 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testHorizontalAndVerticalAlignments_verticalTopLeft@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedCenterWithChildSpacing_variableHeight@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedCenterWithChildSpacing_variableHeight@3x.png new file mode 100644 index 0000000000..f6249587a0 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedCenterWithChildSpacing_variableHeight@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedSpaceAroundWithOneChild@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedSpaceAroundWithOneChild@3x.png new file mode 100644 index 0000000000..f97ca1ee1f Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedSpaceAroundWithOneChild@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedSpaceAroundWithRemainingSpace@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedSpaceAroundWithRemainingSpace@3x.png new file mode 100644 index 0000000000..ea5c8e4db7 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedSpaceAroundWithRemainingSpace@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedSpaceBetweenWithOneChild@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedSpaceBetweenWithOneChild@3x.png new file mode 100644 index 0000000000..34be81fa1a Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedSpaceBetweenWithOneChild@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedSpaceBetweenWithRemainingSpace@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedSpaceBetweenWithRemainingSpace@3x.png new file mode 100644 index 0000000000..1baf4bca46 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testJustifiedSpaceBetweenWithRemainingSpace@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviorsWhenAllFlexShrinkChildrenHaveBeenClampedToZeroButViolationStillExists@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviorsWhenAllFlexShrinkChildrenHaveBeenClampedToZeroButViolationStillExists@3x.png new file mode 100644 index 0000000000..3c6994df44 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviorsWhenAllFlexShrinkChildrenHaveBeenClampedToZeroButViolationStillExists@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviors_flex@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviors_flex@3x.png new file mode 100644 index 0000000000..c313211790 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviors_flex@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviors_justifyCenter@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviors_justifyCenter@3x.png new file mode 100644 index 0000000000..74b509f6cc Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviors_justifyCenter@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviors_justifyEnd@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviors_justifyEnd@3x.png new file mode 100644 index 0000000000..1efcebc1cc Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviors_justifyEnd@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviors_justifyStart@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviors_justifyStart@3x.png new file mode 100644 index 0000000000..e6b5ab6e49 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testOverflowBehaviors_justifyStart@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testPercentageFlexBasisResolvesAgainstParentSize@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testPercentageFlexBasisResolvesAgainstParentSize@3x.png new file mode 100644 index 0000000000..ca92a9bf7f Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testPercentageFlexBasisResolvesAgainstParentSize@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testStackSpacingWithChildrenHavingNilObjects_variableHeight@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testStackSpacingWithChildrenHavingNilObjects_variableHeight@3x.png new file mode 100644 index 0000000000..bb44b6a4df Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testStackSpacingWithChildrenHavingNilObjects_variableHeight@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testStackSpacing_variableHeight@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testStackSpacing_variableHeight@3x.png new file mode 100644 index 0000000000..b5d3bc5e9a Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testStackSpacing_variableHeight@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_flex@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_flex@3x.png new file mode 100644 index 0000000000..f5479576db Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_flex@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifyCenter@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifyCenter@3x.png new file mode 100644 index 0000000000..f89083148f Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifyCenter@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifyEnd@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifyEnd@3x.png new file mode 100644 index 0000000000..7c06d73fa3 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifyEnd@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifySpaceAround@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifySpaceAround@3x.png new file mode 100644 index 0000000000..457062ea1d Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifySpaceAround@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifySpaceBetween@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifySpaceBetween@3x.png new file mode 100644 index 0000000000..eea9e51c30 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifySpaceBetween@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifyStart@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifyStart@3x.png new file mode 100644 index 0000000000..4a34478cec Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testUnderflowBehaviors_justifyStart@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testViolationIsDistributedEquallyAmongFlexibleChildren@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testViolationIsDistributedEquallyAmongFlexibleChildren@3x.png new file mode 100644 index 0000000000..6303a7a871 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStackLayoutSpecSnapshotTests/testViolationIsDistributedEquallyAmongFlexibleChildren@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStaticLayoutSpecSnapshotTests/testChildrenMeasuredWithAutoMaxSize@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStaticLayoutSpecSnapshotTests/testChildrenMeasuredWithAutoMaxSize@3x.png new file mode 100644 index 0000000000..78fafd3fd6 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStaticLayoutSpecSnapshotTests/testChildrenMeasuredWithAutoMaxSize@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStaticLayoutSpecSnapshotTests/testSizingBehaviour_overflowChildren@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStaticLayoutSpecSnapshotTests/testSizingBehaviour_overflowChildren@3x.png new file mode 100644 index 0000000000..2023ff6ad4 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStaticLayoutSpecSnapshotTests/testSizingBehaviour_overflowChildren@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStaticLayoutSpecSnapshotTests/testSizingBehaviour_underflowChildren@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStaticLayoutSpecSnapshotTests/testSizingBehaviour_underflowChildren@3x.png new file mode 100644 index 0000000000..d34850d927 Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStaticLayoutSpecSnapshotTests/testSizingBehaviour_underflowChildren@3x.png differ diff --git a/AsyncDisplayKitTests/ReferenceImages_64/ASStaticLayoutSpecSnapshotTests/testSizingBehaviour_wrappedChildren@3x.png b/AsyncDisplayKitTests/ReferenceImages_64/ASStaticLayoutSpecSnapshotTests/testSizingBehaviour_wrappedChildren@3x.png new file mode 100644 index 0000000000..e1f26129ef Binary files /dev/null and b/AsyncDisplayKitTests/ReferenceImages_64/ASStaticLayoutSpecSnapshotTests/testSizingBehaviour_wrappedChildren@3x.png differ diff --git a/AsyncDisplayKitTests/TestResources/ASThrashTestRecordedCase b/AsyncDisplayKitTests/TestResources/ASThrashTestRecordedCase new file mode 100644 index 0000000000..9e8343590e --- /dev/null +++ b/AsyncDisplayKitTests/TestResources/ASThrashTestRecordedCase @@ -0,0 +1 @@ +YnBsaXN0MDDUAAEAAgADAAQABQAGDfYN91gkdmVyc2lvblgkb2JqZWN0c1kkYXJjaGl2ZXJUJHRvcBIAAYagrxEDRQAHAAgADwAtAC4ALwAwADEAMgAzADQANQA2ADcAOAA5AEAARgBdAGEAaABrAG4AcQB0AHcAegB9AIAAgwCGAIkAjACPAJIAlQCYAJsAngChAKYAqgCuAMUAyADLAM4A0QDUANcA2gDdAOAA4wDmAOkA7ADvAPIA9QD4APsA/gEBAQUBHAEfASIBJQEoASsBLgExATQBNwE6AT0BQAFDAUYBSQFMAU8BUgFVAVgBXAFzAXYBeQF8AX8BggGFAYgBiwGOAZEBlAGXAZoBnQGgAaMBpgGpAawBrwG1AbkBvgHDAdsB4AHjAeYB6AHqAewB7wHyAfQB9gH5AfwB/wICAgUCBwIKAg0CDwITAhYCGAIaAhwCIAIjAiYCKQIsAkMCSAJLAk4CUwJWAlkCXQJgAmQCZwJsAm8CcgJ4AnsCfgKBAoUCiAKNApACkwKXApoCngKhAqYCqQKsArECtAK3Ar0CwALDAsYCywLOAtEC2ALbAt4C4QLkAu4C8QL0AvcC+gL9AwADAwMHAwoDEAMTAxYDGQMeAyEDJAMnAz4DQgNZA1wDXwNiA2UDaANrA24DcQN0A3cDegN9A4ADgwOGA4kDjAOPA5IDlQOZA7ADswO2A7kDvAO/A8IDxQPIA8sDzgPRA9QD1wPaA90D4APjA+YD6QPsA/AEBwQKBA0EEAQTBBYEGQQcBB8EIgQlBCgEKwQuBDEENAQ3BDoEPQRABEMERwReBGEEZARnBGoEbQRwBHMEdgR5BHwEfwSCBIUEiASLBI4EkQSUBJcEmgSeBLUEuAS7BL4EwQTEBMcEygTNBNAE0wTWBNkE3ATfBOIE5QToBOsE7gTxBPUFDAUPBRIFFQUYBRsFHgUhBSQFJwUqBS0FMAUzBTYFOQU8BT8FQgVFBUgFTAVjBWYFaQVsBW8FcgV1BXgFewV+BYEFhAWHBYoFjQWQBZMFlgWZBZwFnwWjBboFvQXABcMFxgXJBcwFzwXSBdUF2AXbBd4F4QXkBecF6gXtBfAF8wX2BfoGEQYUBhcGGgYdBiAGIwYmBikGLAYvBjIGNQY4BjsGPgZBBkQGRwZKBk0GUQZoBmsGbgZxBnQGdwZ6Bn0GgAaDBoYGiQaMBo8GkgaVBpgGmwaeBqEGpAaoBr8GwgbFBsgGywbOBtEG1AbXBtoG3QbgBuMG5gbpBuwG7wbyBvUG+Ab7Bv8HFgcZBxwHHwciByUHKAcrBy4HMQc0BzcHOgc9B0AHQwdGB0kHTAdPB1IHVgdtB3AHcwd2B3kHfAd/B4IHhQeIB4sHjgeRB5QHlweaB50HoAejB6YHqQetB8QHxwfKB80H0AfTB9YH2QfcB98H4gflB+gH6wfuB/EH9Af3B/oH/QgACAQIGwgeCCEIJAgnCCoILQgwCDMINgg5CDwIPwhCCEUISAhLCE4IUQhUCFcIWwhyCHUIeAh7CH4IgQiECIcIigiNCJAIkwiWCJkInAifCKIIpQioCKsIrgiyCMkIzAjPCNII1QjYCNsI3gjhCOQI5wjqCO0I8AjzCPYI+Qj8CP8JAgkFCQkJIAkjCSYJKQksCS8JMgk1CTgJOwk+CUEJRAlHCUoJTQlQCVMJVglZCVwJYAl3CXoJfQmACYMJhgmJCYwJjwmSCZUJmAmbCZ4JoQmkCacJqgmtCbAJswm3Cc4J0QnUCdcJ2gndCeAJ4wnmCekJ7AnvCfIJ9Qn4CfsJ/goBCgQKBwoKCiIKJQo8Cj8KQgpcCl8KYgplCmgKfQqACpUKmAqwCrMKtgq6Cs0K0ArTCtYK2QrcCt8K4grlCugK6wruCvEK9Ar3CvoK/QsBCxcLGgsdCyALIwsmCykLLAsvCzILNQs4CzsLPgtBC0QLRwtKC00LUAtTC2wLbwtyC3ULjAuPC5ILrAuvC7ILtQu4C8wLzwvmC+kL7AvvDAgMCwwODBEMFQwoDCsMLgwxDDQMNww6DD0MQAxDDEYMSQxMDE8MUgxVDFgMWwxyDHUMeAx7DH4MgQyWDJkMnAyfDLYMuQy8DL8M1gzYDNsM3QzgDOMM5gzpDOwM7gzwDPIM9Az2DPgM+gz9DQANAw0GDQkNCw0ODRENFA0XDRoNMQ0zDTYNOQ08DT8NQg1FDUgNSw1NDU8NUQ1TDVYNWQ1cDV8NYQ1kDWcNag1tDXANcw11DXgNew1+DYENgw2bDZ8NpQ2oDaoNrQ2wDbUNug2+DcQNxw3MDdIN2Q3eDeIN5Q3oDe4N8lUkbnVsbNMACQAKAAsADAANAA5VX2RpY3RYX3ZlcnNpb25WJGNsYXNzgAIQAYEDRNMAEAARAAsAEgAfACxXTlMua2V5c1pOUy5vYmplY3RzrAATABQAFQAWABcAGAAZABoAGwAcAB0AHoADgASABYAGgAeACIAJgAqAC4AMgA2ADqwAIAAhACIAIwAkACUAJgAnACgAKQAqACuAD4BrgG+AjYDMgQKFgQLzgQL1gQMQgQMvgQNAgQNCgQNDXxAQaW5zZXJ0ZWRTZWN0aW9uc18QFnJlcGxhY2VkU2VjdGlvbkluZGV4ZXNfEBNpbnNlcnRlZEl0ZW1JbmRleGVzXnJlcGxhY2luZ0l0ZW1zV29sZERhdGFUZGF0YV8QFmluc2VydGVkU2VjdGlvbkluZGV4ZXNfEBJkZWxldGVkSXRlbUluZGV4ZXNfEBNyZXBsYWNlZEl0ZW1JbmRleGVzXWluc2VydGVkSXRlbXNfEBVkZWxldGVkU2VjdGlvbkluZGV4ZXNfEBFyZXBsYWNpbmdTZWN0aW9uc9IAEQALADoAP6QAOwA8AD0APoAQgCmAP4BVgCfTAEEAQgALAEMARABFVWl0ZW1zWXNlY3Rpb25JRIAREKiAKNIAEQALAEcAP68QFABIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFuAEoAUgBWAFoAXgBiAGYAagBuAHIAdgB6AH4AggCGAIoAjgCSAJYAmgCfSAF4ACwBfAGBWaXRlbUlEEQQSgBPSAGIAYwBkAGVaJGNsYXNzbmFtZVgkY2xhc3Nlc18QEEFTVGhyYXNoVGVzdEl0ZW2iAGYAZ18QEEFTVGhyYXNoVGVzdEl0ZW1YTlNPYmplY3TSAF4ACwBpAGARBBOAE9IAXgALAGwAYBEEFIAT0gBeAAsAbwBgEQQVgBPSAF4ACwByAGARBBaAE9IAXgALAHUAYBEEF4AT0gBeAAsAeABgEQQYgBPSAF4ACwB7AGARBBmAE9IAXgALAH4AYBEEGoAT0gBeAAsAgQBgEQQbgBPSAF4ACwCEAGARBByAE9IAXgALAIcAYBEEHYAT0gBeAAsAigBgEQQegBPSAF4ACwCNAGARBB+AE9IAXgALAJAAYBEEIIAT0gBeAAsAkwBgEQQhgBPSAF4ACwCWAGARBCKAE9IAXgALAJkAYBEEI4AT0gBeAAsAnABgEQQkgBPSAF4ACwCfAGARBCWAE9IAYgBjAKIAo15OU011dGFibGVBcnJheaMApAClAGdeTlNNdXRhYmxlQXJyYXlXTlNBcnJhedIAYgBjAKcAqF8QE0FTVGhyYXNoVGVzdFNlY3Rpb26iAKkAZ18QE0FTVGhyYXNoVGVzdFNlY3Rpb27TAEEAQgALAKsArABFgCoQqYAo0gARAAsArwA/rxAUALAAsQCyALMAtAC1ALYAtwC4ALkAugC7ALwAvQC+AL8AwADBAMIAw4ArgCyALYAugC+AMIAxgDKAM4A0gDWANoA3gDiAOYA6gDuAPIA9gD6AJ9IAXgALAMYAYBEEJoAT0gBeAAsAyQBgEQQngBPSAF4ACwDMAGARBCiAE9IAXgALAM8AYBEEKYAT0gBeAAsA0gBgEQQqgBPSAF4ACwDVAGARBCuAE9IAXgALANgAYBEELIAT0gBeAAsA2wBgEQQtgBPSAF4ACwDeAGARBC6AE9IAXgALAOEAYBEEL4AT0gBeAAsA5ABgEQQwgBPSAF4ACwDnAGARBDGAE9IAXgALAOoAYBEEMoAT0gBeAAsA7QBgEQQzgBPSAF4ACwDwAGARBDSAE9IAXgALAPMAYBEENYAT0gBeAAsA9gBgEQQ2gBPSAF4ACwD5AGARBDeAE9IAXgALAPwAYBEEOIAT0gBeAAsA/wBgEQQ5gBPTAEEAQgALAQIBAwBFgEAQqoAo0gARAAsBBgA/rxAUAQcBCAEJAQoBCwEMAQ0BDgEPARABEQESARMBFAEVARYBFwEYARkBGoBBgEKAQ4BEgEWARoBHgEiASYBKgEuATIBNgE6AT4BQgFGAUoBTgFSAJ9IAXgALAR0AYBEEOoAT0gBeAAsBIABgEQQ7gBPSAF4ACwEjAGARBDyAE9IAXgALASYAYBEEPYAT0gBeAAsBKQBgEQQ+gBPSAF4ACwEsAGARBD+AE9IAXgALAS8AYBEEQIAT0gBeAAsBMgBgEQRBgBPSAF4ACwE1AGARBEKAE9IAXgALATgAYBEEQ4AT0gBeAAsBOwBgEQREgBPSAF4ACwE+AGARBEWAE9IAXgALAUEAYBEERoAT0gBeAAsBRABgEQRHgBPSAF4ACwFHAGARBEiAE9IAXgALAUoAYBEESYAT0gBeAAsBTQBgEQRKgBPSAF4ACwFQAGARBEuAE9IAXgALAVMAYBEETIAT0gBeAAsBVgBgEQRNgBPTAEEAQgALAVkBWgBFgFYQq4Ao0gARAAsBXQA/rxAUAV4BXwFgAWEBYgFjAWQBZQFmAWcBaAFpAWoBawFsAW0BbgFvAXABcYBXgFiAWYBagFuAXIBdgF6AX4BggGGAYoBjgGSAZYBmgGeAaIBpgGqAJ9IAXgALAXQAYBEEToAT0gBeAAsBdwBgEQRPgBPSAF4ACwF6AGARBFCAE9IAXgALAX0AYBEEUYAT0gBeAAsBgABgEQRSgBPSAF4ACwGDAGARBFOAE9IAXgALAYYAYBEEVIAT0gBeAAsBiQBgEQRVgBPSAF4ACwGMAGARBFaAE9IAXgALAY8AYBEEV4AT0gBeAAsBkgBgEQRYgBPSAF4ACwGVAGARBFmAE9IAXgALAZgAYBEEWoAT0gBeAAsBmwBgEQRbgBPSAF4ACwGeAGARBFyAE9IAXgALAaEAYBEEXYAT0gBeAAsBpABgEQRegBPSAF4ACwGnAGARBF+AE9IAXgALAaoAYBEEYIAT0gBeAAsBrQBgEQRhgBPTAbAACwGxAbIBswG0XE5TUmFuZ2VDb3VudFtOU1JhbmdlRGF0YRACgG6AbNIBtgALAbcBuFdOUy5kYXRhRAYCEAGAbdIAYgBjAboBu11OU011dGFibGVEYXRhowG8Ab0AZ11OU011dGFibGVEYXRhVk5TRGF0YdIAYgBjAb8BwF8QEU5TTXV0YWJsZUluZGV4U2V0owHBAcIAZ18QEU5TTXV0YWJsZUluZGV4U2V0Wk5TSW5kZXhTZXTSABEACwHEAD+vEBUBxQHGAccByAHJAcoBywHMAc0BzgHPAdAB0QHSAdMB1AHVAdYB1wHYAdmAcIBxgHOAdIB1gHaAeIB5gHqAfIB9gH+AgICCgIOAhYCGgIeAiICKgIyAJ9QB3AALAbAB3QHeAbMADQANWk5TTG9jYXRpb25YTlNMZW5ndGgQAIBu0wGwAAsBsQGyAbMB4oBugHLSAbYACwHkAbhEAgEUAoBt0gGwAAsB3gGzgG7SAbAACwHeAbOAbtIBsAALAd4Bs4Bu0wGwAAsBsQGyAbMB7oBugHfSAbYACwHwAbhEEAETAYBt0gGwAAsB3gGzgG7SAbAACwHeAbOAbtMBsAALAbEBsgGzAfiAboB70gG2AAsB+gG4RAMBDAGAbdQB3AALAbAB3QH9AbMADQANEAeAbtMBsAALAbEBsgGzAgGAboB+0gG2AAsCAwG4RAwCFAGAbdIBsAALAd4Bs4Bu0wGwAAsBsQGyAbMCCYBugIHSAbYACwILAbhEDAEOAYBt0gGwAAsB3gGzgG7TAbAACwGxAhABswISEAOAboCE0gG2AAsCFAG4RgIBDwERAYBt0gGwAAsB3gGzgG7SAbAACwHeAbOAbtIBsAALAd4Bs4Bu0wGwAAsBsQIdAbMCHxAEgG6AidIBtgALAiEBuEgAAQIBBwEJAYBt0wGwAAsBsQGyAbMCJYBugIvSAbYACwInAbhEBwEKAYBt1AHcAAsBsAHdAioBswANAA0QBYBu0gARAAsCLQA/rxAUAi4CLwIwAjECMgIzAjQCNQI2AjcCOAI5AjoCOwI8Aj0CPgI/AkACQYCOgJGAlICWgJiAm4CfgKGApICmgKiAq4CugLKAtYC6gMKAxIDIgMuAJ9IAEQALAkQAP6ICRQJGgI+AkIAn0gBeAAsCSQBgEQOsgBPSAF4ACwJMAGARA62AE9IAEQALAk8AP6ICUAJRgJKAk4An0gBeAAsCVABgEQOugBPSAF4ACwJXAGARA6+AE9IAEQALAloAP6ECW4CVgCfSAF4ACwJeAGARA7CAE9IAEQALAmEAP6ECYoCXgCfSAF4ACwJlAGARA7GAE9IAEQALAmgAP6ICaQJqgJmAmoAn0gBeAAsCbQBgEQOygBPSAF4ACwJwAGARA7OAE9IAEQALAnMAP6MCdAJ1AnaAnICdgJ6AJ9IAXgALAnkAYBEDtIAT0gBeAAsCfABgEQO1gBPSAF4ACwJ/AGARA7aAE9IAEQALAoIAP6ECg4CggCfSAF4ACwKGAGARA7eAE9IAEQALAokAP6ICigKLgKKAo4An0gBeAAsCjgBgEQO4gBPSAF4ACwKRAGARA7mAE9IAEQALApQAP6EClYClgCfSAF4ACwKYAGARA7qAE9IAEQALApsAP6ECnICngCfSAF4ACwKfAGARA7uAE9IAEQALAqIAP6ICowKkgKmAqoAn0gBeAAsCpwBgEQO8gBPSAF4ACwKqAGARA72AE9IAEQALAq0AP6ICrgKvgKyArYAn0gBeAAsCsgBgEQO+gBPSAF4ACwK1AGARA7+AE9IAEQALArgAP6MCuQK6AruAr4CwgLGAJ9IAXgALAr4AYBEDwIAT0gBeAAsCwQBgEQPBgBPSAF4ACwLEAGARA8KAE9IAEQALAscAP6ICyALJgLOAtIAn0gBeAAsCzABgEQPDgBPSAF4ACwLPAGARA8SAE9IAEQALAtIAP6QC0wLUAtUC1oC2gLeAuIC5gCfSAF4ACwLZAGARA8WAE9IAXgALAtwAYBEDxoAT0gBeAAsC3wBgEQPHgBPSAF4ACwLiAGARA8iAE9IAEQALAuUAP6cC5gLnAugC6QLqAusC7IC7gLyAvYC+gL+AwIDBgCfSAF4ACwLvAGARA8mAE9IAXgALAvIAYBEDyoAT0gBeAAsC9QBgEQPLgBPSAF4ACwL4AGARA8yAE9IAXgALAvsAYBEDzYAT0gBeAAsC/gBgEQPOgBPSAF4ACwMBAGARA8+AE9IAEQALAwQAP6EDBYDDgCfSAF4ACwMIAGARA9CAE9IAEQALAwsAP6MDDAMNAw6AxYDGgMeAJ9IAXgALAxEAYBED0YAT0gBeAAsDFABgEQPSgBPSAF4ACwMXAGARA9OAE9IAEQALAxoAP6IDGwMcgMmAyoAn0gBeAAsDHwBgEQPUgBPSAF4ACwMiAGARA9WAE9IAEQALAyUAP6CAJ9IAEQALAygAP68QFAMpAyoDKwMsAy0DLgMvAzADMQMyAzMDNAM1AzYDNwM4AzkDOgM7AzyAzYDjgPmBAQ+BASWBATuBAVGBAWeBAX2BAZOBAamBAb+BAdWBAeuBAgGBAheBAi2BAkOBAlmBAm+AJ9MAQQBCAAsDPwNAAEWAzhBVgCjSABEACwNDAD+vEBQDRANFA0YDRwNIA0kDSgNLA0wDTQNOA08DUANRA1IDUwNUA1UDVgNXgM+A0IDRgNKA04DUgNWA1oDXgNiA2YDagNuA3IDdgN6A34DggOGA4oAn0gBeAAsDWgBgEQIcgBPSAF4ACwNdAGARAh2AE9IAXgALA2AAYBECHoAT0gBeAAsDYwBgEQIfgBPSAF4ACwNmAGARAiCAE9IAXgALA2kAYBECIYAT0gBeAAsDbABgEQIigBPSAF4ACwNvAGARAiOAE9IAXgALA3IAYBECJIAT0gBeAAsDdQBgEQIlgBPSAF4ACwN4AGARAiaAE9IAXgALA3sAYBECJ4AT0gBeAAsDfgBgEQIogBPSAF4ACwOBAGARAimAE9IAXgALA4QAYBECKoAT0gBeAAsDhwBgEQIrgBPSAF4ACwOKAGARAiyAE9IAXgALA40AYBECLYAT0gBeAAsDkABgEQIugBPSAF4ACwOTAGARAi+AE9MAQQBCAAsDlgOXAEWA5BBWgCjSABEACwOaAD+vEBQDmwOcA50DngOfA6ADoQOiA6MDpAOlA6YDpwOoA6kDqgOrA6wDrQOugOWA5oDngOiA6YDqgOuA7IDtgO6A74DwgPGA8oDzgPSA9YD2gPeA+IAn0gBeAAsDsQBgEQIwgBPSAF4ACwO0AGARAjGAE9IAXgALA7cAYBECMoAT0gBeAAsDugBgEQIzgBPSAF4ACwO9AGARAjSAE9IAXgALA8AAYBECNYAT0gBeAAsDwwBgEQI2gBPSAF4ACwPGAGARAjeAE9IAXgALA8kAYBECOIAT0gBeAAsDzABgEQI5gBPSAF4ACwPPAGARAjqAE9IAXgALA9IAYBECO4AT0gBeAAsD1QBgEQI8gBPSAF4ACwPYAGARAj2AE9IAXgALA9sAYBECPoAT0gBeAAsD3gBgEQI/gBPSAF4ACwPhAGARAkCAE9IAXgALA+QAYBECQYAT0gBeAAsD5wBgEQJCgBPSAF4ACwPqAGARAkOAE9MAQQBCAAsD7QPuAEWA+hBXgCjSABEACwPxAD+vEBQD8gPzA/QD9QP2A/cD+AP5A/oD+wP8A/0D/gP/BAAEAQQCBAMEBAQFgPuA/ID9gP6A/4EBAIEBAYEBAoEBA4EBBIEBBYEBBoEBB4EBCIEBCYEBCoEBC4EBDIEBDYEBDoAn0gBeAAsECABgEQJEgBPSAF4ACwQLAGARAkWAE9IAXgALBA4AYBECRoAT0gBeAAsEEQBgEQJHgBPSAF4ACwQUAGARAkiAE9IAXgALBBcAYBECSYAT0gBeAAsEGgBgEQJKgBPSAF4ACwQdAGARAkuAE9IAXgALBCAAYBECTIAT0gBeAAsEIwBgEQJNgBPSAF4ACwQmAGARAk6AE9IAXgALBCkAYBECT4AT0gBeAAsELABgEQJQgBPSAF4ACwQvAGARAlGAE9IAXgALBDIAYBECUoAT0gBeAAsENQBgEQJTgBPSAF4ACwQ4AGARAlSAE9IAXgALBDsAYBECVYAT0gBeAAsEPgBgEQJWgBPSAF4ACwRBAGARAleAE9MAQQBCAAsERARFAEWBARAQWIAo0gARAAsESAA/rxAUBEkESgRLBEwETQROBE8EUARRBFIEUwRUBFUEVgRXBFgEWQRaBFsEXIEBEYEBEoEBE4EBFIEBFYEBFoEBF4EBGIEBGYEBGoEBG4EBHIEBHYEBHoEBH4EBIIEBIYEBIoEBI4EBJIAn0gBeAAsEXwBgEQJYgBPSAF4ACwRiAGARAlmAE9IAXgALBGUAYBECWoAT0gBeAAsEaABgEQJbgBPSAF4ACwRrAGARAlyAE9IAXgALBG4AYBECXYAT0gBeAAsEcQBgEQJegBPSAF4ACwR0AGARAl+AE9IAXgALBHcAYBECYIAT0gBeAAsEegBgEQJhgBPSAF4ACwR9AGARAmKAE9IAXgALBIAAYBECY4AT0gBeAAsEgwBgEQJkgBPSAF4ACwSGAGARAmWAE9IAXgALBIkAYBECZoAT0gBeAAsEjABgEQJngBPSAF4ACwSPAGARAmiAE9IAXgALBJIAYBECaYAT0gBeAAsElQBgEQJqgBPSAF4ACwSYAGARAmuAE9MAQQBCAAsEmwScAEWBASYQWYAo0gARAAsEnwA/rxAUBKAEoQSiBKMEpASlBKYEpwSoBKkEqgSrBKwErQSuBK8EsASxBLIEs4EBJ4EBKIEBKYEBKoEBK4EBLIEBLYEBLoEBL4EBMIEBMYEBMoEBM4EBNIEBNYEBNoEBN4EBOIEBOYEBOoAn0gBeAAsEtgBgEQJsgBPSAF4ACwS5AGARAm2AE9IAXgALBLwAYBECboAT0gBeAAsEvwBgEQJvgBPSAF4ACwTCAGARAnCAE9IAXgALBMUAYBECcYAT0gBeAAsEyABgEQJygBPSAF4ACwTLAGARAnOAE9IAXgALBM4AYBECdIAT0gBeAAsE0QBgEQJ1gBPSAF4ACwTUAGARAnaAE9IAXgALBNcAYBECd4AT0gBeAAsE2gBgEQJ4gBPSAF4ACwTdAGARAnmAE9IAXgALBOAAYBECeoAT0gBeAAsE4wBgEQJ7gBPSAF4ACwTmAGARAnyAE9IAXgALBOkAYBECfYAT0gBeAAsE7ABgEQJ+gBPSAF4ACwTvAGARAn+AE9MAQQBCAAsE8gTzAEWBATwQWoAo0gARAAsE9gA/rxAUBPcE+AT5BPoE+wT8BP0E/gT/BQAFAQUCBQMFBAUFBQYFBwUIBQkFCoEBPYEBPoEBP4EBQIEBQYEBQoEBQ4EBRIEBRYEBRoEBR4EBSIEBSYEBSoEBS4EBTIEBTYEBToEBT4EBUIAn0gBeAAsFDQBgEQKAgBPSAF4ACwUQAGARAoGAE9IAXgALBRMAYBECgoAT0gBeAAsFFgBgEQKDgBPSAF4ACwUZAGARAoSAE9IAXgALBRwAYBEChYAT0gBeAAsFHwBgEQKGgBPSAF4ACwUiAGARAoeAE9IAXgALBSUAYBECiIAT0gBeAAsFKABgEQKJgBPSAF4ACwUrAGARAoqAE9IAXgALBS4AYBECi4AT0gBeAAsFMQBgEQKMgBPSAF4ACwU0AGARAo2AE9IAXgALBTcAYBECjoAT0gBeAAsFOgBgEQKPgBPSAF4ACwU9AGARApCAE9IAXgALBUAAYBECkYAT0gBeAAsFQwBgEQKSgBPSAF4ACwVGAGARApOAE9MAQQBCAAsFSQVKAEWBAVIQW4Ao0gARAAsFTQA/rxAUBU4FTwVQBVEFUgVTBVQFVQVWBVcFWAVZBVoFWwVcBV0FXgVfBWAFYYEBU4EBVIEBVYEBVoEBV4EBWIEBWYEBWoEBW4EBXIEBXYEBXoEBX4EBYIEBYYEBYoEBY4EBZIEBZYEBZoAn0gBeAAsFZABgEQKUgBPSAF4ACwVnAGARApWAE9IAXgALBWoAYBECloAT0gBeAAsFbQBgEQKXgBPSAF4ACwVwAGARApiAE9IAXgALBXMAYBECmYAT0gBeAAsFdgBgEQKagBPSAF4ACwV5AGARApuAE9IAXgALBXwAYBECnIAT0gBeAAsFfwBgEQKdgBPSAF4ACwWCAGARAp6AE9IAXgALBYUAYBECn4AT0gBeAAsFiABgEQKggBPSAF4ACwWLAGARAqGAE9IAXgALBY4AYBECooAT0gBeAAsFkQBgEQKjgBPSAF4ACwWUAGARAqSAE9IAXgALBZcAYBECpYAT0gBeAAsFmgBgEQKmgBPSAF4ACwWdAGARAqeAE9MAQQBCAAsFoAWhAEWBAWgQXIAo0gARAAsFpAA/rxAUBaUFpgWnBagFqQWqBasFrAWtBa4FrwWwBbEFsgWzBbQFtQW2BbcFuIEBaYEBaoEBa4EBbIEBbYEBboEBb4EBcIEBcYEBcoEBc4EBdIEBdYEBdoEBd4EBeIEBeYEBeoEBe4EBfIAn0gBeAAsFuwBgEQKogBPSAF4ACwW+AGARAqmAE9IAXgALBcEAYBECqoAT0gBeAAsFxABgEQKrgBPSAF4ACwXHAGARAqyAE9IAXgALBcoAYBECrYAT0gBeAAsFzQBgEQKugBPSAF4ACwXQAGARAq+AE9IAXgALBdMAYBECsIAT0gBeAAsF1gBgEQKxgBPSAF4ACwXZAGARArKAE9IAXgALBdwAYBECs4AT0gBeAAsF3wBgEQK0gBPSAF4ACwXiAGARArWAE9IAXgALBeUAYBECtoAT0gBeAAsF6ABgEQK3gBPSAF4ACwXrAGARAriAE9IAXgALBe4AYBECuYAT0gBeAAsF8QBgEQK6gBPSAF4ACwX0AGARAruAE9MAQQBCAAsF9wX4AEWBAX4QXYAo0gARAAsF+wA/rxAUBfwF/QX+Bf8GAAYBBgIGAwYEBgUGBgYHBggGCQYKBgsGDAYNBg4GD4EBf4EBgIEBgYEBgoEBg4EBhIEBhYEBhoEBh4EBiIEBiYEBioEBi4EBjIEBjYEBjoEBj4EBkIEBkYEBkoAn0gBeAAsGEgBgEQK8gBPSAF4ACwYVAGARAr2AE9IAXgALBhgAYBECvoAT0gBeAAsGGwBgEQK/gBPSAF4ACwYeAGARAsCAE9IAXgALBiEAYBECwYAT0gBeAAsGJABgEQLCgBPSAF4ACwYnAGARAsOAE9IAXgALBioAYBECxIAT0gBeAAsGLQBgEQLFgBPSAF4ACwYwAGARAsaAE9IAXgALBjMAYBECx4AT0gBeAAsGNgBgEQLIgBPSAF4ACwY5AGARAsmAE9IAXgALBjwAYBECyoAT0gBeAAsGPwBgEQLLgBPSAF4ACwZCAGARAsyAE9IAXgALBkUAYBECzYAT0gBeAAsGSABgEQLOgBPSAF4ACwZLAGARAs+AE9MAQQBCAAsGTgZPAEWBAZQQXoAo0gARAAsGUgA/rxAUBlMGVAZVBlYGVwZYBlkGWgZbBlwGXQZeBl8GYAZhBmIGYwZkBmUGZoEBlYEBloEBl4EBmIEBmYEBmoEBm4EBnIEBnYEBnoEBn4EBoIEBoYEBooEBo4EBpIEBpYEBpoEBp4EBqIAn0gBeAAsGaQBgEQLQgBPSAF4ACwZsAGARAtGAE9IAXgALBm8AYBEC0oAT0gBeAAsGcgBgEQLTgBPSAF4ACwZ1AGARAtSAE9IAXgALBngAYBEC1YAT0gBeAAsGewBgEQLWgBPSAF4ACwZ+AGARAteAE9IAXgALBoEAYBEC2IAT0gBeAAsGhABgEQLZgBPSAF4ACwaHAGARAtqAE9IAXgALBooAYBEC24AT0gBeAAsGjQBgEQLcgBPSAF4ACwaQAGARAt2AE9IAXgALBpMAYBEC3oAT0gBeAAsGlgBgEQLfgBPSAF4ACwaZAGARAuCAE9IAXgALBpwAYBEC4YAT0gBeAAsGnwBgEQLigBPSAF4ACwaiAGARAuOAE9MAQQBCAAsGpQamAEWBAaoQX4Ao0gARAAsGqQA/rxAUBqoGqwasBq0GrgavBrAGsQayBrMGtAa1BrYGtwa4BrkGuga7BrwGvYEBq4EBrIEBrYEBroEBr4EBsIEBsYEBsoEBs4EBtIEBtYEBtoEBt4EBuIEBuYEBuoEBu4EBvIEBvYEBvoAn0gBeAAsGwABgEQLkgBPSAF4ACwbDAGARAuWAE9IAXgALBsYAYBEC5oAT0gBeAAsGyQBgEQLngBPSAF4ACwbMAGARAuiAE9IAXgALBs8AYBEC6YAT0gBeAAsG0gBgEQLqgBPSAF4ACwbVAGARAuuAE9IAXgALBtgAYBEC7IAT0gBeAAsG2wBgEQLtgBPSAF4ACwbeAGARAu6AE9IAXgALBuEAYBEC74AT0gBeAAsG5ABgEQLwgBPSAF4ACwbnAGARAvGAE9IAXgALBuoAYBEC8oAT0gBeAAsG7QBgEQLzgBPSAF4ACwbwAGARAvSAE9IAXgALBvMAYBEC9YAT0gBeAAsG9gBgEQL2gBPSAF4ACwb5AGARAveAE9MAQQBCAAsG/Ab9AEWBAcAQYIAo0gARAAsHAAA/rxAUBwEHAgcDBwQHBQcGBwcHCAcJBwoHCwcMBw0HDgcPBxAHEQcSBxMHFIEBwYEBwoEBw4EBxIEBxYEBxoEBx4EByIEByYEByoEBy4EBzIEBzYEBzoEBz4EB0IEB0YEB0oEB04EB1IAn0gBeAAsHFwBgEQL4gBPSAF4ACwcaAGARAvmAE9IAXgALBx0AYBEC+oAT0gBeAAsHIABgEQL7gBPSAF4ACwcjAGARAvyAE9IAXgALByYAYBEC/YAT0gBeAAsHKQBgEQL+gBPSAF4ACwcsAGARAv+AE9IAXgALBy8AYBEDAIAT0gBeAAsHMgBgEQMBgBPSAF4ACwc1AGARAwKAE9IAXgALBzgAYBEDA4AT0gBeAAsHOwBgEQMEgBPSAF4ACwc+AGARAwWAE9IAXgALB0EAYBEDBoAT0gBeAAsHRABgEQMHgBPSAF4ACwdHAGARAwiAE9IAXgALB0oAYBEDCYAT0gBeAAsHTQBgEQMKgBPSAF4ACwdQAGARAwuAE9MAQQBCAAsHUwdUAEWBAdYQYYAo0gARAAsHVwA/rxAUB1gHWQdaB1sHXAddB14HXwdgB2EHYgdjB2QHZQdmB2cHaAdpB2oHa4EB14EB2IEB2YEB2oEB24EB3IEB3YEB3oEB34EB4IEB4YEB4oEB44EB5IEB5YEB5oEB54EB6IEB6YEB6oAn0gBeAAsHbgBgEQMMgBPSAF4ACwdxAGARAw2AE9IAXgALB3QAYBEDDoAT0gBeAAsHdwBgEQMPgBPSAF4ACwd6AGARAxCAE9IAXgALB30AYBEDEYAT0gBeAAsHgABgEQMSgBPSAF4ACweDAGARAxOAE9IAXgALB4YAYBEDFIAT0gBeAAsHiQBgEQMVgBPSAF4ACweMAGARAxaAE9IAXgALB48AYBEDF4AT0gBeAAsHkgBgEQMYgBPSAF4ACweVAGARAxmAE9IAXgALB5gAYBEDGoAT0gBeAAsHmwBgEQMbgBPSAF4ACweeAGARAxyAE9IAXgALB6EAYBEDHYAT0gBeAAsHpABgEQMegBPSAF4ACwenAGARAx+AE9MAQQBCAAsHqgerAEWBAewQYoAo0gARAAsHrgA/rxAUB68HsAexB7IHswe0B7UHtge3B7gHuQe6B7sHvAe9B74HvwfAB8EHwoEB7YEB7oEB74EB8IEB8YEB8oEB84EB9IEB9YEB9oEB94EB+IEB+YEB+oEB+4EB/IEB/YEB/oEB/4ECAIAn0gBeAAsHxQBgEQMggBPSAF4ACwfIAGARAyGAE9IAXgALB8sAYBEDIoAT0gBeAAsHzgBgEQMjgBPSAF4ACwfRAGARAySAE9IAXgALB9QAYBEDJYAT0gBeAAsH1wBgEQMmgBPSAF4ACwfaAGARAyeAE9IAXgALB90AYBEDKIAT0gBeAAsH4ABgEQMpgBPSAF4ACwfjAGARAyqAE9IAXgALB+YAYBEDK4AT0gBeAAsH6QBgEQMsgBPSAF4ACwfsAGARAy2AE9IAXgALB+8AYBEDLoAT0gBeAAsH8gBgEQMvgBPSAF4ACwf1AGARAzCAE9IAXgALB/gAYBEDMYAT0gBeAAsH+wBgEQMygBPSAF4ACwf+AGARAzOAE9MAQQBCAAsIAQgCAEWBAgIQY4Ao0gARAAsIBQA/rxAUCAYIBwgICAkICggLCAwIDQgOCA8IEAgRCBIIEwgUCBUIFggXCBgIGYECA4ECBIECBYECBoECB4ECCIECCYECCoECC4ECDIECDYECDoECD4ECEIECEYECEoECE4ECFIECFYECFoAn0gBeAAsIHABgEQM0gBPSAF4ACwgfAGARAzWAE9IAXgALCCIAYBEDNoAT0gBeAAsIJQBgEQM3gBPSAF4ACwgoAGARAziAE9IAXgALCCsAYBEDOYAT0gBeAAsILgBgEQM6gBPSAF4ACwgxAGARAzuAE9IAXgALCDQAYBEDPIAT0gBeAAsINwBgEQM9gBPSAF4ACwg6AGARAz6AE9IAXgALCD0AYBEDP4AT0gBeAAsIQABgEQNAgBPSAF4ACwhDAGARA0GAE9IAXgALCEYAYBEDQoAT0gBeAAsISQBgEQNDgBPSAF4ACwhMAGARA0SAE9IAXgALCE8AYBEDRYAT0gBeAAsIUgBgEQNGgBPSAF4ACwhVAGARA0eAE9MAQQBCAAsIWAhZAEWBAhgQZIAo0gARAAsIXAA/rxAUCF0IXghfCGAIYQhiCGMIZAhlCGYIZwhoCGkIaghrCGwIbQhuCG8IcIECGYECGoECG4ECHIECHYECHoECH4ECIIECIYECIoECI4ECJIECJYECJoECJ4ECKIECKYECKoECK4ECLIAn0gBeAAsIcwBgEQNIgBPSAF4ACwh2AGARA0mAE9IAXgALCHkAYBEDSoAT0gBeAAsIfABgEQNLgBPSAF4ACwh/AGARA0yAE9IAXgALCIIAYBEDTYAT0gBeAAsIhQBgEQNOgBPSAF4ACwiIAGARA0+AE9IAXgALCIsAYBEDUIAT0gBeAAsIjgBgEQNRgBPSAF4ACwiRAGARA1KAE9IAXgALCJQAYBEDU4AT0gBeAAsIlwBgEQNUgBPSAF4ACwiaAGARA1WAE9IAXgALCJ0AYBEDVoAT0gBeAAsIoABgEQNXgBPSAF4ACwijAGARA1iAE9IAXgALCKYAYBEDWYAT0gBeAAsIqQBgEQNagBPSAF4ACwisAGARA1uAE9MAQQBCAAsIrwiwAEWBAi4QZYAo0gARAAsIswA/rxAUCLQItQi2CLcIuAi5CLoIuwi8CL0Ivgi/CMAIwQjCCMMIxAjFCMYIx4ECL4ECMIECMYECMoECM4ECNIECNYECNoECN4ECOIECOYECOoECO4ECPIECPYECPoECP4ECQIECQYECQoAn0gBeAAsIygBgEQNcgBPSAF4ACwjNAGARA12AE9IAXgALCNAAYBEDXoAT0gBeAAsI0wBgEQNfgBPSAF4ACwjWAGARA2CAE9IAXgALCNkAYBEDYYAT0gBeAAsI3ABgEQNigBPSAF4ACwjfAGARA2OAE9IAXgALCOIAYBEDZIAT0gBeAAsI5QBgEQNlgBPSAF4ACwjoAGARA2aAE9IAXgALCOsAYBEDZ4AT0gBeAAsI7gBgEQNogBPSAF4ACwjxAGARA2mAE9IAXgALCPQAYBEDaoAT0gBeAAsI9wBgEQNrgBPSAF4ACwj6AGARA2yAE9IAXgALCP0AYBEDbYAT0gBeAAsJAABgEQNugBPSAF4ACwkDAGARA2+AE9MAQQBCAAsJBgkHAEWBAkQQZoAo0gARAAsJCgA/rxAUCQsJDAkNCQ4JDwkQCREJEgkTCRQJFQkWCRcJGAkZCRoJGwkcCR0JHoECRYECRoECR4ECSIECSYECSoECS4ECTIECTYECToECT4ECUIECUYECUoECU4ECVIECVYECVoECV4ECWIAn0gBeAAsJIQBgEQNwgBPSAF4ACwkkAGARA3GAE9IAXgALCScAYBEDcoAT0gBeAAsJKgBgEQNzgBPSAF4ACwktAGARA3SAE9IAXgALCTAAYBEDdYAT0gBeAAsJMwBgEQN2gBPSAF4ACwk2AGARA3eAE9IAXgALCTkAYBEDeIAT0gBeAAsJPABgEQN5gBPSAF4ACwk/AGARA3qAE9IAXgALCUIAYBEDe4AT0gBeAAsJRQBgEQN8gBPSAF4ACwlIAGARA32AE9IAXgALCUsAYBEDfoAT0gBeAAsJTgBgEQN/gBPSAF4ACwlRAGARA4CAE9IAXgALCVQAYBEDgYAT0gBeAAsJVwBgEQOCgBPSAF4ACwlaAGARA4OAE9MAQQBCAAsJXQleAEWBAloQZ4Ao0gARAAsJYQA/rxAUCWIJYwlkCWUJZglnCWgJaQlqCWsJbAltCW4JbwlwCXEJcglzCXQJdYECW4ECXIECXYECXoECX4ECYIECYYECYoECY4ECZIECZYECZoECZ4ECaIECaYECaoECa4ECbIECbYECboAn0gBeAAsJeABgEQOEgBPSAF4ACwl7AGARA4WAE9IAXgALCX4AYBEDhoAT0gBeAAsJgQBgEQOHgBPSAF4ACwmEAGARA4iAE9IAXgALCYcAYBEDiYAT0gBeAAsJigBgEQOKgBPSAF4ACwmNAGARA4uAE9IAXgALCZAAYBEDjIAT0gBeAAsJkwBgEQONgBPSAF4ACwmWAGARA46AE9IAXgALCZkAYBEDj4AT0gBeAAsJnABgEQOQgBPSAF4ACwmfAGARA5GAE9IAXgALCaIAYBEDkoAT0gBeAAsJpQBgEQOTgBPSAF4ACwmoAGARA5SAE9IAXgALCasAYBEDlYAT0gBeAAsJrgBgEQOWgBPSAF4ACwmxAGARA5eAE9MAQQBCAAsJtAm1AEWBAnAQaIAo0gARAAsJuAA/rxAUCbkJugm7CbwJvQm+Cb8JwAnBCcIJwwnECcUJxgnHCcgJyQnKCcsJzIECcYECcoECc4ECdIECdYECdoECd4ECeIECeYECeoECe4ECfIECfYECfoECf4ECgIECgYECgoECg4EChIAn0gBeAAsJzwBgEQOYgBPSAF4ACwnSAGARA5mAE9IAXgALCdUAYBEDmoAT0gBeAAsJ2ABgEQObgBPSAF4ACwnbAGARA5yAE9IAXgALCd4AYBEDnYAT0gBeAAsJ4QBgEQOegBPSAF4ACwnkAGARA5+AE9IAXgALCecAYBEDoIAT0gBeAAsJ6gBgEQOhgBPSAF4ACwntAGARA6KAE9IAXgALCfAAYBEDo4AT0gBeAAsJ8wBgEQOkgBPSAF4ACwn2AGARA6WAE9IAXgALCfkAYBEDpoAT0gBeAAsJ/ABgEQOngBPSAF4ACwn/AGARA6iAE9IAXgALCgIAYBEDqYAT0gBeAAsKBQBgEQOqgBPSAF4ACwoIAGARA6uAE9IAEQALCgsAP68QFQoMCg0AOwoPChAKEQoSChMKFAoVChYKFwoYADwKGgobAD0APgoeCh8KIIEChoECiYAQgQKOgQKQgQKSgQKWgQKogQK9gQLBgQLEgQLJgQLLgCmBAs+BAtSAP4BVgQLmgQLsgQLwgCfTAEEAQgALCiMDlwBFgQKHgCjSABEACwomAD+vEBQKJwObAlADnQOeA58DoAOhA6IDowOkA6UDpgOnA6kCUQOrA6wDrQOugQKIgOWAkoDngOiA6YDqgOuA7IDtgO6A74DwgPGA84CTgPWA9oD3gPiAJ9IAXgALCj0AYBEEYoAT0wBBAEIACwpAA+4ARYECioAo0gARAAsKQwA/rxAXA/ID8wpGA/QD9QP2A/cD+AP5A/oD+wJbA/0D/gP/BAAEAQQCBAMEBApYClkEBYD7gPyBAouA/YD+gP+BAQCBAQGBAQKBAQOBAQSAlYEBBoEBB4EBCIEBCYEBCoEBC4EBDIEBDYECjIECjYEBDoAn0gBeAAsKXQBgEQRjgBPSAF4ACwpgAGARBGSAE9IAXgALCmMAYBEEZYAT0wBBAEIACwpmBEUARYECj4Ao0gARAAsKaQA/rxASBEkESgRLBE0ETgJiBFAEUQRSBFMEVARVBFcEWARZBFoEWwRcgQERgQESgQETgQEVgQEWgJeBARiBARmBARqBARuBARyBAR2BAR+BASCBASGBASKBASOBASSAJ9MAQQBCAAsKfgScAEWBApGAKNIAEQALCoEAP68QEgSgAmkEowSkBKUEpgSnBKgEqQSqBKsErAStBK8EsASxAmoEs4EBJ4CZgQEqgQErgQEsgQEtgQEugQEvgQEwgQExgQEygQEzgQE0gQE2gQE3gQE4gJqBATqAJ9MAQQBCAAsKlgTzAEWBApOAKNIAEQALCpkAP68QFQT3BPgE+QT6AnQE/AJ1BP4E/wUAAnYFAgUDBQQFBgUHCqoFCAUJCq0FCoEBPYEBPoEBP4EBQICcgQFCgJ2BAUSBAUWBAUaAnoEBSIEBSYEBSoEBTIEBTYEClIEBToEBT4EClYEBUIAn0gBeAAsKsQBgEQRmgBPSAF4ACwq0AGARBGeAE9MAQQBCAAsKtwq4AEWBApcQpYAo0gARAAsKuwA/rxAQCrwKvQq+Cr8KwArBCsIKwwrECsUKxgrHCsgKyQrKCsuBApiBApmBApqBApuBApyBAp2BAp6BAp+BAqCBAqGBAqKBAqOBAqSBAqWBAqaBAqeAJ9IAXgALCs4AYBED1oAT0gBeAAsK0QBgEQPXgBPSAF4ACwrUAGARA9iAE9IAXgALCtcAYBED2oAT0gBeAAsK2gBgEQPbgBPSAF4ACwrdAGARA9yAE9IAXgALCuAAYBED3oAT0gBeAAsK4wBgEQPfgBPSAF4ACwrmAGARA+CAE9IAXgALCukAYBED4YAT0gBeAAsK7ABgEQPigBPSAF4ACwrvAGARA+SAE9IAXgALCvIAYBED5YAT0gBeAAsK9QBgEQPmgBPSAF4ACwr4AGARA+eAE9IAXgALCvsAYBED6IAT0wBBAEIACwr+Cv8ARYECqRCmgCjSABEACwsCAD+vEBMLAwsECwULBgsHCwgLCQsKCwsLDAsNCw4LDwsQCxELEgsTCxQLFYECqoECq4ECrIECrYECroECr4ECsIECsYECsoECs4ECtIECtYECtoECt4ECuIECuYECuoECu4ECvIAn0gBeAAsLGABgEQPqgBPSAF4ACwsbAGARA+uAE9IAXgALCx4AYBED7IAT0gBeAAsLIQBgEQPtgBPSAF4ACwskAGARA+6AE9IAXgALCycAYBED74AT0gBeAAsLKgBgEQPwgBPSAF4ACwstAGARA/GAE9IAXgALCzAAYBED8oAT0gBeAAsLMwBgEQPzgBPSAF4ACws2AGARA/SAE9IAXgALCzkAYBED9YAT0gBeAAsLPABgEQP2gBPSAF4ACws/AGARA/eAE9IAXgALC0IAYBED+IAT0gBeAAsLRQBgEQP5gBPSAF4ACwtIAGARA/uAE9IAXgALC0sAYBED/IAT0gBeAAsLTgBgEQP9gBPTAEEAQgALC1EF+ABFgQK+gCjSABEACwtUAD+vEBYF/AX9Bf4LWAX/BgAGAQYCApUGBAYFBgYLYQYHBggGCQYKBgsGDAYNBg4GD4EBf4EBgIEBgYECv4EBgoEBg4EBhIEBhYClgQGHgQGIgQGJgQLAgQGKgQGLgQGMgQGNgQGOgQGPgQGQgQGRgQGSgCfSAF4ACwttAGARBGiAE9IAXgALC3AAYBEEaYAT0wBBAEIACwtzBqYARYECwoAo0gARAAsLdgA/rxAUBqoGqwKjBq4GrwawBrELfgayBrMGtAa1BrYCpAa4BrkGuga7BrwGvYEBq4EBrICpgQGvgQGwgQGxgQGygQLDgQGzgQG0gQG1gQG2gQG3gKqBAbmBAbqBAbuBAbyBAb2BAb6AJ9IAXgALC40AYBEEaoAT0wBBAEIACwuQBv0ARYECxYAo0gARAAsLkwA/rxAXBwEHAgcDBwQHBQcGBwcHCAcJBwoHCwKuC6ALoQcNBw4HDwcQBxECrwuoBxMHFIEBwYEBwoEBw4EBxIEBxYEBxoEBx4EByIEByYEByoEBy4CsgQLGgQLHgQHNgQHOgQHPgQHQgQHRgK2BAsiBAdOBAdSAJ9IAXgALC60AYBEEa4AT0gBeAAsLsABgEQRsgBPSAF4ACwuzAGARBG2AE9MAQQBCAAsLtgerAEWBAsqAKNIAEQALC7kAP68QEQevB7AHsgezB7QHtQe2B7cHuALIB7sHvAe9B78HwALJB8KBAe2BAe6BAfCBAfGBAfKBAfOBAfSBAfWBAfaAs4EB+YEB+oEB+4EB/YEB/oC0gQIAgCfTAEEAQgALC80IAgBFgQLMgCjSABEACwvQAD+vEBQIBggHCAgICQgLAtMIDggPAtQIEQLVCBML3QgUC98IFQgWCBcIGALWgQIDgQIEgQIFgQIGgQIIgLaBAguBAgyAt4ECDoC4gQIQgQLNgQIRgQLOgQISgQITgQIUgQIVgLmAJ9IAXgALC+cAYBEEboAT0gBeAAsL6gBgEQRvgBPTAEEAQgALC+0IWQBFgQLQgCjSABEACwvwAD+vEBYIXQLmC/MIXwLnCGEIYghjCGQIZQhmAugC6QhpCGoMAAhrDAIIbALqAusC7IECGYC7gQLRgQIbgLyBAh2BAh6BAh+BAiCBAiGBAiKAvYC+gQIlgQImgQLSgQIngQLTgQIogL+AwIDBgCfSAF4ACwwJAGARBHCAE9IAXgALDAwAYBEEcYAT0gBeAAsMDwBgEQRygBPTAEEAQgALDBIMEwBFgQLVEKeAKNIAEQALDBYAP68QEAwXDBgMGQwaDBsMHAwdDB4MHwwgDCEMIgwjDCQMJQwmgQLWgQLXgQLYgQLZgQLagQLbgQLcgQLdgQLegQLfgQLggQLhgQLigQLjgQLkgQLlgCfSAF4ACwwpAGARA/+AE9IAXgALDCwAYBEEAYAT0gBeAAsMLwBgEQQCgBPSAF4ACwwyAGARBAOAE9IAXgALDDUAYBEEBIAT0gBeAAsMOABgEQQFgBPSAF4ACww7AGARBAiAE9IAXgALDD4AYBEECYAT0gBeAAsMQQBgEQQKgBPSAF4ACwxEAGARBAuAE9IAXgALDEcAYBEEDIAT0gBeAAsMSgBgEQQNgBPSAF4ACwxNAGARBA6AE9IAXgALDFAAYBEED4AT0gBeAAsMUwBgEQQQgBPSAF4ACwxWAGARBBGAE9MAQQBCAAsMWQkHAEWBAueAKNIAEQALDFwAP68QFAxdCQsMXwkMCQ0JDgMMDGQJEgxmCRMJFAkVCRYJFwMNCRkJGgMOCR6BAuiBAkWBAumBAkaBAkeBAkiAxYEC6oECTIEC64ECTYECToECT4ECUIECUYDGgQJTgQJUgMeBAliAJ9IAXgALDHMAYBEEc4AT0gBeAAsMdgBgEQR0gBPSAF4ACwx5AGARBHWAE9IAXgALDHwAYBEEdoAT0wBBAEIACwx/CV4ARYEC7YAo0gARAAsMggA/rxASCWIJYwMbCWUJZglnCWgMiglqCWsMjQlsCW4JbwlxCXIJcwMcgQJbgQJcgMmBAl6BAl+BAmCBAmGBAu6BAmOBAmSBAu+BAmWBAmeBAmiBAmqBAmuBAmyAyoAn0gBeAAsMlwBgEQR3gBPSAF4ACwyaAGARBHiAE9MAQQBCAAsMnQm1AEWBAvGAKNIAEQALDKAAP68QFAm5CboJuwm8Cb0Mpgm+Cb8JwAnBCcIJwwnECcUJxgnHCcgJyQnLCcyBAnGBAnKBAnOBAnSBAnWBAvKBAnaBAneBAniBAnmBAnqBAnuBAnyBAn2BAn6BAn+BAoCBAoGBAoOBAoSAJ9IAXgALDLcAYBEEeYAT0wGwAAsBsQIQAbMMu4BugQL00gG2AAsMvQG4RgIBDQEQAoBt0gARAAsMwAA/rxAUDMEMwgzDDMQMxQzGDMcMyAzJDMoMywzMDM0MzgzPDNAM0QzSDNMM1IEC9oEC94EC+IEC+YEC+4EC/YEC/oEC/4EDAIEDAYEDAoEDA4EDBIEDBYEDB4EDCYEDCoEDC4EDDYEDD4An0gGwAAsB3gGzgG7UAdwACwGwAd0M2QGzAA0ADRANgG7SAbAACwHeAbOAbtMBsAALAbEBsgGzDN+AboEC+tIBtgALDOEBuEQDAQ0BgG3TAbAACwGxAbIBswzlgG6BAvzSAbYACwznAbhEAgEOAYBt1AHcAAsBsAHdDOoBswANAA0QDoBu0gGwAAsB3gGzgG7SAbAACwHeAbOAbtIBsAALAd4Bs4Bu0gGwAAsB3gGzgG7UAdwACwGwAd0CEAGzAA0ADYBu0gGwAAsB3gGzgG7SAbAACwHeAbOAbtMBsAALAbECEAGzDPyAboEDBtIBtgALDP4BuEYCAQoBDwGAbdMBsAALAbEBsgGzDQKAboEDCNIBtgALDQQBuEQEAQYBgG3UAdwACwGwAd0NBwGzAA0ADRATgG7SAbAACwHeAbOAbtMBsAALAbECEAGzDQ2AboEDDNIBtgALDQ8BuEYEAQYBEQKAbdMBsAALAbECHQGzDROAboEDDtIBtgALDRUBuEgHAQsBDgESAYBt1AHcAAsBsAHdDRgBswANAA0QEYBu0gARAAsNGwA/rxAUDRwNHQ0eDR8NIA0hDSINIw0kDSUNJg0nDSgNKQ0qDSsNLA0tDS4NL4EDEYEDEoEDFIEDFYEDFoEDGIEDGoEDG4EDHIEDHYEDHoEDIIEDIoEDI4EDJYEDJ4EDKYEDKoEDLIEDLoAn0gGwAAsB3gGzgG7TAbAACwGxAbIBsw01gG6BAxPSAbYACw03AbhEAQEPAYBt1AHcAAsBsAHdDToBswANAA0QCoBu1AHcAAsBsAHdDT0BswANAA0QBoBu0wGwAAsBsQGyAbMNQYBugQMX0gG2AAsNQwG4RAEBEgGAbdMBsAALAbECEAGzDUeAboEDGdIBtgALDUkBuEYEAQYBCgGAbdIBsAALAd4Bs4Bu0gGwAAsB3gGzgG7UAdwACwGwAd0B/QGzAA0ADYBu0gGwAAsB3gGzgG7TAbAACwGxAbIBsw1VgG6BAx/SAbYACw1XAbhEAgENAYBt0wGwAAsBsQGyAbMNW4BugQMh0gG2AAsNXQG4RAsBEQGAbdIBsAALAd4Bs4Bu0wGwAAsBsQGyAbMNY4BugQMk0gG2AAsNZQG4RAsBEgGAbdMBsAALAbECHQGzDWmAboEDJtIBtgALDWsBuEgHAQoBDAETAYBt0wGwAAsBsQIdAbMNb4BugQMo0gG2AAsNcQG4SAEBAwEKAhADgG3SAbAACwHeAbOAbtMBsAALAbECEAGzDXeAboEDK9IBtgALDXkBuEYFAQ0BEAGAbdMBsAALAbEBsgGzDX2AboEDLdIBtgALDX8BuEQCARMBgG3SAbAACwHeAbOAbtIAEQALDYQAP68QFQ2FDYYNhw2IDYkNig2HDYcNjQ2ODY8NkA2RDYcNkw2HDYcNhw2XDZgNmYEDMIEDMYEDMoEDNIEDNYEDNoEDMoEDMoEDN4EDOIEDOYEDOoEDO4EDMoEDPIEDMoEDMoEDMoEDPYEDPoEDP4An0gARAAsNnAA/oQongQKIgCfSABEACw2gAD+jCkYKWApZgQKLgQKMgQKNgCfSABEACw2mDaeggQMz0gBiAGMApQ2pogClAGfSABEACw2rAD+ggCfSABEACw2uAD+ggCfSABEACw2xAD+iCqoKrYEClIEClYAn0gARAAsNtgA/ogtYC2GBAr+BAsCAJ9IAEQALDbsAP6ELfoECw4An0gARAAsNvwA/owugC6ELqIECxoECx4ECyIAn0gARAAsNxQA/oIAn0gARAAsNyAA/ogvdC9+BAs2BAs6AJ9IAEQALDc0AP6ML8wwADAKBAtGBAtKBAtOAJ9IAEQALDdMAP6QMXQxfDGQMZoEC6IEC6YEC6oEC64An0gARAAsN2gA/ogyKDI2BAu6BAu+AJ9IAEQALDd8AP6EMpoEC8oAn0wGwAAsBsQIQAbMN5IBugQNB0gG2AAsN5gG4RgABCQEMAYBt0gARAAsN6QA/owoSChMKG4ECloECqIEC1IAn0gBiAGMN7w3wXE5TRGljdGlvbmFyeaIN8QBnXE5TRGljdGlvbmFyedIAYgBjDfMN9F5BU1RocmFzaFVwZGF0ZaIN9QBnXkFTVGhyYXNoVXBkYXRlXxAPTlNLZXllZEFyY2hpdmVy0Q34DflUcm9vdIABAAgAGQAiACsANQA6AD8GzQbTBuAG5gbvBvYG+Ab6Bv0HCgcSBx0HNgc4BzoHPAc+B0AHQgdEB0YHSAdKB0wHTgdnB2kHawdtB28HcQd0B3cHegd9B4AHgweGB4kHnAe1B8sH2gfiB+cIAAgVCCsIOQhRCGUIbgh3CHkIewh9CH8IgQiOCJQIngigCKIIpAitCNgI2gjcCN4I4AjiCOQI5gjoCOoI7AjuCPAI8gj0CPYI+Aj6CPwI/gkACQIJCwkSCRUJFwkgCSsJNAlHCUwJXwloCXEJdAl2CX8JggmECY0JkAmSCZsJngmgCakJrAmuCbcJugm8CcUJyAnKCdMJ1gnYCeEJ5AnmCe8J8gn0Cf0KAAoCCgsKDgoQChkKHAoeCicKKgosCjUKOAo6CkMKRgpIClEKVApWCl8KYgpkCm0KcApyCnsKigqRCqAKqAqxCscKzAriCu8K8QrzCvUK/gspCysLLQsvCzELMws1CzcLOQs7Cz0LPwtBC0MLRQtHC0kLSwtNC08LUQtTC1wLXwthC2oLbQtvC3gLewt9C4YLiQuLC5QLlwuZC6ILpQunC7ALswu1C74LwQvDC8wLzwvRC9oL3QvfC+gL6wvtC/YL+Qv7DAQMBwwJDBIMFQwXDCAMIwwlDC4MMQwzDDwMPwxBDEoMTQxPDFgMWwxdDGYMaQxrDHgMegx8DH4MhwyyDLQMtgy4DLoMvAy+DMAMwgzEDMYMyAzKDMwMzgzQDNIM1AzWDNgM2gzcDOUM6AzqDPMM9gz4DQENBA0GDQ8NEg0UDR0NIA0iDSsNLg0wDTkNPA0+DUcNSg1MDVUNWA1aDWMNZg1oDXENdA12DX8Ngg2EDY0NkA2SDZsNng2gDakNrA2uDbcNug28DcUNyA3KDdMN1g3YDeEN5A3mDe8N8g30DgEOAw4FDgcOEA47Dj0OPw5BDkMORQ5HDkkOSw5NDk8OUQ5TDlUOVw5ZDlsOXQ5fDmEOYw5lDm4OcQ5zDnwOfw6BDooOjQ6PDpgOmw6dDqYOqQ6rDrQOtw65DsIOxQ7HDtAO0w7VDt4O4Q7jDuwO7w7xDvoO/Q7/DwgPCw8NDxYPGQ8bDyQPJw8pDzIPNQ83D0APQw9FD04PUQ9TD1wPXw9hD2oPbQ9vD3gPew99D4oPlw+jD6UPpw+pD7IPug+/D8EPyg/YD98P7Q/0D/0QERAYECwQNxBAEG0QbxBxEHMQdRB3EHkQexB9EH8QgRCDEIUQhxCJEIsQjRCPEJEQkxCVEJcQmRCqELUQvhDAEMIQzxDRENMQ3BDhEOMQ7BDuEPcQ+RECEQQRERETERURHhEjESURLhEwETkROxFIEUoRTBFVEVoRXBFtEW8RcRF+EYARghGLEZARkhGbEZ0RqhGsEa4RtxG8Eb4RxxHJEdYR2BHaEdwR5RHsEe4R9xH5EgISBBINEg8SHBIeEiASIhIrEjQSNhJDEkUSRxJQElUSVxJoEmoSbBJ1EqASohKkEqYSqBKqEqwSrhKwErIStBK2ErgSuhK8Er4SwBLCEsQSxhLIEsoS0xLYEtoS3BLeEucS6hLsEvUS+BL6EwMTCBMKEwwTDhMXExoTHBMlEygTKhMzEzYTOBM6E0MTRhNIE1ETVBNWE1gTYRNkE2YTbxN0E3YTeBN6E4MThhOIE5ETlBOWE58TphOoE6oTrBOuE7cTuhO8E8UTyBPKE9MT1hPYE+ET5BPmE+gT8RP0E/YT/xQEFAYUCBQKFBMUFhQYFCEUJBQmFC8UMhQ0FDYUPxRCFEQUTRRQFFIUVBRdFGAUYhRrFHAUchR0FHYUfxSCFIQUjRSQFJIUmxSgFKIUpBSmFK8UshS0FL0UwBTCFMsU0hTUFNYU2BTaFOMU5hToFPEU9BT2FP8VAhUEFQ0VEhUUFRYVGBUhFSQVJhUvFTIVNBU9FUYVSBVKFUwVThVQFVkVXBVeFWcVahVsFXUVeBV6FYMVhhWIFZEVoBWiFaQVphWoFaoVrBWuFbAVuRW8Fb4VxxXKFcwV1RXYFdoV4xXmFegV8RX0FfYV/xYCFgQWDRYQFhIWGxYeFiAWIhYrFi4WMBY5FkAWQhZEFkYWSBZRFlQWVhZfFmIWZBZtFnAWchZ7FoAWghaEFoYWjxaSFpQWnRagFqIWqxasFq4WtxbiFuQW5hboFusW7hbxFvQW9xb6Fv0XABcDFwYXCRcMFw8XEhcVFxgXGxcdFyoXLBcuFzAXORdkF2YXaBdqF2wXbhdwF3IXdBd2F3gXehd8F34XgBeCF4QXhheIF4oXjBeOF5cXmhecF6UXqBeqF7MXthe4F8EXxBfGF88X0hfUF90X4BfiF+sX7hfwF/kX/Bf+GAcYChgMGBUYGBgaGCMYJhgoGDEYNBg2GD8YQhhEGE0YUBhSGFsYXhhgGGkYbBhuGHcYehh8GIUYiBiKGJMYlhiYGKEYpBimGLMYtRi3GLkYwhjtGO8Y8RjzGPUY9xj5GPsY/Rj/GQEZAxkFGQcZCRkLGQ0ZDxkRGRMZFRkXGSAZIxklGS4ZMRkzGTwZPxlBGUoZTRlPGVgZWxldGWYZaRlrGXQZdxl5GYIZhRmHGZAZkxmVGZ4ZoRmjGawZrxmxGboZvRm/GcgZyxnNGdYZ2RnbGeQZ5xnpGfIZ9Rn3GgAaAxoFGg4aERoTGhwaHxohGioaLRovGjwaPhpAGkIaSxp2Gngaehp8Gn4agBqDGoYaiRqMGo8akhqVGpgamxqeGqEapBqnGqoarRqvGrgauxq9GsYayRrLGtQa1xrZGuIa5RrnGvAa8xr1Gv4bARsDGwwbDxsRGxobHRsfGygbKxstGzYbORs7G0QbRxtJG1IbVRtXG2AbYxtlG24bcRtzG3wbfxuBG4objRuPG5gbmxudG6YbqRurG7Qbtxu5G8IbxRvHG9Qb1xvZG9sb5BwPHBIcFRwYHBscHhwhHCQcJxwqHC0cMBwzHDYcORw8HD8cQhxFHEgcSxxNHFYcWRxbHGQcZxxpHHIcdRx3HIAcgxyFHI4ckRyTHJwcnxyhHKocrRyvHLgcuxy9HMYcyRzLHNQc1xzZHOIc5RznHPAc8xz1HP4dAR0DHQwdDx0RHRodHR0fHSgdKx0tHTYdOR07HUQdRx1JHVIdVR1XHWAdYx1lHXIddR13HXkdgh2tHbAdsx22HbkdvB2/HcIdxR3IHcsdzh3RHdQd1x3aHd0d4B3jHeYd6R3rHfQd9x35HgIeBR4HHhAeEx4VHh4eIR4jHiweLx4xHjoePR4/HkgeSx5NHlYeWR5bHmQeZx5pHnIedR53HoAegx6FHo4ekR6THpwenx6hHqoerR6vHrgeux69HsYeyR7LHtQe1x7ZHuIe5R7nHvAe8x71Hv4fAR8DHxAfEx8VHxcfIB9LH04fUR9UH1cfWh9dH2AfYx9mH2kfbB9vH3IfdR94H3sffh+BH4Qfhx+JH5IflR+XH6Afox+lH64fsR+zH7wfvx/BH8ofzR/PH9gf2x/dH+Yf6R/rH/Qf9x/5IAIgBSAHIBAgEyAVIB4gISAjICwgLyAxIDogPSA/IEggSyBNIFYgWSBbIGQgZyBpIHIgdSB3IIAggyCFII4gkSCTIJwgnyChIK4gsSCzILUgviDpIOwg7yDyIPUg+CD7IP4hASEEIQchCiENIRAhEyEWIRkhHCEfISIhJSEnITAhMyE1IT4hQSFDIUwhTyFRIVohXSFfIWghayFtIXYheSF7IYQhhyGJIZIhlSGXIaAhoyGlIa4hsSGzIbwhvyHBIcohzSHPIdgh2yHdIeYh6SHrIfQh9yH5IgIiBSIHIhAiEyIVIh4iISIjIiwiLyIxIjoiPSI/IkwiTyJRIlMiXCKHIooijSKQIpMiliKZIpwinyKiIqUiqCKrIq4isSK0IrciuiK9IsAiwyLFIs4i0SLTItwi3yLhIuoi7SLvIvgi+yL9IwYjCSMLIxQjFyMZIyIjJSMnIzAjMyM1Iz4jQSNDI0wjTyNRI1ojXSNfI2gjayNtI3YjeSN7I4QjhyOJI5IjlSOXI6AjoyOlI64jsSOzI7wjvyPBI8ojzSPPI9gj2yPdI+oj7SPvI/Ej+iQlJCgkKyQuJDEkNCQ3JDokPSRAJEMkRiRJJEwkTyRSJFUkWCRbJF4kYSRjJGwkbyRxJHokfSR/JIgkiySNJJYkmSSbJKQkpySpJLIktSS3JMAkwyTFJM4k0STTJNwk3yThJOok7STvJPgk+yT9JQYlCSULJRQlFyUZJSIlJSUnJTAlMyU1JT4lQSVDJUwlTyVRJVolXSVfJWglayVtJXYleSV7JYgliyWNJY8lmCXDJcYlySXMJc8l0iXVJdgl2yXeJeEl5CXnJeol7SXwJfMl9iX5Jfwl/yYBJgomDSYPJhgmGyYdJiYmKSYrJjQmNyY5JkImRSZHJlAmUyZVJl4mYSZjJmwmbyZxJnomfSZ/JogmiyaNJpYmmSabJqQmpyapJrImtSa3JsAmwybFJs4m0SbTJtwm3ybhJuom7SbvJvgm+yb9JwYnCScLJxQnFycZJyYnKScrJy0nNidhJ2QnZydqJ20ncCdzJ3YneSd8J38ngieFJ4gniyeOJ5EnlCeXJ5onnSefJ6gnqyetJ7YnuSe7J8QnxyfJJ9In1SfXJ+An4yflJ+4n8SfzJ/wn/ygBKAooDSgPKBgoGygdKCYoKSgrKDQoNyg5KEIoRShHKFAoUyhVKF4oYShjKGwobyhxKHoofSh/KIgoiyiNKJYomSibKKQopyipKLIotSi3KMQoxyjJKMso1Cj/KQIpBSkIKQspDikRKRQpFykaKR0pICkjKSYpKSksKS8pMik1KTgpOyk9KUYpSSlLKVQpVylZKWIpZSlnKXApcyl1KX4pgSmDKYwpjymRKZopnSmfKagpqymtKbYpuSm7KcQpxynJKdIp1SnXKeAp4ynlKe4p8SnzKfwp/yoBKgoqDSoPKhgqGyodKiYqKSorKjQqNyo5KkIqRSpHKlAqUypVKmIqZSpnKmkqciqdKqAqoyqmKqkqrCqvKrIqtSq4KrsqvirBKsQqxyrKKs0q0CrTKtYq2SrbKuQq5yrpKvIq9Sr3KwArAysFKw4rESsTKxwrHyshKyorLSsvKzgrOys9K0YrSStLK1QrVytZK2IrZStnK3Arcyt1K34rgSuDK4wrjyuRK5ornSufK6grqyutK7YruSu7K8QrxyvJK9Ir1SvXK+Ar4yvlK+4r8SvzLAAsAywFLAcsECw7LD4sQSxELEcsSixNLFAsUyxWLFksXCxfLGIsZSxoLGssbixxLHQsdyx5LIIshSyHLJAskyyVLJ4soSyjLKwsryyxLLosvSy/LMgsyyzNLNYs2SzbLOQs5yzpLPIs9Sz3LQAtAy0FLQ4tES0TLRwtHy0hLSotLS0vLTgtOy09LUYtSS1LLVQtVy1ZLWItZS1nLXAtcy11LX4tgS2DLYwtjy2RLZ4toS2jLaUtri3ZLdwt3y3iLeUt6C3rLe4t8S30Lfct+i39LgAuAy4GLgkuDC4PLhIuFS4XLiAuIy4lLi4uMS4zLjwuPy5BLkouTS5PLlguWy5dLmYuaS5rLnQudy55LoIuhS6HLpAuky6VLp4uoS6jLqwury6xLrouvS6/Lsguyy7NLtYu2S7bLuQu5y7pLvIu9S73LwAvAy8FLw4vES8TLxwvHy8hLyovLS8vLzwvPy9BL0MvTC93L3ovfS+AL4Mvhi+JL4wvjy+SL5UvmC+bL54voS+kL6cvqi+tL7Avsy+1L74vwS/DL8wvzy/RL9ov3S/fL+gv6y/tL/Yv+S/7MAQwBzAJMBIwFTAXMCAwIzAlMC4wMTAzMDwwPzBBMEowTTBPMFgwWzBdMGYwaTBrMHQwdzB5MIIwhTCHMJAwkzCVMJ4woTCjMKwwrzCxMLowvTC/MMgwyzDNMNow3TDfMOEw6jEVMRgxGzEeMSExJDEnMSoxLTEwMTMxNjE5MTwxPzFCMUUxSDFLMU4xUTFTMVwxXzFhMWoxbTFvMXgxezF9MYYxiTGLMZQxlzGZMaIxpTGnMbAxszG1Mb4xwTHDMcwxzzHRMdox3THfMegx6zHtMfYx+TH7MgQyBzIJMhIyFTIXMiAyIzIlMi4yMTIzMjwyPzJBMkoyTTJPMlgyWzJdMmYyaTJrMngyezJ9Mn8yiDKzMrYyuTK8Mr8ywjLFMsgyyzLOMtEy1DLXMtoy3TLgMuMy5jLpMuwy7zLxMvoy/TL/MwgzCzMNMxYzGTMbMyQzJzMpMzIzNTM3M0AzQzNFM04zUTNTM1wzXzNhM2ozbTNvM3gzezN9M4YziTOLM5QzlzOZM6IzpTOnM7AzszO1M74zwTPDM8wzzzPRM9oz3TPfM+gz6zPtM/Yz+TP7NAQ0BzQJNBY0GTQbNB00JjRRNFQ0VzRaNF00YDRjNGY0aTRsNG80cjR1NHg0ezR+NIE0hDSHNIo0jTSPNJg0mzSdNKY0qTSrNLQ0tzS5NMI0xTTHNNA00zTVNN404TTjNOw07zTxNPo0/TT/NQg1CzUNNRY1GTUbNSQ1JzUpNTI1NTU3NUA1QzVFNU41UTVTNVw1XzVhNWo1bTVvNXg1ezV9NYY1iTWLNZQ1lzWZNaI1pTWnNbQ1tzW5Nbs1xDXvNfI19TX4Nfs1/jYBNgQ2BzYKNg02EDYTNhY2GTYcNh82IjYlNig2KzYtNjY2OTY7NkQ2RzZJNlI2VTZXNmA2YzZlNm42cTZzNnw2fzaBNoo2jTaPNpg2mzadNqY2qTarNrQ2tza5NsI2xTbHNtA20zbVNt424TbjNuw27zbxNvo2/Tb/Nwg3CzcNNxY3GTcbNyQ3JzcpNzI3NTc3N0A3QzdFN043ezd+N4E3gzeGN4k3jDePN5I3lTeYN5s3njehN6M3pjepN6s3rTewN7M3tje4N8U3yDfKN9M3/jgBOAM4BTgHOAk4CzgNOA84ETgTOBU4FzgZOBs4HTgfOCE4IzglOCc4KTgyODU4NzhEOEc4SThSOIM4hTiHOIo4jDiOOJA4kziWOJk4nDifOKE4pDinOKo4rTiwOLM4tji5OLw4vzjCOMQ4zTjQONI42zjeOOA46TjsOO44+zj+OQA5CTkwOTM5Njk5OTw5PzlBOUQ5RzlKOU05UDlTOVY5WTlcOV85YjllOWc5dDl3OXk5gjmpOaw5rjmxObQ5tzm6Ob05wDnDOcY5yTnMOc850jnVOdg52jndOd857DnvOfE5+jonOio6LTowOjM6NTo4Ojo6PTpAOkM6RTpIOks6TjpROlQ6VzpaOl06YDpjOmU6bjpxOnM6fDp/OoE6jjqROpM6lTqeOsE6xDrHOso6zTrQOtM61jrZOtw63zriOuU66DrrOu468TrzOvw6/zsBOwo7DTsPOxg7GzsdOyY7KTsrOzQ7Nzs5O0I7RTtHO1A7UztVO147YTtjO2w7bztxO3o7fTt/O4g7izuNO5Y7mTubO6Q7pzupO7I7tTu3O8A7wzvFO8470TvTO+A74zvlO+c78DwZPBw8HzwiPCU8KDwrPC48MTw0PDc8Ojw9PEA8QzxGPEk8TDxPPFI8VDxdPGA8YjxrPG48cDx5PHw8fjyHPIo8jDyVPJg8mjyjPKY8qDyxPLQ8tjy/PMI8xDzNPNA80jzbPN484DzpPOw87jz3PPo8/D0FPQg9Cj0TPRY9GD0hPSQ9Jj0vPTI9ND09PUA9Qj1LPU49UD1ZPVw9Xj1rPW49cD15Pag9qz2uPbE9tD23Pbo9vT3APcI9xT3IPcs9zj3RPdQ91z3aPd094D3jPeY96T3rPfQ99z35PgI+BT4HPhQ+Fz4ZPiI+TT5QPlM+VT5YPls+Xj5hPmQ+Zz5qPm0+cD5zPnU+eD57Pn4+gT6EPoc+iT6SPpU+lz6kPqc+qT6yPuM+5j7pPuw+7z7yPvU++D77Pv4/AT8EPwY/CT8MPw8/Ej8VPxg/Gz8dPyA/Iz8mPyg/MT80PzY/Pz9CP0Q/TT9QP1I/Xz9iP2Q/bT+SP5U/mD+bP54/oT+kP6c/qj+tP68/sj+1P7g/uz++P8A/wz/FP9I/1T/XP+BAC0AOQBFAFEAXQBpAHEAfQCJAJEAnQClALEAvQDJANUA4QDtAPkBBQENARUBOQFFAU0BcQF9AYUBuQHFAc0B8QKtArkCwQLNAtkC4QLtAvkDBQMRAx0DKQMxAzkDRQNRA10DaQN1A4EDiQORA5kDoQPFA9ED2QP9BAkEEQQ1BEEESQR9BIkEkQSZBL0FSQVVBWEFbQV5BYUFkQWdBakFtQXBBc0F2QXlBfEF/QYJBhEGNQZBBkkGbQZ5BoEGpQaxBrkG3QbpBvEHFQchBykHTQdZB2EHhQeRB5kHvQfJB9EH9QgBCAkILQg5CEEIZQhxCHkInQipCLEI1QjhCOkJDQkZCSEJRQlRCVkJfQmJCZEJxQnRCdkJ/QqpCrUKwQrNCtkK5QrxCvkLBQsRCx0LKQs1C0ELTQtZC2ELbQt5C4ELjQuVC7kLxQvNC/EL/QwFDCkMNQw9DGEMbQx1DKkMtQy9DOENfQ2JDZUNnQ2pDbUNwQ3NDdkN5Q3xDf0OCQ4VDiEOLQ45DkUOTQ5VDnkOhQ6NDrEOvQ7FDvkPBQ8NDzEP3Q/pD/UQARANEBkQJRAxED0QSRBVEGEQbRB5EIUQkRCdEKkQtRDBEM0Q1RD5EQURDRFBEUkRVRF5EZURnRHBEm0SeRKFEpESnRKpErUSwRLNEtkS5RLxEv0TCRMVEyETLRM5E0UTURNdE2UTiRORE9UT3RPlFAkUERRFFE0UWRR9FJEUmRTNFNUU4RUFFRkVIRVlFW0VdRWZFaEVxRXNFfEV+RYdFiUWaRZxFpUWnRbBFskW/RcFFxEXNRdRF1kXjReVF6EXxRfZF+EYJRgtGDUYWRhhGJUYnRipGM0Y6RjxGSUZLRk5GV0ZgRmJGc0Z1RndGgEarRq5GsUa0RrdGuka9RsBGw0bGRslGzEbPRtJG1UbYRttG3kbhRuRG50bpRvJG9EcBRwNHBkcPRxRHFkcnRylHK0c8Rz5HQEdNR09HUkdbR2BHYkdvR3FHdEd9R4RHhkePR5FHmkecR61Hr0e4R7pHx0fJR8xH1UfaR9xH6UfrR+5H90f8R/5IB0gJSBZIGEgbSCRIKUgrSDhIOkg9SEZIT0hRSF5IYEhjSGxIdUh3SIBIgkiPSJFIlEidSKRIpkizSLVIuEjBSMZIyEjRSNNI3EkJSQxJD0kSSRVJGEkbSR5JIUkkSSdJKkktSTBJM0k2STlJPEk/SUJJRUlISUpJU0lWSVlJW0lkSWtJbklxSXRJdkl/SYBJg0mMSZFJmkmbSZ1JpkmnSalJskm3SbpJvUm/SchJzUnQSdNJ1UneSeFJ5EnmSe9J9kn5SfxJ/0oBSgpKC0oNShZKG0oeSiFKI0osSjNKNko5SjxKPkpHSlBKU0pWSllKXEpeSmdKbEpvSnJKdEp9SoBKg0qFSpJKlEqXSqBKp0qpSrJKuUq8Sr9KwkrESs1K2krfSuxK9UsESwlLGEsqSy9LNAAAAAAAAAICAAAAAAAADfoAAAAAAAAAAAAAAAAAAEs2 \ No newline at end of file diff --git a/Base/ASAssert.h b/Base/ASAssert.h index 446f64b4b7..d3f88a44d3 100644 --- a/Base/ASAssert.h +++ b/Base/ASAssert.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASAssert.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once diff --git a/Base/ASAvailability.h b/Base/ASAvailability.h index 78293c3d63..904da9bff6 100644 --- a/Base/ASAvailability.h +++ b/Base/ASAvailability.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASAvailability.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import @@ -23,6 +25,14 @@ #define kCFCoreFoundationVersionNumber_iOS_8_0 1140.1 #endif +#ifndef kCFCoreFoundationVersionNumber_iOS_8_4 +#define kCFCoreFoundationVersionNumber_iOS_8_4 1145.15 +#endif + +#ifndef kCFCoreFoundationVersionNumber_iOS_9_0 +#define kCFCoreFoundationVersionNumber_iOS_9_0 1240.10 +#endif + #ifndef __IPHONE_7_0 #define __IPHONE_7_0 70000 #endif @@ -31,6 +41,10 @@ #define __IPHONE_8_0 80000 #endif +#ifndef __IPHONE_9_0 +#define __IPHONE_9_0 90000 +#endif + #ifndef AS_IOS8_SDK_OR_LATER #define AS_IOS8_SDK_OR_LATER __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0 #endif @@ -38,3 +52,4 @@ #define AS_AT_LEAST_IOS7 (kCFCoreFoundationVersionNumber > kCFCoreFoundationVersionNumber_iOS_6_1) #define AS_AT_LEAST_IOS7_1 (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_1) #define AS_AT_LEAST_IOS8 (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_8_0) +#define AS_AT_LEAST_IOS9 (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_9_0) diff --git a/Base/ASBaseDefines.h b/Base/ASBaseDefines.h index dcf9dbe825..dfc02c1230 100755 --- a/Base/ASBaseDefines.h +++ b/Base/ASBaseDefines.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASBaseDefines.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once diff --git a/Base/ASEqualityHelpers.h b/Base/ASEqualityHelpers.h index f6dd4de1b7..5373ef19ef 100644 --- a/Base/ASEqualityHelpers.h +++ b/Base/ASEqualityHelpers.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASEqualityHelpers.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ASBaseDefines.h" diff --git a/Base/ASLog.h b/Base/ASLog.h index 4c85bdf99a..4ba3361c68 100644 --- a/Base/ASLog.h +++ b/Base/ASLog.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ASLog.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #pragma once diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bb92630492..c96a002f8c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,6 +10,42 @@ please open an issue on GitHub. 4. Ensure the test suite passes. 5. Make sure your code lints. 6. If you haven't already, complete the Contributor License Agreement ("CLA"). +7. Make sure that any new files conform to the correct file header style below + +*ASDK FILES:* + +// +// ASPagerFlowLayout.h +// AsyncDisplayKit +// +// Created by Levi McCallum on 2/12/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + +*EXAMPLE PROJECT FILES:* + +// +// PhotoCellNode.m +// Sample +// +// Created by Levi McCallum on 2/12/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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. +// ## Contributor License Agreement ("CLA") In order to accept your pull request, we need you to submit a CLA. You only need @@ -25,6 +61,9 @@ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue. +## Getting Help +We use Slack for real-time debugging, community updates, and general talk about ASDK. Signup at http://asdk-slack-auto-invite.herokuapp.com or email AsyncDisplayKit(at)gmail.com to get an invite. + ## Coding Style * 2 spaces for indentation rather than tabs diff --git a/Cartfile b/Cartfile new file mode 100644 index 0000000000..6cdeeb89c1 --- /dev/null +++ b/Cartfile @@ -0,0 +1 @@ +github "pinterest/PINRemoteImage" "3.0.0-beta.2" diff --git a/Podfile b/Podfile index 687ae3c56c..a625c28556 100644 --- a/Podfile +++ b/Podfile @@ -2,7 +2,7 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '7.0' -target :'AsyncDisplayKitTests', :exclusive => true do +target :'AsyncDisplayKitTests' do pod 'OCMock', '~> 2.2' - pod 'FBSnapshotTestCase', '~> 1.8.1' + pod 'FBSnapshotTestCase/Core', '~> 2.1' end diff --git a/README.md b/README.md index e4d1dcd36f..10f28e5005 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![AsyncDisplayKit](https://github.com/facebook/AsyncDisplayKit/blob/master/docs/assets/logo.png) -[![Apps Using](https://img.shields.io/badge/Apps%20Using%20ASDK-%3E3,178-28B9FE.svg)](http://cocoapods.org/pods/AsyncDisplayKit) -[![Downloads](https://img.shields.io/badge/Total%20Downloads-%3E336,372-28B9FE.svg)](http://cocoapods.org/pods/AsyncDisplayKit) +[![Apps Using](https://img.shields.io/badge/Apps%20Using%20ASDK-%3E3,658-28B9FE.svg)](http://cocoapods.org/pods/AsyncDisplayKit) +[![Downloads](https://img.shields.io/badge/Total%20Downloads-%3E377,749-28B9FE.svg)](http://cocoapods.org/pods/AsyncDisplayKit) [![Platform](https://img.shields.io/badge/platforms-iOS%20%7C%20tvOS-orange.svg)](http://AsyncDisplayKit.org) [![Languages](https://img.shields.io/badge/languages-ObjC%20%7C%20Swift-orange.svg)](http://AsyncDisplayKit.org) @@ -97,13 +97,17 @@ You can also easily [create your own nodes](https://github.com/facebook/AsyncDisplayKit/blob/master/AsyncDisplayKit/ASDisplayNode%2BSubclasses.h) to implement node hierarchies or custom drawing. -### Learn more +## Learn more * Read the [Getting Started guide](http://asyncdisplaykit.org/docs/getting-started.html) * Get the [sample projects](https://github.com/facebook/AsyncDisplayKit/tree/master/examples) * Browse the [API reference](http://asyncdisplaykit.org/appledocs.html) * Watch the [NSLondon talk](http://vimeo.com/103589245) or the [NSSpain talk](https://www.youtube.com/watch?v=RY_X7l1g79Q) +## Getting Help + +We use Slack for real-time debugging, community updates, and general talk about ASDK. Signup at http://asdk-slack-auto-invite.herokuapp.com or email AsyncDisplayKit(at)gmail.com to get an invite. + ## Testing AsyncDisplayKit has extensive unit test coverage. You'll need to run `pod install` in the root AsyncDisplayKit directory to set up OCMock. diff --git a/build.sh b/build.sh index c3744eab05..02a2ddb4ab 100755 --- a/build.sh +++ b/build.sh @@ -17,35 +17,42 @@ trap trap_handler INT TERM EXIT MODE="$1" +if type xcpretty-travis-formatter &> /dev/null; then + FORMATTER="-f $(xcpretty-travis-formatter)" + else + FORMATTER="-s" +fi + if [ "$MODE" = "tests" ]; then echo "Building & testing AsyncDisplayKit." pod install - xctool \ + set -o pipefail && xcodebuild \ -workspace AsyncDisplayKit.xcworkspace \ -scheme AsyncDisplayKit \ -sdk "$SDK" \ -destination "$PLATFORM" \ - build test + build test | xcpretty $FORMATTER trap - EXIT exit 0 fi -if [ "$MODE" = "examples" ]; then +if [ "$MODE" = "examples-pt1" ]; then echo "Verifying that all AsyncDisplayKit examples compile." - for example in examples/*/; do - echo "Building $example." + for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -6 | head); do + echo "Building (examples-pt1) $example." if [ -f "${example}/Podfile" ]; then echo "Using CocoaPods" pod install --project-directory=$example - xctool \ - -workspace "${example}Sample.xcworkspace" \ + set -o pipefail && xcodebuild \ + -workspace "${example}/Sample.xcworkspace" \ -scheme Sample \ -sdk "$SDK" \ -destination "$PLATFORM" \ - build + -derivedDataPath ~/ \ + build | xcpretty $FORMATTER elif [ -f "${example}/Cartfile" ]; then echo "Using Carthage" local_repo=`pwd` @@ -55,12 +62,92 @@ if [ "$MODE" = "examples" ]; then echo "git \"file://${local_repo}\" \"${current_branch}\"" > "Cartfile" carthage update --platform iOS - xctool \ + set -o pipefail && xcodebuild \ -project "Sample.xcodeproj" \ -scheme Sample \ -sdk "$SDK" \ -destination "$PLATFORM" \ - build + build | xcpretty $FORMATTER + + cd ../.. + fi + done + trap - EXIT + exit 0 +fi + +if [ "$MODE" = "examples-pt2" ]; then + echo "Verifying that all AsyncDisplayKit examples compile." + + for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -12 | tail -6 | head); do + echo "Building $example (examples-pt2)." + + if [ -f "${example}/Podfile" ]; then + echo "Using CocoaPods" + pod install --project-directory=$example + + set -o pipefail && xcodebuild \ + -workspace "${example}/Sample.xcworkspace" \ + -scheme Sample \ + -sdk "$SDK" \ + -destination "$PLATFORM" \ + -derivedDataPath ~/ \ + build | xcpretty $FORMATTER + elif [ -f "${example}/Cartfile" ]; then + echo "Using Carthage" + local_repo=`pwd` + current_branch=`git rev-parse --abbrev-ref HEAD` + cd $example + + echo "git \"file://${local_repo}\" \"${current_branch}\"" > "Cartfile" + carthage update --platform iOS + + set -o pipefail && xcodebuild \ + -project "Sample.xcodeproj" \ + -scheme Sample \ + -sdk "$SDK" \ + -destination "$PLATFORM" \ + build | xcpretty $FORMATTER + + cd ../.. + fi + done + trap - EXIT + exit 0 +fi + +if [ "$MODE" = "examples-pt3" ]; then + echo "Verifying that all AsyncDisplayKit examples compile." + + for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -7 | head); do + echo "Building $example (examples-pt3)." + + if [ -f "${example}/Podfile" ]; then + echo "Using CocoaPods" + pod install --project-directory=$example + + set -o pipefail && xcodebuild \ + -workspace "${example}/Sample.xcworkspace" \ + -scheme Sample \ + -sdk "$SDK" \ + -destination "$PLATFORM" \ + -derivedDataPath ~/ \ + build | xcpretty $FORMATTER + elif [ -f "${example}/Cartfile" ]; then + echo "Using Carthage" + local_repo=`pwd` + current_branch=`git rev-parse --abbrev-ref HEAD` + cd $example + + echo "git \"file://${local_repo}\" \"${current_branch}\"" > "Cartfile" + carthage update --platform iOS + + set -o pipefail && xcodebuild \ + -project "Sample.xcodeproj" \ + -scheme Sample \ + -sdk "$SDK" \ + -destination "$PLATFORM" \ + build | xcpretty $FORMATTER cd ../.. fi @@ -72,12 +159,12 @@ fi if [ "$MODE" = "life-without-cocoapods" ]; then echo "Verifying that AsyncDisplayKit functions as a static library." - xctool \ + set -o pipefail && xcodebuild \ -workspace "smoke-tests/Life Without CocoaPods/Life Without CocoaPods.xcworkspace" \ -scheme "Life Without CocoaPods" \ -sdk "$SDK" \ -destination "$PLATFORM" \ - build + build | xcpretty $FORMATTER trap - EXIT exit 0 fi @@ -85,12 +172,12 @@ fi if [ "$MODE" = "framework" ]; then echo "Verifying that AsyncDisplayKit functions as a dynamic framework (for Swift/Carthage users)." - xctool \ + set -o pipefail && xcodebuild \ -project "smoke-tests/Framework/Sample.xcodeproj" \ -scheme Sample \ -sdk "$SDK" \ -destination "$PLATFORM" \ - build + build | xcpretty $FORMATTER trap - EXIT exit 0 fi diff --git a/examples/ASAnimatedImage/ASAnimatedImage/AppDelegate.h b/examples/ASAnimatedImage/ASAnimatedImage/AppDelegate.h deleted file mode 100644 index b3ea365221..0000000000 --- a/examples/ASAnimatedImage/ASAnimatedImage/AppDelegate.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// AppDelegate.h -// ASAnimatedImage -// -// Created by Garrett Moon on 3/22/16. -// Copyright Β© 2016 Facebook, Inc. All rights reserved. -// - -#import - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - - -@end - diff --git a/examples/ASAnimatedImage/ASAnimatedImage/AppDelegate.m b/examples/ASAnimatedImage/ASAnimatedImage/AppDelegate.m deleted file mode 100644 index b4a601de56..0000000000 --- a/examples/ASAnimatedImage/ASAnimatedImage/AppDelegate.m +++ /dev/null @@ -1,45 +0,0 @@ -// -// AppDelegate.m -// ASAnimatedImage -// -// Created by Garrett Moon on 3/22/16. -// Copyright Β© 2016 Facebook, Inc. All rights reserved. -// - -#import "AppDelegate.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - -@end diff --git a/examples/ASAnimatedImage/ASAnimatedImage/ViewController.h b/examples/ASAnimatedImage/ASAnimatedImage/ViewController.h deleted file mode 100644 index 5fce20369d..0000000000 --- a/examples/ASAnimatedImage/ASAnimatedImage/ViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ViewController.h -// ASAnimatedImage -// -// Created by Garrett Moon on 3/22/16. -// Copyright Β© 2016 Facebook, Inc. All rights reserved. -// - -#import - -@interface ViewController : UIViewController - - -@end - diff --git a/examples/ASAnimatedImage/ASAnimatedImage/main.m b/examples/ASAnimatedImage/ASAnimatedImage/main.m deleted file mode 100644 index dd6cdbdb8a..0000000000 --- a/examples/ASAnimatedImage/ASAnimatedImage/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// ASAnimatedImage -// -// Created by Garrett Moon on 3/22/16. -// Copyright Β© 2016 Facebook, Inc. All rights reserved. -// - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/examples/ASAnimatedImage/Podfile b/examples/ASAnimatedImage/Podfile deleted file mode 100644 index 5e6d5cc415..0000000000 --- a/examples/ASAnimatedImage/Podfile +++ /dev/null @@ -1,4 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' -pod 'PINRemoteImage', :git => 'https://github.com/pinterest/PINRemoteImage.git', :branch => 'addPINAnimatedImage' diff --git a/examples/ASAnimatedImage/Sample.xcodeproj/project.pbxproj b/examples/ASAnimatedImage/Sample.xcodeproj/project.pbxproj deleted file mode 100644 index eaaaed2bad..0000000000 --- a/examples/ASAnimatedImage/Sample.xcodeproj/project.pbxproj +++ /dev/null @@ -1,385 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 683ADBA31CA19883005863A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 683ADBA21CA19883005863A4 /* main.m */; }; - 683ADBA61CA19883005863A4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 683ADBA51CA19883005863A4 /* AppDelegate.m */; }; - 683ADBA91CA19883005863A4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 683ADBA81CA19883005863A4 /* ViewController.m */; }; - 683ADBAC1CA19883005863A4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 683ADBAA1CA19883005863A4 /* Main.storyboard */; }; - 683ADBAE1CA19883005863A4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 683ADBAD1CA19883005863A4 /* Assets.xcassets */; }; - 683ADBB11CA19883005863A4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 683ADBAF1CA19883005863A4 /* LaunchScreen.storyboard */; }; - EE964E5E7CD506D45C6DCC49 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A6F2399FA1A86586D9BDAE05 /* libPods.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 683ADB9E1CA19883005863A4 /* ASAnimatedImage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ASAnimatedImage.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 683ADBA21CA19883005863A4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 683ADBA41CA19883005863A4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 683ADBA51CA19883005863A4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 683ADBA71CA19883005863A4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 683ADBA81CA19883005863A4 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 683ADBAB1CA19883005863A4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 683ADBAD1CA19883005863A4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 683ADBB01CA19883005863A4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 683ADBB21CA19883005863A4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A6F2399FA1A86586D9BDAE05 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - BBB395EF2813E7DB5CB49459 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - BBBE85D30A6D31AD7021A9AF /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 683ADB9B1CA19883005863A4 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - EE964E5E7CD506D45C6DCC49 /* libPods.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 683ADB951CA19883005863A4 = { - isa = PBXGroup; - children = ( - 683ADBA01CA19883005863A4 /* ASAnimatedImage */, - 683ADB9F1CA19883005863A4 /* Products */, - 71A772B0DB9B7760CE330DD9 /* Pods */, - 8C6AC07DE55B51935C632F56 /* Frameworks */, - ); - sourceTree = ""; - }; - 683ADB9F1CA19883005863A4 /* Products */ = { - isa = PBXGroup; - children = ( - 683ADB9E1CA19883005863A4 /* ASAnimatedImage.app */, - ); - name = Products; - sourceTree = ""; - }; - 683ADBA01CA19883005863A4 /* ASAnimatedImage */ = { - isa = PBXGroup; - children = ( - 683ADBA41CA19883005863A4 /* AppDelegate.h */, - 683ADBA51CA19883005863A4 /* AppDelegate.m */, - 683ADBA71CA19883005863A4 /* ViewController.h */, - 683ADBA81CA19883005863A4 /* ViewController.m */, - 683ADBAA1CA19883005863A4 /* Main.storyboard */, - 683ADBAD1CA19883005863A4 /* Assets.xcassets */, - 683ADBAF1CA19883005863A4 /* LaunchScreen.storyboard */, - 683ADBB21CA19883005863A4 /* Info.plist */, - 683ADBA11CA19883005863A4 /* Supporting Files */, - ); - path = ASAnimatedImage; - sourceTree = ""; - }; - 683ADBA11CA19883005863A4 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 683ADBA21CA19883005863A4 /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 71A772B0DB9B7760CE330DD9 /* Pods */ = { - isa = PBXGroup; - children = ( - BBBE85D30A6D31AD7021A9AF /* Pods.debug.xcconfig */, - BBB395EF2813E7DB5CB49459 /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - 8C6AC07DE55B51935C632F56 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A6F2399FA1A86586D9BDAE05 /* libPods.a */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 683ADB9D1CA19883005863A4 /* ASAnimatedImage */ = { - isa = PBXNativeTarget; - buildConfigurationList = 683ADBB51CA19883005863A4 /* Build configuration list for PBXNativeTarget "ASAnimatedImage" */; - buildPhases = ( - 694B306B43ED1C3916B0D909 /* Check Pods Manifest.lock */, - 683ADB9A1CA19883005863A4 /* Sources */, - 683ADB9B1CA19883005863A4 /* Frameworks */, - 683ADB9C1CA19883005863A4 /* Resources */, - 26A96BEEF893B1FA39F144CF /* Embed Pods Frameworks */, - 2ADE0E7B5309A9CD043DDB3E /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ASAnimatedImage; - productName = ASAnimatedImage; - productReference = 683ADB9E1CA19883005863A4 /* ASAnimatedImage.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 683ADB961CA19883005863A4 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = "Facebook, Inc."; - TargetAttributes = { - 683ADB9D1CA19883005863A4 = { - CreatedOnToolsVersion = 7.2; - }; - }; - }; - buildConfigurationList = 683ADB991CA19883005863A4 /* Build configuration list for PBXProject "ASAnimatedImage" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 683ADB951CA19883005863A4; - productRefGroup = 683ADB9F1CA19883005863A4 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 683ADB9D1CA19883005863A4 /* ASAnimatedImage */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 683ADB9C1CA19883005863A4 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 683ADBB11CA19883005863A4 /* LaunchScreen.storyboard in Resources */, - 683ADBAE1CA19883005863A4 /* Assets.xcassets in Resources */, - 683ADBAC1CA19883005863A4 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 26A96BEEF893B1FA39F144CF /* Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 2ADE0E7B5309A9CD043DDB3E /* 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; - }; - 694B306B43ED1C3916B0D909 /* 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 */ - 683ADB9A1CA19883005863A4 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 683ADBA91CA19883005863A4 /* ViewController.m in Sources */, - 683ADBA61CA19883005863A4 /* AppDelegate.m in Sources */, - 683ADBA31CA19883005863A4 /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 683ADBAA1CA19883005863A4 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 683ADBAB1CA19883005863A4 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 683ADBAF1CA19883005863A4 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 683ADBB01CA19883005863A4 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 683ADBB31CA19883005863A4 /* 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; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - 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 = 9.2; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 683ADBB41CA19883005863A4 /* 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 = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - 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 = 9.2; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 683ADBB61CA19883005863A4 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BBBE85D30A6D31AD7021A9AF /* Pods.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = ASAnimatedImage/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = facebook.ASAnimatedImage; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 683ADBB71CA19883005863A4 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BBB395EF2813E7DB5CB49459 /* Pods.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = ASAnimatedImage/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = facebook.ASAnimatedImage; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 683ADB991CA19883005863A4 /* Build configuration list for PBXProject "ASAnimatedImage" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 683ADBB31CA19883005863A4 /* Debug */, - 683ADBB41CA19883005863A4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 683ADBB51CA19883005863A4 /* Build configuration list for PBXNativeTarget "ASAnimatedImage" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 683ADBB61CA19883005863A4 /* Debug */, - 683ADBB71CA19883005863A4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 683ADB961CA19883005863A4 /* Project object */; -} diff --git a/examples/ASCollectionView/Podfile b/examples/ASCollectionView/Podfile index 6c012e3c04..5c30ce798e 100644 --- a/examples/ASCollectionView/Podfile +++ b/examples/ASCollectionView/Podfile @@ -1,3 +1,6 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end + diff --git a/examples/ASCollectionView/Sample.xcodeproj/project.pbxproj b/examples/ASCollectionView/Sample.xcodeproj/project.pbxproj index 3cdc925105..3a71950cbe 100644 --- a/examples/ASCollectionView/Sample.xcodeproj/project.pbxproj +++ b/examples/ASCollectionView/Sample.xcodeproj/project.pbxproj @@ -14,14 +14,15 @@ AC3C4A671A11F47200143C57 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A661A11F47200143C57 /* AppDelegate.m */; }; AC3C4A6A1A11F47200143C57 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A691A11F47200143C57 /* ViewController.m */; }; AC3C4A8E1A11F80C00143C57 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AC3C4A8D1A11F80C00143C57 /* Images.xcassets */; }; - FABD6D156A3EB118497E5CE6 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F02BAF78E68BC56FD8C161B7 /* libPods.a */; }; + AF3289A5220868C808CB570A /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C8A73B07F48A6BF6CCC23B59 /* libPods-Sample.a */; }; FC3FCA801C2B1564009F6D6D /* PresentingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC3FCA7F1C2B1564009F6D6D /* PresentingViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 25FDEC901BF31EE700CEB123 /* ItemNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemNode.h; sourceTree = ""; }; 25FDEC911BF31EE700CEB123 /* ItemNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemNode.m; sourceTree = ""; }; - 2DBAEE96397BB913350C4530 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + 3AE14FE81840274F92ABA227 /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; + 4BB21270A5CD115520C634A3 /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; 9B92C87F1BC17D3000EE46B2 /* SupplementaryNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SupplementaryNode.h; sourceTree = ""; }; 9B92C8801BC17D3000EE46B2 /* SupplementaryNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SupplementaryNode.m; sourceTree = ""; }; 9BA2CEA01BB2579C00D18414 /* Launchboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Launchboard.storyboard; sourceTree = ""; }; @@ -33,7 +34,7 @@ AC3C4A681A11F47200143C57 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; AC3C4A691A11F47200143C57 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; AC3C4A8D1A11F80C00143C57 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - CD1ABB23007FEDB31D8C1978 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + C8A73B07F48A6BF6CCC23B59 /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; F02BAF78E68BC56FD8C161B7 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; FC3FCA7E1C2B1564009F6D6D /* PresentingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PresentingViewController.h; sourceTree = ""; }; FC3FCA7F1C2B1564009F6D6D /* PresentingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PresentingViewController.m; sourceTree = ""; }; @@ -44,7 +45,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - FABD6D156A3EB118497E5CE6 /* libPods.a in Frameworks */, + AF3289A5220868C808CB570A /* libPods-Sample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -54,8 +55,8 @@ 90A2B9C5397C46134C8A793B /* Pods */ = { isa = PBXGroup; children = ( - 2DBAEE96397BB913350C4530 /* Pods.debug.xcconfig */, - CD1ABB23007FEDB31D8C1978 /* Pods.release.xcconfig */, + 3AE14FE81840274F92ABA227 /* Pods-Sample.debug.xcconfig */, + 4BB21270A5CD115520C634A3 /* Pods-Sample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -114,6 +115,7 @@ isa = PBXGroup; children = ( F02BAF78E68BC56FD8C161B7 /* libPods.a */, + C8A73B07F48A6BF6CCC23B59 /* libPods-Sample.a */, ); name = Frameworks; sourceTree = ""; @@ -125,11 +127,13 @@ isa = PBXNativeTarget; buildConfigurationList = AC3C4A811A11F47200143C57 /* Build configuration list for PBXNativeTarget "Sample" */; buildPhases = ( - F868CFBB21824CC9521B6588 /* Check Pods Manifest.lock */, + F868CFBB21824CC9521B6588 /* πŸ“¦ Check Pods Manifest.lock */, AC3C4A5A1A11F47200143C57 /* Sources */, AC3C4A5B1A11F47200143C57 /* Frameworks */, AC3C4A5C1A11F47200143C57 /* Resources */, - A6902C454C7661D0D277AC62 /* Copy Pods Resources */, + A6902C454C7661D0D277AC62 /* πŸ“¦ Copy Pods Resources */, + 79E97C651F7D1ECDBE6B4793 /* πŸ“¦ Embed Pods Frameworks */, + 8C4782EECEE7F1205007D6DB /* Embed Pods Frameworks */, ); buildRules = ( ); @@ -185,29 +189,59 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - A6902C454C7661D0D277AC62 /* Copy Pods Resources */ = { + 79E97C651F7D1ECDBE6B4793 /* πŸ“¦ Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "πŸ“¦ Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - F868CFBB21824CC9521B6588 /* Check Pods Manifest.lock */ = { + 8C4782EECEE7F1205007D6DB /* Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + A6902C454C7661D0D277AC62 /* πŸ“¦ 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-Sample/Pods-Sample-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + F868CFBB21824CC9521B6588 /* πŸ“¦ Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "πŸ“¦ Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -314,7 +348,7 @@ }; AC3C4A821A11F47200143C57 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2DBAEE96397BB913350C4530 /* Pods.debug.xcconfig */; + baseConfigurationReference = 3AE14FE81840274F92ABA227 /* Pods-Sample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; INFOPLIST_FILE = Sample/Info.plist; @@ -327,7 +361,7 @@ }; AC3C4A831A11F47200143C57 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = CD1ABB23007FEDB31D8C1978 /* Pods.release.xcconfig */; + baseConfigurationReference = 4BB21270A5CD115520C634A3 /* Pods-Sample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; INFOPLIST_FILE = Sample/Info.plist; diff --git a/examples/ASCollectionView/Sample/AppDelegate.h b/examples/ASCollectionView/Sample/AppDelegate.h index 80b7fb3d50..b977c7498f 100644 --- a/examples/ASCollectionView/Sample/AppDelegate.h +++ b/examples/ASCollectionView/Sample/AppDelegate.h @@ -1,13 +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. - */ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/ASCollectionView/Sample/AppDelegate.m b/examples/ASCollectionView/Sample/AppDelegate.m index 19ceedd960..393711a864 100644 --- a/examples/ASCollectionView/Sample/AppDelegate.m +++ b/examples/ASCollectionView/Sample/AppDelegate.m @@ -1,13 +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. - */ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/ASCollectionView/Sample/ItemNode.h b/examples/ASCollectionView/Sample/ItemNode.h index d95f2fa4d2..e50983f7e5 100644 --- a/examples/ASCollectionView/Sample/ItemNode.h +++ b/examples/ASCollectionView/Sample/ItemNode.h @@ -1,13 +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. - */ +// +// ItemNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/ASCollectionView/Sample/ItemNode.m b/examples/ASCollectionView/Sample/ItemNode.m index 1a5f5ce40a..fedd2ca9d5 100644 --- a/examples/ASCollectionView/Sample/ItemNode.m +++ b/examples/ASCollectionView/Sample/ItemNode.m @@ -1,13 +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. - */ +// +// ItemNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ItemNode.h" diff --git a/examples/ASCollectionView/Sample/PresentingViewController.h b/examples/ASCollectionView/Sample/PresentingViewController.h index bd2308fab3..f0c2a76e37 100644 --- a/examples/ASCollectionView/Sample/PresentingViewController.h +++ b/examples/ASCollectionView/Sample/PresentingViewController.h @@ -3,7 +3,18 @@ // Sample // // Created by Tom King on 12/23/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/ASCollectionView/Sample/PresentingViewController.m b/examples/ASCollectionView/Sample/PresentingViewController.m index 80669f29b8..f191898d82 100644 --- a/examples/ASCollectionView/Sample/PresentingViewController.m +++ b/examples/ASCollectionView/Sample/PresentingViewController.m @@ -3,7 +3,18 @@ // Sample // // Created by Tom King on 12/23/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PresentingViewController.h" diff --git a/examples/ASCollectionView/Sample/SupplementaryNode.h b/examples/ASCollectionView/Sample/SupplementaryNode.h index f75c929684..906fc50bdc 100644 --- a/examples/ASCollectionView/Sample/SupplementaryNode.h +++ b/examples/ASCollectionView/Sample/SupplementaryNode.h @@ -1,13 +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. - */ +// +// SupplementaryNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/ASCollectionView/Sample/SupplementaryNode.m b/examples/ASCollectionView/Sample/SupplementaryNode.m index 96e07195b0..fb5783565e 100644 --- a/examples/ASCollectionView/Sample/SupplementaryNode.m +++ b/examples/ASCollectionView/Sample/SupplementaryNode.m @@ -1,13 +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. - */ +// +// SupplementaryNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "SupplementaryNode.h" diff --git a/examples/ASCollectionView/Sample/ViewController.h b/examples/ASCollectionView/Sample/ViewController.h index d0e9200d88..fc52c022f2 100644 --- a/examples/ASCollectionView/Sample/ViewController.h +++ b/examples/ASCollectionView/Sample/ViewController.h @@ -1,13 +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. - */ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/ASCollectionView/Sample/ViewController.m b/examples/ASCollectionView/Sample/ViewController.m index da9ff290e8..6e5e41ceec 100644 --- a/examples/ASCollectionView/Sample/ViewController.m +++ b/examples/ASCollectionView/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/ASCollectionView/Sample/main.m b/examples/ASCollectionView/Sample/main.m index 592423d8f6..d5794dca4c 100644 --- a/examples/ASCollectionView/Sample/main.m +++ b/examples/ASCollectionView/Sample/main.m @@ -1,13 +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. - */ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 #import "AppDelegate.h" diff --git a/examples/ASTableViewStressTest/Default-568h@2x.png b/examples/ASDKTube/Default-568h@2x.png similarity index 100% rename from examples/ASTableViewStressTest/Default-568h@2x.png rename to examples/ASDKTube/Default-568h@2x.png diff --git a/examples/ASTableViewStressTest/Default-667h@2x.png b/examples/ASDKTube/Default-667h@2x.png similarity index 100% rename from examples/ASTableViewStressTest/Default-667h@2x.png rename to examples/ASDKTube/Default-667h@2x.png diff --git a/examples/ASTableViewStressTest/Default-736h@3x.png b/examples/ASDKTube/Default-736h@3x.png similarity index 100% rename from examples/ASTableViewStressTest/Default-736h@3x.png rename to examples/ASDKTube/Default-736h@3x.png diff --git a/examples/ASDKTube/Podfile b/examples/ASDKTube/Podfile new file mode 100644 index 0000000000..919de4b311 --- /dev/null +++ b/examples/ASDKTube/Podfile @@ -0,0 +1,5 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/Placeholders/Sample.xcodeproj/project.pbxproj b/examples/ASDKTube/Sample.xcodeproj/project.pbxproj similarity index 57% rename from examples/Placeholders/Sample.xcodeproj/project.pbxproj rename to examples/ASDKTube/Sample.xcodeproj/project.pbxproj index 1931d888f0..1a8abd1257 100644 --- a/examples/Placeholders/Sample.xcodeproj/project.pbxproj +++ b/examples/ASDKTube/Sample.xcodeproj/project.pbxproj @@ -11,14 +11,20 @@ 05E2128719D4DB510098F589 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128619D4DB510098F589 /* main.m */; }; 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128919D4DB510098F589 /* AppDelegate.m */; }; 05E2128D19D4DB510098F589 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128C19D4DB510098F589 /* ViewController.m */; }; - 29A7F3A51A3638DE00CF34F2 /* SlowpokeTextNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 29A7F3A41A3638DE00CF34F2 /* SlowpokeTextNode.m */; }; - 29E35E9B1A2F8DB0007B4B17 /* SlowpokeImageNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E35E9A1A2F8DB0007B4B17 /* SlowpokeImageNode.m */; }; - 29E35E9E1A2F8DBC007B4B17 /* SlowpokeShareNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E35E9D1A2F8DBC007B4B17 /* SlowpokeShareNode.m */; }; - 29E35EA01A2F9650007B4B17 /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 29E35E9F1A2F9650007B4B17 /* logo.png */; }; - 29E35EA31A2FD0E9007B4B17 /* PostNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E35EA21A2FD0E9007B4B17 /* PostNode.m */; }; - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; + 5791C5525B690FA54F26ACE8 /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A2092CAF5607B3863A3700A2 /* libPods-Sample.a */; }; 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; + 8B0768B81CE7AD03002E1453 /* VideoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B0768B71CE7AD03002E1453 /* VideoModel.m */; }; + 8B0768BC1CE7B091002E1453 /* VideoContentCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B0768BB1CE7B091002E1453 /* VideoContentCell.m */; }; + 8B0768BF1CE7C5A1002E1453 /* WindowWithStatusBarUnderlay.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B0768BE1CE7C5A1002E1453 /* WindowWithStatusBarUnderlay.m */; }; + 8B0768C51CE7C707002E1453 /* Utilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B0768C41CE7C707002E1453 /* Utilities.m */; }; + 8B0768C91CE7C889002E1453 /* VideoFeedNodeController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B0768C81CE7C889002E1453 /* VideoFeedNodeController.m */; }; + 8B9075851CF386A400F924C1 /* ico-unmute.png in Resources */ = {isa = PBXBuildFile; fileRef = 8B90757F1CF386A400F924C1 /* ico-unmute.png */; }; + 8B9075861CF386A400F924C1 /* ico-unmute@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8B9075801CF386A400F924C1 /* ico-unmute@2x.png */; }; + 8B9075871CF386A400F924C1 /* ico-unmute@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8B9075811CF386A400F924C1 /* ico-unmute@3x.png */; }; + 8B9075881CF386A400F924C1 /* ico-mute.png in Resources */ = {isa = PBXBuildFile; fileRef = 8B9075821CF386A400F924C1 /* ico-mute.png */; }; + 8B9075891CF386A400F924C1 /* ico-mute@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8B9075831CF386A400F924C1 /* ico-mute@2x.png */; }; + 8B90758A1CF386A400F924C1 /* ico-mute@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8B9075841CF386A400F924C1 /* ico-mute@3x.png */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -30,20 +36,27 @@ 05E2128919D4DB510098F589 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 05E2128B19D4DB510098F589 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 05E2128C19D4DB510098F589 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - 29A7F3A31A3638DE00CF34F2 /* SlowpokeTextNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlowpokeTextNode.h; sourceTree = ""; }; - 29A7F3A41A3638DE00CF34F2 /* SlowpokeTextNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SlowpokeTextNode.m; sourceTree = ""; }; - 29E35E991A2F8DB0007B4B17 /* SlowpokeImageNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlowpokeImageNode.h; sourceTree = ""; }; - 29E35E9A1A2F8DB0007B4B17 /* SlowpokeImageNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SlowpokeImageNode.m; sourceTree = ""; }; - 29E35E9C1A2F8DBC007B4B17 /* SlowpokeShareNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlowpokeShareNode.h; sourceTree = ""; }; - 29E35E9D1A2F8DBC007B4B17 /* SlowpokeShareNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SlowpokeShareNode.m; sourceTree = ""; }; - 29E35E9F1A2F9650007B4B17 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; - 29E35EA11A2FD0E9007B4B17 /* PostNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PostNode.h; sourceTree = ""; }; - 29E35EA21A2FD0E9007B4B17 /* PostNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PostNode.m; sourceTree = ""; }; - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + 8B0768B61CE7AD03002E1453 /* VideoModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoModel.h; sourceTree = ""; }; + 8B0768B71CE7AD03002E1453 /* VideoModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoModel.m; sourceTree = ""; }; + 8B0768BA1CE7B091002E1453 /* VideoContentCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoContentCell.h; sourceTree = ""; }; + 8B0768BB1CE7B091002E1453 /* VideoContentCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoContentCell.m; sourceTree = ""; }; + 8B0768BD1CE7C5A1002E1453 /* WindowWithStatusBarUnderlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowWithStatusBarUnderlay.h; sourceTree = ""; }; + 8B0768BE1CE7C5A1002E1453 /* WindowWithStatusBarUnderlay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WindowWithStatusBarUnderlay.m; sourceTree = ""; }; + 8B0768C31CE7C707002E1453 /* Utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utilities.h; sourceTree = ""; }; + 8B0768C41CE7C707002E1453 /* Utilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Utilities.m; sourceTree = ""; }; + 8B0768C71CE7C889002E1453 /* VideoFeedNodeController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoFeedNodeController.h; sourceTree = ""; }; + 8B0768C81CE7C889002E1453 /* VideoFeedNodeController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoFeedNodeController.m; sourceTree = ""; }; + 8B90757F1CF386A400F924C1 /* ico-unmute.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ico-unmute.png"; sourceTree = ""; }; + 8B9075801CF386A400F924C1 /* ico-unmute@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ico-unmute@2x.png"; sourceTree = ""; }; + 8B9075811CF386A400F924C1 /* ico-unmute@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ico-unmute@3x.png"; sourceTree = ""; }; + 8B9075821CF386A400F924C1 /* ico-mute.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ico-mute.png"; sourceTree = ""; }; + 8B9075831CF386A400F924C1 /* ico-mute@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ico-mute@2x.png"; sourceTree = ""; }; + 8B9075841CF386A400F924C1 /* ico-mute@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ico-mute@3x.png"; sourceTree = ""; }; + A2092CAF5607B3863A3700A2 /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + CFD6AA1D30516C27DEE5602B /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; + E51646FF8D3676A1D826A5AE /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -51,7 +64,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */, + 5791C5525B690FA54F26ACE8 /* libPods-Sample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -82,20 +95,17 @@ 05E2128319D4DB510098F589 /* Sample */ = { isa = PBXGroup; children = ( + 8B90757E1CF3869100F924C1 /* Icons */, + 8B0768C61CE7C85F002E1453 /* Controller */, + 8B0768B91CE7B07E002E1453 /* Nodes */, + 8B0768B51CE7ACE8002E1453 /* Models */, 05E2128819D4DB510098F589 /* AppDelegate.h */, 05E2128919D4DB510098F589 /* AppDelegate.m */, - 29E35E9F1A2F9650007B4B17 /* logo.png */, - 29E35EA11A2FD0E9007B4B17 /* PostNode.h */, - 29E35EA21A2FD0E9007B4B17 /* PostNode.m */, - 29E35E991A2F8DB0007B4B17 /* SlowpokeImageNode.h */, - 29E35E9A1A2F8DB0007B4B17 /* SlowpokeImageNode.m */, - 29E35E9C1A2F8DBC007B4B17 /* SlowpokeShareNode.h */, - 29E35E9D1A2F8DBC007B4B17 /* SlowpokeShareNode.m */, - 29A7F3A31A3638DE00CF34F2 /* SlowpokeTextNode.h */, - 29A7F3A41A3638DE00CF34F2 /* SlowpokeTextNode.m */, - 05E2128419D4DB510098F589 /* Supporting Files */, 05E2128B19D4DB510098F589 /* ViewController.h */, 05E2128C19D4DB510098F589 /* ViewController.m */, + 05E2128419D4DB510098F589 /* Supporting Files */, + 8B0768BD1CE7C5A1002E1453 /* WindowWithStatusBarUnderlay.h */, + 8B0768BE1CE7C5A1002E1453 /* WindowWithStatusBarUnderlay.m */, ); path = Sample; sourceTree = ""; @@ -115,7 +125,7 @@ 1A943BF0259746F18D6E423F /* Frameworks */ = { isa = PBXGroup; children = ( - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */, + A2092CAF5607B3863A3700A2 /* libPods-Sample.a */, ); name = Frameworks; sourceTree = ""; @@ -123,12 +133,54 @@ 1AE410B73DA5C3BD087ACDD7 /* Pods */ = { isa = PBXGroup; children = ( - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */, - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */, + CFD6AA1D30516C27DEE5602B /* Pods-Sample.debug.xcconfig */, + E51646FF8D3676A1D826A5AE /* Pods-Sample.release.xcconfig */, ); name = Pods; sourceTree = ""; }; + 8B0768B51CE7ACE8002E1453 /* Models */ = { + isa = PBXGroup; + children = ( + 8B0768C31CE7C707002E1453 /* Utilities.h */, + 8B0768C41CE7C707002E1453 /* Utilities.m */, + 8B0768B61CE7AD03002E1453 /* VideoModel.h */, + 8B0768B71CE7AD03002E1453 /* VideoModel.m */, + ); + path = Models; + sourceTree = ""; + }; + 8B0768B91CE7B07E002E1453 /* Nodes */ = { + isa = PBXGroup; + children = ( + 8B0768BA1CE7B091002E1453 /* VideoContentCell.h */, + 8B0768BB1CE7B091002E1453 /* VideoContentCell.m */, + ); + path = Nodes; + sourceTree = ""; + }; + 8B0768C61CE7C85F002E1453 /* Controller */ = { + isa = PBXGroup; + children = ( + 8B0768C71CE7C889002E1453 /* VideoFeedNodeController.h */, + 8B0768C81CE7C889002E1453 /* VideoFeedNodeController.m */, + ); + path = Controller; + sourceTree = ""; + }; + 8B90757E1CF3869100F924C1 /* Icons */ = { + isa = PBXGroup; + children = ( + 8B90757F1CF386A400F924C1 /* ico-unmute.png */, + 8B9075801CF386A400F924C1 /* ico-unmute@2x.png */, + 8B9075811CF386A400F924C1 /* ico-unmute@3x.png */, + 8B9075821CF386A400F924C1 /* ico-mute.png */, + 8B9075831CF386A400F924C1 /* ico-mute@2x.png */, + 8B9075841CF386A400F924C1 /* ico-mute@3x.png */, + ); + path = Icons; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -136,11 +188,12 @@ isa = PBXNativeTarget; buildConfigurationList = 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */; buildPhases = ( - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */, + E080B80F89C34A25B3488E26 /* πŸ“¦ Check Pods Manifest.lock */, 05E2127D19D4DB510098F589 /* Sources */, 05E2127E19D4DB510098F589 /* Frameworks */, 05E2127F19D4DB510098F589 /* Resources */, - F012A6F39E0149F18F564F50 /* Copy Pods Resources */, + F012A6F39E0149F18F564F50 /* πŸ“¦ Copy Pods Resources */, + 93B7780A33739EF25F20366B /* πŸ“¦ Embed Pods Frameworks */, ); buildRules = ( ); @@ -188,24 +241,44 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 29E35EA01A2F9650007B4B17 /* logo.png in Resources */, + 8B9075861CF386A400F924C1 /* ico-unmute@2x.png in Resources */, + 8B9075881CF386A400F924C1 /* ico-mute.png in Resources */, 0585428019D4DBE100606EA6 /* Default-568h@2x.png in Resources */, 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */, 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */, + 8B90758A1CF386A400F924C1 /* ico-mute@3x.png in Resources */, + 8B9075851CF386A400F924C1 /* ico-unmute.png in Resources */, + 8B9075871CF386A400F924C1 /* ico-unmute@3x.png in Resources */, + 8B9075891CF386A400F924C1 /* ico-mute@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */ = { + 93B7780A33739EF25F20366B /* πŸ“¦ Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "πŸ“¦ Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + E080B80F89C34A25B3488E26 /* πŸ“¦ Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "πŸ“¦ Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -213,19 +286,19 @@ 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; }; - F012A6F39E0149F18F564F50 /* Copy Pods Resources */ = { + F012A6F39E0149F18F564F50 /* πŸ“¦ Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "πŸ“¦ Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -235,13 +308,14 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 29A7F3A51A3638DE00CF34F2 /* SlowpokeTextNode.m in Sources */, - 29E35E9B1A2F8DB0007B4B17 /* SlowpokeImageNode.m in Sources */, - 29E35E9E1A2F8DBC007B4B17 /* SlowpokeShareNode.m in Sources */, 05E2128D19D4DB510098F589 /* ViewController.m in Sources */, + 8B0768C91CE7C889002E1453 /* VideoFeedNodeController.m in Sources */, 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */, - 29E35EA31A2FD0E9007B4B17 /* PostNode.m in Sources */, + 8B0768BC1CE7B091002E1453 /* VideoContentCell.m in Sources */, + 8B0768BF1CE7C5A1002E1453 /* WindowWithStatusBarUnderlay.m in Sources */, 05E2128719D4DB510098F589 /* main.m in Sources */, + 8B0768C51CE7C707002E1453 /* Utilities.m in Sources */, + 8B0768B81CE7AD03002E1453 /* VideoModel.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -326,11 +400,10 @@ }; 05E212A519D4DB510098F589 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */; + baseConfigurationReference = CFD6AA1D30516C27DEE5602B /* Pods-Sample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -338,11 +411,10 @@ }; 05E212A619D4DB510098F589 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */; + baseConfigurationReference = E51646FF8D3676A1D826A5AE /* Pods-Sample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; }; diff --git a/examples/ASTableViewStressTest/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/ASDKTube/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/ASTableViewStressTest/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to examples/ASDKTube/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/examples/EditableText/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples/ASDKTube/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme similarity index 100% rename from examples/EditableText/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme rename to examples/ASDKTube/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme diff --git a/examples/ASAnimatedImage/Sample.xcworkspace/contents.xcworkspacedata b/examples/ASDKTube/Sample.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/ASAnimatedImage/Sample.xcworkspace/contents.xcworkspacedata rename to examples/ASDKTube/Sample.xcworkspace/contents.xcworkspacedata diff --git a/examples/ASDKTube/Sample/AppDelegate.h b/examples/ASDKTube/Sample/AppDelegate.h new file mode 100644 index 0000000000..27e560aafe --- /dev/null +++ b/examples/ASDKTube/Sample/AppDelegate.h @@ -0,0 +1,24 @@ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples/ASDKTube/Sample/AppDelegate.m b/examples/ASDKTube/Sample/AppDelegate.m new file mode 100644 index 0000000000..738b215110 --- /dev/null +++ b/examples/ASDKTube/Sample/AppDelegate.m @@ -0,0 +1,51 @@ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "WindowWithStatusBarUnderlay.h" +#import "Utilities.h" +#import "VideoFeedNodeController.h" + + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + + // this UIWindow subclass is neccessary to make the status bar opaque + _window = [[WindowWithStatusBarUnderlay alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + _window.backgroundColor = [UIColor whiteColor]; + + + VideoFeedNodeController *asdkHomeFeedVC = [[VideoFeedNodeController alloc] init]; + UINavigationController *asdkHomeFeedNavCtrl = [[UINavigationController alloc] initWithRootViewController:asdkHomeFeedVC]; + + + _window.rootViewController = asdkHomeFeedNavCtrl; + [_window makeKeyAndVisible]; + + // Nav Bar appearance + NSDictionary *attributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]}; + [[UINavigationBar appearance] setTitleTextAttributes:attributes]; + [[UINavigationBar appearance] setBarTintColor:[UIColor lighOrangeColor]]; + [[UINavigationBar appearance] setTranslucent:NO]; + + [application setStatusBarStyle:UIStatusBarStyleLightContent]; + + + return YES; +} +@end diff --git a/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.h b/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.h new file mode 100644 index 0000000000..3ac85916a1 --- /dev/null +++ b/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.h @@ -0,0 +1,24 @@ +// +// VideoFeedNodeController.h +// Sample +// +// Created by Erekle on 5/15/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface VideoFeedNodeController : ASViewController + +@end diff --git a/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.m b/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.m new file mode 100644 index 0000000000..5c464f0dd3 --- /dev/null +++ b/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.m @@ -0,0 +1,82 @@ +// +// VideoFeedNodeController.m +// Sample +// +// Created by Erekle on 5/15/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "VideoFeedNodeController.h" +#import +#import "VideoModel.h" +#import "VideoContentCell.h" + +@interface VideoFeedNodeController () + +@end + +@implementation VideoFeedNodeController +{ + ASTableNode *_tableNode; + NSMutableArray *_videoFeedData; +} + +- (instancetype)init +{ + self.navigationItem.title = @"Home"; + _tableNode = [[ASTableNode alloc] init]; + _tableNode.delegate = self; + _tableNode.dataSource = self; + + if (!(self = [super initWithNode:_tableNode])) { + return nil; + } + + return self; +} + +- (void)loadView +{ + [super loadView]; + + [self generateFeedData]; + + [_tableNode.view reloadData]; +} + +- (void)generateFeedData +{ + _videoFeedData = [[NSMutableArray alloc] init]; + + for (int i = 0; i < 30; i++) { + [_videoFeedData addObject:[[VideoModel alloc] init]]; + } +} + +#pragma mark - ASCollectionDelegate - ASCollectionDataSource +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return _videoFeedData.count; +} + +- (ASCellNode *)tableView:(ASTableView *)tableView nodeForRowAtIndexPath:(NSIndexPath *)indexPath +{ + VideoModel *videoObject = [_videoFeedData objectAtIndex:indexPath.row]; + VideoContentCell *cellNode = [[VideoContentCell alloc] initWithVideoObject:videoObject]; + return cellNode; +} +@end diff --git a/examples/ASDKTube/Sample/Icons/ico-mute.png b/examples/ASDKTube/Sample/Icons/ico-mute.png new file mode 100644 index 0000000000..1f700e3a5d Binary files /dev/null and b/examples/ASDKTube/Sample/Icons/ico-mute.png differ diff --git a/examples/ASDKTube/Sample/Icons/ico-mute@2x.png b/examples/ASDKTube/Sample/Icons/ico-mute@2x.png new file mode 100644 index 0000000000..025f1386a4 Binary files /dev/null and b/examples/ASDKTube/Sample/Icons/ico-mute@2x.png differ diff --git a/examples/ASDKTube/Sample/Icons/ico-mute@3x.png b/examples/ASDKTube/Sample/Icons/ico-mute@3x.png new file mode 100644 index 0000000000..a4815608b9 Binary files /dev/null and b/examples/ASDKTube/Sample/Icons/ico-mute@3x.png differ diff --git a/examples/ASDKTube/Sample/Icons/ico-unmute.png b/examples/ASDKTube/Sample/Icons/ico-unmute.png new file mode 100644 index 0000000000..52d15943f7 Binary files /dev/null and b/examples/ASDKTube/Sample/Icons/ico-unmute.png differ diff --git a/examples/ASDKTube/Sample/Icons/ico-unmute@2x.png b/examples/ASDKTube/Sample/Icons/ico-unmute@2x.png new file mode 100644 index 0000000000..e671374d47 Binary files /dev/null and b/examples/ASDKTube/Sample/Icons/ico-unmute@2x.png differ diff --git a/examples/ASDKTube/Sample/Icons/ico-unmute@3x.png b/examples/ASDKTube/Sample/Icons/ico-unmute@3x.png new file mode 100644 index 0000000000..2fa2462d98 Binary files /dev/null and b/examples/ASDKTube/Sample/Icons/ico-unmute@3x.png differ diff --git a/examples/ASDKTube/Sample/Info.plist b/examples/ASDKTube/Sample/Info.plist new file mode 100644 index 0000000000..3b4c6c7839 --- /dev/null +++ b/examples/ASDKTube/Sample/Info.plist @@ -0,0 +1,38 @@ + + + + + UIViewControllerBasedStatusBarAppearance + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarStyle + UIStatusBarStyleLightContent + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/examples/ASDKTube/Sample/Models/Utilities.h b/examples/ASDKTube/Sample/Models/Utilities.h new file mode 100644 index 0000000000..9bcb5deee1 --- /dev/null +++ b/examples/ASDKTube/Sample/Models/Utilities.h @@ -0,0 +1,51 @@ +// +// Utilities.h +// Sample +// +// Created by Hannah Troisi on 3/9/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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. +// +#include +@interface UIColor (Additions) + ++ (UIColor *)lighOrangeColor; ++ (UIColor *)darkBlueColor; ++ (UIColor *)lightBlueColor; + +@end + +@interface UIImage (Additions) + ++ (UIImage *)followingButtonStretchableImageForCornerRadius:(CGFloat)cornerRadius following:(BOOL)followingEnabled; ++ (void)downloadImageForURL:(NSURL *)url completion:(void (^)(UIImage *))block; + +- (UIImage *)makeCircularImageWithSize:(CGSize)size; + +@end + +@interface NSString (Additions) + +// returns a user friendly elapsed time such as '50s', '6m' or '3w' ++ (NSString *)elapsedTimeStringSinceDate:(NSString *)uploadDateString; + +@end + +@interface NSAttributedString (Additions) + ++ (NSAttributedString *)attributedStringWithString:(NSString *)string + fontSize:(CGFloat)size + color:(UIColor *)color + firstWordColor:(UIColor *)firstWordColor; + +@end \ No newline at end of file diff --git a/examples/ASDKTube/Sample/Models/Utilities.m b/examples/ASDKTube/Sample/Models/Utilities.m new file mode 100644 index 0000000000..e28bf22736 --- /dev/null +++ b/examples/ASDKTube/Sample/Models/Utilities.m @@ -0,0 +1,241 @@ +// +// Utilities.m +// Sample +// +// Created by Hannah Troisi on 3/9/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "Utilities.h" + +#define StrokeRoundedImages 0 + +@implementation UIColor (Additions) + ++ (UIColor *)lighOrangeColor +{ + return [UIColor colorWithRed:1 green:0.506 blue:0.384 alpha:1]; +} + ++ (UIColor *)darkBlueColor +{ + return [UIColor colorWithRed:70.0/255.0 green:102.0/255.0 blue:118.0/255.0 alpha:1.0]; +} + ++ (UIColor *)lightBlueColor +{ + return [UIColor colorWithRed:70.0/255.0 green:165.0/255.0 blue:196.0/255.0 alpha:1.0]; +} + +@end + +@implementation UIImage (Additions) + ++ (UIImage *)followingButtonStretchableImageForCornerRadius:(CGFloat)cornerRadius following:(BOOL)followingEnabled +{ + CGSize unstretchedSize = CGSizeMake(2 * cornerRadius + 1, 2 * cornerRadius + 1); + CGRect rect = (CGRect) {CGPointZero, unstretchedSize}; + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius]; + + // create a graphics context for the following status button + UIGraphicsBeginImageContextWithOptions(unstretchedSize, NO, 0); + + [path addClip]; + + if (followingEnabled) { + + [[UIColor whiteColor] setFill]; + [path fill]; + + path.lineWidth = 3; + [[UIColor lightBlueColor] setStroke]; + [path stroke]; + + } else { + + [[UIColor lightBlueColor] setFill]; + [path fill]; + } + + UIImage *followingBtnImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + UIImage *followingBtnImageStretchable = [followingBtnImage stretchableImageWithLeftCapWidth:cornerRadius + topCapHeight:cornerRadius]; + return followingBtnImageStretchable; +} + ++ (void)downloadImageForURL:(NSURL *)url completion:(void (^)(UIImage *))block +{ + static NSCache *simpleImageCache = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + simpleImageCache = [[NSCache alloc] init]; + simpleImageCache.countLimit = 10; + }); + + if (!block) { + return; + } + + // check if image is cached + UIImage *image = [simpleImageCache objectForKey:url]; + if (image) { + dispatch_async(dispatch_get_main_queue(), ^{ + block(image); + }); + } else { + // else download image + NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration ephemeralSessionConfiguration]]; + NSURLSessionDataTask *task = [session dataTaskWithURL:url completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { + if (data) { + UIImage *image = [UIImage imageWithData:data]; + dispatch_async(dispatch_get_main_queue(), ^{ + block(image); + }); + } + }]; + [task resume]; + } +} + +- (UIImage *)makeCircularImageWithSize:(CGSize)size +{ + // make a CGRect with the image's size + CGRect circleRect = (CGRect) {CGPointZero, size}; + + // begin the image context since we're not in a drawRect: + UIGraphicsBeginImageContextWithOptions(circleRect.size, NO, 0); + + // create a UIBezierPath circle + UIBezierPath *circle = [UIBezierPath bezierPathWithRoundedRect:circleRect cornerRadius:circleRect.size.width/2]; + + // clip to the circle + [circle addClip]; + + // draw the image in the circleRect *AFTER* the context is clipped + [self drawInRect:circleRect]; + + // create a border (for white background pictures) +#if StrokeRoundedImages + circle.lineWidth = 1; + [[UIColor darkGrayColor] set]; + [circle stroke]; +#endif + + // get an image from the image context + UIImage *roundedImage = UIGraphicsGetImageFromCurrentImageContext(); + + // end the image context since we're not in a drawRect: + UIGraphicsEndImageContext(); + + return roundedImage; +} + +@end + +@implementation NSString (Additions) + +// Returns a user-visible date time string that corresponds to the +// specified RFC 3339 date time string. Note that this does not handle +// all possible RFC 3339 date time strings, just one of the most common +// styles. ++ (NSDate *)userVisibleDateTimeStringForRFC3339DateTimeString:(NSString *)rfc3339DateTimeString +{ + NSDateFormatter * rfc3339DateFormatter; + NSLocale * enUSPOSIXLocale; + + // Convert the RFC 3339 date time string to an NSDate. + + rfc3339DateFormatter = [[NSDateFormatter alloc] init]; + + enUSPOSIXLocale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"]; + + [rfc3339DateFormatter setLocale:enUSPOSIXLocale]; + [rfc3339DateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ssZ'"]; + [rfc3339DateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; + + return [rfc3339DateFormatter dateFromString:rfc3339DateTimeString]; +} + ++ (NSString *)elapsedTimeStringSinceDate:(NSString *)uploadDateString +{ + // early return if no post date string + if (!uploadDateString) + { + return @"NO POST DATE"; + } + + NSDate *postDate = [self userVisibleDateTimeStringForRFC3339DateTimeString:uploadDateString]; + + if (!postDate) { + return @"DATE CONVERSION ERROR"; + } + + NSDate *currentDate = [NSDate date]; + + NSCalendar *calendar = [NSCalendar currentCalendar]; + + NSUInteger seconds = [[calendar components:NSCalendarUnitSecond fromDate:postDate toDate:currentDate options:0] second]; + NSUInteger minutes = [[calendar components:NSCalendarUnitMinute fromDate:postDate toDate:currentDate options:0] minute]; + NSUInteger hours = [[calendar components:NSCalendarUnitHour fromDate:postDate toDate:currentDate options:0] hour]; + NSUInteger days = [[calendar components:NSCalendarUnitDay fromDate:postDate toDate:currentDate options:0] day]; + + NSString *elapsedTime; + + if (days > 7) { + elapsedTime = [NSString stringWithFormat:@"%luw", (long)ceil(days/7.0)]; + } else if (days > 0) { + elapsedTime = [NSString stringWithFormat:@"%lud", (long)days]; + } else if (hours > 0) { + elapsedTime = [NSString stringWithFormat:@"%luh", (long)hours]; + } else if (minutes > 0) { + elapsedTime = [NSString stringWithFormat:@"%lum", (long)minutes]; + } else if (seconds > 0) { + elapsedTime = [NSString stringWithFormat:@"%lus", (long)seconds]; + } else if (seconds == 0) { + elapsedTime = @"1s"; + } else { + elapsedTime = @"ERROR"; + } + + return elapsedTime; +} + +@end + +@implementation NSAttributedString (Additions) + ++ (NSAttributedString *)attributedStringWithString:(NSString *)string fontSize:(CGFloat)size + color:(nullable UIColor *)color firstWordColor:(nullable UIColor *)firstWordColor +{ + NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init]; + + if (string) { + NSDictionary *attributes = @{NSForegroundColorAttributeName: color ? : [UIColor blackColor], + NSFontAttributeName: [UIFont systemFontOfSize:size]}; + attributedString = [[NSMutableAttributedString alloc] initWithString:string]; + [attributedString addAttributes:attributes range:NSMakeRange(0, string.length)]; + + if (firstWordColor) { + NSRange firstSpaceRange = [string rangeOfCharacterFromSet:[NSCharacterSet whitespaceCharacterSet]]; + NSRange firstWordRange = NSMakeRange(0, firstSpaceRange.location); + [attributedString addAttribute:NSForegroundColorAttributeName value:firstWordColor range:firstWordRange]; + } + } + + return attributedString; +} + +@end diff --git a/examples/ASDKTube/Sample/Models/VideoModel.h b/examples/ASDKTube/Sample/Models/VideoModel.h new file mode 100644 index 0000000000..11efb81ef2 --- /dev/null +++ b/examples/ASDKTube/Sample/Models/VideoModel.h @@ -0,0 +1,27 @@ +// +// VideoModel.h +// Sample +// +// Created by Erekle on 5/14/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface VideoModel : NSObject +@property (nonatomic, strong, readonly) NSString* title; +@property (nonatomic, strong, readonly) NSURL *url; +@property (nonatomic, strong, readonly) NSString *userName; +@property (nonatomic, strong, readonly) NSURL *avatarUrl; +@end diff --git a/examples/ASDKTube/Sample/Models/VideoModel.m b/examples/ASDKTube/Sample/Models/VideoModel.m new file mode 100644 index 0000000000..2db920f179 --- /dev/null +++ b/examples/ASDKTube/Sample/Models/VideoModel.m @@ -0,0 +1,38 @@ +// +// VideoModel.m +// Sample +// +// Created by Erekle on 5/14/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "VideoModel.h" + +@implementation VideoModel +- (instancetype)init +{ + self = [super init]; + if (self) { + NSString *videoUrlString = @"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-3045b261-7e93-4492-b7e5-5d6358376c9f-editedLiveAndDie.mov"; + NSString *avatarUrlString = [NSString stringWithFormat:@"https://api.adorable.io/avatars/50/%@",[[NSProcessInfo processInfo] globallyUniqueString]]; + + _title = @"Demo title"; + _url = [NSURL URLWithString:videoUrlString]; + _userName = @"Random User"; + _avatarUrl = [NSURL URLWithString:avatarUrlString]; + } + + return self; +} +@end diff --git a/examples/ASDKTube/Sample/Nodes/VideoContentCell.h b/examples/ASDKTube/Sample/Nodes/VideoContentCell.h new file mode 100644 index 0000000000..598f8f9950 --- /dev/null +++ b/examples/ASDKTube/Sample/Nodes/VideoContentCell.h @@ -0,0 +1,25 @@ +// +// VideoContentCell.h +// Sample +// +// Created by Erekle on 5/14/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 +#import "VideoModel.h" + +@interface VideoContentCell : ASCellNode +- (instancetype)initWithVideoObject:(VideoModel *)video; +@end diff --git a/examples/ASDKTube/Sample/Nodes/VideoContentCell.m b/examples/ASDKTube/Sample/Nodes/VideoContentCell.m new file mode 100644 index 0000000000..34e16b5e83 --- /dev/null +++ b/examples/ASDKTube/Sample/Nodes/VideoContentCell.m @@ -0,0 +1,228 @@ +// +// VideoContentCell.m +// Sample +// +// Created by Erekle on 5/14/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "VideoContentCell.h" +#import "ASVideoPlayerNode.h" +#import "Utilities.h" + +#define AVATAR_IMAGE_HEIGHT 30 +#define HORIZONTAL_BUFFER 10 +#define VERTICAL_BUFFER 5 + +@interface VideoContentCell () + +@end + +@implementation VideoContentCell +{ + VideoModel *_videoModel; + ASTextNode *_titleNode; + ASNetworkImageNode *_avatarNode; + ASVideoPlayerNode *_videoPlayerNode; + ASControlNode *_likeButtonNode; + ASButtonNode *_muteButtonNode; +} + +- (instancetype)initWithVideoObject:(VideoModel *)video +{ + self = [super init]; + if (self) { + _videoModel = video; + + _titleNode = [[ASTextNode alloc] init]; + _titleNode.attributedText = [[NSAttributedString alloc] initWithString:_videoModel.title attributes:[self titleNodeStringOptions]]; + _titleNode.flexGrow = YES; + [self addSubnode:_titleNode]; + + _avatarNode = [[ASNetworkImageNode alloc] init]; + _avatarNode.URL = _videoModel.avatarUrl; + + [_avatarNode setImageModificationBlock:^UIImage *(UIImage *image) { + CGSize profileImageSize = CGSizeMake(AVATAR_IMAGE_HEIGHT, AVATAR_IMAGE_HEIGHT); + return [image makeCircularImageWithSize:profileImageSize]; + }]; + + [self addSubnode:_avatarNode]; + + _likeButtonNode = [[ASControlNode alloc] init]; + _likeButtonNode.backgroundColor = [UIColor redColor]; + [self addSubnode:_likeButtonNode]; + + _muteButtonNode = [[ASButtonNode alloc] init]; + _muteButtonNode.preferredFrameSize = CGSizeMake(16.0, 22.0); + [_muteButtonNode addTarget:self action:@selector(didTapMuteButton) forControlEvents:ASControlNodeEventTouchUpInside]; + + _videoPlayerNode = [[ASVideoPlayerNode alloc] initWithUrl:_videoModel.url loadAssetWhenNodeBecomesVisible:YES]; + _videoPlayerNode.delegate = self; + _videoPlayerNode.backgroundColor = [UIColor blackColor]; + [self addSubnode:_videoPlayerNode]; + + [self setMuteButtonIcon]; + } + return self; +} + +- (NSDictionary*)titleNodeStringOptions +{ + return @{ + NSFontAttributeName : [UIFont systemFontOfSize:14.0], + NSForegroundColorAttributeName: [UIColor blackColor] + }; +} + +- (ASLayoutSpec*)layoutSpecThatFits:(ASSizeRange)constrainedSize +{ + CGFloat fullWidth = [UIScreen mainScreen].bounds.size.width; + _videoPlayerNode.preferredFrameSize = CGSizeMake(fullWidth, fullWidth * 9 / 16); + _avatarNode.preferredFrameSize = CGSizeMake(AVATAR_IMAGE_HEIGHT, AVATAR_IMAGE_HEIGHT); + _likeButtonNode.preferredFrameSize = CGSizeMake(50.0, 26.0); + + ASStackLayoutSpec *headerStack = [ASStackLayoutSpec horizontalStackLayoutSpec]; + headerStack.spacing = HORIZONTAL_BUFFER; + headerStack.alignItems = ASStackLayoutAlignItemsCenter; + [headerStack setChildren:@[ _avatarNode, _titleNode]]; + + UIEdgeInsets headerInsets = UIEdgeInsetsMake(HORIZONTAL_BUFFER, HORIZONTAL_BUFFER, HORIZONTAL_BUFFER, HORIZONTAL_BUFFER); + ASInsetLayoutSpec *headerInset = [ASInsetLayoutSpec insetLayoutSpecWithInsets:headerInsets child:headerStack]; + + ASStackLayoutSpec *bottomControlsStack = [ASStackLayoutSpec horizontalStackLayoutSpec]; + bottomControlsStack.spacing = HORIZONTAL_BUFFER; + bottomControlsStack.alignItems = ASStackLayoutAlignItemsCenter; + [bottomControlsStack setChildren:@[ _likeButtonNode]]; + + UIEdgeInsets bottomControlsInsets = UIEdgeInsetsMake(HORIZONTAL_BUFFER, HORIZONTAL_BUFFER, HORIZONTAL_BUFFER, HORIZONTAL_BUFFER); + ASInsetLayoutSpec *bottomControlsInset = [ASInsetLayoutSpec insetLayoutSpecWithInsets:bottomControlsInsets child:bottomControlsStack]; + + + ASStackLayoutSpec *verticalStack = [ASStackLayoutSpec verticalStackLayoutSpec]; + verticalStack.alignItems = ASStackLayoutAlignItemsStretch; + [verticalStack setChildren:@[ headerInset, _videoPlayerNode, bottomControlsInset ]]; + return verticalStack; +} + +- (void)setMuteButtonIcon +{ + if (_videoPlayerNode.muted) { + [_muteButtonNode setImage:[UIImage imageNamed:@"ico-mute"] forState:ASControlStateNormal]; + } else { + [_muteButtonNode setImage:[UIImage imageNamed:@"ico-unmute"] forState:ASControlStateNormal]; + } +} + +- (void)didTapMuteButton +{ + _videoPlayerNode.muted = !_videoPlayerNode.muted; + [self setMuteButtonIcon]; +} + +#pragma mark - ASVideoPlayerNodeDelegate +- (void)didTapVideoPlayerNode:(ASVideoPlayerNode *)videoPlayer +{ + if (_videoPlayerNode.playerState == ASVideoNodePlayerStatePlaying) { + NSLog(@"TRANSITION"); + _videoPlayerNode.controlsDisabled = !_videoPlayerNode.controlsDisabled; + [_videoPlayerNode pause]; + } else { + [_videoPlayerNode play]; + } +} + +- (NSDictionary *)videoPlayerNodeCustomControls:(ASVideoPlayerNode *)videoPlayer +{ + return @{ + @"muteControl" : _muteButtonNode + }; +} + +- (NSArray *)controlsForControlBar:(NSDictionary *)availableControls +{ + NSMutableArray *controls = [[NSMutableArray alloc] init]; + + if (availableControls[ @(ASVideoPlayerNodeControlTypePlaybackButton) ]) { + [controls addObject:availableControls[ @(ASVideoPlayerNodeControlTypePlaybackButton) ]]; + } + + if (availableControls[ @(ASVideoPlayerNodeControlTypeElapsedText) ]) { + [controls addObject:availableControls[ @(ASVideoPlayerNodeControlTypeElapsedText) ]]; + } + + if (availableControls[ @(ASVideoPlayerNodeControlTypeScrubber) ]) { + [controls addObject:availableControls[ @(ASVideoPlayerNodeControlTypeScrubber) ]]; + } + + if (availableControls[ @(ASVideoPlayerNodeControlTypeDurationText) ]) { + [controls addObject:availableControls[ @(ASVideoPlayerNodeControlTypeDurationText) ]]; + } + + return controls; +} + +#pragma mark - Layout +- (ASLayoutSpec*)videoPlayerNodeLayoutSpec:(ASVideoPlayerNode *)videoPlayer forControls:(NSDictionary *)controls forMaximumSize:(CGSize)maxSize +{ + ASLayoutSpec *spacer = [[ASLayoutSpec alloc] init]; + spacer.flexGrow = YES; + + UIEdgeInsets insets = UIEdgeInsetsMake(10.0, 10.0, 10.0, 10.0); + + if (controls[ @(ASVideoPlayerNodeControlTypeScrubber) ]) { + ASDisplayNode *scrubber = controls[ @(ASVideoPlayerNodeControlTypeScrubber) ]; + scrubber.preferredFrameSize = CGSizeMake(maxSize.width, 44.0); + } + + NSArray *controlBarControls = [self controlsForControlBar:controls]; + NSMutableArray *topBarControls = [[NSMutableArray alloc] init]; + + //Our custom control + if (controls[@"muteControl"]) { + [topBarControls addObject:controls[@"muteControl"]]; + } + + + ASStackLayoutSpec *topBarSpec = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal + spacing:10.0 + justifyContent:ASStackLayoutJustifyContentStart + alignItems:ASStackLayoutAlignItemsCenter + children:topBarControls]; + + ASInsetLayoutSpec *topBarInsetSpec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:topBarSpec]; + + ASStackLayoutSpec *controlbarSpec = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal + spacing:10.0 + justifyContent:ASStackLayoutJustifyContentStart + alignItems:ASStackLayoutAlignItemsCenter + children: controlBarControls ]; + controlbarSpec.alignSelf = ASStackLayoutAlignSelfStretch; + + + + ASInsetLayoutSpec *controlbarInsetSpec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:controlbarSpec]; + + controlbarInsetSpec.alignSelf = ASStackLayoutAlignSelfStretch; + + ASStackLayoutSpec *mainVerticalStack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical + spacing:0.0 + justifyContent:ASStackLayoutJustifyContentStart + alignItems:ASStackLayoutAlignItemsStart + children:@[topBarInsetSpec, spacer, controlbarInsetSpec]]; + + return mainVerticalStack; + +} +@end diff --git a/examples/ASDKTube/Sample/ViewController.h b/examples/ASDKTube/Sample/ViewController.h new file mode 100644 index 0000000000..db689fe324 --- /dev/null +++ b/examples/ASDKTube/Sample/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface ViewController : ASViewController + +@end diff --git a/examples/ASDKTube/Sample/ViewController.m b/examples/ASDKTube/Sample/ViewController.m new file mode 100644 index 0000000000..2480c3d407 --- /dev/null +++ b/examples/ASDKTube/Sample/ViewController.m @@ -0,0 +1,219 @@ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 +#import +#import "VideoModel.h" +#import "VideoContentCell.h" + +@interface ViewController() +@property (nonatomic, strong) ASVideoPlayerNode *videoPlayerNode; +@end + +@implementation ViewController +{ + ASTableNode *_tableNode; + NSMutableArray *_videoFeedData; +} + +- (instancetype)init +{ + _tableNode = [[ASTableNode alloc] init]; + _tableNode.delegate = self; + _tableNode.dataSource = self; + + if (!(self = [super initWithNode:_tableNode])) { + return nil; + } + + return self; +} + +- (void)loadView +{ + [super loadView]; + + _videoFeedData = [[NSMutableArray alloc] initWithObjects:[[VideoModel alloc] init], [[VideoModel alloc] init], nil]; + + [_tableNode.view reloadData]; +} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + + //[self.view addSubnode:self.videoPlayerNode]; + + //[self.videoPlayerNode setNeedsLayout]; +} + +#pragma mark - ASCollectionDelegate - ASCollectionDataSource +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return _videoFeedData.count; +} + +- (ASCellNode *)tableView:(ASTableView *)tableView nodeForRowAtIndexPath:(NSIndexPath *)indexPath +{ + VideoModel *videoObject = [_videoFeedData objectAtIndex:indexPath.row]; + VideoContentCell *cellNode = [[VideoContentCell alloc] initWithVideoObject:videoObject]; + return cellNode; +} + +//- (ASSizeRange)collectionView:(ASCollectionView *)collectionView constrainedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath{ +// CGFloat fullWidth = [UIScreen mainScreen].bounds.size.width; +// return ASSizeRangeMake(CGSizeMake(fullWidth, 0.0), CGSizeMake(fullWidth, 400.0)); +//} + +- (ASVideoPlayerNode *)videoPlayerNode; +{ + if (_videoPlayerNode) { + return _videoPlayerNode; + } + + NSURL *fileUrl = [NSURL URLWithString:@"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-3045b261-7e93-4492-b7e5-5d6358376c9f-editedLiveAndDie.mov"]; + + _videoPlayerNode = [[ASVideoPlayerNode alloc] initWithUrl:fileUrl]; + _videoPlayerNode.delegate = self; +// _videoPlayerNode.disableControls = YES; +// +// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ +// _videoPlayerNode.disableControls = NO; +// }); + + _videoPlayerNode.backgroundColor = [UIColor blackColor]; + + return _videoPlayerNode; +} + +#pragma mark - ASVideoPlayerNodeDelegate +//- (NSArray *)videoPlayerNodeNeededControls:(ASVideoPlayerNode *)videoPlayer +//{ +// return @[ @(ASVideoPlayerNodeControlTypePlaybackButton), +// @(ASVideoPlayerNodeControlTypeElapsedText), +// @(ASVideoPlayerNodeControlTypeScrubber), +// @(ASVideoPlayerNodeControlTypeDurationText) ]; +//} +// +//- (UIColor *)videoPlayerNodeScrubberMaximumTrackTint:(ASVideoPlayerNode *)videoPlayer +//{ +// return [UIColor colorWithRed:1 green:1 blue:1 alpha:0.3]; +//} +// +//- (UIColor *)videoPlayerNodeScrubberMinimumTrackTint:(ASVideoPlayerNode *)videoPlayer +//{ +// return [UIColor whiteColor]; +//} +// +//- (UIColor *)videoPlayerNodeScrubberThumbTint:(ASVideoPlayerNode *)videoPlayer +//{ +// return [UIColor whiteColor]; +//} +// +//- (NSDictionary *)videoPlayerNodeTimeLabelAttributes:(ASVideoPlayerNode *)videoPlayerNode timeLabelType:(ASVideoPlayerNodeControlType)timeLabelType +//{ +// NSDictionary *options; +// +// if (timeLabelType == ASVideoPlayerNodeControlTypeElapsedText) { +// options = @{ +// NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Medium" size:16.0], +// NSForegroundColorAttributeName: [UIColor orangeColor] +// }; +// } else if (timeLabelType == ASVideoPlayerNodeControlTypeDurationText) { +// options = @{ +// NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Medium" size:16.0], +// NSForegroundColorAttributeName: [UIColor redColor] +// }; +// } +// +// return options; +//} + +/*- (ASLayoutSpec *)videoPlayerNodeLayoutSpec:(ASVideoPlayerNode *)videoPlayer + forControls:(NSDictionary *)controls + forConstrainedSize:(ASSizeRange)constrainedSize +{ + + NSMutableArray *bottomControls = [[NSMutableArray alloc] init]; + NSMutableArray *topControls = [[NSMutableArray alloc] init]; + + ASDisplayNode *scrubberNode = controls[@(ASVideoPlayerNodeControlTypeScrubber)]; + ASDisplayNode *playbackButtonNode = controls[@(ASVideoPlayerNodeControlTypePlaybackButton)]; + ASTextNode *elapsedTexNode = controls[@(ASVideoPlayerNodeControlTypeElapsedText)]; + ASTextNode *durationTexNode = controls[@(ASVideoPlayerNodeControlTypeDurationText)]; + + if (playbackButtonNode) { + [bottomControls addObject:playbackButtonNode]; + } + + if (scrubberNode) { + scrubberNode.preferredFrameSize = CGSizeMake(constrainedSize.max.width, 44.0); + [bottomControls addObject:scrubberNode]; + } + + if (elapsedTexNode) { + [topControls addObject:elapsedTexNode]; + } + + if (durationTexNode) { + [topControls addObject:durationTexNode]; + } + + ASLayoutSpec *spacer = [[ASLayoutSpec alloc] init]; + spacer.flexGrow = YES; + + ASStackLayoutSpec *topBarSpec = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal + spacing:10.0 + justifyContent:ASStackLayoutJustifyContentCenter + alignItems:ASStackLayoutAlignItemsCenter + children:topControls]; + + + + UIEdgeInsets topBarSpecInsets = UIEdgeInsetsMake(20.0, 10.0, 0.0, 10.0); + + ASInsetLayoutSpec *topBarSpecInsetSpec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:topBarSpecInsets child:topBarSpec]; + topBarSpecInsetSpec.alignSelf = ASStackLayoutAlignSelfStretch; + + ASStackLayoutSpec *controlbarSpec = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal + spacing:10.0 + justifyContent:ASStackLayoutJustifyContentStart + alignItems:ASStackLayoutAlignItemsCenter + children:bottomControls]; + controlbarSpec.alignSelf = ASStackLayoutAlignSelfStretch; + + UIEdgeInsets insets = UIEdgeInsetsMake(10.0, 10.0, 10.0, 10.0); + + ASInsetLayoutSpec *controlbarInsetSpec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:controlbarSpec]; + + controlbarInsetSpec.alignSelf = ASStackLayoutAlignSelfStretch; + + ASStackLayoutSpec *mainVerticalStack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical + spacing:0.0 + justifyContent:ASStackLayoutJustifyContentStart + alignItems:ASStackLayoutAlignItemsStart + children:@[ topBarSpecInsetSpec, spacer, controlbarInsetSpec ]]; + + + return mainVerticalStack; +}*/ + +@end \ No newline at end of file diff --git a/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.h b/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.h new file mode 100644 index 0000000000..51c3bc26ef --- /dev/null +++ b/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.h @@ -0,0 +1,24 @@ +// +// WindowWithStatusBarUnderlay.h +// Sample +// +// Created by Hannah Troisi on 4/10/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface WindowWithStatusBarUnderlay : UIWindow + +@end diff --git a/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.m b/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.m new file mode 100644 index 0000000000..d153a30cea --- /dev/null +++ b/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.m @@ -0,0 +1,50 @@ +// +// WindowWithStatusBarUnderlay.m +// Sample +// +// Created by Erekle on 5/15/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "WindowWithStatusBarUnderlay.h" +#import "Utilities.h" + +@implementation WindowWithStatusBarUnderlay +{ + UIView *_statusBarOpaqueUnderlayView; +} + +-(instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + _statusBarOpaqueUnderlayView = [[UIView alloc] init]; + _statusBarOpaqueUnderlayView.backgroundColor = [UIColor lighOrangeColor]; + [self addSubview:_statusBarOpaqueUnderlayView]; + } + return self; +} + +-(void)layoutSubviews +{ + [super layoutSubviews]; + + [self bringSubviewToFront:_statusBarOpaqueUnderlayView]; + + CGRect statusBarFrame = CGRectZero; + statusBarFrame.size.width = [[UIScreen mainScreen] bounds].size.width; + statusBarFrame.size.height = [[UIApplication sharedApplication] statusBarFrame].size.height; + _statusBarOpaqueUnderlayView.frame = statusBarFrame; +} +@end diff --git a/examples/ASDKTube/Sample/main.m b/examples/ASDKTube/Sample/main.m new file mode 100644 index 0000000000..756080fb2b --- /dev/null +++ b/examples/ASDKTube/Sample/main.m @@ -0,0 +1,26 @@ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/examples/ASDKgram/Podfile b/examples/ASDKgram/Podfile index 6c012e3c04..5c30ce798e 100644 --- a/examples/ASDKgram/Podfile +++ b/examples/ASDKgram/Podfile @@ -1,3 +1,6 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end + diff --git a/examples/ASDKgram/Sample.xcodeproj/project.pbxproj b/examples/ASDKgram/Sample.xcodeproj/project.pbxproj index b9241d31c6..b736656a9c 100644 --- a/examples/ASDKgram/Sample.xcodeproj/project.pbxproj +++ b/examples/ASDKgram/Sample.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 0585428019D4DBE100606EA6 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */; }; - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; 76229A781CBB79E000B62CEF /* WindowWithStatusBarUnderlay.m in Sources */ = {isa = PBXBuildFile; fileRef = 76229A771CBB79E000B62CEF /* WindowWithStatusBarUnderlay.m */; }; @@ -31,12 +30,12 @@ 768843921CAA37EF00D8629E /* PhotoFeedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7688437A1CAA37EF00D8629E /* PhotoFeedViewController.m */; }; 768843931CAA37EF00D8629E /* UserModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 7688437B1CAA37EF00D8629E /* UserModel.m */; }; 768843961CAA37EF00D8629E /* Utilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 7688437E1CAA37EF00D8629E /* Utilities.m */; }; + B13424EE6D36C2EC5D1030B6 /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AD5DDA0A29B0F32AA5CC47BA /* libPods-Sample.a */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; 05E2128119D4DB510098F589 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; @@ -79,7 +78,9 @@ 7688437B1CAA37EF00D8629E /* UserModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = UserModel.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 7688437E1CAA37EF00D8629E /* Utilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = Utilities.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 7688437F1CAA37EF00D8629E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + 97A9B1BAF4265967672F9EA3 /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; + AD5DDA0A29B0F32AA5CC47BA /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + D09B5DF0BFB37583DE8F3142 /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -87,7 +88,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */, + B13424EE6D36C2EC5D1030B6 /* libPods-Sample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -149,6 +150,7 @@ isa = PBXGroup; children = ( 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */, + AD5DDA0A29B0F32AA5CC47BA /* libPods-Sample.a */, ); name = Frameworks; sourceTree = ""; @@ -156,8 +158,8 @@ 1AE410B73DA5C3BD087ACDD7 /* Pods */ = { isa = PBXGroup; children = ( - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */, - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */, + 97A9B1BAF4265967672F9EA3 /* Pods-Sample.debug.xcconfig */, + D09B5DF0BFB37583DE8F3142 /* Pods-Sample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -252,12 +254,12 @@ isa = PBXNativeTarget; buildConfigurationList = 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */; buildPhases = ( - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */, + E080B80F89C34A25B3488E26 /* πŸ“¦ Check Pods Manifest.lock */, 05E2127D19D4DB510098F589 /* Sources */, 05E2127E19D4DB510098F589 /* Frameworks */, 05E2127F19D4DB510098F589 /* Resources */, - F012A6F39E0149F18F564F50 /* Copy Pods Resources */, - 06770D39D4186D6446B1BDD5 /* Embed Pods Frameworks */, + F012A6F39E0149F18F564F50 /* πŸ“¦ Copy Pods Resources */, + 06770D39D4186D6446B1BDD5 /* πŸ“¦ Embed Pods Frameworks */, ); buildRules = ( ); @@ -279,7 +281,6 @@ TargetAttributes = { 05E2128019D4DB510098F589 = { CreatedOnToolsVersion = 6.0.1; - DevelopmentTeam = X7PHB3A2FT; }; }; }; @@ -317,29 +318,29 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 06770D39D4186D6446B1BDD5 /* Embed Pods Frameworks */ = { + 06770D39D4186D6446B1BDD5 /* πŸ“¦ Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Embed Pods Frameworks"; + name = "πŸ“¦ Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */ = { + E080B80F89C34A25B3488E26 /* πŸ“¦ Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "πŸ“¦ Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -347,19 +348,19 @@ 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; }; - F012A6F39E0149F18F564F50 /* Copy Pods Resources */ = { + F012A6F39E0149F18F564F50 /* πŸ“¦ Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "πŸ“¦ Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -472,7 +473,7 @@ }; 05E212A519D4DB510098F589 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */; + baseConfigurationReference = 97A9B1BAF4265967672F9EA3 /* Pods-Sample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; @@ -491,7 +492,7 @@ }; 05E212A619D4DB510098F589 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */; + baseConfigurationReference = D09B5DF0BFB37583DE8F3142 /* Pods-Sample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; diff --git a/examples/ASDKgram/Sample/AppDelegate.h b/examples/ASDKgram/Sample/AppDelegate.h index 5c687c3f27..cd0d7065ab 100644 --- a/examples/ASDKgram/Sample/AppDelegate.h +++ b/examples/ASDKgram/Sample/AppDelegate.h @@ -1,9 +1,20 @@ // // AppDelegate.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/16/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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. // @protocol PhotoFeedControllerProtocol diff --git a/examples/ASDKgram/Sample/AppDelegate.m b/examples/ASDKgram/Sample/AppDelegate.m index 0796a1b00d..fe04d8e776 100644 --- a/examples/ASDKgram/Sample/AppDelegate.m +++ b/examples/ASDKgram/Sample/AppDelegate.m @@ -1,9 +1,20 @@ // // AppDelegate.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/16/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/ASDKgram/Sample/CommentFeedModel.h b/examples/ASDKgram/Sample/CommentFeedModel.h index adfd4206c2..6ab0bcd940 100644 --- a/examples/ASDKgram/Sample/CommentFeedModel.h +++ b/examples/ASDKgram/Sample/CommentFeedModel.h @@ -1,9 +1,20 @@ // // CommentFeedModel.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/9/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "CommentModel.h" diff --git a/examples/ASDKgram/Sample/CommentFeedModel.m b/examples/ASDKgram/Sample/CommentFeedModel.m index 257154f6f2..0ffc8152b3 100644 --- a/examples/ASDKgram/Sample/CommentFeedModel.m +++ b/examples/ASDKgram/Sample/CommentFeedModel.m @@ -1,9 +1,20 @@ // // CommentFeedModel.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/9/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "CommentFeedModel.h" diff --git a/examples/ASDKgram/Sample/CommentModel.h b/examples/ASDKgram/Sample/CommentModel.h index f102cfb008..aaef86329f 100644 --- a/examples/ASDKgram/Sample/CommentModel.h +++ b/examples/ASDKgram/Sample/CommentModel.h @@ -1,9 +1,20 @@ // // CommentModel.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/9/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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. // @interface CommentModel : NSObject diff --git a/examples/ASDKgram/Sample/CommentModel.m b/examples/ASDKgram/Sample/CommentModel.m index 7b9a41d675..e400a53383 100644 --- a/examples/ASDKgram/Sample/CommentModel.m +++ b/examples/ASDKgram/Sample/CommentModel.m @@ -1,9 +1,20 @@ // // CommentModel.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/9/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "CommentModel.h" diff --git a/examples/ASDKgram/Sample/CommentView.h b/examples/ASDKgram/Sample/CommentView.h index c17b2a402d..fdb2e8048d 100644 --- a/examples/ASDKgram/Sample/CommentView.h +++ b/examples/ASDKgram/Sample/CommentView.h @@ -1,9 +1,20 @@ // // CommentView.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/9/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "CommentFeedModel.h" diff --git a/examples/ASDKgram/Sample/CommentView.m b/examples/ASDKgram/Sample/CommentView.m index bf82e70f05..a463ac981f 100644 --- a/examples/ASDKgram/Sample/CommentView.m +++ b/examples/ASDKgram/Sample/CommentView.m @@ -1,9 +1,20 @@ // // CommentView.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/9/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "CommentView.h" diff --git a/examples/ASDKgram/Sample/CommentsNode.h b/examples/ASDKgram/Sample/CommentsNode.h index 62ebd92ead..3b0bbff424 100644 --- a/examples/ASDKgram/Sample/CommentsNode.h +++ b/examples/ASDKgram/Sample/CommentsNode.h @@ -1,9 +1,20 @@ // // CommentsNode.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/21/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/ASDKgram/Sample/CommentsNode.m b/examples/ASDKgram/Sample/CommentsNode.m index 86d164eae8..56471877ce 100644 --- a/examples/ASDKgram/Sample/CommentsNode.m +++ b/examples/ASDKgram/Sample/CommentsNode.m @@ -1,9 +1,20 @@ // // CommentsNode.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/21/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "CommentsNode.h" diff --git a/examples/ASDKgram/Sample/ImageURLModel.h b/examples/ASDKgram/Sample/ImageURLModel.h index a0a8296680..9c167fed2f 100644 --- a/examples/ASDKgram/Sample/ImageURLModel.h +++ b/examples/ASDKgram/Sample/ImageURLModel.h @@ -1,9 +1,20 @@ // // ImageURLModel.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/11/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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. // @interface ImageURLModel : NSObject diff --git a/examples/ASDKgram/Sample/ImageURLModel.m b/examples/ASDKgram/Sample/ImageURLModel.m index 18cd6729ad..776ee31777 100644 --- a/examples/ASDKgram/Sample/ImageURLModel.m +++ b/examples/ASDKgram/Sample/ImageURLModel.m @@ -1,9 +1,20 @@ // // ImageURLModel.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/11/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ImageURLModel.h" diff --git a/examples/ASDKgram/Sample/LocationModel.h b/examples/ASDKgram/Sample/LocationModel.h index cdc7cbd7a1..eec1caa841 100644 --- a/examples/ASDKgram/Sample/LocationModel.h +++ b/examples/ASDKgram/Sample/LocationModel.h @@ -1,9 +1,20 @@ // // LocationModel.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/26/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "CoreLocation/CoreLocation.h" diff --git a/examples/ASDKgram/Sample/LocationModel.m b/examples/ASDKgram/Sample/LocationModel.m index ed1fc28449..2b825e7b49 100644 --- a/examples/ASDKgram/Sample/LocationModel.m +++ b/examples/ASDKgram/Sample/LocationModel.m @@ -1,9 +1,20 @@ // // LocationModel.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/26/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "LocationModel.h" diff --git a/examples/ASDKgram/Sample/PhotoCellNode.h b/examples/ASDKgram/Sample/PhotoCellNode.h index 058fd812c3..a68465cfef 100644 --- a/examples/ASDKgram/Sample/PhotoCellNode.h +++ b/examples/ASDKgram/Sample/PhotoCellNode.h @@ -1,9 +1,20 @@ // // PhotoCellNode.h -// Flickrgram +// Sample // // Created by Hannah Troisi on 2/17/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/ASDKgram/Sample/PhotoCellNode.m b/examples/ASDKgram/Sample/PhotoCellNode.m index 6c030a2917..fa6cde9e09 100644 --- a/examples/ASDKgram/Sample/PhotoCellNode.m +++ b/examples/ASDKgram/Sample/PhotoCellNode.m @@ -1,9 +1,20 @@ // // PhotoCellNode.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/17/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PhotoCellNode.h" diff --git a/examples/ASDKgram/Sample/PhotoCollectionViewCell.h b/examples/ASDKgram/Sample/PhotoCollectionViewCell.h index 2a3d5268c4..717f575609 100644 --- a/examples/ASDKgram/Sample/PhotoCollectionViewCell.h +++ b/examples/ASDKgram/Sample/PhotoCollectionViewCell.h @@ -1,9 +1,20 @@ // // PhotoCollectionViewCell.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/2/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PhotoModel.h" diff --git a/examples/ASDKgram/Sample/PhotoCollectionViewCell.m b/examples/ASDKgram/Sample/PhotoCollectionViewCell.m index 0d5d746a17..3f9dfe8d27 100644 --- a/examples/ASDKgram/Sample/PhotoCollectionViewCell.m +++ b/examples/ASDKgram/Sample/PhotoCollectionViewCell.m @@ -1,9 +1,20 @@ // // PhotoCollectionViewCell.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/2/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PhotoCollectionViewCell.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedModel.h b/examples/ASDKgram/Sample/PhotoFeedModel.h index f2bb4bbbc2..b0d937013b 100644 --- a/examples/ASDKgram/Sample/PhotoFeedModel.h +++ b/examples/ASDKgram/Sample/PhotoFeedModel.h @@ -1,9 +1,20 @@ // // PhotoFeedModel.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/28/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PhotoModel.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedModel.m b/examples/ASDKgram/Sample/PhotoFeedModel.m index fb98b15316..7fb661205f 100644 --- a/examples/ASDKgram/Sample/PhotoFeedModel.m +++ b/examples/ASDKgram/Sample/PhotoFeedModel.m @@ -1,9 +1,20 @@ // // PhotoFeedModel.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/28/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PhotoFeedModel.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedNodeController.h b/examples/ASDKgram/Sample/PhotoFeedNodeController.h index a0e72c1ae4..04c9aa896c 100644 --- a/examples/ASDKgram/Sample/PhotoFeedNodeController.h +++ b/examples/ASDKgram/Sample/PhotoFeedNodeController.h @@ -1,9 +1,20 @@ // // PhotoFeedNodeController.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/17/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/ASDKgram/Sample/PhotoFeedNodeController.m b/examples/ASDKgram/Sample/PhotoFeedNodeController.m index 4eb9247bc9..f99e6356d2 100644 --- a/examples/ASDKgram/Sample/PhotoFeedNodeController.m +++ b/examples/ASDKgram/Sample/PhotoFeedNodeController.m @@ -1,9 +1,20 @@ // // PhotoFeedNodeController.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/17/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PhotoFeedNodeController.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedViewController.h b/examples/ASDKgram/Sample/PhotoFeedViewController.h index 053812ed63..3942ec5c27 100644 --- a/examples/ASDKgram/Sample/PhotoFeedViewController.h +++ b/examples/ASDKgram/Sample/PhotoFeedViewController.h @@ -1,9 +1,20 @@ // // PhotoFeedViewController.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/17/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/ASDKgram/Sample/PhotoFeedViewController.m b/examples/ASDKgram/Sample/PhotoFeedViewController.m index 1336ea5fe1..ddaf2a7cf9 100644 --- a/examples/ASDKgram/Sample/PhotoFeedViewController.m +++ b/examples/ASDKgram/Sample/PhotoFeedViewController.m @@ -1,9 +1,20 @@ // // PhotoFeedViewController.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/17/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PhotoFeedViewController.h" diff --git a/examples/ASDKgram/Sample/PhotoModel.h b/examples/ASDKgram/Sample/PhotoModel.h index d89c688fca..bfa9f944e7 100644 --- a/examples/ASDKgram/Sample/PhotoModel.h +++ b/examples/ASDKgram/Sample/PhotoModel.h @@ -1,9 +1,20 @@ // // PhotoModel.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/26/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "CoreGraphics/CoreGraphics.h" diff --git a/examples/ASDKgram/Sample/PhotoModel.m b/examples/ASDKgram/Sample/PhotoModel.m index b05005c5e0..db424b8232 100644 --- a/examples/ASDKgram/Sample/PhotoModel.m +++ b/examples/ASDKgram/Sample/PhotoModel.m @@ -1,9 +1,20 @@ // // PhotoModel.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/26/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PhotoModel.h" diff --git a/examples/ASDKgram/Sample/PhotoTableViewCell.h b/examples/ASDKgram/Sample/PhotoTableViewCell.h index c464f99630..713a3044db 100644 --- a/examples/ASDKgram/Sample/PhotoTableViewCell.h +++ b/examples/ASDKgram/Sample/PhotoTableViewCell.h @@ -1,9 +1,20 @@ // // PhotoTableViewCell.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/17/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/ASDKgram/Sample/PhotoTableViewCell.m b/examples/ASDKgram/Sample/PhotoTableViewCell.m index a96883dffb..f51a625983 100644 --- a/examples/ASDKgram/Sample/PhotoTableViewCell.m +++ b/examples/ASDKgram/Sample/PhotoTableViewCell.m @@ -1,9 +1,20 @@ // // PhotoTableViewCell.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/17/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PhotoTableViewCell.h" diff --git a/examples/ASDKgram/Sample/UserModel.h b/examples/ASDKgram/Sample/UserModel.h index 4190c3612e..777fe8caa7 100644 --- a/examples/ASDKgram/Sample/UserModel.h +++ b/examples/ASDKgram/Sample/UserModel.h @@ -1,9 +1,20 @@ // // UserModel.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/26/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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. // @interface UserModel : NSObject diff --git a/examples/ASDKgram/Sample/UserModel.m b/examples/ASDKgram/Sample/UserModel.m index 01c5acb7fb..5c7cddc1ba 100644 --- a/examples/ASDKgram/Sample/UserModel.m +++ b/examples/ASDKgram/Sample/UserModel.m @@ -1,9 +1,20 @@ // // UserModel.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/26/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "UserModel.h" diff --git a/examples/ASDKgram/Sample/Utilities.h b/examples/ASDKgram/Sample/Utilities.h index ce0c589c50..7e9e16cd08 100644 --- a/examples/ASDKgram/Sample/Utilities.h +++ b/examples/ASDKgram/Sample/Utilities.h @@ -1,9 +1,20 @@ // // Utilities.h -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/9/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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. // @interface UIColor (Additions) diff --git a/examples/ASDKgram/Sample/Utilities.m b/examples/ASDKgram/Sample/Utilities.m index 9f25c1975b..b5a144a0be 100644 --- a/examples/ASDKgram/Sample/Utilities.m +++ b/examples/ASDKgram/Sample/Utilities.m @@ -1,9 +1,20 @@ // // Utilities.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 3/9/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "Utilities.h" diff --git a/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.h b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.h index bb3af4ce7e..b12509a43b 100644 --- a/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.h +++ b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.h @@ -3,7 +3,18 @@ // Sample // // Created by Hannah Troisi on 4/10/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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. // diff --git a/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m index 3e8f5a46b7..c98fcf4d0e 100644 --- a/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m +++ b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m @@ -3,7 +3,18 @@ // Sample // // Created by Hannah Troisi on 4/10/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "WindowWithStatusBarUnderlay.h" diff --git a/examples/ASDKgram/Sample/main.m b/examples/ASDKgram/Sample/main.m index 97769ec676..89f1d26c20 100644 --- a/examples/ASDKgram/Sample/main.m +++ b/examples/ASDKgram/Sample/main.m @@ -1,8 +1,20 @@ +// // main.m -// ASDKgram +// Sample // // Created by Hannah Troisi on 2/16/16. -// Copyright Β© 2016 Hannah Troisi. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/ASTableViewStressTest/Podfile b/examples/ASTableViewStressTest/Podfile deleted file mode 100644 index 6c012e3c04..0000000000 --- a/examples/ASTableViewStressTest/Podfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' diff --git a/examples/ASTableViewStressTest/Sample/AppDelegate.h b/examples/ASTableViewStressTest/Sample/AppDelegate.h deleted file mode 100644 index 2aa29369b4..0000000000 --- a/examples/ASTableViewStressTest/Sample/AppDelegate.h +++ /dev/null @@ -1,18 +0,0 @@ -/* 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 - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/examples/ASTableViewStressTest/Sample/ViewController.h b/examples/ASTableViewStressTest/Sample/ViewController.h deleted file mode 100644 index d0e9200d88..0000000000 --- a/examples/ASTableViewStressTest/Sample/ViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface ViewController : UIViewController - -@end diff --git a/examples/ASTableViewStressTest/Sample/main.m b/examples/ASTableViewStressTest/Sample/main.m deleted file mode 100644 index ae9488711c..0000000000 --- a/examples/ASTableViewStressTest/Sample/main.m +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/examples/ASViewController/Podfile b/examples/ASViewController/Podfile index 840a147de4..5c30ce798e 100644 --- a/examples/ASViewController/Podfile +++ b/examples/ASViewController/Podfile @@ -1,3 +1,6 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '7.1' -pod 'AsyncDisplayKit', :path => '../..' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end + diff --git a/examples/ASViewController/Sample.xcodeproj/project.pbxproj b/examples/ASViewController/Sample.xcodeproj/project.pbxproj index 93791a8a13..eeef9f4c40 100644 --- a/examples/ASViewController/Sample.xcodeproj/project.pbxproj +++ b/examples/ASViewController/Sample.xcodeproj/project.pbxproj @@ -1,373 +1,833 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 4E2788BC6EBB297F39C668B1 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 653E635B8743333C495A3A2B /* libPods.a */; }; - 694993D21C8B334F00491CA5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 694993D11C8B334F00491CA5 /* main.m */; }; - 694993D51C8B334F00491CA5 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 694993D41C8B334F00491CA5 /* AppDelegate.m */; }; - 694993D81C8B334F00491CA5 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 694993D71C8B334F00491CA5 /* ViewController.m */; }; - 694993DD1C8B334F00491CA5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 694993DC1C8B334F00491CA5 /* Assets.xcassets */; }; - 694993E01C8B334F00491CA5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 694993DE1C8B334F00491CA5 /* LaunchScreen.storyboard */; }; - 69DCA5221C8B3D30006FF548 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 69DCA5211C8B3D30006FF548 /* DetailViewController.m */; }; - 69DCA5251C8BE01F006FF548 /* DetailRootNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 69DCA5241C8BE01F006FF548 /* DetailRootNode.m */; }; - 69DCA5281C8BE031006FF548 /* DetailCellNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 69DCA5271C8BE031006FF548 /* DetailCellNode.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 2F81D9F66E39A2093332B007 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - 653E635B8743333C495A3A2B /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 694993CD1C8B334F00491CA5 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 694993D11C8B334F00491CA5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 694993D31C8B334F00491CA5 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 694993D41C8B334F00491CA5 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 694993D61C8B334F00491CA5 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 694993D71C8B334F00491CA5 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 694993DC1C8B334F00491CA5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 694993DF1C8B334F00491CA5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 694993E11C8B334F00491CA5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 69DCA5201C8B3D30006FF548 /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; }; - 69DCA5211C8B3D30006FF548 /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; - 69DCA5231C8BE01F006FF548 /* DetailRootNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailRootNode.h; sourceTree = ""; }; - 69DCA5241C8BE01F006FF548 /* DetailRootNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailRootNode.m; sourceTree = ""; }; - 69DCA5261C8BE031006FF548 /* DetailCellNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailCellNode.h; sourceTree = ""; }; - 69DCA5271C8BE031006FF548 /* DetailCellNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailCellNode.m; sourceTree = ""; }; - B173413A31BE1896F0666DC6 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 694993CA1C8B334F00491CA5 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4E2788BC6EBB297F39C668B1 /* libPods.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0DFDB4376BA084DAC7C1976E /* Pods */ = { - isa = PBXGroup; - children = ( - B173413A31BE1896F0666DC6 /* Pods.debug.xcconfig */, - 2F81D9F66E39A2093332B007 /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - 478C8D7C412DCBDFE14640D8 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 653E635B8743333C495A3A2B /* libPods.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 694993C41C8B334F00491CA5 = { - isa = PBXGroup; - children = ( - 694993CF1C8B334F00491CA5 /* Sample */, - 694993CE1C8B334F00491CA5 /* Products */, - 0DFDB4376BA084DAC7C1976E /* Pods */, - 478C8D7C412DCBDFE14640D8 /* Frameworks */, - ); - sourceTree = ""; - }; - 694993CE1C8B334F00491CA5 /* Products */ = { - isa = PBXGroup; - children = ( - 694993CD1C8B334F00491CA5 /* Sample.app */, - ); - name = Products; - sourceTree = ""; - }; - 694993CF1C8B334F00491CA5 /* Sample */ = { - isa = PBXGroup; - children = ( - 694993D31C8B334F00491CA5 /* AppDelegate.h */, - 694993D41C8B334F00491CA5 /* AppDelegate.m */, - 694993D61C8B334F00491CA5 /* ViewController.h */, - 694993D71C8B334F00491CA5 /* ViewController.m */, - 69DCA5201C8B3D30006FF548 /* DetailViewController.h */, - 69DCA5211C8B3D30006FF548 /* DetailViewController.m */, - 69DCA5231C8BE01F006FF548 /* DetailRootNode.h */, - 69DCA5241C8BE01F006FF548 /* DetailRootNode.m */, - 69DCA5261C8BE031006FF548 /* DetailCellNode.h */, - 69DCA5271C8BE031006FF548 /* DetailCellNode.m */, - 694993DC1C8B334F00491CA5 /* Assets.xcassets */, - 694993D01C8B334F00491CA5 /* Supporting Files */, - ); - path = Sample; - sourceTree = ""; - }; - 694993D01C8B334F00491CA5 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 694993E11C8B334F00491CA5 /* Info.plist */, - 694993DE1C8B334F00491CA5 /* LaunchScreen.storyboard */, - 694993D11C8B334F00491CA5 /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 694993CC1C8B334F00491CA5 /* Sample */ = { - isa = PBXNativeTarget; - buildConfigurationList = 694993E41C8B334F00491CA5 /* Build configuration list for PBXNativeTarget "Sample" */; - buildPhases = ( - 80035273449C25F4B2E1454F /* Check Pods Manifest.lock */, - 694993C91C8B334F00491CA5 /* Sources */, - 694993CA1C8B334F00491CA5 /* Frameworks */, - 694993CB1C8B334F00491CA5 /* Resources */, - 06EE2E0ABEB6289D4775A867 /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Sample; - productName = Sample; - productReference = 694993CD1C8B334F00491CA5 /* Sample.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 694993C51C8B334F00491CA5 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = AsyncDisplayKit; - TargetAttributes = { - 694993CC1C8B334F00491CA5 = { - CreatedOnToolsVersion = 7.2.1; - }; - }; - }; - buildConfigurationList = 694993C81C8B334F00491CA5 /* Build configuration list for PBXProject "Sample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 694993C41C8B334F00491CA5; - productRefGroup = 694993CE1C8B334F00491CA5 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 694993CC1C8B334F00491CA5 /* Sample */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 694993CB1C8B334F00491CA5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 694993E01C8B334F00491CA5 /* LaunchScreen.storyboard in Resources */, - 694993DD1C8B334F00491CA5 /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 06EE2E0ABEB6289D4775A867 /* 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; - }; - 80035273449C25F4B2E1454F /* 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 */ - 694993C91C8B334F00491CA5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 694993D81C8B334F00491CA5 /* ViewController.m in Sources */, - 694993D51C8B334F00491CA5 /* AppDelegate.m in Sources */, - 694993D21C8B334F00491CA5 /* main.m in Sources */, - 69DCA5221C8B3D30006FF548 /* DetailViewController.m in Sources */, - 69DCA5281C8BE031006FF548 /* DetailCellNode.m in Sources */, - 69DCA5251C8BE01F006FF548 /* DetailRootNode.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 694993DE1C8B334F00491CA5 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 694993DF1C8B334F00491CA5 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 694993E21C8B334F00491CA5 /* 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; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - 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 = 7.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 694993E31C8B334F00491CA5 /* 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 = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - 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 = 7.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 694993E51C8B334F00491CA5 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B173413A31BE1896F0666DC6 /* Pods.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.AsyncDisplayKit.Sample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 694993E61C8B334F00491CA5 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2F81D9F66E39A2093332B007 /* Pods.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.AsyncDisplayKit.Sample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 694993C81C8B334F00491CA5 /* Build configuration list for PBXProject "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 694993E21C8B334F00491CA5 /* Debug */, - 694993E31C8B334F00491CA5 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 694993E41C8B334F00491CA5 /* Build configuration list for PBXNativeTarget "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 694993E51C8B334F00491CA5 /* Debug */, - 694993E61C8B334F00491CA5 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 694993C51C8B334F00491CA5 /* Project object */; -} + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 06EE2E0ABEB6289D4775A867 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" + + showEnvVarsInLog + 0 + + 0DFDB4376BA084DAC7C1976E + + children + + 15AD337503831C4D33FF8B3A + 97482F27BE2F7583EFE1BC2C + + isa + PBXGroup + name + Pods + sourceTree + <group> + + 15AD337503831C4D33FF8B3A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.debug.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig + sourceTree + <group> + + 23FC03B282CBD9014D868DF6 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" + + showEnvVarsInLog + 0 + + 465082D55CCF1B0CB1AEBACC + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-Sample.a + sourceTree + BUILT_PRODUCTS_DIR + + 478C8D7C412DCBDFE14640D8 + + children + + 465082D55CCF1B0CB1AEBACC + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 5CF3EF5E344946731D4F13F2 + + fileRef + 465082D55CCF1B0CB1AEBACC + isa + PBXBuildFile + + 694993C41C8B334F00491CA5 + + children + + 694993CF1C8B334F00491CA5 + 694993CE1C8B334F00491CA5 + 0DFDB4376BA084DAC7C1976E + 478C8D7C412DCBDFE14640D8 + + isa + PBXGroup + sourceTree + <group> + + 694993C51C8B334F00491CA5 + + attributes + + LastUpgradeCheck + 0720 + ORGANIZATIONNAME + AsyncDisplayKit + TargetAttributes + + 694993CC1C8B334F00491CA5 + + CreatedOnToolsVersion + 7.2.1 + + + + buildConfigurationList + 694993C81C8B334F00491CA5 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + 694993C41C8B334F00491CA5 + productRefGroup + 694993CE1C8B334F00491CA5 + projectDirPath + + projectReferences + + projectRoot + + targets + + 694993CC1C8B334F00491CA5 + + + 694993C81C8B334F00491CA5 + + buildConfigurations + + 694993E21C8B334F00491CA5 + 694993E31C8B334F00491CA5 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 694993C91C8B334F00491CA5 + + buildActionMask + 2147483647 + files + + 694993D81C8B334F00491CA5 + 694993D51C8B334F00491CA5 + 694993D21C8B334F00491CA5 + 69DCA5221C8B3D30006FF548 + 69DCA5281C8BE031006FF548 + 69DCA5251C8BE01F006FF548 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 694993CA1C8B334F00491CA5 + + buildActionMask + 2147483647 + files + + 5CF3EF5E344946731D4F13F2 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 694993CB1C8B334F00491CA5 + + buildActionMask + 2147483647 + files + + 694993E01C8B334F00491CA5 + 694993DD1C8B334F00491CA5 + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 694993CC1C8B334F00491CA5 + + buildConfigurationList + 694993E41C8B334F00491CA5 + buildPhases + + 80035273449C25F4B2E1454F + 694993C91C8B334F00491CA5 + 694993CA1C8B334F00491CA5 + 694993CB1C8B334F00491CA5 + 06EE2E0ABEB6289D4775A867 + 23FC03B282CBD9014D868DF6 + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Sample + productName + Sample + productReference + 694993CD1C8B334F00491CA5 + productType + com.apple.product-type.application + + 694993CD1C8B334F00491CA5 + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + Sample.app + sourceTree + BUILT_PRODUCTS_DIR + + 694993CE1C8B334F00491CA5 + + children + + 694993CD1C8B334F00491CA5 + + isa + PBXGroup + name + Products + sourceTree + <group> + + 694993CF1C8B334F00491CA5 + + children + + 694993D31C8B334F00491CA5 + 694993D41C8B334F00491CA5 + 694993D61C8B334F00491CA5 + 694993D71C8B334F00491CA5 + 69DCA5201C8B3D30006FF548 + 69DCA5211C8B3D30006FF548 + 69DCA5231C8BE01F006FF548 + 69DCA5241C8BE01F006FF548 + 69DCA5261C8BE031006FF548 + 69DCA5271C8BE031006FF548 + 694993DC1C8B334F00491CA5 + 694993D01C8B334F00491CA5 + + isa + PBXGroup + path + Sample + sourceTree + <group> + + 694993D01C8B334F00491CA5 + + children + + 694993E11C8B334F00491CA5 + 694993DE1C8B334F00491CA5 + 694993D11C8B334F00491CA5 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + 694993D11C8B334F00491CA5 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + 694993D21C8B334F00491CA5 + + fileRef + 694993D11C8B334F00491CA5 + isa + PBXBuildFile + + 694993D31C8B334F00491CA5 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AppDelegate.h + sourceTree + <group> + + 694993D41C8B334F00491CA5 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AppDelegate.m + sourceTree + <group> + + 694993D51C8B334F00491CA5 + + fileRef + 694993D41C8B334F00491CA5 + isa + PBXBuildFile + + 694993D61C8B334F00491CA5 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ViewController.h + sourceTree + <group> + + 694993D71C8B334F00491CA5 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ViewController.m + sourceTree + <group> + + 694993D81C8B334F00491CA5 + + fileRef + 694993D71C8B334F00491CA5 + isa + PBXBuildFile + + 694993DC1C8B334F00491CA5 + + isa + PBXFileReference + lastKnownFileType + folder.assetcatalog + path + Assets.xcassets + sourceTree + <group> + + 694993DD1C8B334F00491CA5 + + fileRef + 694993DC1C8B334F00491CA5 + isa + PBXBuildFile + + 694993DE1C8B334F00491CA5 + + children + + 694993DF1C8B334F00491CA5 + + isa + PBXVariantGroup + name + LaunchScreen.storyboard + sourceTree + <group> + + 694993DF1C8B334F00491CA5 + + isa + PBXFileReference + lastKnownFileType + file.storyboard + name + Base + path + Base.lproj/LaunchScreen.storyboard + sourceTree + <group> + + 694993E01C8B334F00491CA5 + + fileRef + 694993DE1C8B334F00491CA5 + isa + PBXBuildFile + + 694993E11C8B334F00491CA5 + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Info.plist + sourceTree + <group> + + 694993E21C8B334F00491CA5 + + 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 + DEBUG_INFORMATION_FORMAT + dwarf + ENABLE_STRICT_OBJC_MSGSEND + YES + ENABLE_TESTABILITY + YES + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_DYNAMIC_NO_PIC + NO + GCC_NO_COMMON_BLOCKS + YES + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + 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 + 7.0 + MTL_ENABLE_DEBUG_INFO + YES + ONLY_ACTIVE_ARCH + YES + SDKROOT + iphoneos + + isa + XCBuildConfiguration + name + Debug + + 694993E31C8B334F00491CA5 + + 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 + DEBUG_INFORMATION_FORMAT + dwarf-with-dsym + ENABLE_NS_ASSERTIONS + NO + ENABLE_STRICT_OBJC_MSGSEND + YES + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_NO_COMMON_BLOCKS + YES + 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 + 7.0 + MTL_ENABLE_DEBUG_INFO + NO + SDKROOT + iphoneos + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 694993E41C8B334F00491CA5 + + buildConfigurations + + 694993E51C8B334F00491CA5 + 694993E61C8B334F00491CA5 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 694993E51C8B334F00491CA5 + + baseConfigurationReference + 15AD337503831C4D33FF8B3A + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_BUNDLE_IDENTIFIER + org.AsyncDisplayKit.Sample + PRODUCT_NAME + $(TARGET_NAME) + + isa + XCBuildConfiguration + name + Debug + + 694993E61C8B334F00491CA5 + + baseConfigurationReference + 97482F27BE2F7583EFE1BC2C + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_BUNDLE_IDENTIFIER + org.AsyncDisplayKit.Sample + PRODUCT_NAME + $(TARGET_NAME) + + isa + XCBuildConfiguration + name + Release + + 69DCA5201C8B3D30006FF548 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + DetailViewController.h + sourceTree + <group> + + 69DCA5211C8B3D30006FF548 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + DetailViewController.m + sourceTree + <group> + + 69DCA5221C8B3D30006FF548 + + fileRef + 69DCA5211C8B3D30006FF548 + isa + PBXBuildFile + + 69DCA5231C8BE01F006FF548 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + DetailRootNode.h + sourceTree + <group> + + 69DCA5241C8BE01F006FF548 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + DetailRootNode.m + sourceTree + <group> + + 69DCA5251C8BE01F006FF548 + + fileRef + 69DCA5241C8BE01F006FF548 + isa + PBXBuildFile + + 69DCA5261C8BE031006FF548 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + DetailCellNode.h + sourceTree + <group> + + 69DCA5271C8BE031006FF548 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + DetailCellNode.m + sourceTree + <group> + + 69DCA5281C8BE031006FF548 + + fileRef + 69DCA5271C8BE031006FF548 + isa + PBXBuildFile + + 80035273449C25F4B2E1454F + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + 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 + + showEnvVarsInLog + 0 + + 97482F27BE2F7583EFE1BC2C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + + + rootObject + 694993C51C8B334F00491CA5 + + diff --git a/examples/ASViewController/Sample/AppDelegate.h b/examples/ASViewController/Sample/AppDelegate.h index db4bc0a921..4591d34854 100644 --- a/examples/ASViewController/Sample/AppDelegate.h +++ b/examples/ASViewController/Sample/AppDelegate.h @@ -1,13 +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. - */ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/ASViewController/Sample/AppDelegate.m b/examples/ASViewController/Sample/AppDelegate.m index 82398fb14a..8e3f33a9dc 100644 --- a/examples/ASViewController/Sample/AppDelegate.m +++ b/examples/ASViewController/Sample/AppDelegate.m @@ -1,13 +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. - */ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/ASViewController/Sample/DetailCellNode.h b/examples/ASViewController/Sample/DetailCellNode.h index b3a1a15214..4331025c34 100644 --- a/examples/ASViewController/Sample/DetailCellNode.h +++ b/examples/ASViewController/Sample/DetailCellNode.h @@ -1,13 +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. - */ +// +// DetailCellNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ASCellNode.h" diff --git a/examples/ASViewController/Sample/DetailCellNode.m b/examples/ASViewController/Sample/DetailCellNode.m index a5e99653ea..47016ab8b6 100644 --- a/examples/ASViewController/Sample/DetailCellNode.m +++ b/examples/ASViewController/Sample/DetailCellNode.m @@ -1,13 +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. - */ +// +// DetailCellNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "DetailCellNode.h" #import diff --git a/examples/ASViewController/Sample/DetailRootNode.h b/examples/ASViewController/Sample/DetailRootNode.h index 35b87f4cef..fb34ae0ae4 100644 --- a/examples/ASViewController/Sample/DetailRootNode.h +++ b/examples/ASViewController/Sample/DetailRootNode.h @@ -1,13 +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. - */ +// +// DetailRootNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ASDisplayNode.h" diff --git a/examples/ASViewController/Sample/DetailRootNode.m b/examples/ASViewController/Sample/DetailRootNode.m index 7dec4b9534..6a6573762a 100644 --- a/examples/ASViewController/Sample/DetailRootNode.m +++ b/examples/ASViewController/Sample/DetailRootNode.m @@ -1,13 +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. - */ +// +// DetailRootNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "DetailRootNode.h" #import diff --git a/examples/ASViewController/Sample/DetailViewController.h b/examples/ASViewController/Sample/DetailViewController.h index b0a02976b6..9ad5a4a58b 100644 --- a/examples/ASViewController/Sample/DetailViewController.h +++ b/examples/ASViewController/Sample/DetailViewController.h @@ -1,13 +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. - */ +// +// DetailViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ASViewController.h" #import "DetailRootNode.h" diff --git a/examples/ASViewController/Sample/DetailViewController.m b/examples/ASViewController/Sample/DetailViewController.m index 9a6577eb0b..6b6b1a902b 100644 --- a/examples/ASViewController/Sample/DetailViewController.m +++ b/examples/ASViewController/Sample/DetailViewController.m @@ -1,13 +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. - */ +// +// DetailViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "DetailViewController.h" #import diff --git a/examples/ASViewController/Sample/ViewController.h b/examples/ASViewController/Sample/ViewController.h index ae8047d1f9..9ece2de58d 100644 --- a/examples/ASViewController/Sample/ViewController.h +++ b/examples/ASViewController/Sample/ViewController.h @@ -1,13 +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. - */ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 #import diff --git a/examples/ASViewController/Sample/ViewController.m b/examples/ASViewController/Sample/ViewController.m index 09d16e9f0b..0ac2f56136 100644 --- a/examples/ASViewController/Sample/ViewController.m +++ b/examples/ASViewController/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ASTableNode.h" diff --git a/examples/ASViewController/Sample/main.m b/examples/ASViewController/Sample/main.m index 6559d60028..791ef4b743 100644 --- a/examples/ASViewController/Sample/main.m +++ b/examples/ASViewController/Sample/main.m @@ -1,13 +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. - */ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 #import "AppDelegate.h" diff --git a/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.h b/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.h new file mode 100644 index 0000000000..b7889999d5 --- /dev/null +++ b/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.h @@ -0,0 +1,28 @@ +// +// AppDelegate.h +// Sample +// +// Created by Garrett Moon on 3/22/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.m b/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.m new file mode 100644 index 0000000000..ae73c318d9 --- /dev/null +++ b/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.m @@ -0,0 +1,34 @@ +// +// AppDelegate.m +// Sample +// +// Created by Garrett Moon on 3/22/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + +@end diff --git a/examples/ASAnimatedImage/ASAnimatedImage/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/AnimatedGIF/ASAnimatedImage/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from examples/ASAnimatedImage/ASAnimatedImage/Assets.xcassets/AppIcon.appiconset/Contents.json rename to examples/AnimatedGIF/ASAnimatedImage/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/examples/ASAnimatedImage/ASAnimatedImage/Base.lproj/LaunchScreen.storyboard b/examples/AnimatedGIF/ASAnimatedImage/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from examples/ASAnimatedImage/ASAnimatedImage/Base.lproj/LaunchScreen.storyboard rename to examples/AnimatedGIF/ASAnimatedImage/Base.lproj/LaunchScreen.storyboard diff --git a/examples/ASAnimatedImage/ASAnimatedImage/Base.lproj/Main.storyboard b/examples/AnimatedGIF/ASAnimatedImage/Base.lproj/Main.storyboard similarity index 100% rename from examples/ASAnimatedImage/ASAnimatedImage/Base.lproj/Main.storyboard rename to examples/AnimatedGIF/ASAnimatedImage/Base.lproj/Main.storyboard diff --git a/examples/ASAnimatedImage/ASAnimatedImage/Info.plist b/examples/AnimatedGIF/ASAnimatedImage/Info.plist similarity index 100% rename from examples/ASAnimatedImage/ASAnimatedImage/Info.plist rename to examples/AnimatedGIF/ASAnimatedImage/Info.plist diff --git a/examples/AnimatedGIF/ASAnimatedImage/ViewController.h b/examples/AnimatedGIF/ASAnimatedImage/ViewController.h new file mode 100644 index 0000000000..73a4c39a3d --- /dev/null +++ b/examples/AnimatedGIF/ASAnimatedImage/ViewController.h @@ -0,0 +1,26 @@ +// +// ViewController.h +// Sample +// +// Created by Garrett Moon on 3/22/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface ViewController : UIViewController + + +@end + diff --git a/examples/ASAnimatedImage/ASAnimatedImage/ViewController.m b/examples/AnimatedGIF/ASAnimatedImage/ViewController.m similarity index 50% rename from examples/ASAnimatedImage/ASAnimatedImage/ViewController.m rename to examples/AnimatedGIF/ASAnimatedImage/ViewController.m index 9087dfdd5d..90d88fbe27 100644 --- a/examples/ASAnimatedImage/ASAnimatedImage/ViewController.m +++ b/examples/AnimatedGIF/ASAnimatedImage/ViewController.m @@ -1,9 +1,20 @@ // // ViewController.m -// ASAnimatedImage +// Sample // // Created by Garrett Moon on 3/22/16. -// Copyright Β© 2016 Facebook, Inc. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" @@ -29,9 +40,4 @@ [self.view addSubnode:imageNode]; } -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - @end diff --git a/examples/AnimatedGIF/ASAnimatedImage/main.m b/examples/AnimatedGIF/ASAnimatedImage/main.m new file mode 100644 index 0000000000..a07ed9d945 --- /dev/null +++ b/examples/AnimatedGIF/ASAnimatedImage/main.m @@ -0,0 +1,27 @@ +// +// main.m +// Sample +// +// Created by Garrett Moon on 3/22/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/examples/CollectionViewWithViewControllerCells/Podfile b/examples/AnimatedGIF/Podfile similarity index 51% rename from examples/CollectionViewWithViewControllerCells/Podfile rename to examples/AnimatedGIF/Podfile index 6c012e3c04..7a8d8c1a00 100644 --- a/examples/CollectionViewWithViewControllerCells/Podfile +++ b/examples/AnimatedGIF/Podfile @@ -1,3 +1,6 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end + diff --git a/examples/AnimatedGIF/Sample.xcodeproj/project.pbxproj b/examples/AnimatedGIF/Sample.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..c413c9b029 --- /dev/null +++ b/examples/AnimatedGIF/Sample.xcodeproj/project.pbxproj @@ -0,0 +1,794 @@ + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 26A96BEEF893B1FA39F144CF + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" + + showEnvVarsInLog + 0 + + 26E3F7C63D79A1F47BEF1AA2 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-Sample.a + sourceTree + BUILT_PRODUCTS_DIR + + 2ADE0E7B5309A9CD043DDB3E + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" + + showEnvVarsInLog + 0 + + 683ADB951CA19883005863A4 + + children + + 683ADBA01CA19883005863A4 + 683ADB9F1CA19883005863A4 + 71A772B0DB9B7760CE330DD9 + 8C6AC07DE55B51935C632F56 + + isa + PBXGroup + sourceTree + <group> + + 683ADB961CA19883005863A4 + + attributes + + LastUpgradeCheck + 0720 + ORGANIZATIONNAME + Facebook, Inc. + TargetAttributes + + 683ADB9D1CA19883005863A4 + + CreatedOnToolsVersion + 7.2 + + + + buildConfigurationList + 683ADB991CA19883005863A4 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + 683ADB951CA19883005863A4 + productRefGroup + 683ADB9F1CA19883005863A4 + projectDirPath + + projectReferences + + projectRoot + + targets + + 683ADB9D1CA19883005863A4 + + + 683ADB991CA19883005863A4 + + buildConfigurations + + 683ADBB31CA19883005863A4 + 683ADBB41CA19883005863A4 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 683ADB9A1CA19883005863A4 + + buildActionMask + 2147483647 + files + + 683ADBA91CA19883005863A4 + 683ADBA61CA19883005863A4 + 683ADBA31CA19883005863A4 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 683ADB9B1CA19883005863A4 + + buildActionMask + 2147483647 + files + + 9AE987532BDC7AC1FD693515 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 683ADB9C1CA19883005863A4 + + buildActionMask + 2147483647 + files + + 683ADBB11CA19883005863A4 + 683ADBAE1CA19883005863A4 + 683ADBAC1CA19883005863A4 + DE5187DA1CD9AA2A00EC11DE + DE5187D91CD9AA2A00EC11DE + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 683ADB9D1CA19883005863A4 + + buildConfigurationList + 683ADBB51CA19883005863A4 + buildPhases + + 694B306B43ED1C3916B0D909 + 683ADB9A1CA19883005863A4 + 683ADB9B1CA19883005863A4 + 683ADB9C1CA19883005863A4 + 26A96BEEF893B1FA39F144CF + 2ADE0E7B5309A9CD043DDB3E + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Sample + productName + ASAnimatedImage + productReference + 683ADB9E1CA19883005863A4 + productType + com.apple.product-type.application + + 683ADB9E1CA19883005863A4 + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + Sample.app + sourceTree + BUILT_PRODUCTS_DIR + + 683ADB9F1CA19883005863A4 + + children + + 683ADB9E1CA19883005863A4 + + isa + PBXGroup + name + Products + sourceTree + <group> + + 683ADBA01CA19883005863A4 + + children + + 683ADBA41CA19883005863A4 + 683ADBA51CA19883005863A4 + 683ADBA71CA19883005863A4 + 683ADBA81CA19883005863A4 + 683ADBAA1CA19883005863A4 + 683ADBAD1CA19883005863A4 + 683ADBAF1CA19883005863A4 + 683ADBB21CA19883005863A4 + 683ADBA11CA19883005863A4 + + isa + PBXGroup + path + ASAnimatedImage + sourceTree + <group> + + 683ADBA11CA19883005863A4 + + children + + 683ADBA21CA19883005863A4 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + 683ADBA21CA19883005863A4 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + 683ADBA31CA19883005863A4 + + fileRef + 683ADBA21CA19883005863A4 + isa + PBXBuildFile + + 683ADBA41CA19883005863A4 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AppDelegate.h + sourceTree + <group> + + 683ADBA51CA19883005863A4 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AppDelegate.m + sourceTree + <group> + + 683ADBA61CA19883005863A4 + + fileRef + 683ADBA51CA19883005863A4 + isa + PBXBuildFile + + 683ADBA71CA19883005863A4 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ViewController.h + sourceTree + <group> + + 683ADBA81CA19883005863A4 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ViewController.m + sourceTree + <group> + + 683ADBA91CA19883005863A4 + + fileRef + 683ADBA81CA19883005863A4 + isa + PBXBuildFile + + 683ADBAA1CA19883005863A4 + + children + + 683ADBAB1CA19883005863A4 + + isa + PBXVariantGroup + name + Main.storyboard + sourceTree + <group> + + 683ADBAB1CA19883005863A4 + + isa + PBXFileReference + lastKnownFileType + file.storyboard + name + Base + path + Base.lproj/Main.storyboard + sourceTree + <group> + + 683ADBAC1CA19883005863A4 + + fileRef + 683ADBAA1CA19883005863A4 + isa + PBXBuildFile + + 683ADBAD1CA19883005863A4 + + isa + PBXFileReference + lastKnownFileType + folder.assetcatalog + path + Assets.xcassets + sourceTree + <group> + + 683ADBAE1CA19883005863A4 + + fileRef + 683ADBAD1CA19883005863A4 + isa + PBXBuildFile + + 683ADBAF1CA19883005863A4 + + children + + 683ADBB01CA19883005863A4 + + isa + PBXVariantGroup + name + LaunchScreen.storyboard + sourceTree + <group> + + 683ADBB01CA19883005863A4 + + isa + PBXFileReference + lastKnownFileType + file.storyboard + name + Base + path + Base.lproj/LaunchScreen.storyboard + sourceTree + <group> + + 683ADBB11CA19883005863A4 + + fileRef + 683ADBAF1CA19883005863A4 + isa + PBXBuildFile + + 683ADBB21CA19883005863A4 + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Info.plist + sourceTree + <group> + + 683ADBB31CA19883005863A4 + + 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 + DEBUG_INFORMATION_FORMAT + dwarf + ENABLE_STRICT_OBJC_MSGSEND + YES + ENABLE_TESTABILITY + YES + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_DYNAMIC_NO_PIC + NO + GCC_NO_COMMON_BLOCKS + YES + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + 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 + 9.2 + MTL_ENABLE_DEBUG_INFO + YES + ONLY_ACTIVE_ARCH + YES + SDKROOT + iphoneos + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Debug + + 683ADBB41CA19883005863A4 + + 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 + DEBUG_INFORMATION_FORMAT + dwarf-with-dsym + ENABLE_NS_ASSERTIONS + NO + ENABLE_STRICT_OBJC_MSGSEND + YES + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_NO_COMMON_BLOCKS + YES + 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 + 9.2 + MTL_ENABLE_DEBUG_INFO + NO + SDKROOT + iphoneos + TARGETED_DEVICE_FAMILY + 1,2 + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 683ADBB51CA19883005863A4 + + buildConfigurations + + 683ADBB61CA19883005863A4 + 683ADBB71CA19883005863A4 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 683ADBB61CA19883005863A4 + + baseConfigurationReference + DE5187D71CD9AA2A00EC11DE + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + ASAnimatedImage/Info.plist + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_BUNDLE_IDENTIFIER + com.facebook.AsyncDisplayKit.Sample + PRODUCT_NAME + $(TARGET_NAME) + + isa + XCBuildConfiguration + name + Debug + + 683ADBB71CA19883005863A4 + + baseConfigurationReference + DE5187D81CD9AA2A00EC11DE + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + ASAnimatedImage/Info.plist + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_BUNDLE_IDENTIFIER + com.facebook.AsyncDisplayKit.Sample + PRODUCT_NAME + $(TARGET_NAME) + + isa + XCBuildConfiguration + name + Release + + 694B306B43ED1C3916B0D909 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + 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 + + showEnvVarsInLog + 0 + + 71A772B0DB9B7760CE330DD9 + + children + + DE5187D71CD9AA2A00EC11DE + DE5187D81CD9AA2A00EC11DE + + isa + PBXGroup + name + Pods + sourceTree + <group> + + 8C6AC07DE55B51935C632F56 + + children + + A6F2399FA1A86586D9BDAE05 + 26E3F7C63D79A1F47BEF1AA2 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 9AE987532BDC7AC1FD693515 + + fileRef + 26E3F7C63D79A1F47BEF1AA2 + isa + PBXBuildFile + + A6F2399FA1A86586D9BDAE05 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods.a + sourceTree + BUILT_PRODUCTS_DIR + + DE5187D71CD9AA2A00EC11DE + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.debug.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig + sourceTree + <group> + + DE5187D81CD9AA2A00EC11DE + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + + DE5187D91CD9AA2A00EC11DE + + fileRef + DE5187D71CD9AA2A00EC11DE + isa + PBXBuildFile + + DE5187DA1CD9AA2A00EC11DE + + fileRef + DE5187D81CD9AA2A00EC11DE + isa + PBXBuildFile + + + rootObject + 683ADB961CA19883005863A4 + + diff --git a/examples/ASAnimatedImage/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/AnimatedGIF/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/ASAnimatedImage/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to examples/AnimatedGIF/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/examples/ASAnimatedImage/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples/AnimatedGIF/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme similarity index 88% rename from examples/ASAnimatedImage/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme rename to examples/AnimatedGIF/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme index 16cb2bd07c..002b3cdc4e 100644 --- a/examples/ASAnimatedImage/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme +++ b/examples/AnimatedGIF/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme @@ -15,8 +15,8 @@ @@ -33,8 +33,8 @@ @@ -56,8 +56,8 @@ @@ -75,8 +75,8 @@ diff --git a/examples/AsyncDisplayKitOverview/Podfile b/examples/AsyncDisplayKitOverview/Podfile new file mode 100644 index 0000000000..e3b2757ef6 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Podfile @@ -0,0 +1,10 @@ +# Uncomment this line to define a global platform for your project +platform :ios, '7.0' + +# Uncomment this line if you're using Swift +# use_frameworks! + +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end + diff --git a/examples/AsyncDisplayKitOverview/Sample.xcodeproj/project.pbxproj b/examples/AsyncDisplayKitOverview/Sample.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..5872950ccd --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample.xcodeproj/project.pbxproj @@ -0,0 +1,409 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 697216351CCD8FB300122312 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 697216341CCD8FB300122312 /* main.m */; }; + 697216381CCD8FB300122312 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 697216371CCD8FB300122312 /* AppDelegate.m */; }; + 697216401CCD8FB300122312 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6972163F1CCD8FB300122312 /* Assets.xcassets */; }; + 697216431CCD8FB300122312 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 697216411CCD8FB300122312 /* LaunchScreen.storyboard */; }; + 6972164E1CCD938A00122312 /* OverviewComponentsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6972164B1CCD938A00122312 /* OverviewComponentsViewController.m */; }; + 6972164F1CCD938A00122312 /* OverviewDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6972164D1CCD938A00122312 /* OverviewDetailViewController.m */; }; + 697216571CCD939000122312 /* OverviewASCollectionNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 697216521CCD939000122312 /* OverviewASCollectionNode.m */; }; + 697216581CCD939000122312 /* OverviewASPagerNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 697216541CCD939000122312 /* OverviewASPagerNode.m */; }; + 697216591CCD939000122312 /* OverviewASTableNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 697216561CCD939000122312 /* OverviewASTableNode.m */; }; + D06F1FFA9226EAB58D090CD4 /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 70BE04668F29651A74A0DDDC /* libPods-Sample.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 697216301CCD8FB300122312 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 697216341CCD8FB300122312 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 697216361CCD8FB300122312 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 697216371CCD8FB300122312 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 6972163F1CCD8FB300122312 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 697216421CCD8FB300122312 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 697216441CCD8FB300122312 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6972164A1CCD938A00122312 /* OverviewComponentsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverviewComponentsViewController.h; sourceTree = ""; }; + 6972164B1CCD938A00122312 /* OverviewComponentsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OverviewComponentsViewController.m; sourceTree = ""; }; + 6972164C1CCD938A00122312 /* OverviewDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverviewDetailViewController.h; sourceTree = ""; }; + 6972164D1CCD938A00122312 /* OverviewDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OverviewDetailViewController.m; sourceTree = ""; }; + 697216511CCD939000122312 /* OverviewASCollectionNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverviewASCollectionNode.h; sourceTree = ""; }; + 697216521CCD939000122312 /* OverviewASCollectionNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OverviewASCollectionNode.m; sourceTree = ""; }; + 697216531CCD939000122312 /* OverviewASPagerNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverviewASPagerNode.h; sourceTree = ""; }; + 697216541CCD939000122312 /* OverviewASPagerNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OverviewASPagerNode.m; sourceTree = ""; }; + 697216551CCD939000122312 /* OverviewASTableNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverviewASTableNode.h; sourceTree = ""; }; + 697216561CCD939000122312 /* OverviewASTableNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OverviewASTableNode.m; sourceTree = ""; }; + 70BE04668F29651A74A0DDDC /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 77E10F80392B14772BED991F /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; + 9C0C5C6BF9E5B05EEF57DB2A /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6972162D1CCD8FB300122312 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D06F1FFA9226EAB58D090CD4 /* libPods-Sample.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2BEE2DA0B40FBAF7BD30B7C2 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 70BE04668F29651A74A0DDDC /* libPods-Sample.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 697216271CCD8FB300122312 = { + isa = PBXGroup; + children = ( + 697216321CCD8FB300122312 /* Sample */, + 697216311CCD8FB300122312 /* Products */, + 7DAA9CC1331AADE28CA32C05 /* Pods */, + 2BEE2DA0B40FBAF7BD30B7C2 /* Frameworks */, + ); + sourceTree = ""; + }; + 697216311CCD8FB300122312 /* Products */ = { + isa = PBXGroup; + children = ( + 697216301CCD8FB300122312 /* Sample.app */, + ); + name = Products; + sourceTree = ""; + }; + 697216321CCD8FB300122312 /* Sample */ = { + isa = PBXGroup; + children = ( + 697216501CCD939000122312 /* Node Containers */, + 697216361CCD8FB300122312 /* AppDelegate.h */, + 697216371CCD8FB300122312 /* AppDelegate.m */, + 6972164A1CCD938A00122312 /* OverviewComponentsViewController.h */, + 6972164B1CCD938A00122312 /* OverviewComponentsViewController.m */, + 6972164C1CCD938A00122312 /* OverviewDetailViewController.h */, + 6972164D1CCD938A00122312 /* OverviewDetailViewController.m */, + 6972163F1CCD8FB300122312 /* Assets.xcassets */, + 697216411CCD8FB300122312 /* LaunchScreen.storyboard */, + 697216441CCD8FB300122312 /* Info.plist */, + 697216331CCD8FB300122312 /* Supporting Files */, + ); + path = Sample; + sourceTree = ""; + }; + 697216331CCD8FB300122312 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 697216341CCD8FB300122312 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 697216501CCD939000122312 /* Node Containers */ = { + isa = PBXGroup; + children = ( + 697216511CCD939000122312 /* OverviewASCollectionNode.h */, + 697216521CCD939000122312 /* OverviewASCollectionNode.m */, + 697216531CCD939000122312 /* OverviewASPagerNode.h */, + 697216541CCD939000122312 /* OverviewASPagerNode.m */, + 697216551CCD939000122312 /* OverviewASTableNode.h */, + 697216561CCD939000122312 /* OverviewASTableNode.m */, + ); + path = "Node Containers"; + sourceTree = ""; + }; + 7DAA9CC1331AADE28CA32C05 /* Pods */ = { + isa = PBXGroup; + children = ( + 77E10F80392B14772BED991F /* Pods-Sample.debug.xcconfig */, + 9C0C5C6BF9E5B05EEF57DB2A /* Pods-Sample.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6972162F1CCD8FB300122312 /* Sample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 697216471CCD8FB300122312 /* Build configuration list for PBXNativeTarget "Sample" */; + buildPhases = ( + 78A0D09A94A74B3737920EA7 /* Check Pods Manifest.lock */, + 6972162C1CCD8FB300122312 /* Sources */, + 6972162D1CCD8FB300122312 /* Frameworks */, + 6972162E1CCD8FB300122312 /* Resources */, + 267658CA53A0F4A2D24A8438 /* Embed Pods Frameworks */, + 84F93825AFB1CA7FBB116BA4 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Sample; + productName = Sample; + productReference = 697216301CCD8FB300122312 /* Sample.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 697216281CCD8FB300122312 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0730; + ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 6972162F1CCD8FB300122312 = { + CreatedOnToolsVersion = 7.3; + }; + }; + }; + buildConfigurationList = 6972162B1CCD8FB300122312 /* Build configuration list for PBXProject "Sample" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 697216271CCD8FB300122312; + productRefGroup = 697216311CCD8FB300122312 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6972162F1CCD8FB300122312 /* Sample */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6972162E1CCD8FB300122312 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 697216431CCD8FB300122312 /* LaunchScreen.storyboard in Resources */, + 697216401CCD8FB300122312 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 267658CA53A0F4A2D24A8438 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 78A0D09A94A74B3737920EA7 /* 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; + }; + 84F93825AFB1CA7FBB116BA4 /* 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-Sample/Pods-Sample-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6972162C1CCD8FB300122312 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 697216581CCD939000122312 /* OverviewASPagerNode.m in Sources */, + 697216381CCD8FB300122312 /* AppDelegate.m in Sources */, + 697216351CCD8FB300122312 /* main.m in Sources */, + 697216571CCD939000122312 /* OverviewASCollectionNode.m in Sources */, + 697216591CCD939000122312 /* OverviewASTableNode.m in Sources */, + 6972164F1CCD938A00122312 /* OverviewDetailViewController.m in Sources */, + 6972164E1CCD938A00122312 /* OverviewComponentsViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 697216411CCD8FB300122312 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 697216421CCD8FB300122312 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 697216451CCD8FB300122312 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + 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; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + 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 = 9.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 697216461CCD8FB300122312 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + 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; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + 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 = 9.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 697216481CCD8FB300122312 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 77E10F80392B14772BED991F /* Pods-Sample.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = Sample/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.AsyncDisplayKit.Sample; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 697216491CCD8FB300122312 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9C0C5C6BF9E5B05EEF57DB2A /* Pods-Sample.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = Sample/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.AsyncDisplayKit.Sample; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6972162B1CCD8FB300122312 /* Build configuration list for PBXProject "Sample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 697216451CCD8FB300122312 /* Debug */, + 697216461CCD8FB300122312 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 697216471CCD8FB300122312 /* Build configuration list for PBXNativeTarget "Sample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 697216481CCD8FB300122312 /* Debug */, + 697216491CCD8FB300122312 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 697216281CCD8FB300122312 /* Project object */; +} diff --git a/examples/BackgroundPropertySetting/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/AsyncDisplayKitOverview/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/BackgroundPropertySetting/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to examples/AsyncDisplayKitOverview/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/examples/AsyncDisplayKitOverview/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples/AsyncDisplayKitOverview/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme new file mode 100644 index 0000000000..18b29fc007 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/AsyncDisplayKitOverview/Sample/AppDelegate.h b/examples/AsyncDisplayKitOverview/Sample/AppDelegate.h new file mode 100644 index 0000000000..c77e4095e2 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/AppDelegate.h @@ -0,0 +1,28 @@ +// +// AppDelegate.h +// Sample +// +// Created by Michael Schneider on 4/24/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/examples/AsyncDisplayKitOverview/Sample/AppDelegate.m b/examples/AsyncDisplayKitOverview/Sample/AppDelegate.m new file mode 100644 index 0000000000..ae97a27ae5 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/AppDelegate.m @@ -0,0 +1,43 @@ +// +// AppDelegate.m +// Sample +// +// Created by Michael Schneider on 4/24/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "OverviewComponentsViewController.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[OverviewComponentsViewController new]]; + self.window.backgroundColor = [UIColor whiteColor]; + [self.window makeKeyAndVisible]; + + [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:47/255.0 green:184/255.0 blue:253/255.0 alpha:1.0]]; + [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; + [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];; + + return YES; +} + +@end diff --git a/examples/AsyncDisplayKitOverview/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/AsyncDisplayKitOverview/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..eeea76c2db --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,73 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/AsyncDisplayKitOverview/Sample/Assets.xcassets/Contents.json b/examples/AsyncDisplayKitOverview/Sample/Assets.xcassets/Contents.json new file mode 100644 index 0000000000..da4a164c91 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/AsyncDisplayKitOverview/Sample/Assets.xcassets/image.imageset/Contents.json b/examples/AsyncDisplayKitOverview/Sample/Assets.xcassets/image.imageset/Contents.json new file mode 100644 index 0000000000..28461488b5 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/Assets.xcassets/image.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "image.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/AsyncDisplayKitOverview/Sample/Assets.xcassets/image.imageset/image.jpg b/examples/AsyncDisplayKitOverview/Sample/Assets.xcassets/image.imageset/image.jpg new file mode 100644 index 0000000000..84428e0164 Binary files /dev/null and b/examples/AsyncDisplayKitOverview/Sample/Assets.xcassets/image.imageset/image.jpg differ diff --git a/examples/BackgroundPropertySetting/Sample/Base.lproj/LaunchScreen.storyboard b/examples/AsyncDisplayKitOverview/Sample/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from examples/BackgroundPropertySetting/Sample/Base.lproj/LaunchScreen.storyboard rename to examples/AsyncDisplayKitOverview/Sample/Base.lproj/LaunchScreen.storyboard diff --git a/examples/AsyncDisplayKitOverview/Sample/Info.plist b/examples/AsyncDisplayKitOverview/Sample/Info.plist new file mode 100644 index 0000000000..028aa2b33f --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/Info.plist @@ -0,0 +1,50 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.h b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.h new file mode 100644 index 0000000000..93c2778dac --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.h @@ -0,0 +1,24 @@ +// +// OverviewASCollectionNode.h +// Sample +// +// Created by Michael Schneider on 4/17/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ASDisplayNode.h" + +@interface OverviewASCollectionNode : ASDisplayNode + +@end diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.m b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.m new file mode 100644 index 0000000000..f0950db089 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.m @@ -0,0 +1,74 @@ +// +// OverviewASCollectionNode.m +// Sample +// +// Created by Michael Schneider on 4/17/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "OverviewASCollectionNode.h" + +#import + +@interface OverviewASCollectionNode () +@property (nonatomic, strong) ASCollectionNode *node; +@end + +@implementation OverviewASCollectionNode + +#pragma mark - Lifecycle + +- (instancetype)init +{ + self = [super init]; + if (self == nil) { return self; } + + UICollectionViewFlowLayout *flowLayout = [UICollectionViewFlowLayout new]; + _node = [[ASCollectionNode alloc] initWithCollectionViewLayout:flowLayout]; + _node.dataSource = self; + _node.delegate = self; + [self addSubnode:_node];; + + return self; +} + +- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize +{ + self.node.sizeRange = ASRelativeSizeRangeMakeWithExactCGSize(constrainedSize.max); + return [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[self.node]]; +} + +#pragma mark - + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section +{ + return 100; +} + +- (ASCellNodeBlock)collectionView:(ASCollectionView *)collectionView nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath +{ + return ^{ + ASTextCellNode *cellNode = [ASTextCellNode new]; + cellNode.backgroundColor = [UIColor lightGrayColor]; + cellNode.text = [NSString stringWithFormat:@"Row: %ld", indexPath.row]; + return cellNode; + }; +} + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath +{ + return CGSizeMake(100, 100); +} + +@end diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.h b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.h new file mode 100644 index 0000000000..824d1fb5c0 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.h @@ -0,0 +1,24 @@ +// +// OverviewASPagerNode.h +// Sample +// +// Created by Michael Schneider on 4/17/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface OverviewASPagerNode : ASDisplayNode + +@end diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.m b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.m new file mode 100644 index 0000000000..8b7f39d840 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.m @@ -0,0 +1,90 @@ +// +// OverviewASPagerNode.m +// Sample +// +// Created by Michael Schneider on 4/17/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "OverviewASPagerNode.h" + +#pragma mark - Helper + +static UIColor *OverViewASPagerNodeRandomColor() { + CGFloat hue = ( arc4random() % 256 / 256.0 ); // 0.0 to 1.0 + CGFloat saturation = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from white + CGFloat brightness = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from black + return [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1]; +} + + +#pragma mark - OverviewASPageNode + +@interface OverviewASPageNode : ASCellNode @end + +@implementation OverviewASPageNode + +- (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize +{ + return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize + size:constrainedSize.max]; +} + +@end + + +#pragma mark - OverviewASPagerNode + +@interface OverviewASPagerNode () +@property (nonatomic, strong) ASPagerNode *node; +@property (nonatomic, copy) NSArray *data; +@end + +@implementation OverviewASPagerNode + +- (instancetype)init +{ + self = [super init]; + if (self == nil) { return self; } + + _node = [ASPagerNode new]; + _node.dataSource = self; + [self addSubnode:_node]; + + return self; +} + +- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize +{ + _node.sizeRange = ASRelativeSizeRangeMakeWithExactCGSize(constrainedSize.max); + return [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[_node]]; +} + +- (NSInteger)numberOfPagesInPagerNode:(ASPagerNode *)pagerNode +{ + return 4; +} + +- (ASCellNodeBlock)pagerNode:(ASPagerNode *)pagerNode nodeBlockAtIndex:(NSInteger)index +{ + return ^{ + ASCellNode *cellNode = [OverviewASPageNode new]; + cellNode.backgroundColor = OverViewASPagerNodeRandomColor(); + return cellNode; + }; +} + + +@end diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.h b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.h new file mode 100644 index 0000000000..c2ba8e5323 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.h @@ -0,0 +1,24 @@ +// +// OverviewASTableNode.h +// Sample +// +// Created by Michael Schneider on 4/17/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface OverviewASTableNode : ASDisplayNode + +@end diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.m b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.m new file mode 100644 index 0000000000..fc31b59ffa --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.m @@ -0,0 +1,66 @@ +// +// OverviewASTableNode.m +// Sample +// +// Created by Michael Schneider on 4/17/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "OverviewASTableNode.h" + +@interface OverviewASTableNode () +@property (nonatomic, strong) ASTableNode *node; +@end + +@implementation OverviewASTableNode + +#pragma mark - Lifecycle + +- (instancetype)init +{ + self = [super init]; + if (self == nil) { return self; } + + _node = [ASTableNode new]; + _node.dataSource = self; + _node.delegate = self; + [self addSubnode:_node]; + + return self; +} + +- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize +{ + _node.sizeRange = ASRelativeSizeRangeMakeWithExactCGSize(constrainedSize.max); + return [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[_node]]; +} + + +#pragma mark - + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 100; +} + +- (ASCellNodeBlock)tableView:(ASTableView *)tableView nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath +{ + return ^{ + ASTextCellNode *cellNode = [ASTextCellNode new]; + cellNode.text = [NSString stringWithFormat:@"Row: %ld", indexPath.row]; + return cellNode; + }; +} + +@end diff --git a/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.h b/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.h new file mode 100644 index 0000000000..880cf78a58 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.h @@ -0,0 +1,34 @@ +// +// OverviewComponentsViewController.h +// Sample +// +// Created by Michael Schneider on 4/15/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + + +@protocol ASLayoutSpecListEntry + +- (NSString *)entryTitle; +- (NSString *)entryDescription; + +@end + +@interface OverviewComponentsViewController : UIViewController + + +@end + diff --git a/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.m b/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.m new file mode 100644 index 0000000000..54bd530b1a --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.m @@ -0,0 +1,550 @@ +// +// OverviewComponentsViewController.m +// Sample +// +// Created by Michael Schneider on 4/15/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "OverviewComponentsViewController.h" + +#import "OverviewDetailViewController.h" +#import "OverviewASCollectionNode.h" +#import "OverviewASTableNode.h" +#import "OverviewASPagerNode.h" + +#import + + +#pragma mark - ASCenterLayoutSpecSizeThatFitsBlock + +typedef ASLayoutSpec *(^OverviewDisplayNodeSizeThatFitsBlock)(ASSizeRange constrainedSize); + +#pragma mark - OverviewDisplayNodeWithSizeBlock + +@interface OverviewDisplayNodeWithSizeBlock : ASDisplayNode +@property (nonatomic, copy) NSString *entryTitle; +@property (nonatomic, copy) NSString *entryDescription; +@property (nonatomic, copy) OverviewDisplayNodeSizeThatFitsBlock sizeThatFitsBlock; +@end + +@implementation OverviewDisplayNodeWithSizeBlock + +// FIXME: Use new ASDisplayNodeAPI (layoutSpecBlock) API if shipped +- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize +{ + OverviewDisplayNodeSizeThatFitsBlock block = self.sizeThatFitsBlock; + if (block != nil) { + return block(constrainedSize); + } + + return [super layoutSpecThatFits:constrainedSize]; +} + +@end + +#pragma mark - OverviewTitleDescriptionCellNode + +@interface OverviewTitleDescriptionCellNode : ASCellNode +@property (nonatomic, strong) ASTextNode *titleNode; +@property (nonatomic, strong) ASTextNode *descriptionNode; +@end + +@implementation OverviewTitleDescriptionCellNode + +- (instancetype)init +{ + self = [super init]; + if (self == nil) { return self; } + + _titleNode = [[ASTextNode alloc] init]; + _descriptionNode = [[ASTextNode alloc] init]; + + [self addSubnode:_titleNode]; + [self addSubnode:_descriptionNode]; + + return self; +} + +- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize +{ + BOOL hasDescription = self.descriptionNode.attributedString.length > 0; + + ASStackLayoutSpec *verticalStackLayoutSpec = [ASStackLayoutSpec verticalStackLayoutSpec]; + verticalStackLayoutSpec.spacing = 5.0; + verticalStackLayoutSpec.children = hasDescription ? @[self.titleNode, self.descriptionNode] : @[self.titleNode]; + + return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(10, 16, 10, 10) child:verticalStackLayoutSpec]; +} + +@end + +#pragma mark - OverviewComponentsViewController + +@interface OverviewComponentsViewController () +@property (nonatomic, copy) NSArray *data; +@property (nonatomic, strong) ASTableNode *tableNode; +@end + +@implementation OverviewComponentsViewController + +#pragma mark - UIViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.title = @"AsyncDisplayKit"; + + [self setupData]; + [self setupTableNode]; +} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + + ASTableView *tableView = self.tableNode.view; + [tableView deselectRowAtIndexPath:tableView.indexPathForSelectedRow animated:YES]; +} + +#pragma mark - Setup + +- (void)setupData +{ + OverviewDisplayNodeWithSizeBlock *parentNode = nil; + ASDisplayNode *childNode = nil; + + +// Setup Nodes Container +// --------------------------------------------------------------------------------------------------------- + NSMutableArray *mutableNodesContainerData = [NSMutableArray array]; + +#pragma mark ASCollectionNode + childNode = [OverviewASCollectionNode new]; + + parentNode = [self centeringParentNodeWithInset:UIEdgeInsetsZero child:childNode]; + parentNode.entryTitle = @"ASCollectionNode"; + parentNode.entryDescription = @"ASCollectionNode is a node based class that wraps an ASCollectionView. It can be used as a subnode of another node, and provide room for many (great) features and improvements later on."; + [mutableNodesContainerData addObject:parentNode]; + +#pragma mark ASTableNode + childNode = [OverviewASTableNode new]; + + parentNode = [self centeringParentNodeWithInset:UIEdgeInsetsZero child:childNode]; + parentNode.entryTitle = @"ASTableNode"; + parentNode.entryDescription = @"ASTableNode is a node based class that wraps an ASTableView. It can be used as a subnode of another node, and provide room for many (great) features and improvements later on."; + [mutableNodesContainerData addObject:parentNode]; + +#pragma mark ASPagerNode + childNode = [OverviewASPagerNode new]; + + parentNode = [self centeringParentNodeWithInset:UIEdgeInsetsZero child:childNode]; + parentNode.entryTitle = @"ASPagerNode"; + parentNode.entryDescription = @"ASPagerNode is a specialized subclass of ASCollectionNode. Using it allows you to produce a page style UI similar to what you'd create with a UIPageViewController with UIKit. Luckily, the API is quite a bit simpler than UIPageViewController's."; + [mutableNodesContainerData addObject:parentNode]; + + +// Setup Nodes +// --------------------------------------------------------------------------------------------------------- + NSMutableArray *mutableNodesData = [NSMutableArray array]; + +#pragma mark ASDisplayNode + ASDisplayNode *displayNode = [self childNode]; + + parentNode = [self centeringParentNodeWithChild:displayNode]; + parentNode.entryTitle = @"ASDisplayNode"; + parentNode.entryDescription = @"ASDisplayNode is the main view abstraction over UIView and CALayer. It initializes and owns a UIView in the same way UIViews create and own their own backing CALayers."; + [mutableNodesData addObject:parentNode]; + +#pragma mark ASButtonNode + ASButtonNode *buttonNode = [ASButtonNode new]; + + // Set title for button node with a given font or color. If you pass in nil for font or color the default system + // font and black as color will be used + [buttonNode setTitle:@"Button Title Normal" withFont:nil withColor:[UIColor blueColor] forState:ASControlStateNormal]; + [buttonNode setTitle:@"Button Title Highlighted" withFont:[UIFont systemFontOfSize:14] withColor:nil forState:ASControlStateHighlighted]; + [buttonNode addTarget:self action:@selector(buttonPressed:) forControlEvents:ASControlNodeEventTouchUpInside]; + + parentNode = [self centeringParentNodeWithChild:buttonNode]; + parentNode.entryTitle = @"ASButtonNode"; + parentNode.entryDescription = @"ASButtonNode (a subclass of ASControlNode) supports simple buttons, with multiple states for a text label and an image with a few different layout options. Enables layerBacking for subnodes to significantly lighten main thread impact relative to UIButton (though async preparation is the bigger win)."; + [mutableNodesData addObject:parentNode]; + +#pragma mark ASTextNode + ASTextNode *textNode = [ASTextNode new]; + textNode.attributedString = [[NSAttributedString alloc] initWithString:@"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum varius nisi quis mattis dignissim. Proin convallis odio nec ipsum molestie, in porta quam viverra. Fusce ornare dapibus velit, nec malesuada mauris pretium vitae. Etiam malesuada ligula magna."]; + + parentNode = [self centeringParentNodeWithChild:textNode]; + parentNode.entryTitle = @"ASTextNode"; + parentNode.entryDescription = @"Like UITextView β€” built on TextKit with full-featured rich text support."; + [mutableNodesData addObject:parentNode]; + +#pragma mark ASEditableTextNode + ASEditableTextNode *editableTextNode = [ASEditableTextNode new]; + editableTextNode.backgroundColor = [UIColor lightGrayColor]; + editableTextNode.attributedText = [[NSAttributedString alloc] initWithString:@"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum varius nisi quis mattis dignissim. Proin convallis odio nec ipsum molestie, in porta quam viverra. Fusce ornare dapibus velit, nec malesuada mauris pretium vitae. Etiam malesuada ligula magna."]; + + parentNode = [self centeringParentNodeWithChild:editableTextNode]; + parentNode.entryTitle = @"ASEditableTextNode"; + parentNode.entryDescription = @"ASEditableTextNode provides a flexible, efficient, and animation-friendly editable text component."; + [mutableNodesData addObject:parentNode]; + +#pragma mark ASImageNode + ASImageNode *imageNode = [ASImageNode new]; + imageNode.image = [UIImage imageNamed:@"image"]; + imageNode.preferredFrameSize = CGSizeMake(imageNode.image.size.width / 7, imageNode.image.size.height / 7); + + parentNode = [self centeringParentNodeWithChild:imageNode]; + parentNode.entryTitle = @"ASImageNode"; + parentNode.entryDescription = @"Like UIImageView β€” decodes images asynchronously."; + [mutableNodesData addObject:parentNode]; + +#pragma mark ASNetworkImageNode + ASNetworkImageNode *networkImageNode = [ASNetworkImageNode new]; + networkImageNode.URL = [NSURL URLWithString:@"http://i.imgur.com/FjOR9kX.jpg"]; + networkImageNode.preferredFrameSize = CGSizeMake(imageNode.image.size.width / 7, imageNode.image.size.height / 7); + + parentNode = [self centeringParentNodeWithChild:networkImageNode]; + parentNode.entryTitle = @"ASNetworkImageNode"; + parentNode.entryDescription = @"ASNetworkImageNode is a simple image node that can download and display an image from the network, with support for a placeholder image."; + [mutableNodesData addObject:parentNode]; + +#pragma mark ASMapNode + ASMapNode *mapNode = [ASMapNode new]; + mapNode.preferredFrameSize = CGSizeMake(300.0, 300.0); + + // San Francisco + CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(37.7749, -122.4194); + mapNode.region = MKCoordinateRegionMakeWithDistance(coord, 20000, 20000); + + parentNode = [self centeringParentNodeWithChild:mapNode]; + parentNode.entryTitle = @"ASMapNode"; + parentNode.entryDescription = @"ASMapNode offers completely asynchronous preparation, automatic preloading, and efficient memory handling. Its standard mode is a fully asynchronous snapshot, with liveMap mode loading automatically triggered by any ASTableView or ASCollectionView; its .liveMap mode can be flipped on with ease (even on a background thread) to provide a cached, fully interactive map when necessary."; + [mutableNodesData addObject:parentNode]; + +#pragma mark ASVideoNode + ASVideoNode *videoNode = [ASVideoNode new]; + videoNode.preferredFrameSize = CGSizeMake(300.0, 400.0); + + AVAsset *asset = [AVAsset assetWithURL:[NSURL URLWithString:@"http://www.w3schools.com/html/mov_bbb.mp4"]]; + videoNode.asset = asset; + + parentNode = [self centeringParentNodeWithChild:videoNode]; + parentNode.entryTitle = @"ASVideoNode"; + parentNode.entryDescription = @"ASVideoNode is a newer class that exposes a relatively full-featured API, and is designed for both efficient and convenient implementation of embedded videos in scrolling views."; + [mutableNodesData addObject:parentNode]; + +#pragma mark ASScrollNode + UIImage *scrollNodeImage = [UIImage imageNamed:@"image"]; + + ASScrollNode *scrollNode = [ASScrollNode new]; + scrollNode.preferredFrameSize = CGSizeMake(300.0, 400.0); + + UIScrollView *scrollNodeView = scrollNode.view; + [scrollNodeView addSubview:[[UIImageView alloc] initWithImage:scrollNodeImage]]; + scrollNodeView.contentSize = scrollNodeImage.size; + + parentNode = [self centeringParentNodeWithChild:scrollNode]; + parentNode.entryTitle = @"ASScrollNode"; + parentNode.entryDescription = @"Simple node that wraps UIScrollView."; + [mutableNodesData addObject:parentNode]; + + +// Layout Specs +// --------------------------------------------------------------------------------------------------------- + NSMutableArray *mutableLayoutSpecData = [NSMutableArray array]; + +#pragma mark ASInsetLayoutSpec + childNode = [self childNode]; + + parentNode = [self parentNodeWithChild:childNode]; + parentNode.entryTitle = @"ASInsetLayoutSpec"; + parentNode.entryDescription = @"Applies an inset margin around a component."; + parentNode.sizeThatFitsBlock = ^ASLayoutSpec *(ASSizeRange constrainedSize) { + return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(20, 10, 0, 0) child:childNode]; + }; + [parentNode addSubnode:childNode]; + [mutableLayoutSpecData addObject:parentNode]; + + +#pragma mark ASBackgroundLayoutSpec + ASDisplayNode *backgroundNode = [ASDisplayNode new]; + backgroundNode.backgroundColor = [UIColor greenColor]; + + childNode = [self childNode]; + childNode.backgroundColor = [childNode.backgroundColor colorWithAlphaComponent:0.5]; + + parentNode = [self parentNodeWithChild:childNode]; + parentNode.entryTitle = @"ASBackgroundLayoutSpec"; + parentNode.entryDescription = @"Lays out a component, stretching another component behind it as a backdrop."; + parentNode.sizeThatFitsBlock = ^ASLayoutSpec *(ASSizeRange constrainedSize) { + return [ASBackgroundLayoutSpec backgroundLayoutSpecWithChild:childNode background:backgroundNode]; + }; + [parentNode addSubnode:backgroundNode]; + [parentNode addSubnode:childNode]; + [mutableLayoutSpecData addObject:parentNode]; + + +#pragma mark ASOverlayLayoutSpec + ASDisplayNode *overlayNode = [ASDisplayNode new]; + overlayNode.backgroundColor = [[UIColor greenColor] colorWithAlphaComponent:0.5]; + + childNode = [self childNode]; + + parentNode = [self parentNodeWithChild:childNode]; + parentNode.entryTitle = @"ASOverlayLayoutSpec"; + parentNode.entryDescription = @"Lays out a component, stretching another component on top of it as an overlay."; + parentNode.sizeThatFitsBlock = ^ASLayoutSpec *(ASSizeRange constrainedSize) { + return [ASOverlayLayoutSpec overlayLayoutSpecWithChild:childNode overlay:overlayNode]; + }; + [parentNode addSubnode:childNode]; + [parentNode addSubnode:overlayNode]; + [mutableLayoutSpecData addObject:parentNode]; + + +#pragma mark ASCenterLayoutSpec + childNode = [self childNode]; + + parentNode = [self parentNodeWithChild:childNode]; + parentNode.entryTitle = @"ASCenterLayoutSpec"; + parentNode.entryDescription = @"Centers a component in the available space."; + parentNode.sizeThatFitsBlock = ^ASLayoutSpec *(ASSizeRange constrainedSize) { + return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringXY + sizingOptions:ASCenterLayoutSpecSizingOptionDefault + child:childNode]; + }; + [parentNode addSubnode:childNode]; + [mutableLayoutSpecData addObject:parentNode]; + +#pragma mark ASRatioLayoutSpec + childNode = [self childNode]; + + parentNode = [self parentNodeWithChild:childNode]; + parentNode.entryTitle = @"ASRatioLayoutSpec"; + parentNode.entryDescription = @"Lays out a component at a fixed aspect ratio. Great for images, gifs and videos."; + parentNode.sizeThatFitsBlock = ^ASLayoutSpec *(ASSizeRange constrainedSize) { + return [ASRatioLayoutSpec ratioLayoutSpecWithRatio:0.25 child:childNode]; + }; + [parentNode addSubnode:childNode]; + [mutableLayoutSpecData addObject:parentNode]; + +#pragma mark ASRelativeLayoutSpec + childNode = [self childNode]; + + parentNode = [self parentNodeWithChild:childNode]; + parentNode.entryTitle = @"ASRelativeLayoutSpec"; + parentNode.entryDescription = @"Lays out a component and positions it within the layout bounds according to vertical and horizontal positional specifiers. Similar to the β€œ9-part” image areas, a child can be positioned at any of the 4 corners, or the middle of any of the 4 edges, as well as the center."; + parentNode.sizeThatFitsBlock = ^ASLayoutSpec *(ASSizeRange constrainedSize) { + return [ASRelativeLayoutSpec relativePositionLayoutSpecWithHorizontalPosition:ASRelativeLayoutSpecPositionEnd + verticalPosition:ASRelativeLayoutSpecPositionCenter + sizingOption:ASRelativeLayoutSpecSizingOptionDefault + child:childNode]; + }; + [parentNode addSubnode:childNode]; + [mutableLayoutSpecData addObject:parentNode]; + +#pragma mark ASStaticLayoutSpec + childNode = [self childNode]; + // Add a layout position to the child node that the static layout spec will pick up and place it on that position + childNode.layoutPosition = CGPointMake(10.0, 10.0); + + parentNode = [self parentNodeWithChild:childNode]; + parentNode.entryTitle = @"ASStaticLayoutSpec"; + parentNode.entryDescription = @"Allows positioning children at fixed offsets."; + parentNode.sizeThatFitsBlock = ^ASLayoutSpec *(ASSizeRange constrainedSize) { + return [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[childNode]]; + }; + [parentNode addSubnode:childNode]; + [mutableLayoutSpecData addObject:parentNode]; + + +#pragma mark Vertical ASStackLayoutSpec + ASDisplayNode *childNode1 = [self childNode]; + childNode1.backgroundColor = [UIColor greenColor]; + + ASDisplayNode *childNode2 = [self childNode]; + childNode2.backgroundColor = [UIColor blueColor]; + + ASDisplayNode *childNode3 = [self childNode]; + childNode3.backgroundColor = [UIColor yellowColor]; + + // If we just would add the childrent to the stack layout the layout would be to tall and run out of the edge of + // the node as 50+50+50 = 150 but the parent node is only 100 height. To prevent that we set flexShrink on 2 of the + // children to let the stack layout know it should shrink these children in case the layout will run over the edge + childNode2.flexShrink = YES; + childNode3.flexShrink = YES; + + parentNode = [self parentNodeWithChild:childNode]; + parentNode.entryTitle = @"Vertical ASStackLayoutSpec"; + parentNode.entryDescription = @"Is based on a simplified version of CSS flexbox. It allows you to stack components vertically or horizontally and specify how they should be flexed and aligned to fit in the available space."; + parentNode.sizeThatFitsBlock = ^ASLayoutSpec *(ASSizeRange constrainedSize) { + ASStackLayoutSpec *verticalStackLayoutSpec = [ASStackLayoutSpec verticalStackLayoutSpec]; + verticalStackLayoutSpec.children = @[childNode1, childNode2, childNode3]; + return verticalStackLayoutSpec; + }; + [parentNode addSubnode:childNode1]; + [parentNode addSubnode:childNode2]; + [parentNode addSubnode:childNode3]; + [mutableLayoutSpecData addObject:parentNode]; + +#pragma mark Horizontal ASStackLayoutSpec + childNode1 = [ASDisplayNode new]; + childNode1.preferredFrameSize = CGSizeMake(10.0, 20); + childNode1.flexGrow = YES; + childNode1.backgroundColor = [UIColor greenColor]; + + childNode2 = [ASDisplayNode new]; + childNode2.preferredFrameSize = CGSizeMake(10.0, 20.0); + childNode2.alignSelf = ASStackLayoutAlignSelfStretch; + childNode2.backgroundColor = [UIColor blueColor]; + + childNode3 = [ASDisplayNode new]; + childNode3.preferredFrameSize = CGSizeMake(10.0, 20.0); + childNode3.backgroundColor = [UIColor yellowColor]; + + parentNode = [self parentNodeWithChild:childNode]; + parentNode.entryTitle = @"Horizontal ASStackLayoutSpec"; + parentNode.entryDescription = @"Is based on a simplified version of CSS flexbox. It allows you to stack components vertically or horizontally and specify how they should be flexed and aligned to fit in the available space."; + parentNode.sizeThatFitsBlock = ^ASLayoutSpec *(ASSizeRange constrainedSize) { + + // Create stack alyout spec to layout children + ASStackLayoutSpec *verticalStackLayoutSpec = [ASStackLayoutSpec horizontalStackLayoutSpec]; + verticalStackLayoutSpec.children = @[childNode1, childNode2, childNode3]; + verticalStackLayoutSpec.spacing = 5.0; // Spacing between children + + // Layout the stack layout with 100% width and 100% height of the parent node + ASRelativeSizeRange sizeRange = ASRelativeSizeRangeMakeWithExactRelativeDimensions(ASRelativeDimensionMakeWithPercent(1), + ASRelativeDimensionMakeWithPercent(1)); + verticalStackLayoutSpec.sizeRange = sizeRange; + + // Wrap the static stack layout in a static spec so it will grow to the whole parent node size + ASStaticLayoutSpec *staticLayoutSpec = [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[verticalStackLayoutSpec]]; + + // Add a bit of inset + return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(0.0, 5.0, 0.0, 5.0) child:staticLayoutSpec]; + }; + [parentNode addSubnode:childNode1]; + [parentNode addSubnode:childNode2]; + [parentNode addSubnode:childNode3]; + [mutableLayoutSpecData addObject:parentNode]; + + +// Setup Data +// --------------------------------------------------------------------------------------------------------- + NSMutableArray *mutableData = [NSMutableArray array]; + [mutableData addObject:@{@"title" : @"Node Containers", @"data" : mutableNodesContainerData}]; + [mutableData addObject:@{@"title" : @"Nodes", @"data" : mutableNodesData}]; + [mutableData addObject:@{@"title" : @"Layout Specs", @"data" : [mutableLayoutSpecData copy]}]; + self.data = mutableData; +} + +- (void)setupTableNode +{ + _tableNode = [ASTableNode new]; + _tableNode.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + _tableNode.frame = self.view.bounds; + _tableNode.delegate = (id)self; + _tableNode.dataSource = (id)self; + [self.view addSubnode:_tableNode]; +} + +#pragma mark - Parent / Child Helper + +- (OverviewDisplayNodeWithSizeBlock *)parentNodeWithChild:(ASDisplayNode *)child +{ + OverviewDisplayNodeWithSizeBlock *parentNode = [OverviewDisplayNodeWithSizeBlock new]; + parentNode.preferredFrameSize = CGSizeMake(100, 100); + parentNode.backgroundColor = [UIColor redColor]; + return parentNode; +} + +- (OverviewDisplayNodeWithSizeBlock *)centeringParentNodeWithChild:(ASDisplayNode *)child +{ + return [self centeringParentNodeWithInset:UIEdgeInsetsMake(10, 10, 10, 10) child:child]; +} + +- (OverviewDisplayNodeWithSizeBlock *)centeringParentNodeWithInset:(UIEdgeInsets)insets child:(ASDisplayNode *)child +{ + OverviewDisplayNodeWithSizeBlock *parentNode = [OverviewDisplayNodeWithSizeBlock new]; + [parentNode addSubnode:child]; + parentNode.sizeThatFitsBlock = ^ASLayoutSpec *(ASSizeRange constrainedSize) { + ASCenterLayoutSpec *centerLayoutSpec = [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringXY sizingOptions:ASCenterLayoutSpecSizingOptionDefault child:child]; + return [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:centerLayoutSpec]; + }; + return parentNode; +} + +- (ASDisplayNode *)childNode +{ + ASDisplayNode *childNode = [ASDisplayNode new]; + childNode.preferredFrameSize = CGSizeMake(50, 50); + childNode.backgroundColor = [UIColor blueColor]; + return childNode; +} + +#pragma mark - Actions + +- (void)buttonPressed:(ASButtonNode *)buttonNode +{ + NSLog(@"Button Pressed"); +} + +#pragma mark - + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return self.data.count; +} + +- (nullable NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + return self.data[section][@"title"]; +} + +- (NSInteger)tableView:(ASTableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return [self.data[section][@"data"] count]; +} + +- (ASCellNodeBlock)tableView:(ASTableView *)tableView nodeBlockForRowAtIndexPath:(NSIndexPath *)indexPath +{ + // You should get the node or data you want to pass to the cell node outside of the ASCellNodeBlock + ASDisplayNode *node = self.data[indexPath.section][@"data"][indexPath.row]; + return ^{ + OverviewTitleDescriptionCellNode *cellNode = [OverviewTitleDescriptionCellNode new]; + + NSDictionary *titleNodeAttributes = @{ + NSFontAttributeName : [UIFont boldSystemFontOfSize:14.0], + NSForegroundColorAttributeName : [UIColor blackColor] + }; + cellNode.titleNode.attributedString = [[NSAttributedString alloc] initWithString:node.entryTitle attributes:titleNodeAttributes]; + + if (node.entryDescription) { + NSDictionary *descriptionNodeAttributes = @{NSForegroundColorAttributeName : [UIColor lightGrayColor]}; + cellNode.descriptionNode.attributedString = [[NSAttributedString alloc] initWithString:node.entryDescription attributes:descriptionNodeAttributes]; + } + + return cellNode; + }; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + ASDisplayNode *node = self.data[indexPath.section][@"data"][indexPath.row]; + OverviewDetailViewController *detail = [[OverviewDetailViewController alloc] initWithNode:node]; + [self.navigationController pushViewController:detail animated:YES]; +} + +@end diff --git a/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.h b/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.h new file mode 100644 index 0000000000..b3fae243c5 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.h @@ -0,0 +1,26 @@ +// +// OverviewDetailViewController.h +// Sample +// +// Created by Michael Schneider on 4/15/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@class ASDisplayNode; + +@interface OverviewDetailViewController : UIViewController +- (instancetype)initWithNode:(ASDisplayNode *)node; +@end diff --git a/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.m b/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.m new file mode 100644 index 0000000000..c5bfdb146c --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.m @@ -0,0 +1,62 @@ +// +// OverviewDetailViewController.m +// Sample +// +// Created by Michael Schneider on 4/15/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "OverviewDetailViewController.h" + +@interface OverviewDetailViewController () +@property (nonatomic, strong) ASDisplayNode *node; +@end + +@implementation OverviewDetailViewController + +#pragma mark - Lifecycle + +- (instancetype)initWithNode:(ASDisplayNode *)node +{ + self = [super initWithNibName:nil bundle:nil]; + if (self == nil) { return self; } + _node = node; + return self; +} + +#pragma mark - UIViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.view.backgroundColor = [UIColor whiteColor]; + [self.view addSubnode:self.node]; +} + +- (void)viewDidLayoutSubviews +{ + [super viewDidLayoutSubviews]; + + // Center node frame + CGRect bounds = self.view.bounds; + CGSize nodeSize = self.node.preferredFrameSize; + if (CGSizeEqualToSize(nodeSize, CGSizeZero)) { + nodeSize = self.view.bounds.size; + } + self.node.frame = CGRectMake(CGRectGetMidX(bounds) - (nodeSize.width / 2.0), CGRectGetMidY(bounds) - (nodeSize.height / 2.0), nodeSize.width, nodeSize.height); + [self.node measure:self.node.bounds.size]; +} + +@end diff --git a/examples/AsyncDisplayKitOverview/Sample/main.m b/examples/AsyncDisplayKitOverview/Sample/main.m new file mode 100644 index 0000000000..63beb381e8 --- /dev/null +++ b/examples/AsyncDisplayKitOverview/Sample/main.m @@ -0,0 +1,27 @@ +// +// main.m +// Sample +// +// Created by Michael Schneider on 4/24/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/examples/BackgroundPropertySetting/Podfile b/examples/BackgroundPropertySetting/Podfile deleted file mode 100644 index 3ca3b0ba09..0000000000 --- a/examples/BackgroundPropertySetting/Podfile +++ /dev/null @@ -1,4 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -use_frameworks! -pod 'AsyncDisplayKit', :path => '../..' diff --git a/examples/BackgroundPropertySetting/Sample/Utilities.swift b/examples/BackgroundPropertySetting/Sample/Utilities.swift deleted file mode 100644 index 5aedf39722..0000000000 --- a/examples/BackgroundPropertySetting/Sample/Utilities.swift +++ /dev/null @@ -1,15 +0,0 @@ -// -// Utilities.swift -// BackgroundPropertySetting -// -// Created by Adlai Holler on 2/17/16. -// Copyright Β© 2016 Adlai Holler. All rights reserved. -// - -import UIKit - -extension UIColor { - static func random() -> UIColor { - return UIColor(red: CGFloat(drand48()), green: CGFloat(drand48()), blue: CGFloat(drand48()), alpha: 1.0) - } -} diff --git a/examples/CarthageBuildTest/Cartfile b/examples/CarthageBuildTest/Cartfile index 75ef551216..aa14143b00 100644 --- a/examples/CarthageBuildTest/Cartfile +++ b/examples/CarthageBuildTest/Cartfile @@ -1 +1 @@ -git "file:///build.sh/will/put/local/absolute/path/here" "master" +github "facebook/AsyncDisplayKit" "master" diff --git a/examples/CarthageBuildTest/CarthageExample/AppDelegate.h b/examples/CarthageBuildTest/CarthageExample/AppDelegate.h index 6f3bc417f3..2679ca0f5d 100644 --- a/examples/CarthageBuildTest/CarthageExample/AppDelegate.h +++ b/examples/CarthageBuildTest/CarthageExample/AppDelegate.h @@ -1,9 +1,20 @@ // // AppDelegate.h -// CarthageExample +// Sample // // Created by Engin Kurutepe on 23/02/16. -// Copyright Β© 2016 Engin Kurutepe. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CarthageBuildTest/CarthageExample/AppDelegate.m b/examples/CarthageBuildTest/CarthageExample/AppDelegate.m index 225a9f70b1..3cbd83a5e1 100644 --- a/examples/CarthageBuildTest/CarthageExample/AppDelegate.m +++ b/examples/CarthageBuildTest/CarthageExample/AppDelegate.m @@ -1,9 +1,20 @@ // // AppDelegate.m -// CarthageExample +// Sample // // Created by Engin Kurutepe on 23/02/16. -// Copyright Β© 2016 Engin Kurutepe. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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; diff --git a/examples/CarthageBuildTest/CarthageExample/Base.lproj/LaunchScreen.storyboard b/examples/CarthageBuildTest/CarthageExample/Base.lproj/LaunchScreen.storyboard index 2e721e1833..ebf48f6039 100644 --- a/examples/CarthageBuildTest/CarthageExample/Base.lproj/LaunchScreen.storyboard +++ b/examples/CarthageBuildTest/CarthageExample/Base.lproj/LaunchScreen.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -15,7 +16,6 @@ - diff --git a/examples/CarthageBuildTest/CarthageExample/Base.lproj/Main.storyboard b/examples/CarthageBuildTest/CarthageExample/Base.lproj/Main.storyboard index f56d2f3bb5..82cf14be21 100644 --- a/examples/CarthageBuildTest/CarthageExample/Base.lproj/Main.storyboard +++ b/examples/CarthageBuildTest/CarthageExample/Base.lproj/Main.storyboard @@ -1,13 +1,14 @@ - + - + + - + diff --git a/examples/CarthageBuildTest/CarthageExample/ViewController.h b/examples/CarthageBuildTest/CarthageExample/ViewController.h index 4cf7ecbc3e..69b7c77fa8 100644 --- a/examples/CarthageBuildTest/CarthageExample/ViewController.h +++ b/examples/CarthageBuildTest/CarthageExample/ViewController.h @@ -1,9 +1,20 @@ // // ViewController.h -// CarthageExample +// Sample // // Created by Engin Kurutepe on 23/02/16. -// Copyright Β© 2016 Engin Kurutepe. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CarthageBuildTest/CarthageExample/ViewController.m b/examples/CarthageBuildTest/CarthageExample/ViewController.m index a65c7f7d6e..25a6cc4fc8 100644 --- a/examples/CarthageBuildTest/CarthageExample/ViewController.m +++ b/examples/CarthageBuildTest/CarthageExample/ViewController.m @@ -1,9 +1,20 @@ // // ViewController.m -// CarthageExample +// Sample // // Created by Engin Kurutepe on 23/02/16. -// Copyright Β© 2016 Engin Kurutepe. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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; diff --git a/examples/CarthageBuildTest/CarthageExample/main.m b/examples/CarthageBuildTest/CarthageExample/main.m index e37b278758..269c9a6c74 100644 --- a/examples/CarthageBuildTest/CarthageExample/main.m +++ b/examples/CarthageBuildTest/CarthageExample/main.m @@ -1,9 +1,20 @@ // // main.m -// CarthageExample +// Sample // // Created by Engin Kurutepe on 23/02/16. -// Copyright Β© 2016 Engin Kurutepe. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CarthageBuildTest/Sample.xcodeproj/project.pbxproj b/examples/CarthageBuildTest/Sample.xcodeproj/project.pbxproj index cffd86f348..6d3073fb34 100644 --- a/examples/CarthageBuildTest/Sample.xcodeproj/project.pbxproj +++ b/examples/CarthageBuildTest/Sample.xcodeproj/project.pbxproj @@ -14,6 +14,8 @@ 871BB3591C7C98B1005CF62A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 871BB3581C7C98B1005CF62A /* Assets.xcassets */; }; 871BB35C1C7C98B1005CF62A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 871BB35A1C7C98B1005CF62A /* LaunchScreen.storyboard */; }; 871BB3651C7C99B0005CF62A /* AsyncDisplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 871BB3641C7C99B0005CF62A /* AsyncDisplayKit.framework */; }; + DEAE185D1D1A504A0083FAD0 /* PINCache.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEAE185B1D1A504A0083FAD0 /* PINCache.framework */; }; + DEAE185E1D1A504A0083FAD0 /* PINRemoteImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEAE185C1D1A504A0083FAD0 /* PINRemoteImage.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -28,6 +30,8 @@ 871BB35B1C7C98B1005CF62A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 871BB35D1C7C98B1005CF62A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 871BB3641C7C99B0005CF62A /* AsyncDisplayKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AsyncDisplayKit.framework; path = Carthage/Build/iOS/AsyncDisplayKit.framework; sourceTree = SOURCE_ROOT; }; + DEAE185B1D1A504A0083FAD0 /* PINCache.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PINCache.framework; path = ../Carthage/Build/iOS/PINCache.framework; sourceTree = ""; }; + DEAE185C1D1A504A0083FAD0 /* PINRemoteImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PINRemoteImage.framework; path = ../Carthage/Build/iOS/PINRemoteImage.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -36,6 +40,8 @@ buildActionMask = 2147483647; files = ( 871BB3651C7C99B0005CF62A /* AsyncDisplayKit.framework in Frameworks */, + DEAE185D1D1A504A0083FAD0 /* PINCache.framework in Frameworks */, + DEAE185E1D1A504A0083FAD0 /* PINRemoteImage.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -87,6 +93,8 @@ isa = PBXGroup; children = ( 871BB3641C7C99B0005CF62A /* AsyncDisplayKit.framework */, + DEAE185B1D1A504A0083FAD0 /* PINCache.framework */, + DEAE185C1D1A504A0083FAD0 /* PINRemoteImage.framework */, ); name = Frameworks; sourceTree = ""; @@ -126,7 +134,7 @@ }; }; }; - buildConfigurationList = 871BB3441C7C98B1005CF62A /* Build configuration list for PBXProject "CarthageExample" */; + buildConfigurationList = 871BB3441C7C98B1005CF62A /* Build configuration list for PBXProject "Sample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -325,7 +333,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 871BB3441C7C98B1005CF62A /* Build configuration list for PBXProject "CarthageExample" */ = { + 871BB3441C7C98B1005CF62A /* Build configuration list for PBXProject "Sample" */ = { isa = XCConfigurationList; buildConfigurations = ( 871BB35E1C7C98B1005CF62A /* Debug */, diff --git a/examples/CatDealsCollectionView/Podfile b/examples/CatDealsCollectionView/Podfile index 6c012e3c04..919de4b311 100644 --- a/examples/CatDealsCollectionView/Podfile +++ b/examples/CatDealsCollectionView/Podfile @@ -1,3 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/CatDealsCollectionView/Sample.xcodeproj/project.pbxproj b/examples/CatDealsCollectionView/Sample.xcodeproj/project.pbxproj index 1810a8ebbf..366fe1ef9c 100644 --- a/examples/CatDealsCollectionView/Sample.xcodeproj/project.pbxproj +++ b/examples/CatDealsCollectionView/Sample.xcodeproj/project.pbxproj @@ -1,405 +1,970 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 25FDEC921BF31EE700CEB123 /* ItemNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 25FDEC911BF31EE700CEB123 /* ItemNode.m */; }; - 7A83848E1C34359D002CDD08 /* ItemViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A83848D1C34359D002CDD08 /* ItemViewModel.m */; }; - 7A8384941C343680002CDD08 /* BlurbNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A8384921C343680002CDD08 /* BlurbNode.m */; }; - 7A8384971C344057002CDD08 /* ItemStyles.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A8384961C344057002CDD08 /* ItemStyles.m */; }; - 7ACD5F891C415B7500E7BE16 /* LoadingNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ACD5F881C415B7500E7BE16 /* LoadingNode.m */; }; - 7ACD5F961C4847C000E7BE16 /* PlaceholderNetworkImageNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ACD5F951C4847C000E7BE16 /* PlaceholderNetworkImageNode.m */; }; - 9BA2CEA11BB2579C00D18414 /* Launchboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9BA2CEA01BB2579C00D18414 /* Launchboard.storyboard */; }; - AC3C4A641A11F47200143C57 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A631A11F47200143C57 /* main.m */; }; - AC3C4A671A11F47200143C57 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A661A11F47200143C57 /* AppDelegate.m */; }; - AC3C4A6A1A11F47200143C57 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A691A11F47200143C57 /* ViewController.m */; }; - AC3C4A8E1A11F80C00143C57 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AC3C4A8D1A11F80C00143C57 /* Images.xcassets */; }; - FABD6D156A3EB118497E5CE6 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F02BAF78E68BC56FD8C161B7 /* libPods.a */; }; - FC3FCA801C2B1564009F6D6D /* PresentingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC3FCA7F1C2B1564009F6D6D /* PresentingViewController.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 25FDEC901BF31EE700CEB123 /* ItemNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemNode.h; sourceTree = ""; }; - 25FDEC911BF31EE700CEB123 /* ItemNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemNode.m; sourceTree = ""; }; - 2DBAEE96397BB913350C4530 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; - 7A83848C1C34359D002CDD08 /* ItemViewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemViewModel.h; sourceTree = ""; }; - 7A83848D1C34359D002CDD08 /* ItemViewModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemViewModel.m; sourceTree = ""; }; - 7A8384911C343680002CDD08 /* BlurbNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlurbNode.h; sourceTree = ""; }; - 7A8384921C343680002CDD08 /* BlurbNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlurbNode.m; sourceTree = ""; }; - 7A8384951C344057002CDD08 /* ItemStyles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItemStyles.h; sourceTree = ""; }; - 7A8384961C344057002CDD08 /* ItemStyles.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ItemStyles.m; sourceTree = ""; }; - 7ACD5F871C415B7500E7BE16 /* LoadingNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadingNode.h; sourceTree = ""; }; - 7ACD5F881C415B7500E7BE16 /* LoadingNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoadingNode.m; sourceTree = ""; }; - 7ACD5F941C4847C000E7BE16 /* PlaceholderNetworkImageNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaceholderNetworkImageNode.h; sourceTree = ""; }; - 7ACD5F951C4847C000E7BE16 /* PlaceholderNetworkImageNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlaceholderNetworkImageNode.m; sourceTree = ""; }; - 9BA2CEA01BB2579C00D18414 /* Launchboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Launchboard.storyboard; sourceTree = ""; }; - AC3C4A5E1A11F47200143C57 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - AC3C4A621A11F47200143C57 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - AC3C4A631A11F47200143C57 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - AC3C4A651A11F47200143C57 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - AC3C4A661A11F47200143C57 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - AC3C4A681A11F47200143C57 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - AC3C4A691A11F47200143C57 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - AC3C4A8D1A11F80C00143C57 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - CD1ABB23007FEDB31D8C1978 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - F02BAF78E68BC56FD8C161B7 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - FC3FCA7E1C2B1564009F6D6D /* PresentingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PresentingViewController.h; sourceTree = ""; }; - FC3FCA7F1C2B1564009F6D6D /* PresentingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PresentingViewController.m; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - AC3C4A5B1A11F47200143C57 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - FABD6D156A3EB118497E5CE6 /* libPods.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 90A2B9C5397C46134C8A793B /* Pods */ = { - isa = PBXGroup; - children = ( - 2DBAEE96397BB913350C4530 /* Pods.debug.xcconfig */, - CD1ABB23007FEDB31D8C1978 /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - AC3C4A551A11F47200143C57 = { - isa = PBXGroup; - children = ( - AC3C4A601A11F47200143C57 /* Sample */, - AC3C4A5F1A11F47200143C57 /* Products */, - 90A2B9C5397C46134C8A793B /* Pods */, - D6E38FF0CB18E3F55CF06437 /* Frameworks */, - ); - sourceTree = ""; - }; - AC3C4A5F1A11F47200143C57 /* Products */ = { - isa = PBXGroup; - children = ( - AC3C4A5E1A11F47200143C57 /* Sample.app */, - ); - name = Products; - sourceTree = ""; - }; - AC3C4A601A11F47200143C57 /* Sample */ = { - isa = PBXGroup; - children = ( - AC3C4A651A11F47200143C57 /* AppDelegate.h */, - AC3C4A661A11F47200143C57 /* AppDelegate.m */, - AC3C4A681A11F47200143C57 /* ViewController.h */, - AC3C4A691A11F47200143C57 /* ViewController.m */, - 7ACD5F941C4847C000E7BE16 /* PlaceholderNetworkImageNode.h */, - 7ACD5F951C4847C000E7BE16 /* PlaceholderNetworkImageNode.m */, - FC3FCA7E1C2B1564009F6D6D /* PresentingViewController.h */, - FC3FCA7F1C2B1564009F6D6D /* PresentingViewController.m */, - AC3C4A8D1A11F80C00143C57 /* Images.xcassets */, - AC3C4A611A11F47200143C57 /* Supporting Files */, - 25FDEC901BF31EE700CEB123 /* ItemNode.h */, - 25FDEC911BF31EE700CEB123 /* ItemNode.m */, - 7A8384951C344057002CDD08 /* ItemStyles.h */, - 7A8384961C344057002CDD08 /* ItemStyles.m */, - 7A83848C1C34359D002CDD08 /* ItemViewModel.h */, - 7A83848D1C34359D002CDD08 /* ItemViewModel.m */, - 7A8384911C343680002CDD08 /* BlurbNode.h */, - 7A8384921C343680002CDD08 /* BlurbNode.m */, - 7ACD5F871C415B7500E7BE16 /* LoadingNode.h */, - 7ACD5F881C415B7500E7BE16 /* LoadingNode.m */, - ); - indentWidth = 2; - path = Sample; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - AC3C4A611A11F47200143C57 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - AC3C4A621A11F47200143C57 /* Info.plist */, - AC3C4A631A11F47200143C57 /* main.m */, - 9BA2CEA01BB2579C00D18414 /* Launchboard.storyboard */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - D6E38FF0CB18E3F55CF06437 /* Frameworks */ = { - isa = PBXGroup; - children = ( - F02BAF78E68BC56FD8C161B7 /* libPods.a */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - AC3C4A5D1A11F47200143C57 /* Sample */ = { - isa = PBXNativeTarget; - buildConfigurationList = AC3C4A811A11F47200143C57 /* Build configuration list for PBXNativeTarget "Sample" */; - buildPhases = ( - F868CFBB21824CC9521B6588 /* Check Pods Manifest.lock */, - AC3C4A5A1A11F47200143C57 /* Sources */, - AC3C4A5B1A11F47200143C57 /* Frameworks */, - AC3C4A5C1A11F47200143C57 /* Resources */, - A6902C454C7661D0D277AC62 /* Copy Pods Resources */, - B4CD33E927E6F4EE5DD6CCF0 /* Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Sample; - productName = Sample; - productReference = AC3C4A5E1A11F47200143C57 /* Sample.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - AC3C4A561A11F47200143C57 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0610; - ORGANIZATIONNAME = Facebook; - TargetAttributes = { - AC3C4A5D1A11F47200143C57 = { - CreatedOnToolsVersion = 6.1; - }; - }; - }; - buildConfigurationList = AC3C4A591A11F47200143C57 /* Build configuration list for PBXProject "Sample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = AC3C4A551A11F47200143C57; - productRefGroup = AC3C4A5F1A11F47200143C57 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - AC3C4A5D1A11F47200143C57 /* Sample */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - AC3C4A5C1A11F47200143C57 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9BA2CEA11BB2579C00D18414 /* Launchboard.storyboard in Resources */, - AC3C4A8E1A11F80C00143C57 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - A6902C454C7661D0D277AC62 /* 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; - }; - B4CD33E927E6F4EE5DD6CCF0 /* Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - F868CFBB21824CC9521B6588 /* 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 */ - AC3C4A5A1A11F47200143C57 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 25FDEC921BF31EE700CEB123 /* ItemNode.m in Sources */, - 7ACD5F891C415B7500E7BE16 /* LoadingNode.m in Sources */, - AC3C4A6A1A11F47200143C57 /* ViewController.m in Sources */, - 7A8384971C344057002CDD08 /* ItemStyles.m in Sources */, - FC3FCA801C2B1564009F6D6D /* PresentingViewController.m in Sources */, - 7A8384941C343680002CDD08 /* BlurbNode.m in Sources */, - 7A83848E1C34359D002CDD08 /* ItemViewModel.m in Sources */, - AC3C4A671A11F47200143C57 /* AppDelegate.m in Sources */, - 7ACD5F961C4847C000E7BE16 /* PlaceholderNetworkImageNode.m in Sources */, - AC3C4A641A11F47200143C57 /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - AC3C4A7F1A11F47200143C57 /* 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.1; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - AC3C4A801A11F47200143C57 /* 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.1; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - AC3C4A821A11F47200143C57 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2DBAEE96397BB913350C4530 /* Pods.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - AC3C4A831A11F47200143C57 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CD1ABB23007FEDB31D8C1978 /* Pods.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - AC3C4A591A11F47200143C57 /* Build configuration list for PBXProject "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AC3C4A7F1A11F47200143C57 /* Debug */, - AC3C4A801A11F47200143C57 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - AC3C4A811A11F47200143C57 /* Build configuration list for PBXNativeTarget "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AC3C4A821A11F47200143C57 /* Debug */, - AC3C4A831A11F47200143C57 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = AC3C4A561A11F47200143C57 /* Project object */; -} + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 25FDEC901BF31EE700CEB123 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ItemNode.h + sourceTree + <group> + + 25FDEC911BF31EE700CEB123 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ItemNode.m + sourceTree + <group> + + 25FDEC921BF31EE700CEB123 + + fileRef + 25FDEC911BF31EE700CEB123 + isa + PBXBuildFile + + 65F7AC562A910A742522053C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + + 7A83848C1C34359D002CDD08 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ItemViewModel.h + sourceTree + <group> + + 7A83848D1C34359D002CDD08 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ItemViewModel.m + sourceTree + <group> + + 7A83848E1C34359D002CDD08 + + fileRef + 7A83848D1C34359D002CDD08 + isa + PBXBuildFile + + 7A8384911C343680002CDD08 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + BlurbNode.h + sourceTree + <group> + + 7A8384921C343680002CDD08 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + BlurbNode.m + sourceTree + <group> + + 7A8384941C343680002CDD08 + + fileRef + 7A8384921C343680002CDD08 + isa + PBXBuildFile + + 7A8384951C344057002CDD08 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ItemStyles.h + sourceTree + <group> + + 7A8384961C344057002CDD08 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ItemStyles.m + sourceTree + <group> + + 7A8384971C344057002CDD08 + + fileRef + 7A8384961C344057002CDD08 + isa + PBXBuildFile + + 7ACD5F871C415B7500E7BE16 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + LoadingNode.h + sourceTree + <group> + + 7ACD5F881C415B7500E7BE16 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + LoadingNode.m + sourceTree + <group> + + 7ACD5F891C415B7500E7BE16 + + fileRef + 7ACD5F881C415B7500E7BE16 + isa + PBXBuildFile + + 7ACD5F941C4847C000E7BE16 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + PlaceholderNetworkImageNode.h + sourceTree + <group> + + 7ACD5F951C4847C000E7BE16 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + PlaceholderNetworkImageNode.m + sourceTree + <group> + + 7ACD5F961C4847C000E7BE16 + + fileRef + 7ACD5F951C4847C000E7BE16 + isa + PBXBuildFile + + 90A2B9C5397C46134C8A793B + + children + + F3A72D578C378357FF56486A + 65F7AC562A910A742522053C + + isa + PBXGroup + name + Pods + sourceTree + <group> + + 91C402838901BD02685337A8 + + fileRef + F1E539014E1F516F00A8F167 + isa + PBXBuildFile + + 9BA2CEA01BB2579C00D18414 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + file.storyboard + path + Launchboard.storyboard + sourceTree + <group> + + 9BA2CEA11BB2579C00D18414 + + fileRef + 9BA2CEA01BB2579C00D18414 + isa + PBXBuildFile + + A6902C454C7661D0D277AC62 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" + + showEnvVarsInLog + 0 + + AC3C4A551A11F47200143C57 + + children + + AC3C4A601A11F47200143C57 + AC3C4A5F1A11F47200143C57 + 90A2B9C5397C46134C8A793B + D6E38FF0CB18E3F55CF06437 + + isa + PBXGroup + sourceTree + <group> + + AC3C4A561A11F47200143C57 + + attributes + + LastUpgradeCheck + 0610 + ORGANIZATIONNAME + Facebook + TargetAttributes + + AC3C4A5D1A11F47200143C57 + + CreatedOnToolsVersion + 6.1 + + + + buildConfigurationList + AC3C4A591A11F47200143C57 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + AC3C4A551A11F47200143C57 + productRefGroup + AC3C4A5F1A11F47200143C57 + projectDirPath + + projectReferences + + projectRoot + + targets + + AC3C4A5D1A11F47200143C57 + + + AC3C4A591A11F47200143C57 + + buildConfigurations + + AC3C4A7F1A11F47200143C57 + AC3C4A801A11F47200143C57 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + AC3C4A5A1A11F47200143C57 + + buildActionMask + 2147483647 + files + + 25FDEC921BF31EE700CEB123 + 7ACD5F891C415B7500E7BE16 + AC3C4A6A1A11F47200143C57 + 7A8384971C344057002CDD08 + FC3FCA801C2B1564009F6D6D + 7A8384941C343680002CDD08 + 7A83848E1C34359D002CDD08 + AC3C4A671A11F47200143C57 + 7ACD5F961C4847C000E7BE16 + AC3C4A641A11F47200143C57 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + AC3C4A5B1A11F47200143C57 + + buildActionMask + 2147483647 + files + + 91C402838901BD02685337A8 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + AC3C4A5C1A11F47200143C57 + + buildActionMask + 2147483647 + files + + 9BA2CEA11BB2579C00D18414 + AC3C4A8E1A11F80C00143C57 + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + AC3C4A5D1A11F47200143C57 + + buildConfigurationList + AC3C4A811A11F47200143C57 + buildPhases + + F868CFBB21824CC9521B6588 + AC3C4A5A1A11F47200143C57 + AC3C4A5B1A11F47200143C57 + AC3C4A5C1A11F47200143C57 + A6902C454C7661D0D277AC62 + B4CD33E927E6F4EE5DD6CCF0 + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Sample + productName + Sample + productReference + AC3C4A5E1A11F47200143C57 + productType + com.apple.product-type.application + + AC3C4A5E1A11F47200143C57 + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + Sample.app + sourceTree + BUILT_PRODUCTS_DIR + + AC3C4A5F1A11F47200143C57 + + children + + AC3C4A5E1A11F47200143C57 + + isa + PBXGroup + name + Products + sourceTree + <group> + + AC3C4A601A11F47200143C57 + + children + + AC3C4A651A11F47200143C57 + AC3C4A661A11F47200143C57 + AC3C4A681A11F47200143C57 + AC3C4A691A11F47200143C57 + 7ACD5F941C4847C000E7BE16 + 7ACD5F951C4847C000E7BE16 + FC3FCA7E1C2B1564009F6D6D + FC3FCA7F1C2B1564009F6D6D + AC3C4A8D1A11F80C00143C57 + AC3C4A611A11F47200143C57 + 25FDEC901BF31EE700CEB123 + 25FDEC911BF31EE700CEB123 + 7A8384951C344057002CDD08 + 7A8384961C344057002CDD08 + 7A83848C1C34359D002CDD08 + 7A83848D1C34359D002CDD08 + 7A8384911C343680002CDD08 + 7A8384921C343680002CDD08 + 7ACD5F871C415B7500E7BE16 + 7ACD5F881C415B7500E7BE16 + + indentWidth + 2 + isa + PBXGroup + path + Sample + sourceTree + <group> + tabWidth + 2 + usesTabs + 0 + + AC3C4A611A11F47200143C57 + + children + + AC3C4A621A11F47200143C57 + AC3C4A631A11F47200143C57 + 9BA2CEA01BB2579C00D18414 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + AC3C4A621A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Info.plist + sourceTree + <group> + + AC3C4A631A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + AC3C4A641A11F47200143C57 + + fileRef + AC3C4A631A11F47200143C57 + isa + PBXBuildFile + + AC3C4A651A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AppDelegate.h + sourceTree + <group> + + AC3C4A661A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AppDelegate.m + sourceTree + <group> + + AC3C4A671A11F47200143C57 + + fileRef + AC3C4A661A11F47200143C57 + isa + PBXBuildFile + + AC3C4A681A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ViewController.h + sourceTree + <group> + + AC3C4A691A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ViewController.m + sourceTree + <group> + + AC3C4A6A1A11F47200143C57 + + fileRef + AC3C4A691A11F47200143C57 + isa + PBXBuildFile + + AC3C4A7F1A11F47200143C57 + + 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.1 + MTL_ENABLE_DEBUG_INFO + YES + ONLY_ACTIVE_ARCH + YES + SDKROOT + iphoneos + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Debug + + AC3C4A801A11F47200143C57 + + 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.1 + MTL_ENABLE_DEBUG_INFO + NO + SDKROOT + iphoneos + TARGETED_DEVICE_FAMILY + 1,2 + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + AC3C4A811A11F47200143C57 + + buildConfigurations + + AC3C4A821A11F47200143C57 + AC3C4A831A11F47200143C57 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + AC3C4A821A11F47200143C57 + + baseConfigurationReference + F3A72D578C378357FF56486A + buildSettings + + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME + LaunchImage + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 8.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Debug + + AC3C4A831A11F47200143C57 + + baseConfigurationReference + 65F7AC562A910A742522053C + buildSettings + + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME + LaunchImage + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 8.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Release + + AC3C4A8D1A11F80C00143C57 + + isa + PBXFileReference + lastKnownFileType + folder.assetcatalog + path + Images.xcassets + sourceTree + <group> + + AC3C4A8E1A11F80C00143C57 + + fileRef + AC3C4A8D1A11F80C00143C57 + isa + PBXBuildFile + + B4CD33E927E6F4EE5DD6CCF0 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" + + showEnvVarsInLog + 0 + + D6E38FF0CB18E3F55CF06437 + + children + + F1E539014E1F516F00A8F167 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + F1E539014E1F516F00A8F167 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-Sample.a + sourceTree + BUILT_PRODUCTS_DIR + + F3A72D578C378357FF56486A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.debug.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig + sourceTree + <group> + + F868CFBB21824CC9521B6588 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + 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 + + showEnvVarsInLog + 0 + + FC3FCA7E1C2B1564009F6D6D + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + PresentingViewController.h + sourceTree + <group> + + FC3FCA7F1C2B1564009F6D6D + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + PresentingViewController.m + sourceTree + <group> + + FC3FCA801C2B1564009F6D6D + + fileRef + FC3FCA7F1C2B1564009F6D6D + isa + PBXBuildFile + + + rootObject + AC3C4A561A11F47200143C57 + + diff --git a/examples/CatDealsCollectionView/Sample/AppDelegate.h b/examples/CatDealsCollectionView/Sample/AppDelegate.h index 80b7fb3d50..b977c7498f 100644 --- a/examples/CatDealsCollectionView/Sample/AppDelegate.h +++ b/examples/CatDealsCollectionView/Sample/AppDelegate.h @@ -1,13 +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. - */ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CatDealsCollectionView/Sample/AppDelegate.m b/examples/CatDealsCollectionView/Sample/AppDelegate.m index adab692baf..564ba05b5d 100644 --- a/examples/CatDealsCollectionView/Sample/AppDelegate.m +++ b/examples/CatDealsCollectionView/Sample/AppDelegate.m @@ -1,13 +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. - */ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/CatDealsCollectionView/Sample/BlurbNode.h b/examples/CatDealsCollectionView/Sample/BlurbNode.h index efe58505e1..762352e76f 100644 --- a/examples/CatDealsCollectionView/Sample/BlurbNode.h +++ b/examples/CatDealsCollectionView/Sample/BlurbNode.h @@ -1,13 +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. - */ +// +// BlurbNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CatDealsCollectionView/Sample/BlurbNode.m b/examples/CatDealsCollectionView/Sample/BlurbNode.m index 68dcf866bc..c39d5ef0da 100644 --- a/examples/CatDealsCollectionView/Sample/BlurbNode.m +++ b/examples/CatDealsCollectionView/Sample/BlurbNode.m @@ -1,13 +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. - */ +// +// BlurbNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/CatDealsCollectionView/Sample/ItemNode.h b/examples/CatDealsCollectionView/Sample/ItemNode.h index eee5dc5dc9..7fc1dedc13 100644 --- a/examples/CatDealsCollectionView/Sample/ItemNode.h +++ b/examples/CatDealsCollectionView/Sample/ItemNode.h @@ -1,13 +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. - */ +// +// ItemNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 #import "ItemViewModel.h" diff --git a/examples/CatDealsCollectionView/Sample/ItemNode.m b/examples/CatDealsCollectionView/Sample/ItemNode.m index dd1c27a290..e383abf16f 100644 --- a/examples/CatDealsCollectionView/Sample/ItemNode.m +++ b/examples/CatDealsCollectionView/Sample/ItemNode.m @@ -1,13 +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. - */ +// +// ItemNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ItemNode.h" #import "ItemStyles.h" diff --git a/examples/CatDealsCollectionView/Sample/ItemStyles.h b/examples/CatDealsCollectionView/Sample/ItemStyles.h index 67879f3925..a5af90a017 100644 --- a/examples/CatDealsCollectionView/Sample/ItemStyles.h +++ b/examples/CatDealsCollectionView/Sample/ItemStyles.h @@ -3,7 +3,18 @@ // Sample // // Created by Samuel Stow on 12/30/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CatDealsCollectionView/Sample/ItemStyles.m b/examples/CatDealsCollectionView/Sample/ItemStyles.m index 3b39068452..12871e3be1 100644 --- a/examples/CatDealsCollectionView/Sample/ItemStyles.m +++ b/examples/CatDealsCollectionView/Sample/ItemStyles.m @@ -3,7 +3,18 @@ // Sample // // Created by Samuel Stow on 12/30/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ItemStyles.h" diff --git a/examples/CatDealsCollectionView/Sample/ItemViewModel.h b/examples/CatDealsCollectionView/Sample/ItemViewModel.h index 1d0403331c..4f73f3afe1 100644 --- a/examples/CatDealsCollectionView/Sample/ItemViewModel.h +++ b/examples/CatDealsCollectionView/Sample/ItemViewModel.h @@ -1,9 +1,20 @@ // -// GPDealViewModel.h -// Groupon +// ItemViewModel.h +// Sample // // Created by Samuel Stow on 12/29/15. -// Copyright Β© 2015 Groupon Inc. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CatDealsCollectionView/Sample/ItemViewModel.m b/examples/CatDealsCollectionView/Sample/ItemViewModel.m index 6ad4c1d13e..c975a798f4 100644 --- a/examples/CatDealsCollectionView/Sample/ItemViewModel.m +++ b/examples/CatDealsCollectionView/Sample/ItemViewModel.m @@ -1,9 +1,20 @@ // -// GPDealViewModel.m -// Groupon +// ItemViewModel.m +// Sample // // Created by Samuel Stow on 12/29/15. -// Copyright Β© 2015 Groupon Inc. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ItemViewModel.h" diff --git a/examples/CatDealsCollectionView/Sample/LoadingNode.h b/examples/CatDealsCollectionView/Sample/LoadingNode.h index 87c182c7a9..109cf61a32 100644 --- a/examples/CatDealsCollectionView/Sample/LoadingNode.h +++ b/examples/CatDealsCollectionView/Sample/LoadingNode.h @@ -3,7 +3,18 @@ // Sample // // Created by Samuel Stow on 1/9/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CatDealsCollectionView/Sample/LoadingNode.m b/examples/CatDealsCollectionView/Sample/LoadingNode.m index 1bb3977b9a..43a7693700 100644 --- a/examples/CatDealsCollectionView/Sample/LoadingNode.m +++ b/examples/CatDealsCollectionView/Sample/LoadingNode.m @@ -3,7 +3,18 @@ // Sample // // Created by Samuel Stow on 1/9/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "LoadingNode.h" diff --git a/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.h b/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.h index e9018a3784..53ba71544c 100644 --- a/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.h +++ b/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.h @@ -1,9 +1,20 @@ // -// PlacholderNetworkImageNode.h +// PlaceholderNetworkImageNode.h // Sample // // Created by Samuel Stow on 1/14/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.m b/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.m index c68607f8bb..cb1b7e81bc 100644 --- a/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.m +++ b/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.m @@ -1,9 +1,20 @@ // -// PlacholderNetworkImageNode.m +// PlaceholderNetworkImageNode.m // Sample // // Created by Samuel Stow on 1/14/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PlaceholderNetworkImageNode.h" diff --git a/examples/CatDealsCollectionView/Sample/PresentingViewController.h b/examples/CatDealsCollectionView/Sample/PresentingViewController.h index bd2308fab3..f0c2a76e37 100644 --- a/examples/CatDealsCollectionView/Sample/PresentingViewController.h +++ b/examples/CatDealsCollectionView/Sample/PresentingViewController.h @@ -3,7 +3,18 @@ // Sample // // Created by Tom King on 12/23/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CatDealsCollectionView/Sample/PresentingViewController.m b/examples/CatDealsCollectionView/Sample/PresentingViewController.m index 49c65e6906..53f297f9e3 100644 --- a/examples/CatDealsCollectionView/Sample/PresentingViewController.m +++ b/examples/CatDealsCollectionView/Sample/PresentingViewController.m @@ -3,7 +3,18 @@ // Sample // // Created by Tom King on 12/23/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PresentingViewController.h" diff --git a/examples/CatDealsCollectionView/Sample/ViewController.h b/examples/CatDealsCollectionView/Sample/ViewController.h index d0e9200d88..fc52c022f2 100644 --- a/examples/CatDealsCollectionView/Sample/ViewController.h +++ b/examples/CatDealsCollectionView/Sample/ViewController.h @@ -1,13 +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. - */ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CatDealsCollectionView/Sample/ViewController.m b/examples/CatDealsCollectionView/Sample/ViewController.m index 0effcdbdc3..e6e043ccda 100644 --- a/examples/CatDealsCollectionView/Sample/ViewController.m +++ b/examples/CatDealsCollectionView/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/CatDealsCollectionView/Sample/main.m b/examples/CatDealsCollectionView/Sample/main.m index 592423d8f6..d5794dca4c 100644 --- a/examples/CatDealsCollectionView/Sample/main.m +++ b/examples/CatDealsCollectionView/Sample/main.m @@ -1,13 +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. - */ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 #import "AppDelegate.h" diff --git a/examples/CollectionViewWithViewControllerCells/Sample.xcodeproj/project.pbxproj b/examples/CollectionViewWithViewControllerCells/Sample.xcodeproj/project.pbxproj deleted file mode 100644 index 74b4210418..0000000000 --- a/examples/CollectionViewWithViewControllerCells/Sample.xcodeproj/project.pbxproj +++ /dev/null @@ -1,365 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 25A1FA851C02F7AC00193875 /* MosaicCollectionViewLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 25A1FA841C02F7AC00193875 /* MosaicCollectionViewLayout.m */; }; - 9B92C8811BC17D3000EE46B2 /* SupplementaryNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92C8801BC17D3000EE46B2 /* SupplementaryNode.m */; }; - 9BA2CEA11BB2579C00D18414 /* Launchboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9BA2CEA01BB2579C00D18414 /* Launchboard.storyboard */; }; - AC3C4A641A11F47200143C57 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A631A11F47200143C57 /* main.m */; }; - AC3C4A671A11F47200143C57 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A661A11F47200143C57 /* AppDelegate.m */; }; - AC3C4A6A1A11F47200143C57 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A691A11F47200143C57 /* ViewController.m */; }; - AC3C4A8E1A11F80C00143C57 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AC3C4A8D1A11F80C00143C57 /* Images.xcassets */; }; - AEE6B3E51C16B65600238D20 /* ImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AEE6B3E41C16B65600238D20 /* ImageViewController.m */; }; - FABD6D156A3EB118497E5CE6 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F02BAF78E68BC56FD8C161B7 /* libPods.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 25A1FA831C02F7AC00193875 /* MosaicCollectionViewLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MosaicCollectionViewLayout.h; sourceTree = ""; }; - 25A1FA841C02F7AC00193875 /* MosaicCollectionViewLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MosaicCollectionViewLayout.m; sourceTree = ""; }; - 2DBAEE96397BB913350C4530 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; - 9B92C87F1BC17D3000EE46B2 /* SupplementaryNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SupplementaryNode.h; sourceTree = ""; }; - 9B92C8801BC17D3000EE46B2 /* SupplementaryNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SupplementaryNode.m; sourceTree = ""; }; - 9BA2CEA01BB2579C00D18414 /* Launchboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Launchboard.storyboard; sourceTree = ""; }; - AC3C4A5E1A11F47200143C57 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - AC3C4A621A11F47200143C57 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - AC3C4A631A11F47200143C57 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - AC3C4A651A11F47200143C57 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - AC3C4A661A11F47200143C57 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - AC3C4A681A11F47200143C57 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - AC3C4A691A11F47200143C57 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - AC3C4A8D1A11F80C00143C57 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - AEE6B3E31C16B65600238D20 /* ImageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageViewController.h; sourceTree = ""; }; - AEE6B3E41C16B65600238D20 /* ImageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageViewController.m; sourceTree = ""; }; - CD1ABB23007FEDB31D8C1978 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - F02BAF78E68BC56FD8C161B7 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - AC3C4A5B1A11F47200143C57 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - FABD6D156A3EB118497E5CE6 /* libPods.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 90A2B9C5397C46134C8A793B /* Pods */ = { - isa = PBXGroup; - children = ( - 2DBAEE96397BB913350C4530 /* Pods.debug.xcconfig */, - CD1ABB23007FEDB31D8C1978 /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - AC3C4A551A11F47200143C57 = { - isa = PBXGroup; - children = ( - AC3C4A601A11F47200143C57 /* Sample */, - AC3C4A5F1A11F47200143C57 /* Products */, - 90A2B9C5397C46134C8A793B /* Pods */, - D6E38FF0CB18E3F55CF06437 /* Frameworks */, - ); - sourceTree = ""; - }; - AC3C4A5F1A11F47200143C57 /* Products */ = { - isa = PBXGroup; - children = ( - AC3C4A5E1A11F47200143C57 /* Sample.app */, - ); - name = Products; - sourceTree = ""; - }; - AC3C4A601A11F47200143C57 /* Sample */ = { - isa = PBXGroup; - children = ( - 25A1FA831C02F7AC00193875 /* MosaicCollectionViewLayout.h */, - 25A1FA841C02F7AC00193875 /* MosaicCollectionViewLayout.m */, - AC3C4A651A11F47200143C57 /* AppDelegate.h */, - AC3C4A661A11F47200143C57 /* AppDelegate.m */, - AC3C4A681A11F47200143C57 /* ViewController.h */, - AC3C4A691A11F47200143C57 /* ViewController.m */, - AC3C4A8D1A11F80C00143C57 /* Images.xcassets */, - AC3C4A611A11F47200143C57 /* Supporting Files */, - 9B92C87F1BC17D3000EE46B2 /* SupplementaryNode.h */, - 9B92C8801BC17D3000EE46B2 /* SupplementaryNode.m */, - AEE6B3E31C16B65600238D20 /* ImageViewController.h */, - AEE6B3E41C16B65600238D20 /* ImageViewController.m */, - ); - indentWidth = 2; - path = Sample; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - AC3C4A611A11F47200143C57 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - AC3C4A621A11F47200143C57 /* Info.plist */, - AC3C4A631A11F47200143C57 /* main.m */, - 9BA2CEA01BB2579C00D18414 /* Launchboard.storyboard */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - D6E38FF0CB18E3F55CF06437 /* Frameworks */ = { - isa = PBXGroup; - children = ( - F02BAF78E68BC56FD8C161B7 /* libPods.a */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - AC3C4A5D1A11F47200143C57 /* Sample */ = { - isa = PBXNativeTarget; - buildConfigurationList = AC3C4A811A11F47200143C57 /* Build configuration list for PBXNativeTarget "Sample" */; - buildPhases = ( - F868CFBB21824CC9521B6588 /* Check Pods Manifest.lock */, - AC3C4A5A1A11F47200143C57 /* Sources */, - AC3C4A5B1A11F47200143C57 /* Frameworks */, - AC3C4A5C1A11F47200143C57 /* Resources */, - A6902C454C7661D0D277AC62 /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Sample; - productName = Sample; - productReference = AC3C4A5E1A11F47200143C57 /* Sample.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - AC3C4A561A11F47200143C57 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0610; - ORGANIZATIONNAME = Facebook; - TargetAttributes = { - AC3C4A5D1A11F47200143C57 = { - CreatedOnToolsVersion = 6.1; - }; - }; - }; - buildConfigurationList = AC3C4A591A11F47200143C57 /* Build configuration list for PBXProject "Sample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = AC3C4A551A11F47200143C57; - productRefGroup = AC3C4A5F1A11F47200143C57 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - AC3C4A5D1A11F47200143C57 /* Sample */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - AC3C4A5C1A11F47200143C57 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9BA2CEA11BB2579C00D18414 /* Launchboard.storyboard in Resources */, - AC3C4A8E1A11F80C00143C57 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - A6902C454C7661D0D277AC62 /* 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; - }; - F868CFBB21824CC9521B6588 /* 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 */ - AC3C4A5A1A11F47200143C57 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 25A1FA851C02F7AC00193875 /* MosaicCollectionViewLayout.m in Sources */, - AC3C4A6A1A11F47200143C57 /* ViewController.m in Sources */, - 9B92C8811BC17D3000EE46B2 /* SupplementaryNode.m in Sources */, - AC3C4A671A11F47200143C57 /* AppDelegate.m in Sources */, - AC3C4A641A11F47200143C57 /* main.m in Sources */, - AEE6B3E51C16B65600238D20 /* ImageViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - AC3C4A7F1A11F47200143C57 /* 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.1; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - AC3C4A801A11F47200143C57 /* 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.1; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - AC3C4A821A11F47200143C57 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2DBAEE96397BB913350C4530 /* Pods.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = 1; - }; - name = Debug; - }; - AC3C4A831A11F47200143C57 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CD1ABB23007FEDB31D8C1978 /* Pods.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = 1; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - AC3C4A591A11F47200143C57 /* Build configuration list for PBXProject "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AC3C4A7F1A11F47200143C57 /* Debug */, - AC3C4A801A11F47200143C57 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - AC3C4A811A11F47200143C57 /* Build configuration list for PBXNativeTarget "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AC3C4A821A11F47200143C57 /* Debug */, - AC3C4A831A11F47200143C57 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = AC3C4A561A11F47200143C57 /* Project object */; -} diff --git a/examples/CollectionViewWithViewControllerCells/Sample/AppDelegate.h b/examples/CollectionViewWithViewControllerCells/Sample/AppDelegate.h deleted file mode 100644 index 2aa29369b4..0000000000 --- a/examples/CollectionViewWithViewControllerCells/Sample/AppDelegate.h +++ /dev/null @@ -1,18 +0,0 @@ -/* 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 - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/examples/CollectionViewWithViewControllerCells/Sample/AppDelegate.m b/examples/CollectionViewWithViewControllerCells/Sample/AppDelegate.m deleted file mode 100644 index 6d9b473532..0000000000 --- a/examples/CollectionViewWithViewControllerCells/Sample/AppDelegate.m +++ /dev/null @@ -1,29 +0,0 @@ -/* 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 diff --git a/examples/CollectionViewWithViewControllerCells/Sample/ImageViewController.h b/examples/CollectionViewWithViewControllerCells/Sample/ImageViewController.h deleted file mode 100644 index 668840d050..0000000000 --- a/examples/CollectionViewWithViewControllerCells/Sample/ImageViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface ImageViewController : UIViewController -- (instancetype)initWithImage:(UIImage *)image; -@end diff --git a/examples/CollectionViewWithViewControllerCells/Sample/ImageViewController.m b/examples/CollectionViewWithViewControllerCells/Sample/ImageViewController.m deleted file mode 100644 index 77b35b8a32..0000000000 --- a/examples/CollectionViewWithViewControllerCells/Sample/ImageViewController.m +++ /dev/null @@ -1,50 +0,0 @@ -/* 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 "ImageViewController.h" - -@interface ImageViewController () -@property (nonatomic) UIImageView *imageView; -@end - -@implementation ImageViewController - -- (instancetype)initWithImage:(UIImage *)image { - if (!(self = [super init])) { return nil; } - - self.imageView = [[UIImageView alloc] initWithImage:image]; - - return self; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - - [self.view addSubview:self.imageView]; - - UIGestureRecognizer *tap = [[UIGestureRecognizer alloc] initWithTarget:self action:@selector(tapped)]; - [self.view addGestureRecognizer:tap]; - - self.imageView.contentMode = UIViewContentModeScaleAspectFill; -} - -- (void)tapped; -{ - NSLog(@"tapped!"); -} - -- (void)viewWillLayoutSubviews -{ - self.imageView.frame = self.view.bounds; -} - -@end diff --git a/examples/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.h b/examples/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.h deleted file mode 100644 index f75c929684..0000000000 --- a/examples/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.h +++ /dev/null @@ -1,18 +0,0 @@ -/* 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 - -@interface SupplementaryNode : ASCellNode - -- (instancetype)initWithText:(NSString *)text; - -@end diff --git a/examples/CollectionViewWithViewControllerCells/Sample/ViewController.h b/examples/CollectionViewWithViewControllerCells/Sample/ViewController.h deleted file mode 100644 index d0e9200d88..0000000000 --- a/examples/CollectionViewWithViewControllerCells/Sample/ViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface ViewController : UIViewController - -@end diff --git a/examples/CollectionViewWithViewControllerCells/Sample/main.m b/examples/CollectionViewWithViewControllerCells/Sample/main.m deleted file mode 100644 index 592423d8f6..0000000000 --- a/examples/CollectionViewWithViewControllerCells/Sample/main.m +++ /dev/null @@ -1,19 +0,0 @@ -/* 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 -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/examples/CustomCollectionView/Podfile b/examples/CustomCollectionView/Podfile index 6c012e3c04..919de4b311 100644 --- a/examples/CustomCollectionView/Podfile +++ b/examples/CustomCollectionView/Podfile @@ -1,3 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/CustomCollectionView/Sample.xcodeproj/project.pbxproj b/examples/CustomCollectionView/Sample.xcodeproj/project.pbxproj index 70cc92d2d3..3aadc478a2 100644 --- a/examples/CustomCollectionView/Sample.xcodeproj/project.pbxproj +++ b/examples/CustomCollectionView/Sample.xcodeproj/project.pbxproj @@ -1,359 +1,790 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 25A1FA851C02F7AC00193875 /* MosaicCollectionViewLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 25A1FA841C02F7AC00193875 /* MosaicCollectionViewLayout.m */; }; - 25A1FA881C02FCB000193875 /* ImageCellNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 25A1FA871C02FCB000193875 /* ImageCellNode.m */; }; - 9BA2CEA11BB2579C00D18414 /* Launchboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9BA2CEA01BB2579C00D18414 /* Launchboard.storyboard */; }; - AC3C4A641A11F47200143C57 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A631A11F47200143C57 /* main.m */; }; - AC3C4A671A11F47200143C57 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A661A11F47200143C57 /* AppDelegate.m */; }; - AC3C4A6A1A11F47200143C57 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A691A11F47200143C57 /* ViewController.m */; }; - AC3C4A8E1A11F80C00143C57 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AC3C4A8D1A11F80C00143C57 /* Images.xcassets */; }; - FABD6D156A3EB118497E5CE6 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F02BAF78E68BC56FD8C161B7 /* libPods.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 25A1FA831C02F7AC00193875 /* MosaicCollectionViewLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MosaicCollectionViewLayout.h; sourceTree = ""; }; - 25A1FA841C02F7AC00193875 /* MosaicCollectionViewLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MosaicCollectionViewLayout.m; sourceTree = ""; }; - 25A1FA861C02FCB000193875 /* ImageCellNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageCellNode.h; sourceTree = ""; }; - 25A1FA871C02FCB000193875 /* ImageCellNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageCellNode.m; sourceTree = ""; }; - 2DBAEE96397BB913350C4530 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; - 9BA2CEA01BB2579C00D18414 /* Launchboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Launchboard.storyboard; sourceTree = ""; }; - AC3C4A5E1A11F47200143C57 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - AC3C4A621A11F47200143C57 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - AC3C4A631A11F47200143C57 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - AC3C4A651A11F47200143C57 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - AC3C4A661A11F47200143C57 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - AC3C4A681A11F47200143C57 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - AC3C4A691A11F47200143C57 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - AC3C4A8D1A11F80C00143C57 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - CD1ABB23007FEDB31D8C1978 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - F02BAF78E68BC56FD8C161B7 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - AC3C4A5B1A11F47200143C57 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - FABD6D156A3EB118497E5CE6 /* libPods.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 90A2B9C5397C46134C8A793B /* Pods */ = { - isa = PBXGroup; - children = ( - 2DBAEE96397BB913350C4530 /* Pods.debug.xcconfig */, - CD1ABB23007FEDB31D8C1978 /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - AC3C4A551A11F47200143C57 = { - isa = PBXGroup; - children = ( - AC3C4A601A11F47200143C57 /* Sample */, - AC3C4A5F1A11F47200143C57 /* Products */, - 90A2B9C5397C46134C8A793B /* Pods */, - D6E38FF0CB18E3F55CF06437 /* Frameworks */, - ); - sourceTree = ""; - }; - AC3C4A5F1A11F47200143C57 /* Products */ = { - isa = PBXGroup; - children = ( - AC3C4A5E1A11F47200143C57 /* Sample.app */, - ); - name = Products; - sourceTree = ""; - }; - AC3C4A601A11F47200143C57 /* Sample */ = { - isa = PBXGroup; - children = ( - 25A1FA831C02F7AC00193875 /* MosaicCollectionViewLayout.h */, - 25A1FA841C02F7AC00193875 /* MosaicCollectionViewLayout.m */, - AC3C4A651A11F47200143C57 /* AppDelegate.h */, - AC3C4A661A11F47200143C57 /* AppDelegate.m */, - AC3C4A681A11F47200143C57 /* ViewController.h */, - AC3C4A691A11F47200143C57 /* ViewController.m */, - 25A1FA861C02FCB000193875 /* ImageCellNode.h */, - 25A1FA871C02FCB000193875 /* ImageCellNode.m */, - AC3C4A8D1A11F80C00143C57 /* Images.xcassets */, - AC3C4A611A11F47200143C57 /* Supporting Files */, - ); - indentWidth = 2; - path = Sample; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - AC3C4A611A11F47200143C57 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - AC3C4A621A11F47200143C57 /* Info.plist */, - AC3C4A631A11F47200143C57 /* main.m */, - 9BA2CEA01BB2579C00D18414 /* Launchboard.storyboard */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - D6E38FF0CB18E3F55CF06437 /* Frameworks */ = { - isa = PBXGroup; - children = ( - F02BAF78E68BC56FD8C161B7 /* libPods.a */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - AC3C4A5D1A11F47200143C57 /* Sample */ = { - isa = PBXNativeTarget; - buildConfigurationList = AC3C4A811A11F47200143C57 /* Build configuration list for PBXNativeTarget "Sample" */; - buildPhases = ( - F868CFBB21824CC9521B6588 /* Check Pods Manifest.lock */, - AC3C4A5A1A11F47200143C57 /* Sources */, - AC3C4A5B1A11F47200143C57 /* Frameworks */, - AC3C4A5C1A11F47200143C57 /* Resources */, - A6902C454C7661D0D277AC62 /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Sample; - productName = Sample; - productReference = AC3C4A5E1A11F47200143C57 /* Sample.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - AC3C4A561A11F47200143C57 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0610; - ORGANIZATIONNAME = Facebook; - TargetAttributes = { - AC3C4A5D1A11F47200143C57 = { - CreatedOnToolsVersion = 6.1; - }; - }; - }; - buildConfigurationList = AC3C4A591A11F47200143C57 /* Build configuration list for PBXProject "Sample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = AC3C4A551A11F47200143C57; - productRefGroup = AC3C4A5F1A11F47200143C57 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - AC3C4A5D1A11F47200143C57 /* Sample */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - AC3C4A5C1A11F47200143C57 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9BA2CEA11BB2579C00D18414 /* Launchboard.storyboard in Resources */, - AC3C4A8E1A11F80C00143C57 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - A6902C454C7661D0D277AC62 /* 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; - }; - F868CFBB21824CC9521B6588 /* 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 */ - AC3C4A5A1A11F47200143C57 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 25A1FA851C02F7AC00193875 /* MosaicCollectionViewLayout.m in Sources */, - AC3C4A6A1A11F47200143C57 /* ViewController.m in Sources */, - AC3C4A671A11F47200143C57 /* AppDelegate.m in Sources */, - AC3C4A641A11F47200143C57 /* main.m in Sources */, - 25A1FA881C02FCB000193875 /* ImageCellNode.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - AC3C4A7F1A11F47200143C57 /* 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.1; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - AC3C4A801A11F47200143C57 /* 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.1; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - AC3C4A821A11F47200143C57 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2DBAEE96397BB913350C4530 /* Pods.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = 1; - }; - name = Debug; - }; - AC3C4A831A11F47200143C57 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CD1ABB23007FEDB31D8C1978 /* Pods.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = 1; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - AC3C4A591A11F47200143C57 /* Build configuration list for PBXProject "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AC3C4A7F1A11F47200143C57 /* Debug */, - AC3C4A801A11F47200143C57 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - AC3C4A811A11F47200143C57 /* Build configuration list for PBXNativeTarget "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AC3C4A821A11F47200143C57 /* Debug */, - AC3C4A831A11F47200143C57 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = AC3C4A561A11F47200143C57 /* Project object */; -} + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 25A1FA831C02F7AC00193875 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + MosaicCollectionViewLayout.h + sourceTree + <group> + + 25A1FA841C02F7AC00193875 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + MosaicCollectionViewLayout.m + sourceTree + <group> + + 25A1FA851C02F7AC00193875 + + fileRef + 25A1FA841C02F7AC00193875 + isa + PBXBuildFile + + 25A1FA861C02FCB000193875 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ImageCellNode.h + sourceTree + <group> + + 25A1FA871C02FCB000193875 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ImageCellNode.m + sourceTree + <group> + + 25A1FA881C02FCB000193875 + + fileRef + 25A1FA871C02FCB000193875 + isa + PBXBuildFile + + 3760AAE3843D6EA89A9A166B + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" + + showEnvVarsInLog + 0 + + 4CC0FB9EE0030992E8FBC0A0 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-Sample.a + sourceTree + BUILT_PRODUCTS_DIR + + 576F970133B34DFD583D5CE4 + + fileRef + 4CC0FB9EE0030992E8FBC0A0 + isa + PBXBuildFile + + 90A2B9C5397C46134C8A793B + + children + + F36BCD8EBAF79797AB5C6708 + E2F287D91FFDEA2A747630CE + + isa + PBXGroup + name + Pods + sourceTree + <group> + + 9BA2CEA01BB2579C00D18414 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + file.storyboard + path + Launchboard.storyboard + sourceTree + <group> + + 9BA2CEA11BB2579C00D18414 + + fileRef + 9BA2CEA01BB2579C00D18414 + isa + PBXBuildFile + + A6902C454C7661D0D277AC62 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" + + showEnvVarsInLog + 0 + + AC3C4A551A11F47200143C57 + + children + + AC3C4A601A11F47200143C57 + AC3C4A5F1A11F47200143C57 + 90A2B9C5397C46134C8A793B + D6E38FF0CB18E3F55CF06437 + + isa + PBXGroup + sourceTree + <group> + + AC3C4A561A11F47200143C57 + + attributes + + LastUpgradeCheck + 0610 + ORGANIZATIONNAME + Facebook + TargetAttributes + + AC3C4A5D1A11F47200143C57 + + CreatedOnToolsVersion + 6.1 + + + + buildConfigurationList + AC3C4A591A11F47200143C57 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + AC3C4A551A11F47200143C57 + productRefGroup + AC3C4A5F1A11F47200143C57 + projectDirPath + + projectReferences + + projectRoot + + targets + + AC3C4A5D1A11F47200143C57 + + + AC3C4A591A11F47200143C57 + + buildConfigurations + + AC3C4A7F1A11F47200143C57 + AC3C4A801A11F47200143C57 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + AC3C4A5A1A11F47200143C57 + + buildActionMask + 2147483647 + files + + 25A1FA851C02F7AC00193875 + AC3C4A6A1A11F47200143C57 + AC3C4A671A11F47200143C57 + AC3C4A641A11F47200143C57 + 25A1FA881C02FCB000193875 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + AC3C4A5B1A11F47200143C57 + + buildActionMask + 2147483647 + files + + 576F970133B34DFD583D5CE4 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + AC3C4A5C1A11F47200143C57 + + buildActionMask + 2147483647 + files + + 9BA2CEA11BB2579C00D18414 + AC3C4A8E1A11F80C00143C57 + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + AC3C4A5D1A11F47200143C57 + + buildConfigurationList + AC3C4A811A11F47200143C57 + buildPhases + + F868CFBB21824CC9521B6588 + AC3C4A5A1A11F47200143C57 + AC3C4A5B1A11F47200143C57 + AC3C4A5C1A11F47200143C57 + A6902C454C7661D0D277AC62 + 3760AAE3843D6EA89A9A166B + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Sample + productName + Sample + productReference + AC3C4A5E1A11F47200143C57 + productType + com.apple.product-type.application + + AC3C4A5E1A11F47200143C57 + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + Sample.app + sourceTree + BUILT_PRODUCTS_DIR + + AC3C4A5F1A11F47200143C57 + + children + + AC3C4A5E1A11F47200143C57 + + isa + PBXGroup + name + Products + sourceTree + <group> + + AC3C4A601A11F47200143C57 + + children + + 25A1FA831C02F7AC00193875 + 25A1FA841C02F7AC00193875 + AC3C4A651A11F47200143C57 + AC3C4A661A11F47200143C57 + AC3C4A681A11F47200143C57 + AC3C4A691A11F47200143C57 + 25A1FA861C02FCB000193875 + 25A1FA871C02FCB000193875 + AC3C4A8D1A11F80C00143C57 + AC3C4A611A11F47200143C57 + + indentWidth + 2 + isa + PBXGroup + path + Sample + sourceTree + <group> + tabWidth + 2 + usesTabs + 0 + + AC3C4A611A11F47200143C57 + + children + + AC3C4A621A11F47200143C57 + AC3C4A631A11F47200143C57 + 9BA2CEA01BB2579C00D18414 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + AC3C4A621A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Info.plist + sourceTree + <group> + + AC3C4A631A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + AC3C4A641A11F47200143C57 + + fileRef + AC3C4A631A11F47200143C57 + isa + PBXBuildFile + + AC3C4A651A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AppDelegate.h + sourceTree + <group> + + AC3C4A661A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AppDelegate.m + sourceTree + <group> + + AC3C4A671A11F47200143C57 + + fileRef + AC3C4A661A11F47200143C57 + isa + PBXBuildFile + + AC3C4A681A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ViewController.h + sourceTree + <group> + + AC3C4A691A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ViewController.m + sourceTree + <group> + + AC3C4A6A1A11F47200143C57 + + fileRef + AC3C4A691A11F47200143C57 + isa + PBXBuildFile + + AC3C4A7F1A11F47200143C57 + + 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.1 + MTL_ENABLE_DEBUG_INFO + YES + ONLY_ACTIVE_ARCH + YES + SDKROOT + iphoneos + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Debug + + AC3C4A801A11F47200143C57 + + 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.1 + MTL_ENABLE_DEBUG_INFO + NO + SDKROOT + iphoneos + TARGETED_DEVICE_FAMILY + 1,2 + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + AC3C4A811A11F47200143C57 + + buildConfigurations + + AC3C4A821A11F47200143C57 + AC3C4A831A11F47200143C57 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + AC3C4A821A11F47200143C57 + + baseConfigurationReference + F36BCD8EBAF79797AB5C6708 + buildSettings + + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME + LaunchImage + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 8.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1 + + isa + XCBuildConfiguration + name + Debug + + AC3C4A831A11F47200143C57 + + baseConfigurationReference + E2F287D91FFDEA2A747630CE + buildSettings + + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME + LaunchImage + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 8.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1 + + isa + XCBuildConfiguration + name + Release + + AC3C4A8D1A11F80C00143C57 + + isa + PBXFileReference + lastKnownFileType + folder.assetcatalog + path + Images.xcassets + sourceTree + <group> + + AC3C4A8E1A11F80C00143C57 + + fileRef + AC3C4A8D1A11F80C00143C57 + isa + PBXBuildFile + + D6E38FF0CB18E3F55CF06437 + + children + + 4CC0FB9EE0030992E8FBC0A0 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + E2F287D91FFDEA2A747630CE + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + + F36BCD8EBAF79797AB5C6708 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.debug.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig + sourceTree + <group> + + F868CFBB21824CC9521B6588 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + 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 + + showEnvVarsInLog + 0 + + + rootObject + AC3C4A561A11F47200143C57 + + diff --git a/examples/CustomCollectionView/Sample/AppDelegate.h b/examples/CustomCollectionView/Sample/AppDelegate.h index 2aa29369b4..27e560aafe 100644 --- a/examples/CustomCollectionView/Sample/AppDelegate.h +++ b/examples/CustomCollectionView/Sample/AppDelegate.h @@ -1,13 +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. - */ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CustomCollectionView/Sample/AppDelegate.m b/examples/CustomCollectionView/Sample/AppDelegate.m index 6d9b473532..853bf6e8bc 100644 --- a/examples/CustomCollectionView/Sample/AppDelegate.m +++ b/examples/CustomCollectionView/Sample/AppDelegate.m @@ -1,13 +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. - */ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/CustomCollectionView/Sample/ImageCellNode.h b/examples/CustomCollectionView/Sample/ImageCellNode.h index d2722d19d2..6a0f4c63d9 100644 --- a/examples/CustomCollectionView/Sample/ImageCellNode.h +++ b/examples/CustomCollectionView/Sample/ImageCellNode.h @@ -3,7 +3,18 @@ // Sample // // Created by McCallum, Levi on 11/22/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CustomCollectionView/Sample/ImageCellNode.m b/examples/CustomCollectionView/Sample/ImageCellNode.m index 02064168c7..5eb7163c32 100644 --- a/examples/CustomCollectionView/Sample/ImageCellNode.m +++ b/examples/CustomCollectionView/Sample/ImageCellNode.m @@ -3,7 +3,18 @@ // Sample // // Created by McCallum, Levi on 11/22/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ImageCellNode.h" diff --git a/examples/CustomCollectionView/Sample/MosaicCollectionViewLayout.h b/examples/CustomCollectionView/Sample/MosaicCollectionViewLayout.h index 03b8af5f7c..0acb1dde08 100644 --- a/examples/CustomCollectionView/Sample/MosaicCollectionViewLayout.h +++ b/examples/CustomCollectionView/Sample/MosaicCollectionViewLayout.h @@ -3,7 +3,18 @@ // Sample // // Created by McCallum, Levi on 11/22/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CustomCollectionView/Sample/MosaicCollectionViewLayout.m b/examples/CustomCollectionView/Sample/MosaicCollectionViewLayout.m index 67654b0df9..67f2505f83 100644 --- a/examples/CustomCollectionView/Sample/MosaicCollectionViewLayout.m +++ b/examples/CustomCollectionView/Sample/MosaicCollectionViewLayout.m @@ -3,7 +3,18 @@ // Sample // // Created by McCallum, Levi on 11/22/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "MosaicCollectionViewLayout.h" diff --git a/examples/CustomCollectionView/Sample/ViewController.h b/examples/CustomCollectionView/Sample/ViewController.h index d0e9200d88..fc52c022f2 100644 --- a/examples/CustomCollectionView/Sample/ViewController.h +++ b/examples/CustomCollectionView/Sample/ViewController.h @@ -1,13 +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. - */ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CustomCollectionView/Sample/ViewController.m b/examples/CustomCollectionView/Sample/ViewController.m index 76beec0259..c2aee53b2f 100644 --- a/examples/CustomCollectionView/Sample/ViewController.m +++ b/examples/CustomCollectionView/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/CustomCollectionView/Sample/main.m b/examples/CustomCollectionView/Sample/main.m index 592423d8f6..d5794dca4c 100644 --- a/examples/CustomCollectionView/Sample/main.m +++ b/examples/CustomCollectionView/Sample/main.m @@ -1,13 +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. - */ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 #import "AppDelegate.h" diff --git a/examples/EditableText/CustomCollectionView.gif b/examples/EditableText/CustomCollectionView.gif deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/examples/EditableText/Podfile b/examples/EditableText/Podfile deleted file mode 100644 index 6c012e3c04..0000000000 --- a/examples/EditableText/Podfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' diff --git a/examples/EditableText/Sample.xcworkspace/contents.xcworkspacedata b/examples/EditableText/Sample.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7b5a2f3050..0000000000 --- a/examples/EditableText/Sample.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/examples/EditableText/Sample/AppDelegate.h b/examples/EditableText/Sample/AppDelegate.h deleted file mode 100644 index 2aa29369b4..0000000000 --- a/examples/EditableText/Sample/AppDelegate.h +++ /dev/null @@ -1,18 +0,0 @@ -/* 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 - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/examples/EditableText/Sample/AppDelegate.m b/examples/EditableText/Sample/AppDelegate.m deleted file mode 100644 index a8e5594780..0000000000 --- a/examples/EditableText/Sample/AppDelegate.m +++ /dev/null @@ -1,27 +0,0 @@ -/* 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 diff --git a/examples/EditableText/Sample/ViewController.h b/examples/EditableText/Sample/ViewController.h deleted file mode 100644 index d0e9200d88..0000000000 --- a/examples/EditableText/Sample/ViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface ViewController : UIViewController - -@end diff --git a/examples/EditableText/Sample/main.m b/examples/EditableText/Sample/main.m deleted file mode 100644 index ae9488711c..0000000000 --- a/examples/EditableText/Sample/main.m +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/examples/HorizontalWithinVerticalScrolling/Podfile b/examples/HorizontalWithinVerticalScrolling/Podfile index 6c012e3c04..919de4b311 100644 --- a/examples/HorizontalWithinVerticalScrolling/Podfile +++ b/examples/HorizontalWithinVerticalScrolling/Podfile @@ -1,3 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/HorizontalWithinVerticalScrolling/Sample.xcodeproj/project.pbxproj b/examples/HorizontalWithinVerticalScrolling/Sample.xcodeproj/project.pbxproj index aabd4dda02..00f893b725 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample.xcodeproj/project.pbxproj +++ b/examples/HorizontalWithinVerticalScrolling/Sample.xcodeproj/project.pbxproj @@ -1,361 +1,806 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 05561CFD19D4F94A00CBA93C /* HorizontalScrollCellNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05561CFC19D4F94A00CBA93C /* HorizontalScrollCellNode.mm */; }; - 0585428019D4DBE100606EA6 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */; }; - 05E2128719D4DB510098F589 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128619D4DB510098F589 /* main.m */; }; - 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128919D4DB510098F589 /* AppDelegate.m */; }; - 05E2128D19D4DB510098F589 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128C19D4DB510098F589 /* ViewController.m */; }; - 18C2ED861B9B8CE700F627B3 /* RandomCoreGraphicsNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 18C2ED851B9B8CE700F627B3 /* RandomCoreGraphicsNode.m */; }; - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; - 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; - 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 05561CFB19D4F94A00CBA93C /* HorizontalScrollCellNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HorizontalScrollCellNode.h; sourceTree = ""; }; - 05561CFC19D4F94A00CBA93C /* HorizontalScrollCellNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HorizontalScrollCellNode.mm; sourceTree = ""; }; - 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; - 05E2128119D4DB510098F589 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 05E2128519D4DB510098F589 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 05E2128619D4DB510098F589 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 05E2128819D4DB510098F589 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 05E2128919D4DB510098F589 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 05E2128B19D4DB510098F589 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 05E2128C19D4DB510098F589 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - 18C2ED841B9B8CE700F627B3 /* RandomCoreGraphicsNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RandomCoreGraphicsNode.h; sourceTree = ""; }; - 18C2ED851B9B8CE700F627B3 /* RandomCoreGraphicsNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RandomCoreGraphicsNode.m; sourceTree = ""; }; - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; - 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 05E2127E19D4DB510098F589 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 05E2127819D4DB510098F589 = { - isa = PBXGroup; - children = ( - 05E2128319D4DB510098F589 /* Sample */, - 05E2128219D4DB510098F589 /* Products */, - 1A943BF0259746F18D6E423F /* Frameworks */, - 1AE410B73DA5C3BD087ACDD7 /* Pods */, - ); - indentWidth = 2; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - 05E2128219D4DB510098F589 /* Products */ = { - isa = PBXGroup; - children = ( - 05E2128119D4DB510098F589 /* Sample.app */, - ); - name = Products; - sourceTree = ""; - }; - 05E2128319D4DB510098F589 /* Sample */ = { - isa = PBXGroup; - children = ( - 05E2128819D4DB510098F589 /* AppDelegate.h */, - 05E2128919D4DB510098F589 /* AppDelegate.m */, - 05E2128B19D4DB510098F589 /* ViewController.h */, - 05E2128C19D4DB510098F589 /* ViewController.m */, - 05561CFB19D4F94A00CBA93C /* HorizontalScrollCellNode.h */, - 05561CFC19D4F94A00CBA93C /* HorizontalScrollCellNode.mm */, - 18C2ED841B9B8CE700F627B3 /* RandomCoreGraphicsNode.h */, - 18C2ED851B9B8CE700F627B3 /* RandomCoreGraphicsNode.m */, - 05E2128419D4DB510098F589 /* Supporting Files */, - ); - path = Sample; - sourceTree = ""; - }; - 05E2128419D4DB510098F589 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */, - 6C2C82AA19EE274300767484 /* Default-667h@2x.png */, - 6C2C82AB19EE274300767484 /* Default-736h@3x.png */, - 05E2128519D4DB510098F589 /* Info.plist */, - 05E2128619D4DB510098F589 /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 1A943BF0259746F18D6E423F /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 1AE410B73DA5C3BD087ACDD7 /* Pods */ = { - isa = PBXGroup; - children = ( - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */, - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 05E2128019D4DB510098F589 /* Sample */ = { - isa = PBXNativeTarget; - buildConfigurationList = 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */; - buildPhases = ( - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */, - 05E2127D19D4DB510098F589 /* Sources */, - 05E2127E19D4DB510098F589 /* Frameworks */, - 05E2127F19D4DB510098F589 /* Resources */, - F012A6F39E0149F18F564F50 /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Sample; - productName = Sample; - productReference = 05E2128119D4DB510098F589 /* Sample.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 05E2127919D4DB510098F589 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0600; - ORGANIZATIONNAME = Facebook; - TargetAttributes = { - 05E2128019D4DB510098F589 = { - CreatedOnToolsVersion = 6.0.1; - }; - }; - }; - buildConfigurationList = 05E2127C19D4DB510098F589 /* Build configuration list for PBXProject "Sample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 05E2127819D4DB510098F589; - productRefGroup = 05E2128219D4DB510098F589 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 05E2128019D4DB510098F589 /* Sample */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 05E2127F19D4DB510098F589 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 0585428019D4DBE100606EA6 /* Default-568h@2x.png in Resources */, - 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */, - 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - E080B80F89C34A25B3488E26 /* 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; - }; - F012A6F39E0149F18F564F50 /* 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; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 05E2127D19D4DB510098F589 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 18C2ED861B9B8CE700F627B3 /* RandomCoreGraphicsNode.m in Sources */, - 05561CFD19D4F94A00CBA93C /* HorizontalScrollCellNode.mm in Sources */, - 05E2128D19D4DB510098F589 /* ViewController.m in Sources */, - 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */, - 05E2128719D4DB510098F589 /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 05E212A219D4DB510098F589 /* 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; - }; - name = Debug; - }; - 05E212A319D4DB510098F589 /* 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; - }; - 05E212A519D4DB510098F589 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 05E212A619D4DB510098F589 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 05E2127C19D4DB510098F589 /* Build configuration list for PBXProject "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 05E212A219D4DB510098F589 /* Debug */, - 05E212A319D4DB510098F589 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 05E212A519D4DB510098F589 /* Debug */, - 05E212A619D4DB510098F589 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 05E2127919D4DB510098F589 /* Project object */; -} + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 05561CFB19D4F94A00CBA93C + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + HorizontalScrollCellNode.h + sourceTree + <group> + + 05561CFC19D4F94A00CBA93C + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.cpp.objcpp + path + HorizontalScrollCellNode.mm + sourceTree + <group> + + 05561CFD19D4F94A00CBA93C + + fileRef + 05561CFC19D4F94A00CBA93C + isa + PBXBuildFile + + 0585427F19D4DBE100606EA6 + + isa + PBXFileReference + lastKnownFileType + image.png + name + Default-568h@2x.png + path + ../Default-568h@2x.png + sourceTree + <group> + + 0585428019D4DBE100606EA6 + + fileRef + 0585427F19D4DBE100606EA6 + isa + PBXBuildFile + + 05E2127819D4DB510098F589 + + children + + 05E2128319D4DB510098F589 + 05E2128219D4DB510098F589 + 1A943BF0259746F18D6E423F + 1AE410B73DA5C3BD087ACDD7 + + indentWidth + 2 + isa + PBXGroup + sourceTree + <group> + tabWidth + 2 + usesTabs + 0 + + 05E2127919D4DB510098F589 + + attributes + + LastUpgradeCheck + 0600 + ORGANIZATIONNAME + Facebook + TargetAttributes + + 05E2128019D4DB510098F589 + + CreatedOnToolsVersion + 6.0.1 + + + + buildConfigurationList + 05E2127C19D4DB510098F589 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + 05E2127819D4DB510098F589 + productRefGroup + 05E2128219D4DB510098F589 + projectDirPath + + projectReferences + + projectRoot + + targets + + 05E2128019D4DB510098F589 + + + 05E2127C19D4DB510098F589 + + buildConfigurations + + 05E212A219D4DB510098F589 + 05E212A319D4DB510098F589 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 05E2127D19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 18C2ED861B9B8CE700F627B3 + 05561CFD19D4F94A00CBA93C + 05E2128D19D4DB510098F589 + 05E2128A19D4DB510098F589 + 05E2128719D4DB510098F589 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2127E19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 18B5AC4A1550AC957426B54E + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2127F19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 0585428019D4DBE100606EA6 + 6C2C82AC19EE274300767484 + 6C2C82AD19EE274300767484 + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2128019D4DB510098F589 + + buildConfigurationList + 05E212A419D4DB510098F589 + buildPhases + + E080B80F89C34A25B3488E26 + 05E2127D19D4DB510098F589 + 05E2127E19D4DB510098F589 + 05E2127F19D4DB510098F589 + F012A6F39E0149F18F564F50 + A79A9172A45D7C9595AA01CC + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Sample + productName + Sample + productReference + 05E2128119D4DB510098F589 + productType + com.apple.product-type.application + + 05E2128119D4DB510098F589 + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + Sample.app + sourceTree + BUILT_PRODUCTS_DIR + + 05E2128219D4DB510098F589 + + children + + 05E2128119D4DB510098F589 + + isa + PBXGroup + name + Products + sourceTree + <group> + + 05E2128319D4DB510098F589 + + children + + 05E2128819D4DB510098F589 + 05E2128919D4DB510098F589 + 05E2128B19D4DB510098F589 + 05E2128C19D4DB510098F589 + 05561CFB19D4F94A00CBA93C + 05561CFC19D4F94A00CBA93C + 18C2ED841B9B8CE700F627B3 + 18C2ED851B9B8CE700F627B3 + 05E2128419D4DB510098F589 + + isa + PBXGroup + path + Sample + sourceTree + <group> + + 05E2128419D4DB510098F589 + + children + + 0585427F19D4DBE100606EA6 + 6C2C82AA19EE274300767484 + 6C2C82AB19EE274300767484 + 05E2128519D4DB510098F589 + 05E2128619D4DB510098F589 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + 05E2128519D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Info.plist + sourceTree + <group> + + 05E2128619D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + 05E2128719D4DB510098F589 + + fileRef + 05E2128619D4DB510098F589 + isa + PBXBuildFile + + 05E2128819D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AppDelegate.h + sourceTree + <group> + + 05E2128919D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AppDelegate.m + sourceTree + <group> + + 05E2128A19D4DB510098F589 + + fileRef + 05E2128919D4DB510098F589 + isa + PBXBuildFile + + 05E2128B19D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ViewController.h + sourceTree + <group> + + 05E2128C19D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ViewController.m + sourceTree + <group> + + 05E2128D19D4DB510098F589 + + fileRef + 05E2128C19D4DB510098F589 + isa + PBXBuildFile + + 05E212A219D4DB510098F589 + + 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 + + isa + XCBuildConfiguration + name + Debug + + 05E212A319D4DB510098F589 + + 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 + + isa + XCBuildConfiguration + name + Release + + 05E212A419D4DB510098F589 + + buildConfigurations + + 05E212A519D4DB510098F589 + 05E212A619D4DB510098F589 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 05E212A519D4DB510098F589 + + baseConfigurationReference + 367E401FD4A0E65C4C240050 + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 7.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Debug + + 05E212A619D4DB510098F589 + + baseConfigurationReference + 9CEC783A48902CC0051FDE7E + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 7.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Release + + 18B5AC4A1550AC957426B54E + + fileRef + 9341ADE7BE83CA50F1FD55C1 + isa + PBXBuildFile + + 18C2ED841B9B8CE700F627B3 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RandomCoreGraphicsNode.h + sourceTree + <group> + + 18C2ED851B9B8CE700F627B3 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RandomCoreGraphicsNode.m + sourceTree + <group> + + 18C2ED861B9B8CE700F627B3 + + fileRef + 18C2ED851B9B8CE700F627B3 + isa + PBXBuildFile + + 1A943BF0259746F18D6E423F + + children + + 9341ADE7BE83CA50F1FD55C1 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 1AE410B73DA5C3BD087ACDD7 + + children + + 367E401FD4A0E65C4C240050 + 9CEC783A48902CC0051FDE7E + + isa + PBXGroup + name + Pods + sourceTree + <group> + + 367E401FD4A0E65C4C240050 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.debug.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig + sourceTree + <group> + + 6C2C82AA19EE274300767484 + + isa + PBXFileReference + lastKnownFileType + image.png + path + Default-667h@2x.png + sourceTree + SOURCE_ROOT + + 6C2C82AB19EE274300767484 + + isa + PBXFileReference + lastKnownFileType + image.png + path + Default-736h@3x.png + sourceTree + SOURCE_ROOT + + 6C2C82AC19EE274300767484 + + fileRef + 6C2C82AA19EE274300767484 + isa + PBXBuildFile + + 6C2C82AD19EE274300767484 + + fileRef + 6C2C82AB19EE274300767484 + isa + PBXBuildFile + + 9341ADE7BE83CA50F1FD55C1 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-Sample.a + sourceTree + BUILT_PRODUCTS_DIR + + 9CEC783A48902CC0051FDE7E + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + + A79A9172A45D7C9595AA01CC + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" + + showEnvVarsInLog + 0 + + E080B80F89C34A25B3488E26 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + 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 + + showEnvVarsInLog + 0 + + F012A6F39E0149F18F564F50 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" + + showEnvVarsInLog + 0 + + + rootObject + 05E2127919D4DB510098F589 + + diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.h b/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.h index 85855277e9..5274628a9e 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.h +++ b/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.h @@ -1,13 +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. - */ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.m b/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.m index 1dea563b77..58fe564898 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.m +++ b/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.m @@ -1,13 +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. - */ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.h b/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.h index 9d036ce48e..7443d66db5 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.h +++ b/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.h @@ -1,13 +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. - */ +// +// HorizontalScrollCellNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.mm b/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.mm index 15b36b8402..a7b5989591 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.mm +++ b/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.mm @@ -1,13 +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. - */ +// +// HorizontalScrollCellNode.mm +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "HorizontalScrollCellNode.h" #import "RandomCoreGraphicsNode.h" diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.h b/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.h index f4324b5d3e..8785d084ec 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.h +++ b/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.h @@ -3,7 +3,18 @@ // Sample // // Created by Scott Goodson on 9/5/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.m b/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.m index 7821f9af5f..2aa66a97b3 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.m +++ b/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.m @@ -3,7 +3,18 @@ // Sample // // Created by Scott Goodson on 9/5/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "RandomCoreGraphicsNode.h" diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.h b/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.h index d0e9200d88..fc52c022f2 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.h +++ b/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.h @@ -1,13 +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. - */ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.m b/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.m index 416000b92f..0f3afbae0c 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.m +++ b/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 #import diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/main.m b/examples/HorizontalWithinVerticalScrolling/Sample/main.m index ae9488711c..756080fb2b 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/main.m +++ b/examples/HorizontalWithinVerticalScrolling/Sample/main.m @@ -1,13 +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. - */ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Kittens/Podfile b/examples/Kittens/Podfile index 6c012e3c04..919de4b311 100644 --- a/examples/Kittens/Podfile +++ b/examples/Kittens/Podfile @@ -1,3 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/Kittens/Sample.xcodeproj/project.pbxproj b/examples/Kittens/Sample.xcodeproj/project.pbxproj index ddfd884074..a5dffda444 100644 --- a/examples/Kittens/Sample.xcodeproj/project.pbxproj +++ b/examples/Kittens/Sample.xcodeproj/project.pbxproj @@ -13,7 +13,7 @@ 05E2128719D4DB510098F589 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128619D4DB510098F589 /* main.m */; }; 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128919D4DB510098F589 /* AppDelegate.m */; }; 05E2128D19D4DB510098F589 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128C19D4DB510098F589 /* ViewController.m */; }; - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; + 52C9A6CB87CA529C55C02E59 /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E0D5A93FCFED54B93217FB08 /* libPods-Sample.a */; }; 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; /* End PBXBuildFile section */ @@ -31,11 +31,12 @@ 05E2128919D4DB510098F589 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 05E2128B19D4DB510098F589 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 05E2128C19D4DB510098F589 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + 6DE7AC2C8D07948DFC1E9C93 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + DEE781281CCB21EB0053A711 /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; + DEE781291CCB21EB0053A711 /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; + E0D5A93FCFED54B93217FB08 /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -43,7 +44,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */, + 52C9A6CB87CA529C55C02E59 /* libPods-Sample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -102,7 +103,8 @@ 1A943BF0259746F18D6E423F /* Frameworks */ = { isa = PBXGroup; children = ( - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */, + 6DE7AC2C8D07948DFC1E9C93 /* libPods.a */, + E0D5A93FCFED54B93217FB08 /* libPods-Sample.a */, ); name = Frameworks; sourceTree = ""; @@ -110,8 +112,8 @@ 1AE410B73DA5C3BD087ACDD7 /* Pods */ = { isa = PBXGroup; children = ( - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */, - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */, + DEE781281CCB21EB0053A711 /* Pods-Sample.debug.xcconfig */, + DEE781291CCB21EB0053A711 /* Pods-Sample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -128,6 +130,7 @@ 05E2127E19D4DB510098F589 /* Frameworks */, 05E2127F19D4DB510098F589 /* Resources */, F012A6F39E0149F18F564F50 /* Copy Pods Resources */, + 9C2078E0C7EEEFF207C7F6A9 /* Embed Pods Frameworks */, ); buildRules = ( ); @@ -144,7 +147,7 @@ 05E2127919D4DB510098F589 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0600; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = Facebook; TargetAttributes = { 05E2128019D4DB510098F589 = { @@ -184,6 +187,21 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 9C2078E0C7EEEFF207C7F6A9 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -211,7 +229,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -252,6 +270,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -310,12 +329,13 @@ }; 05E212A519D4DB510098F589 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */; + baseConfigurationReference = DEE781281CCB21EB0053A711 /* Pods-Sample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 7.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -323,12 +343,13 @@ }; 05E212A619D4DB510098F589 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */; + baseConfigurationReference = DEE781291CCB21EB0053A711 /* Pods-Sample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 7.1; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/examples/Kittens/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples/Kittens/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme index 1e14aa0329..d41d58c5d8 100644 --- a/examples/Kittens/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme +++ b/examples/Kittens/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -38,15 +38,18 @@ ReferencedContainer = "container:Sample.xcodeproj"> + + @@ -62,10 +65,10 @@ diff --git a/examples/Kittens/Sample.xcworkspace/contents.xcworkspacedata b/examples/Kittens/Sample.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7b5a2f3050..0000000000 --- a/examples/Kittens/Sample.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/examples/Kittens/Sample/AppDelegate.h b/examples/Kittens/Sample/AppDelegate.h index 85855277e9..5274628a9e 100644 --- a/examples/Kittens/Sample/AppDelegate.h +++ b/examples/Kittens/Sample/AppDelegate.h @@ -1,13 +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. - */ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Kittens/Sample/AppDelegate.m b/examples/Kittens/Sample/AppDelegate.m index 1dea563b77..58fe564898 100644 --- a/examples/Kittens/Sample/AppDelegate.m +++ b/examples/Kittens/Sample/AppDelegate.m @@ -1,13 +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. - */ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/Kittens/Sample/BlurbNode.h b/examples/Kittens/Sample/BlurbNode.h index 57d8e30787..e6574bcd05 100644 --- a/examples/Kittens/Sample/BlurbNode.h +++ b/examples/Kittens/Sample/BlurbNode.h @@ -1,13 +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. - */ +// +// BlurbNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Kittens/Sample/BlurbNode.m b/examples/Kittens/Sample/BlurbNode.m index 693ec0cd03..4f580098ff 100644 --- a/examples/Kittens/Sample/BlurbNode.m +++ b/examples/Kittens/Sample/BlurbNode.m @@ -1,13 +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. - */ +// +// BlurbNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/Kittens/Sample/Info.plist b/examples/Kittens/Sample/Info.plist index 35d842827b..fb4115c84c 100644 --- a/examples/Kittens/Sample/Info.plist +++ b/examples/Kittens/Sample/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/examples/Kittens/Sample/KittenNode.h b/examples/Kittens/Sample/KittenNode.h index 3cc23d5a44..9193b9df29 100644 --- a/examples/Kittens/Sample/KittenNode.h +++ b/examples/Kittens/Sample/KittenNode.h @@ -1,13 +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. - */ +// +// KittenNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Kittens/Sample/KittenNode.mm b/examples/Kittens/Sample/KittenNode.mm index 347460df50..f030681c97 100644 --- a/examples/Kittens/Sample/KittenNode.mm +++ b/examples/Kittens/Sample/KittenNode.mm @@ -1,13 +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. - */ +// +// KittenNode.mm +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "AppDelegate.h" diff --git a/examples/Kittens/Sample/ViewController.h b/examples/Kittens/Sample/ViewController.h index d0e9200d88..fc52c022f2 100644 --- a/examples/Kittens/Sample/ViewController.h +++ b/examples/Kittens/Sample/ViewController.h @@ -1,13 +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. - */ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Kittens/Sample/ViewController.m b/examples/Kittens/Sample/ViewController.m index 9ec66fa418..51f3807015 100644 --- a/examples/Kittens/Sample/ViewController.m +++ b/examples/Kittens/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/Kittens/Sample/main.m b/examples/Kittens/Sample/main.m index ae9488711c..756080fb2b 100644 --- a/examples/Kittens/Sample/main.m +++ b/examples/Kittens/Sample/main.m @@ -1,13 +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. - */ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Multiplex/Podfile b/examples/Multiplex/Podfile deleted file mode 100644 index 6c012e3c04..0000000000 --- a/examples/Multiplex/Podfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' diff --git a/examples/Multiplex/Sample/AppDelegate.h b/examples/Multiplex/Sample/AppDelegate.h deleted file mode 100644 index 2aa29369b4..0000000000 --- a/examples/Multiplex/Sample/AppDelegate.h +++ /dev/null @@ -1,18 +0,0 @@ -/* 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 - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/examples/Multiplex/Sample/AppDelegate.m b/examples/Multiplex/Sample/AppDelegate.m deleted file mode 100644 index a8e5594780..0000000000 --- a/examples/Multiplex/Sample/AppDelegate.m +++ /dev/null @@ -1,27 +0,0 @@ -/* 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 diff --git a/examples/Multiplex/Sample/ScreenNode.h b/examples/Multiplex/Sample/ScreenNode.h deleted file mode 100644 index 9a818befa0..0000000000 --- a/examples/Multiplex/Sample/ScreenNode.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// ScreenNode.h -// Sample -// -// Created by Huy Nguyen on 16/09/15. -// Copyright (c) 2015 Facebook. All rights reserved. -// - -#import - -@interface ScreenNode : ASDisplayNode - -@property (nonatomic, strong) ASMultiplexImageNode *imageNode; -@property (nonatomic, strong) ASButtonNode *buttonNode; - -- (void)start; -- (void)reload; - -@end diff --git a/examples/Multiplex/Sample/ViewController.h b/examples/Multiplex/Sample/ViewController.h deleted file mode 100644 index b73c290852..0000000000 --- a/examples/Multiplex/Sample/ViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface ViewController : ASViewController - -@end diff --git a/examples/Multiplex/Sample/ViewController.m b/examples/Multiplex/Sample/ViewController.m deleted file mode 100644 index 08a62ede74..0000000000 --- a/examples/Multiplex/Sample/ViewController.m +++ /dev/null @@ -1,42 +0,0 @@ -/* 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 "ScreenNode.h" - -@interface ViewController() -{ - ScreenNode *_screenNode; -} - -@end - -@implementation ViewController - -- (instancetype)init -{ - ScreenNode *node = [[ScreenNode alloc] init]; - if (!(self = [super initWithNode:node])) - return nil; - - _screenNode = node; - - return self; -} - -- (void)viewWillAppear:(BOOL)animated -{ - // This should be done before calling super's viewWillAppear which triggers data fetching on the node. - [_screenNode start]; - [super viewWillAppear:animated]; -} - -@end diff --git a/examples/Multiplex/Sample/main.m b/examples/Multiplex/Sample/main.m deleted file mode 100644 index ae9488711c..0000000000 --- a/examples/Multiplex/Sample/main.m +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/examples/PagerNode/Podfile b/examples/PagerNode/Podfile index 6c012e3c04..919de4b311 100644 --- a/examples/PagerNode/Podfile +++ b/examples/PagerNode/Podfile @@ -1,3 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/PagerNode/Sample.xcodeproj/project.pbxproj b/examples/PagerNode/Sample.xcodeproj/project.pbxproj index ad6e24433a..ea21795fa1 100644 --- a/examples/PagerNode/Sample.xcodeproj/project.pbxproj +++ b/examples/PagerNode/Sample.xcodeproj/project.pbxproj @@ -1,358 +1,776 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 0585428019D4DBE100606EA6 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */; }; - 05E2128719D4DB510098F589 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128619D4DB510098F589 /* main.m */; }; - 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128919D4DB510098F589 /* AppDelegate.m */; }; - 05E2128D19D4DB510098F589 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128C19D4DB510098F589 /* ViewController.m */; }; - 252041E21C167DFC00E264C8 /* PageNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 252041E11C167DFC00E264C8 /* PageNode.m */; }; - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; - 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; - 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; - 05E2128119D4DB510098F589 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 05E2128519D4DB510098F589 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 05E2128619D4DB510098F589 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 05E2128819D4DB510098F589 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 05E2128919D4DB510098F589 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 05E2128B19D4DB510098F589 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 05E2128C19D4DB510098F589 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - 252041E01C167DFC00E264C8 /* PageNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageNode.h; sourceTree = ""; }; - 252041E11C167DFC00E264C8 /* PageNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PageNode.m; sourceTree = ""; }; - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; - 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 05E2127E19D4DB510098F589 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 05E2127819D4DB510098F589 = { - isa = PBXGroup; - children = ( - 05E2128319D4DB510098F589 /* Sample */, - 05E2128219D4DB510098F589 /* Products */, - 1A943BF0259746F18D6E423F /* Frameworks */, - 1AE410B73DA5C3BD087ACDD7 /* Pods */, - ); - indentWidth = 2; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - 05E2128219D4DB510098F589 /* Products */ = { - isa = PBXGroup; - children = ( - 05E2128119D4DB510098F589 /* Sample.app */, - ); - name = Products; - sourceTree = ""; - }; - 05E2128319D4DB510098F589 /* Sample */ = { - isa = PBXGroup; - children = ( - 252041E01C167DFC00E264C8 /* PageNode.h */, - 252041E11C167DFC00E264C8 /* PageNode.m */, - 05E2128819D4DB510098F589 /* AppDelegate.h */, - 05E2128919D4DB510098F589 /* AppDelegate.m */, - 05E2128B19D4DB510098F589 /* ViewController.h */, - 05E2128C19D4DB510098F589 /* ViewController.m */, - 05E2128419D4DB510098F589 /* Supporting Files */, - ); - path = Sample; - sourceTree = ""; - }; - 05E2128419D4DB510098F589 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */, - 6C2C82AA19EE274300767484 /* Default-667h@2x.png */, - 6C2C82AB19EE274300767484 /* Default-736h@3x.png */, - 05E2128519D4DB510098F589 /* Info.plist */, - 05E2128619D4DB510098F589 /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 1A943BF0259746F18D6E423F /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 1AE410B73DA5C3BD087ACDD7 /* Pods */ = { - isa = PBXGroup; - children = ( - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */, - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 05E2128019D4DB510098F589 /* Sample */ = { - isa = PBXNativeTarget; - buildConfigurationList = 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */; - buildPhases = ( - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */, - 05E2127D19D4DB510098F589 /* Sources */, - 05E2127E19D4DB510098F589 /* Frameworks */, - 05E2127F19D4DB510098F589 /* Resources */, - F012A6F39E0149F18F564F50 /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Sample; - productName = Sample; - productReference = 05E2128119D4DB510098F589 /* Sample.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 05E2127919D4DB510098F589 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0710; - ORGANIZATIONNAME = Facebook; - TargetAttributes = { - 05E2128019D4DB510098F589 = { - CreatedOnToolsVersion = 6.0.1; - }; - }; - }; - buildConfigurationList = 05E2127C19D4DB510098F589 /* Build configuration list for PBXProject "Sample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 05E2127819D4DB510098F589; - productRefGroup = 05E2128219D4DB510098F589 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 05E2128019D4DB510098F589 /* Sample */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 05E2127F19D4DB510098F589 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 0585428019D4DBE100606EA6 /* Default-568h@2x.png in Resources */, - 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */, - 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - E080B80F89C34A25B3488E26 /* 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; - }; - F012A6F39E0149F18F564F50 /* 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; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 05E2127D19D4DB510098F589 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 05E2128D19D4DB510098F589 /* ViewController.m in Sources */, - 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */, - 05E2128719D4DB510098F589 /* main.m in Sources */, - 252041E21C167DFC00E264C8 /* PageNode.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 05E212A219D4DB510098F589 /* 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; - ENABLE_TESTABILITY = 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; - }; - name = Debug; - }; - 05E212A319D4DB510098F589 /* 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; - }; - 05E212A519D4DB510098F589 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 05E212A619D4DB510098F589 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 05E2127C19D4DB510098F589 /* Build configuration list for PBXProject "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 05E212A219D4DB510098F589 /* Debug */, - 05E212A319D4DB510098F589 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 05E212A519D4DB510098F589 /* Debug */, - 05E212A619D4DB510098F589 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 05E2127919D4DB510098F589 /* Project object */; -} + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 0585427F19D4DBE100606EA6 + + isa + PBXFileReference + lastKnownFileType + image.png + name + Default-568h@2x.png + path + ../Default-568h@2x.png + sourceTree + <group> + + 0585428019D4DBE100606EA6 + + fileRef + 0585427F19D4DBE100606EA6 + isa + PBXBuildFile + + 05E2127819D4DB510098F589 + + children + + 05E2128319D4DB510098F589 + 05E2128219D4DB510098F589 + 1A943BF0259746F18D6E423F + 1AE410B73DA5C3BD087ACDD7 + + indentWidth + 2 + isa + PBXGroup + sourceTree + <group> + tabWidth + 2 + usesTabs + 0 + + 05E2127919D4DB510098F589 + + attributes + + LastUpgradeCheck + 0710 + ORGANIZATIONNAME + Facebook + TargetAttributes + + 05E2128019D4DB510098F589 + + CreatedOnToolsVersion + 6.0.1 + + + + buildConfigurationList + 05E2127C19D4DB510098F589 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + 05E2127819D4DB510098F589 + productRefGroup + 05E2128219D4DB510098F589 + projectDirPath + + projectReferences + + projectRoot + + targets + + 05E2128019D4DB510098F589 + + + 05E2127C19D4DB510098F589 + + buildConfigurations + + 05E212A219D4DB510098F589 + 05E212A319D4DB510098F589 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 05E2127D19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 05E2128D19D4DB510098F589 + 05E2128A19D4DB510098F589 + 05E2128719D4DB510098F589 + 252041E21C167DFC00E264C8 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2127E19D4DB510098F589 + + buildActionMask + 2147483647 + files + + DFE855DDBC731242D3515B58 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2127F19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 0585428019D4DBE100606EA6 + 6C2C82AC19EE274300767484 + 6C2C82AD19EE274300767484 + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2128019D4DB510098F589 + + buildConfigurationList + 05E212A419D4DB510098F589 + buildPhases + + E080B80F89C34A25B3488E26 + 05E2127D19D4DB510098F589 + 05E2127E19D4DB510098F589 + 05E2127F19D4DB510098F589 + F012A6F39E0149F18F564F50 + 6E05308BEF86AD80AEB4EEE7 + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Sample + productName + Sample + productReference + 05E2128119D4DB510098F589 + productType + com.apple.product-type.application + + 05E2128119D4DB510098F589 + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + Sample.app + sourceTree + BUILT_PRODUCTS_DIR + + 05E2128219D4DB510098F589 + + children + + 05E2128119D4DB510098F589 + + isa + PBXGroup + name + Products + sourceTree + <group> + + 05E2128319D4DB510098F589 + + children + + 252041E01C167DFC00E264C8 + 252041E11C167DFC00E264C8 + 05E2128819D4DB510098F589 + 05E2128919D4DB510098F589 + 05E2128B19D4DB510098F589 + 05E2128C19D4DB510098F589 + 05E2128419D4DB510098F589 + + isa + PBXGroup + path + Sample + sourceTree + <group> + + 05E2128419D4DB510098F589 + + children + + 0585427F19D4DBE100606EA6 + 6C2C82AA19EE274300767484 + 6C2C82AB19EE274300767484 + 05E2128519D4DB510098F589 + 05E2128619D4DB510098F589 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + 05E2128519D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Info.plist + sourceTree + <group> + + 05E2128619D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + 05E2128719D4DB510098F589 + + fileRef + 05E2128619D4DB510098F589 + isa + PBXBuildFile + + 05E2128819D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AppDelegate.h + sourceTree + <group> + + 05E2128919D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AppDelegate.m + sourceTree + <group> + + 05E2128A19D4DB510098F589 + + fileRef + 05E2128919D4DB510098F589 + isa + PBXBuildFile + + 05E2128B19D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ViewController.h + sourceTree + <group> + + 05E2128C19D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ViewController.m + sourceTree + <group> + + 05E2128D19D4DB510098F589 + + fileRef + 05E2128C19D4DB510098F589 + isa + PBXBuildFile + + 05E212A219D4DB510098F589 + + 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 + ENABLE_TESTABILITY + 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 + + isa + XCBuildConfiguration + name + Debug + + 05E212A319D4DB510098F589 + + 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 + + isa + XCBuildConfiguration + name + Release + + 05E212A419D4DB510098F589 + + buildConfigurations + + 05E212A519D4DB510098F589 + 05E212A619D4DB510098F589 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 05E212A519D4DB510098F589 + + baseConfigurationReference + 79ED4D85CC60068C341CFD77 + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 7.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_BUNDLE_IDENTIFIER + com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier) + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Debug + + 05E212A619D4DB510098F589 + + baseConfigurationReference + 1C47DEC3F9D2BD9AD5F5CD67 + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 7.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_BUNDLE_IDENTIFIER + com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier) + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Release + + 1A943BF0259746F18D6E423F + + children + + C284F7E957985CA251284B05 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 1AE410B73DA5C3BD087ACDD7 + + children + + 79ED4D85CC60068C341CFD77 + 1C47DEC3F9D2BD9AD5F5CD67 + + isa + PBXGroup + name + Pods + sourceTree + <group> + + 1C47DEC3F9D2BD9AD5F5CD67 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + + 252041E01C167DFC00E264C8 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + PageNode.h + sourceTree + <group> + + 252041E11C167DFC00E264C8 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + PageNode.m + sourceTree + <group> + + 252041E21C167DFC00E264C8 + + fileRef + 252041E11C167DFC00E264C8 + isa + PBXBuildFile + + 6C2C82AA19EE274300767484 + + isa + PBXFileReference + lastKnownFileType + image.png + path + Default-667h@2x.png + sourceTree + SOURCE_ROOT + + 6C2C82AB19EE274300767484 + + isa + PBXFileReference + lastKnownFileType + image.png + path + Default-736h@3x.png + sourceTree + SOURCE_ROOT + + 6C2C82AC19EE274300767484 + + fileRef + 6C2C82AA19EE274300767484 + isa + PBXBuildFile + + 6C2C82AD19EE274300767484 + + fileRef + 6C2C82AB19EE274300767484 + isa + PBXBuildFile + + 6E05308BEF86AD80AEB4EEE7 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" + + showEnvVarsInLog + 0 + + 79ED4D85CC60068C341CFD77 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.debug.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig + sourceTree + <group> + + C284F7E957985CA251284B05 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-Sample.a + sourceTree + BUILT_PRODUCTS_DIR + + DFE855DDBC731242D3515B58 + + fileRef + C284F7E957985CA251284B05 + isa + PBXBuildFile + + E080B80F89C34A25B3488E26 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + 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 + + showEnvVarsInLog + 0 + + F012A6F39E0149F18F564F50 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" + + showEnvVarsInLog + 0 + + + rootObject + 05E2127919D4DB510098F589 + + diff --git a/examples/PagerNode/Sample.xcworkspace/contents.xcworkspacedata b/examples/PagerNode/Sample.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7b5a2f3050..0000000000 --- a/examples/PagerNode/Sample.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/examples/PagerNode/Sample/AppDelegate.h b/examples/PagerNode/Sample/AppDelegate.h index 2aa29369b4..27e560aafe 100644 --- a/examples/PagerNode/Sample/AppDelegate.h +++ b/examples/PagerNode/Sample/AppDelegate.h @@ -1,13 +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. - */ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/PagerNode/Sample/AppDelegate.m b/examples/PagerNode/Sample/AppDelegate.m index 1dea563b77..58fe564898 100644 --- a/examples/PagerNode/Sample/AppDelegate.m +++ b/examples/PagerNode/Sample/AppDelegate.m @@ -1,13 +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. - */ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/PagerNode/Sample/PageNode.h b/examples/PagerNode/Sample/PageNode.h index b8843378de..e87a74628b 100644 --- a/examples/PagerNode/Sample/PageNode.h +++ b/examples/PagerNode/Sample/PageNode.h @@ -3,7 +3,18 @@ // Sample // // Created by McCallum, Levi on 12/7/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/PagerNode/Sample/PageNode.m b/examples/PagerNode/Sample/PageNode.m index 2a60c8982b..4db8e4f966 100644 --- a/examples/PagerNode/Sample/PageNode.m +++ b/examples/PagerNode/Sample/PageNode.m @@ -3,7 +3,18 @@ // Sample // // Created by McCallum, Levi on 12/7/15. -// Copyright Β© 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PageNode.h" @@ -12,7 +23,9 @@ - (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize { - return [ASLayout layoutWithLayoutableObject:self size:constrainedSize.max]; + return [ASLayout layoutWithLayoutableObject:self + constrainedSizeRange:constrainedSize + size:constrainedSize.max]; } - (void)fetchData diff --git a/examples/PagerNode/Sample/ViewController.h b/examples/PagerNode/Sample/ViewController.h index d4ec993c7b..151b29582a 100644 --- a/examples/PagerNode/Sample/ViewController.h +++ b/examples/PagerNode/Sample/ViewController.h @@ -1,16 +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. - */ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 -@interface ViewController : ASViewController +@interface ViewController : ASViewController @end diff --git a/examples/PagerNode/Sample/ViewController.m b/examples/PagerNode/Sample/ViewController.m index e10d013ec8..8adf45354c 100644 --- a/examples/PagerNode/Sample/ViewController.m +++ b/examples/PagerNode/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" @@ -15,9 +21,14 @@ #import "PageNode.h" -@interface ViewController () +static UIColor *randomColor() { + CGFloat hue = ( arc4random() % 256 / 256.0 ); // 0.0 to 1.0 + CGFloat saturation = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from white + CGFloat brightness = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from black + return [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1]; +} -- (ASPagerNode *)node; +@interface ViewController () @end @@ -25,19 +36,30 @@ - (instancetype)init { - if (!(self = [super initWithNode:[[ASPagerNode alloc] init]])) - return nil; + self = [super initWithNode:[[ASPagerNode alloc] init]]; + if (self == nil) { + return self; + } - [self node].dataSource = self; - self.title = @"Pages"; + self.node.dataSource = self; + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Next" style:UIBarButtonItemStylePlain target:self action:@selector(scrollToNextPage:)]; + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Previous" style:UIBarButtonItemStylePlain target:self action:@selector(scrollToPreviousPage:)]; return self; } -- (ASPagerNode *)node +#pragma mark - Actions + +- (void)scrollToNextPage:(id)sender { - return (ASPagerNode *)[super node]; + [self.node scrollToPageAtIndex:self.node.currentPageIndex+1 animated:YES]; +} + +- (void)scrollToPreviousPage:(id)sender +{ + [self.node scrollToPageAtIndex:self.node.currentPageIndex-1 animated:YES]; } #pragma mark - ASPagerNodeDataSource @@ -47,11 +69,13 @@ return 5; } -- (ASCellNode *)pagerNode:(ASPagerNode *)pagerNode nodeAtIndex:(NSInteger)index +- (ASCellNodeBlock)pagerNode:(ASPagerNode *)pagerNode nodeBlockAtIndex:(NSInteger)index { - PageNode *page = [[PageNode alloc] init]; - page.backgroundColor = [UIColor blueColor]; - return page; + return ^{ + PageNode *page = [[PageNode alloc] init]; + page.backgroundColor = randomColor(); + return page; + }; } @end diff --git a/examples/PagerNode/Sample/main.m b/examples/PagerNode/Sample/main.m index ae9488711c..756080fb2b 100644 --- a/examples/PagerNode/Sample/main.m +++ b/examples/PagerNode/Sample/main.m @@ -1,13 +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. - */ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Placeholders/Podfile b/examples/Placeholders/Podfile deleted file mode 100644 index 6c012e3c04..0000000000 --- a/examples/Placeholders/Podfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' diff --git a/examples/Placeholders/Sample/AppDelegate.h b/examples/Placeholders/Sample/AppDelegate.h deleted file mode 100644 index 2aa29369b4..0000000000 --- a/examples/Placeholders/Sample/AppDelegate.h +++ /dev/null @@ -1,18 +0,0 @@ -/* 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 - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/examples/Placeholders/Sample/AppDelegate.m b/examples/Placeholders/Sample/AppDelegate.m deleted file mode 100644 index a8e5594780..0000000000 --- a/examples/Placeholders/Sample/AppDelegate.m +++ /dev/null @@ -1,27 +0,0 @@ -/* 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 diff --git a/examples/Placeholders/Sample/PostNode.h b/examples/Placeholders/Sample/PostNode.h deleted file mode 100644 index 2cfa5a6048..0000000000 --- a/examples/Placeholders/Sample/PostNode.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface PostNode : ASDisplayNode - -@end diff --git a/examples/Placeholders/Sample/SlowpokeImageNode.h b/examples/Placeholders/Sample/SlowpokeImageNode.h deleted file mode 100644 index 466590c03a..0000000000 --- a/examples/Placeholders/Sample/SlowpokeImageNode.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface SlowpokeImageNode : ASImageNode - -@end diff --git a/examples/Placeholders/Sample/SlowpokeShareNode.h b/examples/Placeholders/Sample/SlowpokeShareNode.h deleted file mode 100644 index 67d3c3b0ef..0000000000 --- a/examples/Placeholders/Sample/SlowpokeShareNode.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface SlowpokeShareNode : ASControlNode - -@end diff --git a/examples/Placeholders/Sample/SlowpokeTextNode.h b/examples/Placeholders/Sample/SlowpokeTextNode.h deleted file mode 100644 index 199430330c..0000000000 --- a/examples/Placeholders/Sample/SlowpokeTextNode.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface SlowpokeTextNode : ASTextNode - -@end diff --git a/examples/Placeholders/Sample/SlowpokeTextNode.m b/examples/Placeholders/Sample/SlowpokeTextNode.m deleted file mode 100644 index db309741c9..0000000000 --- a/examples/Placeholders/Sample/SlowpokeTextNode.m +++ /dev/null @@ -1,25 +0,0 @@ -/* 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 "SlowpokeTextNode.h" - -#import - -@implementation SlowpokeTextNode - -+ (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing -{ - usleep( (long)(1.0 * USEC_PER_SEC) ); // artificial delay of 1.0 - - [super drawRect:bounds withParameters:parameters isCancelled:isCancelledBlock isRasterizing:isRasterizing]; -} - -@end diff --git a/examples/Placeholders/Sample/ViewController.h b/examples/Placeholders/Sample/ViewController.h deleted file mode 100644 index d0e9200d88..0000000000 --- a/examples/Placeholders/Sample/ViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface ViewController : UIViewController - -@end diff --git a/examples/Placeholders/Sample/main.m b/examples/Placeholders/Sample/main.m deleted file mode 100644 index ae9488711c..0000000000 --- a/examples/Placeholders/Sample/main.m +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/examples/SocialAppLayout/Podfile b/examples/SocialAppLayout/Podfile index da4e2a7b30..919de4b311 100644 --- a/examples/SocialAppLayout/Podfile +++ b/examples/SocialAppLayout/Podfile @@ -1,3 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' \ No newline at end of file +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/SocialAppLayout/Sample.xcodeproj/project.pbxproj b/examples/SocialAppLayout/Sample.xcodeproj/project.pbxproj index b14014b7a0..988eb17a45 100644 --- a/examples/SocialAppLayout/Sample.xcodeproj/project.pbxproj +++ b/examples/SocialAppLayout/Sample.xcodeproj/project.pbxproj @@ -10,12 +10,18 @@ 46 objects - 1DAE4C3A5DA2C2B081CD640F + 193CE60FE6429EFEBF6EA52B - fileRef - 7577801AA7321797C5FBB9A1 + explicitFileType + archive.ar + includeInIndex + 0 isa - PBXBuildFile + PBXFileReference + path + libPods-Sample.a + sourceTree + BUILT_PRODUCTS_DIR 21F2C1D9B53F9468EAF1653F @@ -36,7 +42,7 @@ shellPath /bin/sh shellScript - "${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh" + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" showEnvVarsInLog 0 @@ -142,7 +148,7 @@ 2147483647 files - 1DAE4C3A5DA2C2B081CD640F + 93964C9FCC28D92625106430 isa PBXFrameworksBuildPhase @@ -558,7 +564,7 @@ 3EEA4EFC1BECC4A1008A7F35 baseConfigurationReference - E38AD915EE10CFC641F39E5C + CC6F2ABE8383FAB21802C734 buildSettings ASSETCATALOG_COMPILER_APPICON_NAME @@ -584,7 +590,7 @@ 3EEA4EFD1BECC4A1008A7F35 baseConfigurationReference - 839964CA580D0ED921A6FCB1 + FCCC1AD413FCA8603156ED15 buildSettings ASSETCATALOG_COMPILER_APPICON_NAME @@ -1180,40 +1186,12 @@ isa PBXBuildFile - 7577801AA7321797C5FBB9A1 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods.a - sourceTree - BUILT_PRODUCTS_DIR - - 839964CA580D0ED921A6FCB1 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - name - Pods.release.xcconfig - path - Pods/Target Support Files/Pods/Pods.release.xcconfig - sourceTree - <group> - 842ADAFE88475D19B24183AC children - E38AD915EE10CFC641F39E5C - 839964CA580D0ED921A6FCB1 + CC6F2ABE8383FAB21802C734 + FCCC1AD413FCA8603156ED15 isa PBXGroup @@ -1241,11 +1219,18 @@ shellPath /bin/sh shellScript - "${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh" + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" showEnvVarsInLog 0 + 93964C9FCC28D92625106430 + + fileRef + 193CE60FE6429EFEBF6EA52B + isa + PBXBuildFile + B5BD9E5609B2CB179EEE0CF4 buildActionMask @@ -1276,7 +1261,7 @@ fi showEnvVarsInLog 0 - E38AD915EE10CFC641F39E5C + CC6F2ABE8383FAB21802C734 includeInIndex 1 @@ -1285,9 +1270,9 @@ fi lastKnownFileType text.xcconfig name - Pods.debug.xcconfig + Pods-Sample.debug.xcconfig path - Pods/Target Support Files/Pods/Pods.debug.xcconfig + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig sourceTree <group> @@ -1295,7 +1280,7 @@ fi children - 7577801AA7321797C5FBB9A1 + 193CE60FE6429EFEBF6EA52B isa PBXGroup @@ -1304,6 +1289,21 @@ fi sourceTree <group> + FCCC1AD413FCA8603156ED15 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + rootObject 3EEA4EDC1BECC4A1008A7F35 diff --git a/examples/SocialAppLayout/Sample.xcworkspace/contents.xcworkspacedata b/examples/SocialAppLayout/Sample.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7b5a2f3050..0000000000 --- a/examples/SocialAppLayout/Sample.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/examples/SocialAppLayout/Sample/AppDelegate.h b/examples/SocialAppLayout/Sample/AppDelegate.h index 2aa29369b4..27e560aafe 100644 --- a/examples/SocialAppLayout/Sample/AppDelegate.h +++ b/examples/SocialAppLayout/Sample/AppDelegate.h @@ -1,13 +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. - */ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/SocialAppLayout/Sample/AppDelegate.m b/examples/SocialAppLayout/Sample/AppDelegate.m index 5bd8203ef3..da7d93f4d8 100644 --- a/examples/SocialAppLayout/Sample/AppDelegate.m +++ b/examples/SocialAppLayout/Sample/AppDelegate.m @@ -1,13 +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. - */ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/SocialAppLayout/Sample/CommentsNode.h b/examples/SocialAppLayout/Sample/CommentsNode.h index 254f6abe2b..24e39cb5b4 100644 --- a/examples/SocialAppLayout/Sample/CommentsNode.h +++ b/examples/SocialAppLayout/Sample/CommentsNode.h @@ -1,13 +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. - */ +// +// CommentsNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/SocialAppLayout/Sample/CommentsNode.m b/examples/SocialAppLayout/Sample/CommentsNode.m index 1e8bc94028..a9d76093ca 100644 --- a/examples/SocialAppLayout/Sample/CommentsNode.m +++ b/examples/SocialAppLayout/Sample/CommentsNode.m @@ -1,13 +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. - */ +// +// CommentsNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "CommentsNode.h" #import "TextStyles.h" diff --git a/examples/SocialAppLayout/Sample/LikesNode.h b/examples/SocialAppLayout/Sample/LikesNode.h index d294459bc5..b98cbebef6 100644 --- a/examples/SocialAppLayout/Sample/LikesNode.h +++ b/examples/SocialAppLayout/Sample/LikesNode.h @@ -1,13 +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. - */ +// +// LikesNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/SocialAppLayout/Sample/LikesNode.m b/examples/SocialAppLayout/Sample/LikesNode.m index 0a6eb9bc6a..6733f2af8c 100644 --- a/examples/SocialAppLayout/Sample/LikesNode.m +++ b/examples/SocialAppLayout/Sample/LikesNode.m @@ -1,13 +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. - */ +// +// LikesNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "LikesNode.h" #import "TextStyles.h" diff --git a/examples/SocialAppLayout/Sample/Post.h b/examples/SocialAppLayout/Sample/Post.h index 58be8bad74..44bed0dd73 100644 --- a/examples/SocialAppLayout/Sample/Post.h +++ b/examples/SocialAppLayout/Sample/Post.h @@ -1,13 +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. - */ +// +// Post.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/SocialAppLayout/Sample/Post.m b/examples/SocialAppLayout/Sample/Post.m index 7bedb4e25a..10bf3a7623 100644 --- a/examples/SocialAppLayout/Sample/Post.m +++ b/examples/SocialAppLayout/Sample/Post.m @@ -1,13 +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. - */ +// +// Post.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "Post.h" diff --git a/examples/SocialAppLayout/Sample/PostNode.h b/examples/SocialAppLayout/Sample/PostNode.h index 486c9184d8..6d8c62696d 100644 --- a/examples/SocialAppLayout/Sample/PostNode.h +++ b/examples/SocialAppLayout/Sample/PostNode.h @@ -1,13 +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. - */ +// +// PostNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/SocialAppLayout/Sample/PostNode.m b/examples/SocialAppLayout/Sample/PostNode.m index fd570dc481..df6915afd6 100644 --- a/examples/SocialAppLayout/Sample/PostNode.m +++ b/examples/SocialAppLayout/Sample/PostNode.m @@ -1,13 +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. - */ +// +// PostNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PostNode.h" #import "Post.h" @@ -15,6 +21,8 @@ #import "LikesNode.h" #import "CommentsNode.h" +#define PostNodeDividerColor [UIColor lightGrayColor] + @interface PostNode() @property (strong, nonatomic) Post *post; @@ -34,6 +42,8 @@ @implementation PostNode +#pragma mark - Lifecycle + - (instancetype)initWithPost:(Post *)post { self = [super init]; @@ -149,7 +159,7 @@ // Hairline cell separator _divider = [[ASDisplayNode alloc] init]; - _divider.backgroundColor = [UIColor lightGrayColor]; + [self updateDividerColor]; [self addSubnode:_divider]; // Via @@ -173,6 +183,20 @@ return self; } +- (void)updateDividerColor +{ + /* + * UITableViewCell traverses through all its descendant views and adjusts their background color accordingly + * either to [UIColor clearColor], although potentially it could use the same color as the selection highlight itself. + * After selection, the same trick is performed again in reverse, putting all the backgrounds back as they used to be. + * But in our case, we don't want to have the background color disappearing so we reset it after highlighting or + * selection is done. + */ + _divider.backgroundColor = PostNodeDividerColor; +} + +#pragma mark - ASDisplayNode + - (void)didLoad { // enable highlighting now that self.layer has loaded -- see ASHighlightOverlayLayer.h @@ -245,7 +269,23 @@ _divider.frame = CGRectMake(0.0f, 0.0f, self.calculatedSize.width, pixelHeight); } -#pragma mark - ASTextNodeDelegate methods. +#pragma mark - ASCellNode + +- (void)setHighlighted:(BOOL)highlighted +{ + [super setHighlighted:highlighted]; + + [self updateDividerColor]; +} + +- (void)setSelected:(BOOL)selected +{ + [super setSelected:selected]; + + [self updateDividerColor]; +} + +#pragma mark - - (BOOL)textNode:(ASTextNode *)richTextNode shouldHighlightLinkAttribute:(NSString *)attribute value:(id)value atPoint:(CGPoint)point { diff --git a/examples/SocialAppLayout/Sample/TextStyles.h b/examples/SocialAppLayout/Sample/TextStyles.h index c2ff390690..b8ef6780c1 100644 --- a/examples/SocialAppLayout/Sample/TextStyles.h +++ b/examples/SocialAppLayout/Sample/TextStyles.h @@ -1,13 +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. - */ +// +// TextStyles.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 #import diff --git a/examples/SocialAppLayout/Sample/TextStyles.m b/examples/SocialAppLayout/Sample/TextStyles.m index cc2b6bdffb..8f642522b7 100644 --- a/examples/SocialAppLayout/Sample/TextStyles.m +++ b/examples/SocialAppLayout/Sample/TextStyles.m @@ -1,13 +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. - */ +// +// TextStyles.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "TextStyles.h" diff --git a/examples/SocialAppLayout/Sample/ViewController.h b/examples/SocialAppLayout/Sample/ViewController.h index 76b893d103..40359e2f0e 100644 --- a/examples/SocialAppLayout/Sample/ViewController.h +++ b/examples/SocialAppLayout/Sample/ViewController.h @@ -1,13 +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. - */ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/SocialAppLayout/Sample/ViewController.m b/examples/SocialAppLayout/Sample/ViewController.m index c9500b1778..9a2692f5d0 100644 --- a/examples/SocialAppLayout/Sample/ViewController.m +++ b/examples/SocialAppLayout/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "Post.h" diff --git a/examples/SocialAppLayout/Sample/main.m b/examples/SocialAppLayout/Sample/main.m index 6559d60028..791ef4b743 100644 --- a/examples/SocialAppLayout/Sample/main.m +++ b/examples/SocialAppLayout/Sample/main.m @@ -1,13 +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. - */ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 #import "AppDelegate.h" diff --git a/examples/Swift/Podfile b/examples/Swift/Podfile index d76ea6718b..628b25d36c 100644 --- a/examples/Swift/Podfile +++ b/examples/Swift/Podfile @@ -1,6 +1,8 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' +platform :ios, '7.0' use_frameworks! -pod 'AsyncDisplayKit', :path => '../..' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/Swift/Sample.xcodeproj/project.pbxproj b/examples/Swift/Sample.xcodeproj/project.pbxproj index 18f8aba889..46a012138e 100644 --- a/examples/Swift/Sample.xcodeproj/project.pbxproj +++ b/examples/Swift/Sample.xcodeproj/project.pbxproj @@ -10,9 +10,9 @@ 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 */; }; + 161FE6897BB33A570A663F90 /* Pods_Sample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27E6141C83F216FCA6D7EAEE /* Pods_Sample.framework */; }; 6C5053DB19EE266A00E385DE /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C5053D919EE266A00E385DE /* Default-667h@2x.png */; }; 6C5053DC19EE266A00E385DE /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C5053DA19EE266A00E385DE /* Default-736h@3x.png */; }; - 92E46E91A7D47AEC5B2B2F55 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FC29F18AE7C8C204A5CD4F2 /* Pods.framework */; }; CCB01CAB1C5FEA6E00CA64C4 /* TailLoadingCellNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCB01CAA1C5FEA6E00CA64C4 /* TailLoadingCellNode.swift */; }; /* End PBXBuildFile section */ @@ -22,12 +22,12 @@ 050E7C7319D22E19004363C2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 050E7C7519D22E19004363C2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 05DDD8DA19D2336300013C30 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; + 08B9AAEC0A03243C3516AA96 /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; + 27E6141C83F216FCA6D7EAEE /* Pods_Sample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Sample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6C5053D919EE266A00E385DE /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; 6C5053DA19EE266A00E385DE /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; - 7FC29F18AE7C8C204A5CD4F2 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; 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 = ""; }; + 9B402DAAE8C6A8B9BE1A506B /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; CCB01CAA1C5FEA6E00CA64C4 /* TailLoadingCellNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TailLoadingCellNode.swift; sourceTree = ""; }; - 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -35,7 +35,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 92E46E91A7D47AEC5B2B2F55 /* Pods.framework in Frameworks */, + 161FE6897BB33A570A663F90 /* Pods_Sample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -88,7 +88,7 @@ 092C2001FE124604891D6E90 /* Frameworks */ = { isa = PBXGroup; children = ( - 7FC29F18AE7C8C204A5CD4F2 /* Pods.framework */, + 27E6141C83F216FCA6D7EAEE /* Pods_Sample.framework */, ); name = Frameworks; sourceTree = ""; @@ -96,8 +96,8 @@ 655F2ABBD991CBDE7140FACE /* Pods */ = { isa = PBXGroup; children = ( - 841652076B3E9351337AA7C7 /* Pods.debug.xcconfig */, - E3EE87D12CE3EF73FAE2EF02 /* Pods.release.xcconfig */, + 9B402DAAE8C6A8B9BE1A506B /* Pods-Sample.debug.xcconfig */, + 08B9AAEC0A03243C3516AA96 /* Pods-Sample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -185,7 +185,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 941C5E41C54B4613A2D3B760 /* Copy Pods Resources */ = { @@ -200,7 +200,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh\"\n"; showEnvVarsInLog = 0; }; B8824BD0ED824BAD8268EC35 /* Check Pods Manifest.lock */ = { @@ -314,7 +314,7 @@ }; 050E7C8E19D22E1A004363C2 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 841652076B3E9351337AA7C7 /* Pods.debug.xcconfig */; + baseConfigurationReference = 9B402DAAE8C6A8B9BE1A506B /* Pods-Sample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; @@ -326,7 +326,7 @@ }; 050E7C8F19D22E1A004363C2 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E3EE87D12CE3EF73FAE2EF02 /* Pods.release.xcconfig */; + baseConfigurationReference = 08B9AAEC0A03243C3516AA96 /* Pods-Sample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; diff --git a/examples/Swift/Sample.xcworkspace/contents.xcworkspacedata b/examples/Swift/Sample.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7b5a2f3050..0000000000 --- a/examples/Swift/Sample.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/examples/Swift/Sample/AppDelegate.swift b/examples/Swift/Sample/AppDelegate.swift index 3a1dac68c1..7bcf44e432 100644 --- a/examples/Swift/Sample/AppDelegate.swift +++ b/examples/Swift/Sample/AppDelegate.swift @@ -1,13 +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. - */ +// +// AppDelegate.swift +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Swift/Sample/TailLoadingCellNode.swift b/examples/Swift/Sample/TailLoadingCellNode.swift index e6b4d333f0..f4210ca509 100644 --- a/examples/Swift/Sample/TailLoadingCellNode.swift +++ b/examples/Swift/Sample/TailLoadingCellNode.swift @@ -3,7 +3,18 @@ // Sample // // Created by Adlai Holler on 2/1/16. -// Copyright Β© 2016 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Swift/Sample/ViewController.swift b/examples/Swift/Sample/ViewController.swift index 84318e2b5e..a23486bd7d 100644 --- a/examples/Swift/Sample/ViewController.swift +++ b/examples/Swift/Sample/ViewController.swift @@ -1,13 +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. - */ +// +// ViewController.swift +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 import AsyncDisplayKit diff --git a/examples/SynchronousConcurrency/Podfile b/examples/SynchronousConcurrency/Podfile deleted file mode 100644 index 6c012e3c04..0000000000 --- a/examples/SynchronousConcurrency/Podfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' diff --git a/examples/SynchronousConcurrency/Sample.xcodeproj/project.pbxproj b/examples/SynchronousConcurrency/Sample.xcodeproj/project.pbxproj deleted file mode 100644 index 78472428dc..0000000000 --- a/examples/SynchronousConcurrency/Sample.xcodeproj/project.pbxproj +++ /dev/null @@ -1,361 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 0585428019D4DBE100606EA6 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */; }; - 05E2128719D4DB510098F589 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128619D4DB510098F589 /* main.m */; }; - 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128919D4DB510098F589 /* AppDelegate.m */; }; - 05E2128D19D4DB510098F589 /* AsyncTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128C19D4DB510098F589 /* AsyncTableViewController.m */; }; - 18748FDB1BB727B20053A9C1 /* AsyncViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18748FDA1BB727B20053A9C1 /* AsyncViewController.m */; settings = {ASSET_TAGS = (); }; }; - 18C2ED861B9B8CE700F627B3 /* RandomCoreGraphicsNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 18C2ED851B9B8CE700F627B3 /* RandomCoreGraphicsNode.m */; }; - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; - 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; - 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; - 05E2128119D4DB510098F589 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 05E2128519D4DB510098F589 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 05E2128619D4DB510098F589 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 05E2128819D4DB510098F589 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 05E2128919D4DB510098F589 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 05E2128B19D4DB510098F589 /* AsyncTableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AsyncTableViewController.h; sourceTree = ""; }; - 05E2128C19D4DB510098F589 /* AsyncTableViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AsyncTableViewController.m; sourceTree = ""; }; - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - 18748FD91BB727B20053A9C1 /* AsyncViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncViewController.h; sourceTree = ""; }; - 18748FDA1BB727B20053A9C1 /* AsyncViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AsyncViewController.m; sourceTree = ""; }; - 18C2ED841B9B8CE700F627B3 /* RandomCoreGraphicsNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RandomCoreGraphicsNode.h; sourceTree = ""; }; - 18C2ED851B9B8CE700F627B3 /* RandomCoreGraphicsNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RandomCoreGraphicsNode.m; sourceTree = ""; }; - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; - 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 05E2127E19D4DB510098F589 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 05E2127819D4DB510098F589 = { - isa = PBXGroup; - children = ( - 05E2128319D4DB510098F589 /* Sample */, - 05E2128219D4DB510098F589 /* Products */, - 1A943BF0259746F18D6E423F /* Frameworks */, - 1AE410B73DA5C3BD087ACDD7 /* Pods */, - ); - indentWidth = 2; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - 05E2128219D4DB510098F589 /* Products */ = { - isa = PBXGroup; - children = ( - 05E2128119D4DB510098F589 /* Sample.app */, - ); - name = Products; - sourceTree = ""; - }; - 05E2128319D4DB510098F589 /* Sample */ = { - isa = PBXGroup; - children = ( - 05E2128819D4DB510098F589 /* AppDelegate.h */, - 05E2128919D4DB510098F589 /* AppDelegate.m */, - 05E2128B19D4DB510098F589 /* AsyncTableViewController.h */, - 05E2128C19D4DB510098F589 /* AsyncTableViewController.m */, - 18748FD91BB727B20053A9C1 /* AsyncViewController.h */, - 18748FDA1BB727B20053A9C1 /* AsyncViewController.m */, - 18C2ED841B9B8CE700F627B3 /* RandomCoreGraphicsNode.h */, - 18C2ED851B9B8CE700F627B3 /* RandomCoreGraphicsNode.m */, - 05E2128419D4DB510098F589 /* Supporting Files */, - ); - path = Sample; - sourceTree = ""; - }; - 05E2128419D4DB510098F589 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */, - 6C2C82AA19EE274300767484 /* Default-667h@2x.png */, - 6C2C82AB19EE274300767484 /* Default-736h@3x.png */, - 05E2128519D4DB510098F589 /* Info.plist */, - 05E2128619D4DB510098F589 /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 1A943BF0259746F18D6E423F /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 1AE410B73DA5C3BD087ACDD7 /* Pods */ = { - isa = PBXGroup; - children = ( - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */, - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 05E2128019D4DB510098F589 /* Sample */ = { - isa = PBXNativeTarget; - buildConfigurationList = 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */; - buildPhases = ( - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */, - 05E2127D19D4DB510098F589 /* Sources */, - 05E2127E19D4DB510098F589 /* Frameworks */, - 05E2127F19D4DB510098F589 /* Resources */, - F012A6F39E0149F18F564F50 /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Sample; - productName = Sample; - productReference = 05E2128119D4DB510098F589 /* Sample.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 05E2127919D4DB510098F589 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0600; - ORGANIZATIONNAME = Facebook; - TargetAttributes = { - 05E2128019D4DB510098F589 = { - CreatedOnToolsVersion = 6.0.1; - }; - }; - }; - buildConfigurationList = 05E2127C19D4DB510098F589 /* Build configuration list for PBXProject "Sample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 05E2127819D4DB510098F589; - productRefGroup = 05E2128219D4DB510098F589 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 05E2128019D4DB510098F589 /* Sample */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 05E2127F19D4DB510098F589 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 0585428019D4DBE100606EA6 /* Default-568h@2x.png in Resources */, - 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */, - 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - E080B80F89C34A25B3488E26 /* 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; - }; - F012A6F39E0149F18F564F50 /* 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; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 05E2127D19D4DB510098F589 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 18C2ED861B9B8CE700F627B3 /* RandomCoreGraphicsNode.m in Sources */, - 18748FDB1BB727B20053A9C1 /* AsyncViewController.m in Sources */, - 05E2128D19D4DB510098F589 /* AsyncTableViewController.m in Sources */, - 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */, - 05E2128719D4DB510098F589 /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 05E212A219D4DB510098F589 /* 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; - }; - name = Debug; - }; - 05E212A319D4DB510098F589 /* 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; - }; - 05E212A519D4DB510098F589 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 05E212A619D4DB510098F589 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 05E2127C19D4DB510098F589 /* Build configuration list for PBXProject "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 05E212A219D4DB510098F589 /* Debug */, - 05E212A319D4DB510098F589 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 05E212A519D4DB510098F589 /* Debug */, - 05E212A619D4DB510098F589 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 05E2127919D4DB510098F589 /* Project object */; -} diff --git a/examples/SynchronousConcurrency/Sample/AppDelegate.h b/examples/SynchronousConcurrency/Sample/AppDelegate.h deleted file mode 100644 index 85855277e9..0000000000 --- a/examples/SynchronousConcurrency/Sample/AppDelegate.h +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - -#define UseAutomaticLayout 1 - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/examples/SynchronousConcurrency/Sample/AppDelegate.m b/examples/SynchronousConcurrency/Sample/AppDelegate.m deleted file mode 100644 index a99a682823..0000000000 --- a/examples/SynchronousConcurrency/Sample/AppDelegate.m +++ /dev/null @@ -1,33 +0,0 @@ -/* 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 "AsyncTableViewController.h" -#import "AsyncViewController.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.backgroundColor = [UIColor whiteColor]; - - UITabBarController *tabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil]; - self.window.rootViewController = tabBarController; - - [tabBarController setViewControllers:@[[[AsyncTableViewController alloc] init], [[AsyncViewController alloc] init]]]; - - [self.window makeKeyAndVisible]; - return YES; -} - -@end diff --git a/examples/SynchronousConcurrency/Sample/AsyncTableViewController.h b/examples/SynchronousConcurrency/Sample/AsyncTableViewController.h deleted file mode 100644 index a1edcd7f6a..0000000000 --- a/examples/SynchronousConcurrency/Sample/AsyncTableViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface AsyncTableViewController : UIViewController - -@end diff --git a/examples/SynchronousConcurrency/Sample/AsyncViewController.h b/examples/SynchronousConcurrency/Sample/AsyncViewController.h deleted file mode 100644 index b449abbb2f..0000000000 --- a/examples/SynchronousConcurrency/Sample/AsyncViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// AsyncViewController.h -// Sample -// -// Created by Scott Goodson on 9/26/15. -// Copyright Β© 2015 Facebook. All rights reserved. -// - -#import "ASViewController.h" - -@interface AsyncViewController : ASViewController - -@end diff --git a/examples/SynchronousConcurrency/Sample/AsyncViewController.m b/examples/SynchronousConcurrency/Sample/AsyncViewController.m deleted file mode 100644 index 16e8fdb017..0000000000 --- a/examples/SynchronousConcurrency/Sample/AsyncViewController.m +++ /dev/null @@ -1,37 +0,0 @@ -// -// AsyncViewController.m -// Sample -// -// Created by Scott Goodson on 9/26/15. -// Copyright Β© 2015 Facebook. All rights reserved. -// - -#import "AsyncViewController.h" -#import "RandomCoreGraphicsNode.h" - -@implementation AsyncViewController - -- (instancetype)init -{ - if (!(self = [super initWithNode:[[RandomCoreGraphicsNode alloc] init]])) { - return nil; - } - - self.neverShowPlaceholders = YES; - self.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0]; - return self; -} - -- (void)viewWillAppear:(BOOL)animated -{ - // FIXME: This is only being called on the first time the UITabBarController shows us. - [super viewWillAppear:animated]; -} - -- (void)viewDidDisappear:(BOOL)animated -{ - [self.node recursivelyClearContents]; - [super viewDidDisappear:animated]; -} - -@end diff --git a/examples/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.h b/examples/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.h deleted file mode 100644 index cecc3446b9..0000000000 --- a/examples/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// RandomCoreGraphicsNode.h -// Sample -// -// Created by Scott Goodson on 9/5/15. -// Copyright (c) 2015 Facebook. All rights reserved. -// - -#import - -@interface RandomCoreGraphicsNode : ASCellNode -{ - ASTextNode *_textNode; -} - -@end diff --git a/examples/SynchronousConcurrency/Sample/main.m b/examples/SynchronousConcurrency/Sample/main.m deleted file mode 100644 index ae9488711c..0000000000 --- a/examples/SynchronousConcurrency/Sample/main.m +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/examples/SynchronousKittens/Podfile b/examples/SynchronousKittens/Podfile deleted file mode 100644 index 6c012e3c04..0000000000 --- a/examples/SynchronousKittens/Podfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' diff --git a/examples/SynchronousKittens/Sample.xcworkspace/contents.xcworkspacedata b/examples/SynchronousKittens/Sample.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7b5a2f3050..0000000000 --- a/examples/SynchronousKittens/Sample.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/examples/SynchronousKittens/Sample/AppDelegate.h b/examples/SynchronousKittens/Sample/AppDelegate.h deleted file mode 100644 index 85855277e9..0000000000 --- a/examples/SynchronousKittens/Sample/AppDelegate.h +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - -#define UseAutomaticLayout 1 - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/examples/SynchronousKittens/Sample/AppDelegate.m b/examples/SynchronousKittens/Sample/AppDelegate.m deleted file mode 100644 index 1dea563b77..0000000000 --- a/examples/SynchronousKittens/Sample/AppDelegate.m +++ /dev/null @@ -1,27 +0,0 @@ -/* 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 diff --git a/examples/SynchronousKittens/Sample/BlurbNode.h b/examples/SynchronousKittens/Sample/BlurbNode.h deleted file mode 100644 index 57d8e30787..0000000000 --- a/examples/SynchronousKittens/Sample/BlurbNode.h +++ /dev/null @@ -1,19 +0,0 @@ -/* 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 - -/** - * Simple node that displays a placekitten.com attribution. - */ -@interface BlurbNode : ASCellNode - -@end diff --git a/examples/SynchronousKittens/Sample/KittenNode.h b/examples/SynchronousKittens/Sample/KittenNode.h deleted file mode 100644 index 3cc23d5a44..0000000000 --- a/examples/SynchronousKittens/Sample/KittenNode.h +++ /dev/null @@ -1,24 +0,0 @@ -/* 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 - -/** - * 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; - -- (void)toggleImageEnlargement; - -@end diff --git a/examples/SynchronousKittens/Sample/ViewController.h b/examples/SynchronousKittens/Sample/ViewController.h deleted file mode 100644 index d0e9200d88..0000000000 --- a/examples/SynchronousKittens/Sample/ViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface ViewController : UIViewController - -@end diff --git a/examples/SynchronousKittens/Sample/main.m b/examples/SynchronousKittens/Sample/main.m deleted file mode 100644 index ae9488711c..0000000000 --- a/examples/SynchronousKittens/Sample/main.m +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/examples/VerticalWithinHorizontalScrolling/Podfile b/examples/VerticalWithinHorizontalScrolling/Podfile index 6c012e3c04..919de4b311 100644 --- a/examples/VerticalWithinHorizontalScrolling/Podfile +++ b/examples/VerticalWithinHorizontalScrolling/Podfile @@ -1,3 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/VerticalWithinHorizontalScrolling/Sample.xcodeproj/project.pbxproj b/examples/VerticalWithinHorizontalScrolling/Sample.xcodeproj/project.pbxproj index 2be08f1dcd..0dec823b1e 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample.xcodeproj/project.pbxproj +++ b/examples/VerticalWithinHorizontalScrolling/Sample.xcodeproj/project.pbxproj @@ -1,361 +1,806 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 05561CFD19D4F94A00CBA93C /* GradientTableNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05561CFC19D4F94A00CBA93C /* GradientTableNode.mm */; }; - 0585428019D4DBE100606EA6 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */; }; - 05E2128719D4DB510098F589 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128619D4DB510098F589 /* main.m */; }; - 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128919D4DB510098F589 /* AppDelegate.m */; }; - 05E2128D19D4DB510098F589 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128C19D4DB510098F589 /* ViewController.m */; }; - 18C2ED861B9B8CE700F627B3 /* RandomCoreGraphicsNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 18C2ED851B9B8CE700F627B3 /* RandomCoreGraphicsNode.m */; }; - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; - 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; - 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 05561CFB19D4F94A00CBA93C /* GradientTableNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GradientTableNode.h; sourceTree = ""; }; - 05561CFC19D4F94A00CBA93C /* GradientTableNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GradientTableNode.mm; sourceTree = ""; }; - 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; - 05E2128119D4DB510098F589 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 05E2128519D4DB510098F589 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 05E2128619D4DB510098F589 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 05E2128819D4DB510098F589 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 05E2128919D4DB510098F589 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 05E2128B19D4DB510098F589 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 05E2128C19D4DB510098F589 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - 18C2ED841B9B8CE700F627B3 /* RandomCoreGraphicsNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RandomCoreGraphicsNode.h; sourceTree = ""; }; - 18C2ED851B9B8CE700F627B3 /* RandomCoreGraphicsNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RandomCoreGraphicsNode.m; sourceTree = ""; }; - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; - 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 05E2127E19D4DB510098F589 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 05E2127819D4DB510098F589 = { - isa = PBXGroup; - children = ( - 05E2128319D4DB510098F589 /* Sample */, - 05E2128219D4DB510098F589 /* Products */, - 1A943BF0259746F18D6E423F /* Frameworks */, - 1AE410B73DA5C3BD087ACDD7 /* Pods */, - ); - indentWidth = 2; - sourceTree = ""; - tabWidth = 2; - usesTabs = 0; - }; - 05E2128219D4DB510098F589 /* Products */ = { - isa = PBXGroup; - children = ( - 05E2128119D4DB510098F589 /* Sample.app */, - ); - name = Products; - sourceTree = ""; - }; - 05E2128319D4DB510098F589 /* Sample */ = { - isa = PBXGroup; - children = ( - 05E2128819D4DB510098F589 /* AppDelegate.h */, - 05E2128919D4DB510098F589 /* AppDelegate.m */, - 05E2128B19D4DB510098F589 /* ViewController.h */, - 05E2128C19D4DB510098F589 /* ViewController.m */, - 05561CFB19D4F94A00CBA93C /* GradientTableNode.h */, - 05561CFC19D4F94A00CBA93C /* GradientTableNode.mm */, - 18C2ED841B9B8CE700F627B3 /* RandomCoreGraphicsNode.h */, - 18C2ED851B9B8CE700F627B3 /* RandomCoreGraphicsNode.m */, - 05E2128419D4DB510098F589 /* Supporting Files */, - ); - path = Sample; - sourceTree = ""; - }; - 05E2128419D4DB510098F589 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */, - 6C2C82AA19EE274300767484 /* Default-667h@2x.png */, - 6C2C82AB19EE274300767484 /* Default-736h@3x.png */, - 05E2128519D4DB510098F589 /* Info.plist */, - 05E2128619D4DB510098F589 /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 1A943BF0259746F18D6E423F /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 1AE410B73DA5C3BD087ACDD7 /* Pods */ = { - isa = PBXGroup; - children = ( - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */, - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 05E2128019D4DB510098F589 /* Sample */ = { - isa = PBXNativeTarget; - buildConfigurationList = 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */; - buildPhases = ( - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */, - 05E2127D19D4DB510098F589 /* Sources */, - 05E2127E19D4DB510098F589 /* Frameworks */, - 05E2127F19D4DB510098F589 /* Resources */, - F012A6F39E0149F18F564F50 /* Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Sample; - productName = Sample; - productReference = 05E2128119D4DB510098F589 /* Sample.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 05E2127919D4DB510098F589 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0600; - ORGANIZATIONNAME = Facebook; - TargetAttributes = { - 05E2128019D4DB510098F589 = { - CreatedOnToolsVersion = 6.0.1; - }; - }; - }; - buildConfigurationList = 05E2127C19D4DB510098F589 /* Build configuration list for PBXProject "Sample" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 05E2127819D4DB510098F589; - productRefGroup = 05E2128219D4DB510098F589 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 05E2128019D4DB510098F589 /* Sample */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 05E2127F19D4DB510098F589 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 0585428019D4DBE100606EA6 /* Default-568h@2x.png in Resources */, - 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */, - 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - E080B80F89C34A25B3488E26 /* 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; - }; - F012A6F39E0149F18F564F50 /* 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; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 05E2127D19D4DB510098F589 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 18C2ED861B9B8CE700F627B3 /* RandomCoreGraphicsNode.m in Sources */, - 05561CFD19D4F94A00CBA93C /* GradientTableNode.mm in Sources */, - 05E2128D19D4DB510098F589 /* ViewController.m in Sources */, - 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */, - 05E2128719D4DB510098F589 /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 05E212A219D4DB510098F589 /* 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 = 7.1; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 05E212A319D4DB510098F589 /* 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 = 7.1; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 05E212A519D4DB510098F589 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 05E212A619D4DB510098F589 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 05E2127C19D4DB510098F589 /* Build configuration list for PBXProject "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 05E212A219D4DB510098F589 /* Debug */, - 05E212A319D4DB510098F589 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 05E212A519D4DB510098F589 /* Debug */, - 05E212A619D4DB510098F589 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 05E2127919D4DB510098F589 /* Project object */; -} + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 05561CFB19D4F94A00CBA93C + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + GradientTableNode.h + sourceTree + <group> + + 05561CFC19D4F94A00CBA93C + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.cpp.objcpp + path + GradientTableNode.mm + sourceTree + <group> + + 05561CFD19D4F94A00CBA93C + + fileRef + 05561CFC19D4F94A00CBA93C + isa + PBXBuildFile + + 0585427F19D4DBE100606EA6 + + isa + PBXFileReference + lastKnownFileType + image.png + name + Default-568h@2x.png + path + ../Default-568h@2x.png + sourceTree + <group> + + 0585428019D4DBE100606EA6 + + fileRef + 0585427F19D4DBE100606EA6 + isa + PBXBuildFile + + 05E2127819D4DB510098F589 + + children + + 05E2128319D4DB510098F589 + 05E2128219D4DB510098F589 + 1A943BF0259746F18D6E423F + 1AE410B73DA5C3BD087ACDD7 + + indentWidth + 2 + isa + PBXGroup + sourceTree + <group> + tabWidth + 2 + usesTabs + 0 + + 05E2127919D4DB510098F589 + + attributes + + LastUpgradeCheck + 0600 + ORGANIZATIONNAME + Facebook + TargetAttributes + + 05E2128019D4DB510098F589 + + CreatedOnToolsVersion + 6.0.1 + + + + buildConfigurationList + 05E2127C19D4DB510098F589 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + 05E2127819D4DB510098F589 + productRefGroup + 05E2128219D4DB510098F589 + projectDirPath + + projectReferences + + projectRoot + + targets + + 05E2128019D4DB510098F589 + + + 05E2127C19D4DB510098F589 + + buildConfigurations + + 05E212A219D4DB510098F589 + 05E212A319D4DB510098F589 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 05E2127D19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 18C2ED861B9B8CE700F627B3 + 05561CFD19D4F94A00CBA93C + 05E2128D19D4DB510098F589 + 05E2128A19D4DB510098F589 + 05E2128719D4DB510098F589 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2127E19D4DB510098F589 + + buildActionMask + 2147483647 + files + + C81806AD7AEA1CC3061C4742 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2127F19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 0585428019D4DBE100606EA6 + 6C2C82AC19EE274300767484 + 6C2C82AD19EE274300767484 + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2128019D4DB510098F589 + + buildConfigurationList + 05E212A419D4DB510098F589 + buildPhases + + E080B80F89C34A25B3488E26 + 05E2127D19D4DB510098F589 + 05E2127E19D4DB510098F589 + 05E2127F19D4DB510098F589 + F012A6F39E0149F18F564F50 + 6E94068CFAA7736333E7D960 + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Sample + productName + Sample + productReference + 05E2128119D4DB510098F589 + productType + com.apple.product-type.application + + 05E2128119D4DB510098F589 + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + Sample.app + sourceTree + BUILT_PRODUCTS_DIR + + 05E2128219D4DB510098F589 + + children + + 05E2128119D4DB510098F589 + + isa + PBXGroup + name + Products + sourceTree + <group> + + 05E2128319D4DB510098F589 + + children + + 05E2128819D4DB510098F589 + 05E2128919D4DB510098F589 + 05E2128B19D4DB510098F589 + 05E2128C19D4DB510098F589 + 05561CFB19D4F94A00CBA93C + 05561CFC19D4F94A00CBA93C + 18C2ED841B9B8CE700F627B3 + 18C2ED851B9B8CE700F627B3 + 05E2128419D4DB510098F589 + + isa + PBXGroup + path + Sample + sourceTree + <group> + + 05E2128419D4DB510098F589 + + children + + 0585427F19D4DBE100606EA6 + 6C2C82AA19EE274300767484 + 6C2C82AB19EE274300767484 + 05E2128519D4DB510098F589 + 05E2128619D4DB510098F589 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + 05E2128519D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Info.plist + sourceTree + <group> + + 05E2128619D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + 05E2128719D4DB510098F589 + + fileRef + 05E2128619D4DB510098F589 + isa + PBXBuildFile + + 05E2128819D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AppDelegate.h + sourceTree + <group> + + 05E2128919D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AppDelegate.m + sourceTree + <group> + + 05E2128A19D4DB510098F589 + + fileRef + 05E2128919D4DB510098F589 + isa + PBXBuildFile + + 05E2128B19D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ViewController.h + sourceTree + <group> + + 05E2128C19D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ViewController.m + sourceTree + <group> + + 05E2128D19D4DB510098F589 + + fileRef + 05E2128C19D4DB510098F589 + isa + PBXBuildFile + + 05E212A219D4DB510098F589 + + 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 + 7.1 + MTL_ENABLE_DEBUG_INFO + YES + ONLY_ACTIVE_ARCH + YES + SDKROOT + iphoneos + + isa + XCBuildConfiguration + name + Debug + + 05E212A319D4DB510098F589 + + 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 + 7.1 + MTL_ENABLE_DEBUG_INFO + NO + SDKROOT + iphoneos + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + 05E212A419D4DB510098F589 + + buildConfigurations + + 05E212A519D4DB510098F589 + 05E212A619D4DB510098F589 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 05E212A519D4DB510098F589 + + baseConfigurationReference + 19760F30C80D89FC055CF57A + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 7.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Debug + + 05E212A619D4DB510098F589 + + baseConfigurationReference + A5A1F5A0D2B4375F57D02F1A + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 7.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Release + + 18C2ED841B9B8CE700F627B3 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RandomCoreGraphicsNode.h + sourceTree + <group> + + 18C2ED851B9B8CE700F627B3 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RandomCoreGraphicsNode.m + sourceTree + <group> + + 18C2ED861B9B8CE700F627B3 + + fileRef + 18C2ED851B9B8CE700F627B3 + isa + PBXBuildFile + + 19760F30C80D89FC055CF57A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.debug.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig + sourceTree + <group> + + 1A943BF0259746F18D6E423F + + children + + DBF6047FF8AB82FD183F47C3 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 1AE410B73DA5C3BD087ACDD7 + + children + + 19760F30C80D89FC055CF57A + A5A1F5A0D2B4375F57D02F1A + + isa + PBXGroup + name + Pods + sourceTree + <group> + + 6C2C82AA19EE274300767484 + + isa + PBXFileReference + lastKnownFileType + image.png + path + Default-667h@2x.png + sourceTree + SOURCE_ROOT + + 6C2C82AB19EE274300767484 + + isa + PBXFileReference + lastKnownFileType + image.png + path + Default-736h@3x.png + sourceTree + SOURCE_ROOT + + 6C2C82AC19EE274300767484 + + fileRef + 6C2C82AA19EE274300767484 + isa + PBXBuildFile + + 6C2C82AD19EE274300767484 + + fileRef + 6C2C82AB19EE274300767484 + isa + PBXBuildFile + + 6E94068CFAA7736333E7D960 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" + + showEnvVarsInLog + 0 + + A5A1F5A0D2B4375F57D02F1A + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + + C81806AD7AEA1CC3061C4742 + + fileRef + DBF6047FF8AB82FD183F47C3 + isa + PBXBuildFile + + DBF6047FF8AB82FD183F47C3 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-Sample.a + sourceTree + BUILT_PRODUCTS_DIR + + E080B80F89C34A25B3488E26 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + 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 + + showEnvVarsInLog + 0 + + F012A6F39E0149F18F564F50 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" + + showEnvVarsInLog + 0 + + + rootObject + 05E2127919D4DB510098F589 + + diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.h b/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.h index 85855277e9..5274628a9e 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.h +++ b/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.h @@ -1,13 +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. - */ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.m b/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.m index 6c998ed4bb..7856fdec08 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.m +++ b/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.m @@ -1,13 +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. - */ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.h b/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.h index f50b74b983..09bffc8b19 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.h +++ b/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.h @@ -1,13 +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. - */ +// +// GradientTableNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.mm b/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.mm index 2721a92d15..d86f831dd5 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.mm +++ b/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.mm @@ -1,13 +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. - */ +// +// GradientTableNode.mm +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "GradientTableNode.h" #import "RandomCoreGraphicsNode.h" diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.h b/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.h index 09e2d201d8..6eaed935c8 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.h +++ b/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.h @@ -3,7 +3,18 @@ // Sample // // Created by Scott Goodson on 9/5/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.m b/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.m index 18f71821cd..52f72a0f01 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.m +++ b/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.m @@ -3,7 +3,18 @@ // Sample // // Created by Scott Goodson on 9/5/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "RandomCoreGraphicsNode.h" diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.h b/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.h index d0e9200d88..fc52c022f2 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.h +++ b/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.h @@ -1,13 +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. - */ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.m b/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.m index 71647da9b0..74a5f53cc8 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.m +++ b/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 #import "ViewController.h" diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/main.m b/examples/VerticalWithinHorizontalScrolling/Sample/main.m index ae9488711c..756080fb2b 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/main.m +++ b/examples/VerticalWithinHorizontalScrolling/Sample/main.m @@ -1,13 +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. - */ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/VideoTableView/Podfile b/examples/VideoTableView/Podfile deleted file mode 100644 index 6c012e3c04..0000000000 --- a/examples/VideoTableView/Podfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' diff --git a/examples/VideoTableView/Sample.xcworkspace/contents.xcworkspacedata b/examples/VideoTableView/Sample.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7b5a2f3050..0000000000 --- a/examples/VideoTableView/Sample.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/examples/VideoTableView/Sample/AppDelegate.h b/examples/VideoTableView/Sample/AppDelegate.h deleted file mode 100644 index 85855277e9..0000000000 --- a/examples/VideoTableView/Sample/AppDelegate.h +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - -#define UseAutomaticLayout 1 - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/examples/VideoTableView/Sample/AppDelegate.m b/examples/VideoTableView/Sample/AppDelegate.m deleted file mode 100644 index 1dea563b77..0000000000 --- a/examples/VideoTableView/Sample/AppDelegate.m +++ /dev/null @@ -1,27 +0,0 @@ -/* 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 diff --git a/examples/VideoTableView/Sample/BlurbNode.h b/examples/VideoTableView/Sample/BlurbNode.h deleted file mode 100644 index 57d8e30787..0000000000 --- a/examples/VideoTableView/Sample/BlurbNode.h +++ /dev/null @@ -1,19 +0,0 @@ -/* 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 - -/** - * Simple node that displays a placekitten.com attribution. - */ -@interface BlurbNode : ASCellNode - -@end diff --git a/examples/VideoTableView/Sample/NicCageNode.h b/examples/VideoTableView/Sample/NicCageNode.h deleted file mode 100644 index 4330fcd16d..0000000000 --- a/examples/VideoTableView/Sample/NicCageNode.h +++ /dev/null @@ -1,24 +0,0 @@ -/* 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 - -/** - * 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 diff --git a/examples/VideoTableView/Sample/ViewController.h b/examples/VideoTableView/Sample/ViewController.h deleted file mode 100644 index d0e9200d88..0000000000 --- a/examples/VideoTableView/Sample/ViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -/* 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 - -@interface ViewController : UIViewController - -@end diff --git a/examples/VideoTableView/Sample/main.m b/examples/VideoTableView/Sample/main.m deleted file mode 100644 index ae9488711c..0000000000 --- a/examples/VideoTableView/Sample/main.m +++ /dev/null @@ -1,20 +0,0 @@ -/* 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 - -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/examples/Videos/Podfile b/examples/Videos/Podfile index 6c012e3c04..919de4b311 100644 --- a/examples/Videos/Podfile +++ b/examples/Videos/Podfile @@ -1,3 +1,5 @@ source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '8.0' -pod 'AsyncDisplayKit', :path => '../..' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/Videos/Sample.xcodeproj/project.pbxproj b/examples/Videos/Sample.xcodeproj/project.pbxproj index 0956e3307c..b43c7e7fc8 100644 --- a/examples/Videos/Sample.xcodeproj/project.pbxproj +++ b/examples/Videos/Sample.xcodeproj/project.pbxproj @@ -11,7 +11,7 @@ 05E2128719D4DB510098F589 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128619D4DB510098F589 /* main.m */; }; 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128919D4DB510098F589 /* AppDelegate.m */; }; 05E2128D19D4DB510098F589 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128C19D4DB510098F589 /* ViewController.m */; }; - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; + 5791C5525B690FA54F26ACE8 /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A2092CAF5607B3863A3700A2 /* libPods-Sample.a */; }; 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; AE8E41191C228A4A00913AC4 /* bearacrat@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = AE8E41181C228A4A00913AC4 /* bearacrat@2x.jpg */; }; @@ -29,15 +29,15 @@ 05E2128919D4DB510098F589 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 05E2128B19D4DB510098F589 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 05E2128C19D4DB510098F589 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; + A2092CAF5607B3863A3700A2 /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; AE8E41181C228A4A00913AC4 /* bearacrat@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "bearacrat@2x.jpg"; sourceTree = ""; }; AE8E411A1C235A6000913AC4 /* simon.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = simon.mp4; sourceTree = ""; }; AED850661C22679200183ED3 /* playButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "playButton@2x.png"; sourceTree = ""; }; AEE1F2BF1C293CF1005E0577 /* playButtonSelected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "playButtonSelected@2x.png"; sourceTree = ""; }; - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + CFD6AA1D30516C27DEE5602B /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; + E51646FF8D3676A1D826A5AE /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -45,7 +45,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */, + 5791C5525B690FA54F26ACE8 /* libPods-Sample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -104,7 +104,7 @@ 1A943BF0259746F18D6E423F /* Frameworks */ = { isa = PBXGroup; children = ( - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */, + A2092CAF5607B3863A3700A2 /* libPods-Sample.a */, ); name = Frameworks; sourceTree = ""; @@ -112,8 +112,8 @@ 1AE410B73DA5C3BD087ACDD7 /* Pods */ = { isa = PBXGroup; children = ( - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */, - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */, + CFD6AA1D30516C27DEE5602B /* Pods-Sample.debug.xcconfig */, + E51646FF8D3676A1D826A5AE /* Pods-Sample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -125,12 +125,12 @@ isa = PBXNativeTarget; buildConfigurationList = 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */; buildPhases = ( - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */, + E080B80F89C34A25B3488E26 /* πŸ“¦ Check Pods Manifest.lock */, 05E2127D19D4DB510098F589 /* Sources */, 05E2127E19D4DB510098F589 /* Frameworks */, 05E2127F19D4DB510098F589 /* Resources */, - F012A6F39E0149F18F564F50 /* Copy Pods Resources */, - 93B7780A33739EF25F20366B /* Embed Pods Frameworks */, + F012A6F39E0149F18F564F50 /* πŸ“¦ Copy Pods Resources */, + 93B7780A33739EF25F20366B /* πŸ“¦ Embed Pods Frameworks */, ); buildRules = ( ); @@ -191,29 +191,29 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 93B7780A33739EF25F20366B /* Embed Pods Frameworks */ = { + 93B7780A33739EF25F20366B /* πŸ“¦ Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Embed Pods Frameworks"; + name = "πŸ“¦ Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */ = { + E080B80F89C34A25B3488E26 /* πŸ“¦ Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "πŸ“¦ Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -221,19 +221,19 @@ 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; }; - F012A6F39E0149F18F564F50 /* Copy Pods Resources */ = { + F012A6F39E0149F18F564F50 /* πŸ“¦ Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "πŸ“¦ Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -330,7 +330,7 @@ }; 05E212A519D4DB510098F589 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */; + baseConfigurationReference = CFD6AA1D30516C27DEE5602B /* Pods-Sample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; @@ -341,7 +341,7 @@ }; 05E212A619D4DB510098F589 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */; + baseConfigurationReference = E51646FF8D3676A1D826A5AE /* Pods-Sample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; diff --git a/examples/Videos/Sample/ASVideoNode.h b/examples/Videos/Sample/ASVideoNode.h index 3e2cb7ecc9..3fcce60480 100644 --- a/examples/Videos/Sample/ASVideoNode.h +++ b/examples/Videos/Sample/ASVideoNode.h @@ -1,3 +1,19 @@ +// +// ASVideoNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Videos/Sample/ASVideoNode.m b/examples/Videos/Sample/ASVideoNode.m index aec4dbf1dc..7b9118721d 100644 --- a/examples/Videos/Sample/ASVideoNode.m +++ b/examples/Videos/Sample/ASVideoNode.m @@ -1,3 +1,19 @@ +// +// ASVideoNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ASVideoNode.h" diff --git a/examples/Videos/Sample/AppDelegate.h b/examples/Videos/Sample/AppDelegate.h index 2aa29369b4..27e560aafe 100644 --- a/examples/Videos/Sample/AppDelegate.h +++ b/examples/Videos/Sample/AppDelegate.h @@ -1,13 +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. - */ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Videos/Sample/AppDelegate.m b/examples/Videos/Sample/AppDelegate.m index a8e5594780..c62355c06c 100644 --- a/examples/Videos/Sample/AppDelegate.m +++ b/examples/Videos/Sample/AppDelegate.m @@ -1,13 +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. - */ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/Videos/Sample/ViewController.h b/examples/Videos/Sample/ViewController.h index 1664a00082..7cce1c400a 100644 --- a/examples/Videos/Sample/ViewController.h +++ b/examples/Videos/Sample/ViewController.h @@ -1,13 +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. - */ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 #import diff --git a/examples/Videos/Sample/ViewController.m b/examples/Videos/Sample/ViewController.m index 74e4ced00f..43a0fd6755 100644 --- a/examples/Videos/Sample/ViewController.m +++ b/examples/Videos/Sample/ViewController.m @@ -1,105 +1,151 @@ -/* 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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ASLayoutSpec.h" +#import "ASStaticLayoutSpec.h" @interface ViewController() -@property (nonatomic) ASVideoNode *videoNode; +@property (nonatomic, strong) ASDisplayNode *rootNode; +@property (nonatomic, strong) ASVideoNode *guitarVideoNode; @end @implementation ViewController +#pragma mark - UIViewController + - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - ASVideoNode *guitarVideo = [self guitarVideo]; - [self.view addSubnode:guitarVideo]; + // Root node for the view controller + _rootNode = [ASDisplayNode new]; + _rootNode.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - ASVideoNode *nicCageVideo = [self nicCageVideo]; - [self.view addSubnode:nicCageVideo]; + ASVideoNode *guitarVideoNode = self.guitarVideoNode; + [_rootNode addSubnode:self.guitarVideoNode]; - ASVideoNode *simonVideo = [self simonVideo]; - [self.view addSubnode:simonVideo]; + ASVideoNode *nicCageVideoNode = self.nicCageVideoNode; + [_rootNode addSubnode:nicCageVideoNode]; + + // Video node with custom play button + ASVideoNode *simonVideoNode = self.simonVideoNode; + [_rootNode addSubnode:simonVideoNode]; + + _rootNode.layoutSpecBlock = ^ASLayoutSpec *(ASDisplayNode * _Nonnull node, ASSizeRange constrainedSize) { + guitarVideoNode.layoutPosition = CGPointMake(0, 0); + guitarVideoNode.preferredFrameSize = CGSizeMake([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height/3); + + nicCageVideoNode.layoutPosition = CGPointMake([UIScreen mainScreen].bounds.size.width/2, [UIScreen mainScreen].bounds.size.height/3); + nicCageVideoNode.preferredFrameSize = CGSizeMake([UIScreen mainScreen].bounds.size.width/2, [UIScreen mainScreen].bounds.size.height/3); + + simonVideoNode.layoutPosition = CGPointMake(0, [UIScreen mainScreen].bounds.size.height - ([UIScreen mainScreen].bounds.size.height/3)); + simonVideoNode.preferredFrameSize = CGSizeMake([UIScreen mainScreen].bounds.size.width/2, [UIScreen mainScreen].bounds.size.height/3); + return [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[guitarVideoNode, nicCageVideoNode, simonVideoNode]]; + }; + [self.view addSubnode:_rootNode]; } -- (ASVideoNode *)guitarVideo; +- (void)viewDidLayoutSubviews { - ASVideoNode *videoNode = [[ASVideoNode alloc] init]; + [super viewDidLayoutSubviews]; - videoNode.asset = [AVAsset assetWithURL:[NSURL URLWithString:@"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-3045b261-7e93-4492-b7e5-5d6358376c9f-editedLiveAndDie.mov"]]; - - videoNode.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height/3); - - videoNode.gravity = AVLayerVideoGravityResizeAspectFill; - - videoNode.backgroundColor = [UIColor lightGrayColor]; - - return videoNode; + // After all subviews are layed out we have to measure it and move the root node to the right place + CGSize viewSize = self.view.bounds.size; + [self.rootNode measureWithSizeRange:ASSizeRangeMake(viewSize, viewSize)]; + [self.rootNode setNeedsLayout]; } -- (ASVideoNode *)nicCageVideo; -{ - ASVideoNode *nicCageVideo = [[ASVideoNode alloc] init]; - - nicCageVideo.delegate = self; - - nicCageVideo.asset = [AVAsset assetWithURL:[NSURL URLWithString:@"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-753fe655-86bb-46da-89b7-aa59c60e49c0-niccage.mp4"]]; - - nicCageVideo.frame = CGRectMake([UIScreen mainScreen].bounds.size.width/2, [UIScreen mainScreen].bounds.size.height/3, [UIScreen mainScreen].bounds.size.width/2, [UIScreen mainScreen].bounds.size.height/3); - - nicCageVideo.gravity = AVLayerVideoGravityResize; - - nicCageVideo.backgroundColor = [UIColor lightGrayColor]; - nicCageVideo.shouldAutorepeat = YES; - nicCageVideo.shouldAutoplay = YES; - nicCageVideo.muted = YES; +#pragma mark - Getter / Setter - return nicCageVideo; +- (ASVideoNode *)guitarVideoNode; +{ + if (_guitarVideoNode) { + return _guitarVideoNode; + } + + _guitarVideoNode = [[ASVideoNode alloc] init]; + _guitarVideoNode.asset = [AVAsset assetWithURL:[NSURL URLWithString:@"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-3045b261-7e93-4492-b7e5-5d6358376c9f-editedLiveAndDie.mov"]]; + _guitarVideoNode.gravity = AVLayerVideoGravityResizeAspectFill; + _guitarVideoNode.backgroundColor = [UIColor lightGrayColor]; + _guitarVideoNode.periodicTimeObserverTimescale = 1; //Default is 100 + _guitarVideoNode.delegate = self; + + return _guitarVideoNode; } -- (ASVideoNode *)simonVideo; +- (ASVideoNode *)nicCageVideoNode; { - ASVideoNode *simonVideo = [[ASVideoNode alloc] init]; + ASVideoNode *nicCageVideoNode = [[ASVideoNode alloc] init]; + nicCageVideoNode.delegate = self; + nicCageVideoNode.asset = [AVAsset assetWithURL:[NSURL URLWithString:@"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-753fe655-86bb-46da-89b7-aa59c60e49c0-niccage.mp4"]]; + nicCageVideoNode.gravity = AVLayerVideoGravityResize; + nicCageVideoNode.backgroundColor = [UIColor lightGrayColor]; + nicCageVideoNode.shouldAutorepeat = YES; + nicCageVideoNode.shouldAutoplay = YES; + nicCageVideoNode.muted = YES; + + return nicCageVideoNode; +} + +- (ASVideoNode *)simonVideoNode +{ + ASVideoNode *simonVideoNode = [[ASVideoNode alloc] init]; NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"simon" ofType:@"mp4"]]; - simonVideo.asset = [AVAsset assetWithURL:url]; + simonVideoNode.asset = [AVAsset assetWithURL:url]; + simonVideoNode.gravity = AVLayerVideoGravityResizeAspect; + simonVideoNode.backgroundColor = [UIColor lightGrayColor]; + simonVideoNode.shouldAutorepeat = YES; + simonVideoNode.shouldAutoplay = YES; + simonVideoNode.muted = YES; - simonVideo.frame = CGRectMake(0, [UIScreen mainScreen].bounds.size.height - ([UIScreen mainScreen].bounds.size.height/3), [UIScreen mainScreen].bounds.size.width/2, [UIScreen mainScreen].bounds.size.height/3); - - simonVideo.gravity = AVLayerVideoGravityResizeAspect; - - simonVideo.backgroundColor = [UIColor lightGrayColor]; - simonVideo.shouldAutorepeat = YES; - simonVideo.shouldAutoplay = YES; - - return simonVideo; + return simonVideoNode; } - (ASButtonNode *)playButton; { - ASButtonNode *playButton = [[ASButtonNode alloc] init]; + ASButtonNode *playButtonNode = [[ASButtonNode alloc] init]; UIImage *image = [UIImage imageNamed:@"playButton@2x.png"]; - [playButton setImage:image forState:ASControlStateNormal]; - [playButton measure:CGSizeMake(50, 50)]; - playButton.bounds = CGRectMake(0, 0, playButton.calculatedSize.width, playButton.calculatedSize.height); - playButton.position = CGPointMake([UIScreen mainScreen].bounds.size.width/4, ([UIScreen mainScreen].bounds.size.height/3)/2); - [playButton setImage:[UIImage imageNamed:@"playButtonSelected@2x.png"] forState:ASControlStateHighlighted]; - - return playButton; + [playButtonNode setImage:image forState:ASControlStateNormal]; + [playButtonNode setImage:[UIImage imageNamed:@"playButtonSelected@2x.png"] forState:ASControlStateHighlighted]; + + // Change placement of play button if necessary + //playButtonNode.contentHorizontalAlignment = ASHorizontalAlignmentStart; + //playButtonNode.contentVerticalAlignment = ASVerticalAlignmentCenter; + + return playButtonNode; } -- (void)videoNodeWasTapped:(ASVideoNode *)videoNode +#pragma mark - Actions + +- (void)didTapVideoNode:(ASVideoNode *)videoNode { + if (videoNode == self.guitarVideoNode) { + if (videoNode.playerState == ASVideoNodePlayerStatePlaying) { + [videoNode pause]; + } else if(videoNode.playerState == ASVideoNodePlayerStateLoading) { + [videoNode pause]; + } else { + [videoNode play]; + } + return; + } if (videoNode.player.muted == YES) { videoNode.player.muted = NO; } else { @@ -107,4 +153,31 @@ } } -@end +#pragma mark - ASVideoNodeDelegate + +- (void)videoNode:(ASVideoNode *)videoNode willChangePlayerState:(ASVideoNodePlayerState)state toState:(ASVideoNodePlayerState)toState +{ + //Ignore nicCageVideo + if (videoNode != _guitarVideoNode) { + return; + } + + if (toState == ASVideoNodePlayerStatePlaying) { + NSLog(@"guitarVideoNode is playing"); + } else if (toState == ASVideoNodePlayerStateFinished) { + NSLog(@"guitarVideoNode finished"); + } else if (toState == ASVideoNodePlayerStateLoading) { + NSLog(@"guitarVideoNode is buffering"); + } +} + +- (void)videoNode:(ASVideoNode *)videoNode didPlayToTimeInterval:(NSTimeInterval)timeInterval +{ + if (videoNode != _guitarVideoNode) { + return; + } + + NSLog(@"guitarVideoNode playback time is: %f",timeInterval); +} + +@end \ No newline at end of file diff --git a/examples/Videos/Sample/main.m b/examples/Videos/Sample/main.m index ae9488711c..756080fb2b 100644 --- a/examples/Videos/Sample/main.m +++ b/examples/Videos/Sample/main.m @@ -1,13 +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. - */ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Videos/best.png b/examples/Videos/best.png deleted file mode 100644 index d50d8103a6..0000000000 Binary files a/examples/Videos/best.png and /dev/null differ diff --git a/examples/Videos/medium.png b/examples/Videos/medium.png deleted file mode 100644 index 7c08e0adc0..0000000000 Binary files a/examples/Videos/medium.png and /dev/null differ diff --git a/examples/Videos/worst.png b/examples/Videos/worst.png deleted file mode 100644 index 78727fa98f..0000000000 Binary files a/examples/Videos/worst.png and /dev/null differ diff --git a/examples/EditableText/Default-568h@2x.png b/examples_extra/ASTableViewStressTest/Default-568h@2x.png similarity index 100% rename from examples/EditableText/Default-568h@2x.png rename to examples_extra/ASTableViewStressTest/Default-568h@2x.png diff --git a/examples/EditableText/Default-667h@2x.png b/examples_extra/ASTableViewStressTest/Default-667h@2x.png similarity index 100% rename from examples/EditableText/Default-667h@2x.png rename to examples_extra/ASTableViewStressTest/Default-667h@2x.png diff --git a/examples/EditableText/Default-736h@3x.png b/examples_extra/ASTableViewStressTest/Default-736h@3x.png similarity index 100% rename from examples/EditableText/Default-736h@3x.png rename to examples_extra/ASTableViewStressTest/Default-736h@3x.png diff --git a/examples_extra/ASTableViewStressTest/Podfile b/examples_extra/ASTableViewStressTest/Podfile new file mode 100644 index 0000000000..919de4b311 --- /dev/null +++ b/examples_extra/ASTableViewStressTest/Podfile @@ -0,0 +1,5 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/ASTableViewStressTest/Sample.xcodeproj/project.pbxproj b/examples_extra/ASTableViewStressTest/Sample.xcodeproj/project.pbxproj similarity index 86% rename from examples/ASTableViewStressTest/Sample.xcodeproj/project.pbxproj rename to examples_extra/ASTableViewStressTest/Sample.xcodeproj/project.pbxproj index e066c2fcd1..3e68545a8d 100644 --- a/examples/ASTableViewStressTest/Sample.xcodeproj/project.pbxproj +++ b/examples_extra/ASTableViewStressTest/Sample.xcodeproj/project.pbxproj @@ -11,12 +11,13 @@ 05E2128719D4DB510098F589 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128619D4DB510098F589 /* main.m */; }; 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128919D4DB510098F589 /* AppDelegate.m */; }; 05E2128D19D4DB510098F589 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128C19D4DB510098F589 /* ViewController.m */; }; - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; + 881AF5D3D4458C15BACC8930 /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D65D3016E9D596BDDD17FA44 /* libPods-Sample.a */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 0431779F19E096F3CEC4D269 /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; 05E2128119D4DB510098F589 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 05E2128519D4DB510098F589 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -25,11 +26,10 @@ 05E2128919D4DB510098F589 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 05E2128B19D4DB510098F589 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 05E2128C19D4DB510098F589 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + D65D3016E9D596BDDD17FA44 /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + DBA49A0CCF4CA8FC1F96CB6D /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -37,7 +37,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */, + 881AF5D3D4458C15BACC8930 /* libPods-Sample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -92,7 +92,7 @@ 1A943BF0259746F18D6E423F /* Frameworks */ = { isa = PBXGroup; children = ( - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */, + D65D3016E9D596BDDD17FA44 /* libPods-Sample.a */, ); name = Frameworks; sourceTree = ""; @@ -100,8 +100,8 @@ 1AE410B73DA5C3BD087ACDD7 /* Pods */ = { isa = PBXGroup; children = ( - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */, - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */, + DBA49A0CCF4CA8FC1F96CB6D /* Pods-Sample.debug.xcconfig */, + 0431779F19E096F3CEC4D269 /* Pods-Sample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -118,6 +118,7 @@ 05E2127E19D4DB510098F589 /* Frameworks */, 05E2127F19D4DB510098F589 /* Resources */, F012A6F39E0149F18F564F50 /* Copy Pods Resources */, + 75CADB9ECE58AB74892E1D67 /* Embed Pods Frameworks */, ); buildRules = ( ); @@ -174,6 +175,21 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 75CADB9ECE58AB74892E1D67 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -201,7 +217,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -298,7 +314,7 @@ }; 05E212A519D4DB510098F589 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */; + baseConfigurationReference = DBA49A0CCF4CA8FC1F96CB6D /* Pods-Sample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; @@ -310,7 +326,7 @@ }; 05E212A619D4DB510098F589 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */; + baseConfigurationReference = 0431779F19E096F3CEC4D269 /* Pods-Sample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; diff --git a/examples/CollectionViewWithViewControllerCells/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples_extra/ASTableViewStressTest/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to examples_extra/ASTableViewStressTest/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/examples/ASTableViewStressTest/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples_extra/ASTableViewStressTest/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme similarity index 100% rename from examples/ASTableViewStressTest/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme rename to examples_extra/ASTableViewStressTest/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme diff --git a/examples_extra/ASTableViewStressTest/Sample/AppDelegate.h b/examples_extra/ASTableViewStressTest/Sample/AppDelegate.h new file mode 100644 index 0000000000..27e560aafe --- /dev/null +++ b/examples_extra/ASTableViewStressTest/Sample/AppDelegate.h @@ -0,0 +1,24 @@ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples/ASTableViewStressTest/Sample/AppDelegate.m b/examples_extra/ASTableViewStressTest/Sample/AppDelegate.m similarity index 59% rename from examples/ASTableViewStressTest/Sample/AppDelegate.m rename to examples_extra/ASTableViewStressTest/Sample/AppDelegate.m index 50382b9daa..3ba6ef18f3 100644 --- a/examples/ASTableViewStressTest/Sample/AppDelegate.m +++ b/examples_extra/ASTableViewStressTest/Sample/AppDelegate.m @@ -1,13 +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. - */ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/ASTableViewStressTest/Sample/Info.plist b/examples_extra/ASTableViewStressTest/Sample/Info.plist similarity index 100% rename from examples/ASTableViewStressTest/Sample/Info.plist rename to examples_extra/ASTableViewStressTest/Sample/Info.plist diff --git a/examples_extra/ASTableViewStressTest/Sample/ViewController.h b/examples_extra/ASTableViewStressTest/Sample/ViewController.h new file mode 100644 index 0000000000..fc52c022f2 --- /dev/null +++ b/examples_extra/ASTableViewStressTest/Sample/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface ViewController : UIViewController + +@end diff --git a/examples/ASTableViewStressTest/Sample/ViewController.m b/examples_extra/ASTableViewStressTest/Sample/ViewController.m similarity index 87% rename from examples/ASTableViewStressTest/Sample/ViewController.m rename to examples_extra/ASTableViewStressTest/Sample/ViewController.m index f2b02e5594..b16630ecb1 100644 --- a/examples/ASTableViewStressTest/Sample/ViewController.m +++ b/examples_extra/ASTableViewStressTest/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples_extra/ASTableViewStressTest/Sample/main.m b/examples_extra/ASTableViewStressTest/Sample/main.m new file mode 100644 index 0000000000..756080fb2b --- /dev/null +++ b/examples_extra/ASTableViewStressTest/Sample/main.m @@ -0,0 +1,26 @@ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/examples_extra/ASTraitCollection/Podfile b/examples_extra/ASTraitCollection/Podfile new file mode 100644 index 0000000000..919de4b311 --- /dev/null +++ b/examples_extra/ASTraitCollection/Podfile @@ -0,0 +1,5 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/SynchronousKittens/Sample.xcodeproj/project.pbxproj b/examples_extra/ASTraitCollection/Sample.xcodeproj/project.pbxproj similarity index 67% rename from examples/SynchronousKittens/Sample.xcodeproj/project.pbxproj rename to examples_extra/ASTraitCollection/Sample.xcodeproj/project.pbxproj index ddfd884074..f9e679bb36 100644 --- a/examples/SynchronousKittens/Sample.xcodeproj/project.pbxproj +++ b/examples_extra/ASTraitCollection/Sample.xcodeproj/project.pbxproj @@ -7,23 +7,19 @@ objects = { /* Begin PBXBuildFile section */ - 05561CFA19D4E77700CBA93C /* BlurbNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 05561CF919D4E77700CBA93C /* BlurbNode.m */; }; - 05561CFD19D4F94A00CBA93C /* KittenNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05561CFC19D4F94A00CBA93C /* KittenNode.mm */; }; - 0585428019D4DBE100606EA6 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */; }; 05E2128719D4DB510098F589 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128619D4DB510098F589 /* main.m */; }; 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128919D4DB510098F589 /* AppDelegate.m */; }; 05E2128D19D4DB510098F589 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128C19D4DB510098F589 /* ViewController.m */; }; - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; - 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; - 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; + 1BEECAB53F4B61DCB949ED44 /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EEDFC574739077BA65E0CF5 /* libPods-Sample.a */; }; + 9C37D01E1CC94BC9004C8BC1 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9C37D01D1CC94BC9004C8BC1 /* Launch Screen.storyboard */; }; + 9CACC7811CCEAF9E009A1613 /* TableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CACC7801CCEAF9E009A1613 /* TableViewController.m */; }; + 9CACC7841CCEAFAE009A1613 /* CollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CACC7831CCEAFAE009A1613 /* CollectionViewController.m */; }; + 9CACC7871CCEBD3B009A1613 /* KittenNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CACC7861CCEBD3B009A1613 /* KittenNode.m */; }; + 9CACC78A1CCEC82C009A1613 /* OverrideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CACC7891CCEC82C009A1613 /* OverrideViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 05561CF819D4E77700CBA93C /* BlurbNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlurbNode.h; sourceTree = ""; }; - 05561CF919D4E77700CBA93C /* BlurbNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlurbNode.m; sourceTree = ""; }; - 05561CFB19D4F94A00CBA93C /* KittenNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KittenNode.h; sourceTree = ""; }; - 05561CFC19D4F94A00CBA93C /* KittenNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KittenNode.mm; sourceTree = ""; }; - 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; + 056298286C03B7760575CC56 /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; 05E2128119D4DB510098F589 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 05E2128519D4DB510098F589 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 05E2128619D4DB510098F589 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; @@ -32,9 +28,18 @@ 05E2128B19D4DB510098F589 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 05E2128C19D4DB510098F589 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + 1EEDFC574739077BA65E0CF5 /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; - 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; + 9C37D01D1CC94BC9004C8BC1 /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; + 9CACC77F1CCEAF9E009A1613 /* TableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewController.h; sourceTree = ""; }; + 9CACC7801CCEAF9E009A1613 /* TableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableViewController.m; sourceTree = ""; }; + 9CACC7821CCEAFAE009A1613 /* CollectionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionViewController.h; sourceTree = ""; }; + 9CACC7831CCEAFAE009A1613 /* CollectionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CollectionViewController.m; sourceTree = ""; }; + 9CACC7851CCEBD3B009A1613 /* KittenNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KittenNode.h; sourceTree = ""; }; + 9CACC7861CCEBD3B009A1613 /* KittenNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KittenNode.m; sourceTree = ""; }; + 9CACC7881CCEC82C009A1613 /* OverrideViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverrideViewController.h; sourceTree = ""; }; + 9CACC7891CCEC82C009A1613 /* OverrideViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OverrideViewController.m; sourceTree = ""; }; + A7F0013FBBCBEA0C9FB68986 /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -43,7 +48,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */, + 1BEECAB53F4B61DCB949ED44 /* libPods-Sample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -78,11 +83,15 @@ 05E2128919D4DB510098F589 /* AppDelegate.m */, 05E2128B19D4DB510098F589 /* ViewController.h */, 05E2128C19D4DB510098F589 /* ViewController.m */, - 05561CFB19D4F94A00CBA93C /* KittenNode.h */, - 05561CFC19D4F94A00CBA93C /* KittenNode.mm */, - 05561CF819D4E77700CBA93C /* BlurbNode.h */, - 05561CF919D4E77700CBA93C /* BlurbNode.m */, 05E2128419D4DB510098F589 /* Supporting Files */, + 9CACC77F1CCEAF9E009A1613 /* TableViewController.h */, + 9CACC7801CCEAF9E009A1613 /* TableViewController.m */, + 9CACC7821CCEAFAE009A1613 /* CollectionViewController.h */, + 9CACC7831CCEAFAE009A1613 /* CollectionViewController.m */, + 9CACC7851CCEBD3B009A1613 /* KittenNode.h */, + 9CACC7861CCEBD3B009A1613 /* KittenNode.m */, + 9CACC7881CCEC82C009A1613 /* OverrideViewController.h */, + 9CACC7891CCEC82C009A1613 /* OverrideViewController.m */, ); path = Sample; sourceTree = ""; @@ -90,11 +99,9 @@ 05E2128419D4DB510098F589 /* Supporting Files */ = { isa = PBXGroup; children = ( - 0585427F19D4DBE100606EA6 /* Default-568h@2x.png */, - 6C2C82AA19EE274300767484 /* Default-667h@2x.png */, - 6C2C82AB19EE274300767484 /* Default-736h@3x.png */, 05E2128519D4DB510098F589 /* Info.plist */, 05E2128619D4DB510098F589 /* main.m */, + 9C37D01D1CC94BC9004C8BC1 /* Launch Screen.storyboard */, ); name = "Supporting Files"; sourceTree = ""; @@ -103,6 +110,7 @@ isa = PBXGroup; children = ( 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */, + 1EEDFC574739077BA65E0CF5 /* libPods-Sample.a */, ); name = Frameworks; sourceTree = ""; @@ -112,6 +120,8 @@ children = ( C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */, 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */, + 056298286C03B7760575CC56 /* Pods-Sample.debug.xcconfig */, + A7F0013FBBCBEA0C9FB68986 /* Pods-Sample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -123,11 +133,12 @@ isa = PBXNativeTarget; buildConfigurationList = 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */; buildPhases = ( - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */, + E080B80F89C34A25B3488E26 /* πŸ“¦ Check Pods Manifest.lock */, 05E2127D19D4DB510098F589 /* Sources */, 05E2127E19D4DB510098F589 /* Frameworks */, 05E2127F19D4DB510098F589 /* Resources */, - F012A6F39E0149F18F564F50 /* Copy Pods Resources */, + F012A6F39E0149F18F564F50 /* πŸ“¦ Copy Pods Resources */, + FFF65E837E66ADA71296F0FF /* πŸ“¦ Embed Pods Frameworks */, ); buildRules = ( ); @@ -175,23 +186,21 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 0585428019D4DBE100606EA6 /* Default-568h@2x.png in Resources */, - 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */, - 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */, + 9C37D01E1CC94BC9004C8BC1 /* Launch Screen.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */ = { + E080B80F89C34A25B3488E26 /* πŸ“¦ Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "πŸ“¦ Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -199,19 +208,34 @@ 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; }; - F012A6F39E0149F18F564F50 /* Copy Pods Resources */ = { + F012A6F39E0149F18F564F50 /* πŸ“¦ Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "πŸ“¦ Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + FFF65E837E66ADA71296F0FF /* πŸ“¦ Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "πŸ“¦ Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -221,11 +245,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 05561CFD19D4F94A00CBA93C /* KittenNode.mm in Sources */, 05E2128D19D4DB510098F589 /* ViewController.m in Sources */, + 9CACC78A1CCEC82C009A1613 /* OverrideViewController.m in Sources */, 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */, - 05561CFA19D4E77700CBA93C /* BlurbNode.m in Sources */, 05E2128719D4DB510098F589 /* main.m in Sources */, + 9CACC7841CCEAFAE009A1613 /* CollectionViewController.m in Sources */, + 9CACC7871CCEBD3B009A1613 /* KittenNode.m in Sources */, + 9CACC7811CCEAF9E009A1613 /* TableViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -310,11 +336,10 @@ }; 05E212A519D4DB510098F589 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */; + baseConfigurationReference = 056298286C03B7760575CC56 /* Pods-Sample.debug.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -323,11 +348,10 @@ }; 05E212A619D4DB510098F589 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */; + baseConfigurationReference = A7F0013FBBCBEA0C9FB68986 /* Pods-Sample.release.xcconfig */; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/examples/EditableText/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples_extra/ASTraitCollection/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/EditableText/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to examples_extra/ASTraitCollection/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/examples/Multiplex/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples_extra/ASTraitCollection/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme similarity index 100% rename from examples/Multiplex/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme rename to examples_extra/ASTraitCollection/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme diff --git a/examples/BackgroundPropertySetting/Sample.xcworkspace/contents.xcworkspacedata b/examples_extra/ASTraitCollection/Sample.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/BackgroundPropertySetting/Sample.xcworkspace/contents.xcworkspacedata rename to examples_extra/ASTraitCollection/Sample.xcworkspace/contents.xcworkspacedata diff --git a/examples_extra/ASTraitCollection/Sample/AppDelegate.h b/examples_extra/ASTraitCollection/Sample/AppDelegate.h new file mode 100644 index 0000000000..5274628a9e --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/AppDelegate.h @@ -0,0 +1,26 @@ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#define UseAutomaticLayout 1 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples_extra/ASTraitCollection/Sample/AppDelegate.m b/examples_extra/ASTraitCollection/Sample/AppDelegate.m new file mode 100644 index 0000000000..eb5d123a4b --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/AppDelegate.m @@ -0,0 +1,37 @@ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" +#import "TableViewController.h" +#import "CollectionViewController.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + self.window.backgroundColor = [UIColor whiteColor]; + UITabBarController *tabController = [[UITabBarController alloc] init]; + [tabController setViewControllers:@[[[ViewController alloc] init], [[TableViewController alloc] init], [[CollectionViewController alloc] init]]]; + self.window.rootViewController = tabController; + [self.window makeKeyAndVisible]; + return YES; +} + +@end diff --git a/examples_extra/ASTraitCollection/Sample/CollectionViewController.h b/examples_extra/ASTraitCollection/Sample/CollectionViewController.h new file mode 100644 index 0000000000..68c7b30d07 --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/CollectionViewController.h @@ -0,0 +1,21 @@ +// +// CollectionViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface CollectionViewController : ASViewController +@end diff --git a/examples_extra/ASTraitCollection/Sample/CollectionViewController.m b/examples_extra/ASTraitCollection/Sample/CollectionViewController.m new file mode 100644 index 0000000000..1c94ce4812 --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/CollectionViewController.m @@ -0,0 +1,79 @@ +// +// CollectionViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "CollectionViewController.h" +#import "KittenNode.h" +#import + +@interface CollectionViewController () +@property (nonatomic, strong) ASCollectionNode *collectionNode; +@end + +@implementation CollectionViewController + +- (instancetype)init +{ + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.minimumLineSpacing = 10; + layout.minimumInteritemSpacing = 10; + + ASCollectionNode *collectionNode = [[ASCollectionNode alloc] initWithCollectionViewLayout:layout]; + + if (!(self = [super initWithNode:collectionNode])) + return nil; + + self.title = @"Collection Node"; + _collectionNode = collectionNode; + collectionNode.dataSource = self; + collectionNode.delegate = self; + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + self.collectionNode.view.contentInset = UIEdgeInsetsMake(20, 10, CGRectGetHeight(self.tabBarController.tabBar.frame), 10); +} + +#pragma mark - ASCollectionDataSource + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section +{ + return 50; +} + +- (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForItemAtIndexPath:(NSIndexPath *)indexPath +{ + KittenNode *cell = [[KittenNode alloc] init]; + cell.textNode.maximumNumberOfLines = 3; + cell.imageTappedBlock = ^{ + [KittenNode defaultImageTappedAction:self]; + }; + return cell; +} + +- (ASSizeRange)collectionView:(ASCollectionView *)collectionView constrainedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath +{ + ASTraitCollection *traitCollection = [self.collectionNode asyncTraitCollection]; + + if (traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular) { + return ASSizeRangeMake(CGSizeMake(200, 120), CGSizeMake(200, 120)); + } + return ASSizeRangeMake(CGSizeMake(132, 180), CGSizeMake(132, 180)); +} + +@end diff --git a/examples_extra/ASTraitCollection/Sample/Info.plist b/examples_extra/ASTraitCollection/Sample/Info.plist new file mode 100644 index 0000000000..acc713cc71 --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/Info.plist @@ -0,0 +1,39 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + Launch Screen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortraitUpsideDown + + + diff --git a/examples_extra/ASTraitCollection/Sample/KittenNode.h b/examples_extra/ASTraitCollection/Sample/KittenNode.h new file mode 100644 index 0000000000..1fd783f03d --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/KittenNode.h @@ -0,0 +1,29 @@ +// +// KittenNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface KittenNode : ASCellNode +@property (nonatomic, strong, readonly) ASNetworkImageNode *imageNode; +@property (nonatomic, strong, readonly) ASTextNode *textNode; + +@property (nonatomic, copy) dispatch_block_t imageTappedBlock; + +// The default action when an image node is tapped. This action will create an +// OverrideVC and override its display traits to always be compact. ++ (void)defaultImageTappedAction:(ASViewController *)sourceViewController; +@end diff --git a/examples_extra/ASTraitCollection/Sample/KittenNode.m b/examples_extra/ASTraitCollection/Sample/KittenNode.m new file mode 100644 index 0000000000..750bf63a1b --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/KittenNode.m @@ -0,0 +1,174 @@ +// +// KittenNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "OverrideViewController.h" + +#import + +static const CGFloat kOuterPadding = 16.0f; +static const CGFloat kInnerPadding = 10.0f; + +@interface KittenNode () +{ + CGSize _kittenSize; +} + +@end + + +@implementation KittenNode + +// 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)init +{ + if (!(self = [super init])) + return nil; + + _kittenSize = CGSizeMake(100,100); + + // kitten image, with a solid background colour serving as placeholder + _imageNode = [[ASNetworkImageNode alloc] init]; + _imageNode.backgroundColor = ASDisplayNodeDefaultPlaceholderColor(); + _imageNode.preferredFrameSize = _kittenSize; + [_imageNode addTarget:self action:@selector(imageTapped:) forControlEvents:ASControlNodeEventTouchUpInside]; + + CGFloat scale = [UIScreen mainScreen].scale; + _imageNode.URL = [NSURL URLWithString:[NSString stringWithFormat:@"https://placekitten.com/%zd/%zd?image=%zd", + (NSInteger)roundl(_kittenSize.width * scale), + (NSInteger)roundl(_kittenSize.height * scale), + (NSInteger)arc4random_uniform(20)]]; + [self addSubnode:_imageNode]; + + // lorem ipsum text, plus some nice styling + _textNode = [[ASTextNode alloc] init]; + _textNode.attributedString = [[NSAttributedString alloc] initWithString:[self kittyIpsum] + attributes:[self textStyle]]; + _textNode.flexShrink = YES; + _textNode.flexGrow = YES; + [self addSubnode:_textNode]; + + return self; +} + +- (void)imageTapped:(id)sender +{ + if (self.imageTappedBlock) { + self.imageTappedBlock(); + } +} + +- (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, + ASTextNodeWordKerningAttributeName : @.5}; +} + +- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize +{ + ASStackLayoutSpec *stackSpec = [[ASStackLayoutSpec alloc] init]; + stackSpec.spacing = kInnerPadding; + [stackSpec setChildren:@[_imageNode, _textNode]]; + + if (self.asyncTraitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular) { + _imageNode.alignSelf = ASStackLayoutAlignSelfStart; + stackSpec.direction = ASStackLayoutDirectionHorizontal; + } else { + _imageNode.alignSelf = ASStackLayoutAlignSelfCenter; + stackSpec.direction = ASStackLayoutDirectionVertical; + } + + return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(kOuterPadding, kOuterPadding, kOuterPadding, kOuterPadding) child:stackSpec]; +} + ++ (void)defaultImageTappedAction:(ASViewController *)sourceViewController +{ + OverrideViewController *overrideVC = [[OverrideViewController alloc] init]; + + overrideVC.overrideDisplayTraitsWithTraitCollection = ^(UITraitCollection *traitCollection) { + ASTraitCollection *asyncTraitCollection = [ASTraitCollection traitCollectionWithDisplayScale:traitCollection.displayScale + userInterfaceIdiom:traitCollection.userInterfaceIdiom + horizontalSizeClass:UIUserInterfaceSizeClassCompact + verticalSizeClass:UIUserInterfaceSizeClassCompact + forceTouchCapability:traitCollection.forceTouchCapability + traitCollectionContext:nil]; + return asyncTraitCollection; + }; + + [sourceViewController presentViewController:overrideVC animated:YES completion:nil]; + overrideVC.closeBlock = ^{ + [sourceViewController dismissViewControllerAnimated:YES completion:nil]; + }; +} + +@end diff --git a/examples_extra/ASTraitCollection/Sample/Launch Screen.storyboard b/examples_extra/ASTraitCollection/Sample/Launch Screen.storyboard new file mode 100644 index 0000000000..95c8ef474d --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/Launch Screen.storyboard @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples_extra/ASTraitCollection/Sample/OverrideViewController.h b/examples_extra/ASTraitCollection/Sample/OverrideViewController.h new file mode 100644 index 0000000000..895d21ce2a --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/OverrideViewController.h @@ -0,0 +1,35 @@ +// +// OverrideViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +/* + * A simple node that displays the attribution for the kitties in the app. Note that + * for a regular horizontal size class it does something stupid and sets the font size to 100. + * It's VC, OverrideViewController, will have its display traits overridden such that + * it will always have a compact horizontal size class. + */ +@interface OverrideNode : ASDisplayNode +@end + +/* + * This is a fairly stupid VC that's main purpose is to show how to override ASDisplayTraits. + * Take a look at `defaultImageTappedAction` in KittenNode to see how this is accomplished. + */ +@interface OverrideViewController : ASViewController +@property (nonatomic, copy) dispatch_block_t closeBlock; +@end diff --git a/examples_extra/ASTraitCollection/Sample/OverrideViewController.m b/examples_extra/ASTraitCollection/Sample/OverrideViewController.m new file mode 100644 index 0000000000..f150bc317d --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/OverrideViewController.m @@ -0,0 +1,103 @@ +// +// OverrideViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "OverrideViewController.h" +#import + +static NSString *kLinkAttributeName = @"PlaceKittenNodeLinkAttributeName"; + +@interface OverrideNode() +@property (nonatomic, strong) ASTextNode *textNode; +@property (nonatomic, strong) ASButtonNode *buttonNode; +@end + +@implementation OverrideNode + +- (instancetype)init +{ + if (!(self = [super init])) + return nil; + + _textNode = [[ASTextNode alloc] init]; + _textNode.flexGrow = YES; + _textNode.flexShrink = YES; + _textNode.maximumNumberOfLines = 3; + [self addSubnode:_textNode]; + + _buttonNode = [[ASButtonNode alloc] init]; + [_buttonNode setAttributedTitle:[[NSAttributedString alloc] initWithString:@"Close"] forState:ASControlStateNormal]; + [self addSubnode:_buttonNode]; + + self.backgroundColor = [UIColor lightGrayColor]; + + return self; +} + +- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize +{ + CGFloat pointSize = 16.f; + ASTraitCollection *traitCollection = [self asyncTraitCollection]; + if (traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular) { + // This should never happen because we override the VC's display traits to always be compact. + pointSize = 100; + } + + NSString *blurb = @"kittens courtesy placekitten.com"; + NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:blurb]; + [string addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue" size:pointSize] 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; + + ASStackLayoutSpec *stackSpec = [ASStackLayoutSpec verticalStackLayoutSpec]; + stackSpec.children = @[_textNode, _buttonNode]; + stackSpec.spacing = 10; + return [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(40, 20, 20, 20) child:stackSpec]; +} + +@end + +@interface OverrideViewController () + +@end + +@implementation OverrideViewController + +- (instancetype)init +{ + OverrideNode *overrideNode = [[OverrideNode alloc] init]; + + if (!(self = [super initWithNode:overrideNode])) + return nil; + + [overrideNode.buttonNode addTarget:self action:@selector(closeTapped:) forControlEvents:ASControlNodeEventTouchUpInside]; + return self; +} + +- (void)closeTapped:(id)sender +{ + if (self.closeBlock) { + self.closeBlock(); + } +} + +@end diff --git a/examples_extra/ASTraitCollection/Sample/TableViewController.h b/examples_extra/ASTraitCollection/Sample/TableViewController.h new file mode 100644 index 0000000000..56683ad278 --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/TableViewController.h @@ -0,0 +1,22 @@ +// +// TableViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface TableViewController : ASViewController + +@end diff --git a/examples_extra/ASTraitCollection/Sample/TableViewController.m b/examples_extra/ASTraitCollection/Sample/TableViewController.m new file mode 100644 index 0000000000..b24cdec5ca --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/TableViewController.m @@ -0,0 +1,68 @@ +// +// TableViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "TableViewController.h" +#import "KittenNode.h" + +@interface TableViewController () +@property (nonatomic, strong) ASTableNode *tableNode; +@end + +@implementation TableViewController + +- (instancetype)init +{ + ASTableNode *tableNode = [[ASTableNode alloc] init]; + if (!(self = [super initWithNode:tableNode])) + return nil; + + _tableNode = tableNode; + tableNode.delegate = self; + tableNode.dataSource = self; + self.title = @"Table Node"; + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + self.tableNode.view.contentInset = UIEdgeInsetsMake(CGRectGetHeight([[UIApplication sharedApplication] statusBarFrame]), 0, CGRectGetHeight(self.tabBarController.tabBar.frame), 0); +} + +#pragma mark - +#pragma mark ASTableView. + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:YES]; +} + +- (ASCellNode *)tableView:(ASTableView *)tableView nodeForRowAtIndexPath:(NSIndexPath *)indexPath +{ + KittenNode *cell = [[KittenNode alloc] init]; + cell.imageTappedBlock = ^{ + [KittenNode defaultImageTappedAction:self]; + }; + return cell; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 15; +} + +@end diff --git a/examples_extra/ASTraitCollection/Sample/ViewController.h b/examples_extra/ASTraitCollection/Sample/ViewController.h new file mode 100644 index 0000000000..c5a802dd6f --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface ViewController : ASViewController + +@end diff --git a/examples_extra/ASTraitCollection/Sample/ViewController.m b/examples_extra/ASTraitCollection/Sample/ViewController.m new file mode 100644 index 0000000000..0b7b6dd370 --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/ViewController.m @@ -0,0 +1,51 @@ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "KittenNode.h" +#import "OverrideViewController.h" + +#import +#import + +@interface ViewController () +@end + +@implementation ViewController + +#pragma mark - +#pragma mark UIViewController. + +- (instancetype)init +{ + KittenNode *displayNode = [[KittenNode alloc] init]; + if (!(self = [super initWithNode:displayNode])) + return nil; + + self.title = @"Display Node"; + displayNode.imageTappedBlock = ^{ + [KittenNode defaultImageTappedAction:self]; + }; + return self; +} + +- (void)viewWillLayoutSubviews +{ + [super viewWillLayoutSubviews]; +} + +@end diff --git a/examples_extra/ASTraitCollection/Sample/main.m b/examples_extra/ASTraitCollection/Sample/main.m new file mode 100644 index 0000000000..756080fb2b --- /dev/null +++ b/examples_extra/ASTraitCollection/Sample/main.m @@ -0,0 +1,26 @@ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/examples_extra/BackgroundPropertySetting/Podfile b/examples_extra/BackgroundPropertySetting/Podfile new file mode 100644 index 0000000000..e077db444a --- /dev/null +++ b/examples_extra/BackgroundPropertySetting/Podfile @@ -0,0 +1,6 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' +use_frameworks! +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/BackgroundPropertySetting/Sample.xcodeproj/project.pbxproj b/examples_extra/BackgroundPropertySetting/Sample.xcodeproj/project.pbxproj similarity index 89% rename from examples/BackgroundPropertySetting/Sample.xcodeproj/project.pbxproj rename to examples_extra/BackgroundPropertySetting/Sample.xcodeproj/project.pbxproj index 297e538fbe..31e73d7e61 100644 --- a/examples/BackgroundPropertySetting/Sample.xcodeproj/project.pbxproj +++ b/examples_extra/BackgroundPropertySetting/Sample.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 13C5ECD49F2371E08EBD30F7 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B36F7F82AB7809F22F4C8635 /* Pods.framework */; }; + BCDB7EDE9701EB3DD88BCDA0 /* Pods_Sample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DD2D199AD8BD92717ED9783 /* Pods_Sample.framework */; }; CCB8301E1C7688B500847D42 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CCB8301D1C7688B500847D42 /* Assets.xcassets */; }; CCB830211C7688B500847D42 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CCB8301F1C7688B500847D42 /* LaunchScreen.storyboard */; }; CCB8302C1C7688EC00847D42 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCB830281C7688EC00847D42 /* AppDelegate.swift */; }; @@ -17,9 +17,9 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 811311717C2489CE07A1B9D0 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - B36F7F82AB7809F22F4C8635 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - BC1DAB40E0D262E674E35EEF /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + 0C1B25A26B6D6815A16D0911 /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; + 46B216EB47D6586F63D99B86 /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; + 9DD2D199AD8BD92717ED9783 /* Pods_Sample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Sample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CCB830131C7688B500847D42 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; CCB8301D1C7688B500847D42 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; CCB830201C7688B500847D42 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; @@ -35,7 +35,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 13C5ECD49F2371E08EBD30F7 /* Pods.framework in Frameworks */, + BCDB7EDE9701EB3DD88BCDA0 /* Pods_Sample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -45,8 +45,8 @@ 2D17B5A68E217F63F504A0AB /* Pods */ = { isa = PBXGroup; children = ( - BC1DAB40E0D262E674E35EEF /* Pods.debug.xcconfig */, - 811311717C2489CE07A1B9D0 /* Pods.release.xcconfig */, + 46B216EB47D6586F63D99B86 /* Pods-Sample.debug.xcconfig */, + 0C1B25A26B6D6815A16D0911 /* Pods-Sample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -54,7 +54,7 @@ 4C1A8C0BFF16C5457DF86019 /* Frameworks */ = { isa = PBXGroup; children = ( - B36F7F82AB7809F22F4C8635 /* Pods.framework */, + 9DD2D199AD8BD92717ED9783 /* Pods_Sample.framework */, ); name = Frameworks; sourceTree = ""; @@ -187,7 +187,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; FC69305B914BC44642AD442E /* Copy Pods Resources */ = { @@ -202,7 +202,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -316,7 +316,7 @@ }; CCB830261C7688B500847D42 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BC1DAB40E0D262E674E35EEF /* Pods.debug.xcconfig */; + baseConfigurationReference = 46B216EB47D6586F63D99B86 /* Pods-Sample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -330,7 +330,7 @@ }; CCB830271C7688B500847D42 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 811311717C2489CE07A1B9D0 /* Pods.release.xcconfig */; + baseConfigurationReference = 0C1B25A26B6D6815A16D0911 /* Pods-Sample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; diff --git a/examples/Multiplex/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples_extra/BackgroundPropertySetting/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/Multiplex/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to examples_extra/BackgroundPropertySetting/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/examples/BackgroundPropertySetting/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples_extra/BackgroundPropertySetting/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme similarity index 100% rename from examples/BackgroundPropertySetting/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme rename to examples_extra/BackgroundPropertySetting/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme diff --git a/examples/BackgroundPropertySetting/Sample/AppDelegate.swift b/examples_extra/BackgroundPropertySetting/Sample/AppDelegate.swift similarity index 73% rename from examples/BackgroundPropertySetting/Sample/AppDelegate.swift rename to examples_extra/BackgroundPropertySetting/Sample/AppDelegate.swift index ad9b18050a..bc0e91bfc6 100644 --- a/examples/BackgroundPropertySetting/Sample/AppDelegate.swift +++ b/examples_extra/BackgroundPropertySetting/Sample/AppDelegate.swift @@ -1,9 +1,20 @@ // // AppDelegate.swift -// BackgroundPropertySetting +// Sample // // Created by Adlai Holler on 2/17/16. -// Copyright Β© 2016 Adlai Holler. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/BackgroundPropertySetting/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples_extra/BackgroundPropertySetting/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from examples/BackgroundPropertySetting/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json rename to examples_extra/BackgroundPropertySetting/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/examples_extra/BackgroundPropertySetting/Sample/Base.lproj/LaunchScreen.storyboard b/examples_extra/BackgroundPropertySetting/Sample/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000000..2e721e1833 --- /dev/null +++ b/examples_extra/BackgroundPropertySetting/Sample/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/BackgroundPropertySetting/Sample/DemoCellNode.swift b/examples_extra/BackgroundPropertySetting/Sample/DemoCellNode.swift similarity index 72% rename from examples/BackgroundPropertySetting/Sample/DemoCellNode.swift rename to examples_extra/BackgroundPropertySetting/Sample/DemoCellNode.swift index 63524a540d..3fac84dfcc 100644 --- a/examples/BackgroundPropertySetting/Sample/DemoCellNode.swift +++ b/examples_extra/BackgroundPropertySetting/Sample/DemoCellNode.swift @@ -1,9 +1,20 @@ // // DemoCellNode.swift -// BackgroundPropertySetting +// Sample // // Created by Adlai Holler on 2/17/16. -// Copyright Β© 2016 Adlai Holler. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/BackgroundPropertySetting/Sample/Info.plist b/examples_extra/BackgroundPropertySetting/Sample/Info.plist similarity index 100% rename from examples/BackgroundPropertySetting/Sample/Info.plist rename to examples_extra/BackgroundPropertySetting/Sample/Info.plist diff --git a/examples_extra/BackgroundPropertySetting/Sample/Utilities.swift b/examples_extra/BackgroundPropertySetting/Sample/Utilities.swift new file mode 100644 index 0000000000..4a313ac139 --- /dev/null +++ b/examples_extra/BackgroundPropertySetting/Sample/Utilities.swift @@ -0,0 +1,26 @@ +// +// Utilities.swift +// Sample +// +// Created by Adlai Holler on 2/17/16. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +extension UIColor { + static func random() -> UIColor { + return UIColor(red: CGFloat(drand48()), green: CGFloat(drand48()), blue: CGFloat(drand48()), alpha: 1.0) + } +} diff --git a/examples/BackgroundPropertySetting/Sample/ViewController.swift b/examples_extra/BackgroundPropertySetting/Sample/ViewController.swift similarity index 76% rename from examples/BackgroundPropertySetting/Sample/ViewController.swift rename to examples_extra/BackgroundPropertySetting/Sample/ViewController.swift index 1573b9ebeb..facf11c8a5 100644 --- a/examples/BackgroundPropertySetting/Sample/ViewController.swift +++ b/examples_extra/BackgroundPropertySetting/Sample/ViewController.swift @@ -1,9 +1,20 @@ // // ViewController.swift -// BackgroundPropertySetting +// Sample // // Created by Adlai Holler on 2/17/16. -// Copyright Β© 2016 Adlai Holler. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 @@ -24,8 +35,8 @@ final class ViewController: ASViewController, ASCollectionDelegate, ASCollection layout.minimumInteritemSpacing = padding layout.minimumLineSpacing = padding super.init(node: ASCollectionNode(collectionViewLayout: layout)) - navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Color", style: .Plain, target: self, action: "didTapColorsButton") - navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Layout", style: .Plain, target: self, action: "didTapLayoutButton") + navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Color", style: .Plain, target: self, action: #selector(didTapColorsButton)) + navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Layout", style: .Plain, target: self, action: #selector(didTapLayoutButton)) collectionNode.delegate = self collectionNode.dataSource = self title = "Background Updating" diff --git a/examples_extra/CollectionViewWithViewControllerCells/Podfile b/examples_extra/CollectionViewWithViewControllerCells/Podfile new file mode 100644 index 0000000000..919de4b311 --- /dev/null +++ b/examples_extra/CollectionViewWithViewControllerCells/Podfile @@ -0,0 +1,5 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample.xcodeproj/project.pbxproj b/examples_extra/CollectionViewWithViewControllerCells/Sample.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..c6fe60b900 --- /dev/null +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample.xcodeproj/project.pbxproj @@ -0,0 +1,826 @@ + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 25A1FA831C02F7AC00193875 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + MosaicCollectionViewLayout.h + sourceTree + <group> + + 25A1FA841C02F7AC00193875 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + MosaicCollectionViewLayout.m + sourceTree + <group> + + 25A1FA851C02F7AC00193875 + + fileRef + 25A1FA841C02F7AC00193875 + isa + PBXBuildFile + + 4E5B5F4E697ED7E9DB2D6324 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" + + showEnvVarsInLog + 0 + + 637D7C9FD46862FB6060DE4D + + fileRef + D9DB64B734017B22EADB64FD + isa + PBXBuildFile + + 90A2B9C5397C46134C8A793B + + children + + F594729764C63FA050734ED5 + D61D292E4C992F2B47A062A3 + + isa + PBXGroup + name + Pods + sourceTree + <group> + + 9B92C87F1BC17D3000EE46B2 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + SupplementaryNode.h + sourceTree + <group> + + 9B92C8801BC17D3000EE46B2 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + SupplementaryNode.m + sourceTree + <group> + + 9B92C8811BC17D3000EE46B2 + + fileRef + 9B92C8801BC17D3000EE46B2 + isa + PBXBuildFile + + 9BA2CEA01BB2579C00D18414 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + file.storyboard + path + Launchboard.storyboard + sourceTree + <group> + + 9BA2CEA11BB2579C00D18414 + + fileRef + 9BA2CEA01BB2579C00D18414 + isa + PBXBuildFile + + A6902C454C7661D0D277AC62 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" + + showEnvVarsInLog + 0 + + AC3C4A551A11F47200143C57 + + children + + AC3C4A601A11F47200143C57 + AC3C4A5F1A11F47200143C57 + 90A2B9C5397C46134C8A793B + D6E38FF0CB18E3F55CF06437 + + isa + PBXGroup + sourceTree + <group> + + AC3C4A561A11F47200143C57 + + attributes + + LastUpgradeCheck + 0610 + ORGANIZATIONNAME + Facebook + TargetAttributes + + AC3C4A5D1A11F47200143C57 + + CreatedOnToolsVersion + 6.1 + + + + buildConfigurationList + AC3C4A591A11F47200143C57 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + AC3C4A551A11F47200143C57 + productRefGroup + AC3C4A5F1A11F47200143C57 + projectDirPath + + projectReferences + + projectRoot + + targets + + AC3C4A5D1A11F47200143C57 + + + AC3C4A591A11F47200143C57 + + buildConfigurations + + AC3C4A7F1A11F47200143C57 + AC3C4A801A11F47200143C57 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + AC3C4A5A1A11F47200143C57 + + buildActionMask + 2147483647 + files + + 25A1FA851C02F7AC00193875 + AC3C4A6A1A11F47200143C57 + 9B92C8811BC17D3000EE46B2 + AC3C4A671A11F47200143C57 + AC3C4A641A11F47200143C57 + AEE6B3E51C16B65600238D20 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + AC3C4A5B1A11F47200143C57 + + buildActionMask + 2147483647 + files + + 637D7C9FD46862FB6060DE4D + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + AC3C4A5C1A11F47200143C57 + + buildActionMask + 2147483647 + files + + 9BA2CEA11BB2579C00D18414 + AC3C4A8E1A11F80C00143C57 + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + AC3C4A5D1A11F47200143C57 + + buildConfigurationList + AC3C4A811A11F47200143C57 + buildPhases + + F868CFBB21824CC9521B6588 + AC3C4A5A1A11F47200143C57 + AC3C4A5B1A11F47200143C57 + AC3C4A5C1A11F47200143C57 + A6902C454C7661D0D277AC62 + 4E5B5F4E697ED7E9DB2D6324 + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Sample + productName + Sample + productReference + AC3C4A5E1A11F47200143C57 + productType + com.apple.product-type.application + + AC3C4A5E1A11F47200143C57 + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + Sample.app + sourceTree + BUILT_PRODUCTS_DIR + + AC3C4A5F1A11F47200143C57 + + children + + AC3C4A5E1A11F47200143C57 + + isa + PBXGroup + name + Products + sourceTree + <group> + + AC3C4A601A11F47200143C57 + + children + + 25A1FA831C02F7AC00193875 + 25A1FA841C02F7AC00193875 + AC3C4A651A11F47200143C57 + AC3C4A661A11F47200143C57 + AC3C4A681A11F47200143C57 + AC3C4A691A11F47200143C57 + AC3C4A8D1A11F80C00143C57 + AC3C4A611A11F47200143C57 + 9B92C87F1BC17D3000EE46B2 + 9B92C8801BC17D3000EE46B2 + AEE6B3E31C16B65600238D20 + AEE6B3E41C16B65600238D20 + + indentWidth + 2 + isa + PBXGroup + path + Sample + sourceTree + <group> + tabWidth + 2 + usesTabs + 0 + + AC3C4A611A11F47200143C57 + + children + + AC3C4A621A11F47200143C57 + AC3C4A631A11F47200143C57 + 9BA2CEA01BB2579C00D18414 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + AC3C4A621A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Info.plist + sourceTree + <group> + + AC3C4A631A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + AC3C4A641A11F47200143C57 + + fileRef + AC3C4A631A11F47200143C57 + isa + PBXBuildFile + + AC3C4A651A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AppDelegate.h + sourceTree + <group> + + AC3C4A661A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AppDelegate.m + sourceTree + <group> + + AC3C4A671A11F47200143C57 + + fileRef + AC3C4A661A11F47200143C57 + isa + PBXBuildFile + + AC3C4A681A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ViewController.h + sourceTree + <group> + + AC3C4A691A11F47200143C57 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ViewController.m + sourceTree + <group> + + AC3C4A6A1A11F47200143C57 + + fileRef + AC3C4A691A11F47200143C57 + isa + PBXBuildFile + + AC3C4A7F1A11F47200143C57 + + 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.1 + MTL_ENABLE_DEBUG_INFO + YES + ONLY_ACTIVE_ARCH + YES + SDKROOT + iphoneos + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Debug + + AC3C4A801A11F47200143C57 + + 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.1 + MTL_ENABLE_DEBUG_INFO + NO + SDKROOT + iphoneos + TARGETED_DEVICE_FAMILY + 1,2 + VALIDATE_PRODUCT + YES + + isa + XCBuildConfiguration + name + Release + + AC3C4A811A11F47200143C57 + + buildConfigurations + + AC3C4A821A11F47200143C57 + AC3C4A831A11F47200143C57 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + AC3C4A821A11F47200143C57 + + baseConfigurationReference + F594729764C63FA050734ED5 + buildSettings + + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME + LaunchImage + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 8.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1 + + isa + XCBuildConfiguration + name + Debug + + AC3C4A831A11F47200143C57 + + baseConfigurationReference + D61D292E4C992F2B47A062A3 + buildSettings + + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME + LaunchImage + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 8.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1 + + isa + XCBuildConfiguration + name + Release + + AC3C4A8D1A11F80C00143C57 + + isa + PBXFileReference + lastKnownFileType + folder.assetcatalog + path + Images.xcassets + sourceTree + <group> + + AC3C4A8E1A11F80C00143C57 + + fileRef + AC3C4A8D1A11F80C00143C57 + isa + PBXBuildFile + + AEE6B3E31C16B65600238D20 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ImageViewController.h + sourceTree + <group> + + AEE6B3E41C16B65600238D20 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ImageViewController.m + sourceTree + <group> + + AEE6B3E51C16B65600238D20 + + fileRef + AEE6B3E41C16B65600238D20 + isa + PBXBuildFile + + D61D292E4C992F2B47A062A3 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + + D6E38FF0CB18E3F55CF06437 + + children + + D9DB64B734017B22EADB64FD + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + D9DB64B734017B22EADB64FD + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-Sample.a + sourceTree + BUILT_PRODUCTS_DIR + + F594729764C63FA050734ED5 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.debug.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig + sourceTree + <group> + + F868CFBB21824CC9521B6588 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + 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 + + showEnvVarsInLog + 0 + + + rootObject + AC3C4A561A11F47200143C57 + + diff --git a/examples/Placeholders/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples_extra/CollectionViewWithViewControllerCells/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/Placeholders/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to examples_extra/CollectionViewWithViewControllerCells/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/examples/CollectionViewWithViewControllerCells/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples_extra/CollectionViewWithViewControllerCells/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme rename to examples_extra/CollectionViewWithViewControllerCells/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme diff --git a/examples/CatDealsCollectionView/Sample.xcworkspace/contents.xcworkspacedata b/examples_extra/CollectionViewWithViewControllerCells/Sample.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/CatDealsCollectionView/Sample.xcworkspace/contents.xcworkspacedata rename to examples_extra/CollectionViewWithViewControllerCells/Sample.xcworkspace/contents.xcworkspacedata diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.h b/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.h new file mode 100644 index 0000000000..27e560aafe --- /dev/null +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.h @@ -0,0 +1,24 @@ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.m b/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.m new file mode 100644 index 0000000000..853bf6e8bc --- /dev/null +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.m @@ -0,0 +1,35 @@ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.h b/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.h new file mode 100644 index 0000000000..e24af762a1 --- /dev/null +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.h @@ -0,0 +1,22 @@ +// +// ImageViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface ImageViewController : UIViewController +- (instancetype)initWithImage:(UIImage *)image; +@end diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.m b/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.m new file mode 100644 index 0000000000..2d330689ce --- /dev/null +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.m @@ -0,0 +1,56 @@ +// +// ImageViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ImageViewController.h" + +@interface ImageViewController () +@property (nonatomic) UIImageView *imageView; +@end + +@implementation ImageViewController + +- (instancetype)initWithImage:(UIImage *)image { + if (!(self = [super init])) { return nil; } + + self.imageView = [[UIImageView alloc] initWithImage:image]; + + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self.view addSubview:self.imageView]; + + UIGestureRecognizer *tap = [[UIGestureRecognizer alloc] initWithTarget:self action:@selector(tapped)]; + [self.view addGestureRecognizer:tap]; + + self.imageView.contentMode = UIViewContentModeScaleAspectFill; +} + +- (void)tapped; +{ + NSLog(@"tapped!"); +} + +- (void)viewWillLayoutSubviews +{ + self.imageView.frame = self.view.bounds; +} + +@end diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/LaunchImage.launchimage/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/LaunchImage.launchimage/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/LaunchImage.launchimage/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/LaunchImage.launchimage/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_0.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_0.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_0.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_0.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_0.imageset/image_0.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_0.imageset/image_0.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_0.imageset/image_0.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_0.imageset/image_0.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_1.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_1.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_1.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_1.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_1.imageset/image_1.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_1.imageset/image_1.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_1.imageset/image_1.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_1.imageset/image_1.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_10.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_10.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_10.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_10.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_10.imageset/image_10.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_10.imageset/image_10.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_10.imageset/image_10.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_10.imageset/image_10.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_11.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_11.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_11.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_11.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_11.imageset/image_11.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_11.imageset/image_11.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_11.imageset/image_11.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_11.imageset/image_11.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_12.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_12.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_12.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_12.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_12.imageset/image_12.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_12.imageset/image_12.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_12.imageset/image_12.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_12.imageset/image_12.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_13.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_13.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_13.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_13.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_13.imageset/image_13.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_13.imageset/image_13.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_13.imageset/image_13.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_13.imageset/image_13.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_2.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_2.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_2.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_2.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_2.imageset/image_2.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_2.imageset/image_2.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_2.imageset/image_2.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_2.imageset/image_2.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_3.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_3.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_3.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_3.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_3.imageset/image_3.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_3.imageset/image_3.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_3.imageset/image_3.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_3.imageset/image_3.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_4.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_4.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_4.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_4.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_4.imageset/image_4.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_4.imageset/image_4.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_4.imageset/image_4.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_4.imageset/image_4.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_5.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_5.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_5.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_5.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_5.imageset/image_5.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_5.imageset/image_5.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_5.imageset/image_5.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_5.imageset/image_5.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_6.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_6.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_6.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_6.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_6.imageset/image_6.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_6.imageset/image_6.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_6.imageset/image_6.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_6.imageset/image_6.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_7.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_7.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_7.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_7.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_7.imageset/image_7.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_7.imageset/image_7.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_7.imageset/image_7.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_7.imageset/image_7.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_8.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_8.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_8.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_8.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_8.imageset/image_8.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_8.imageset/image_8.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_8.imageset/image_8.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_8.imageset/image_8.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_9.imageset/Contents.json b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_9.imageset/Contents.json similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_9.imageset/Contents.json rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_9.imageset/Contents.json diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_9.imageset/image_9.jpg b/examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_9.imageset/image_9.jpg similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_9.imageset/image_9.jpg rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Images.xcassets/image_9.imageset/image_9.jpg diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Info.plist b/examples_extra/CollectionViewWithViewControllerCells/Sample/Info.plist similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Info.plist rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Info.plist diff --git a/examples/CollectionViewWithViewControllerCells/Sample/Launchboard.storyboard b/examples_extra/CollectionViewWithViewControllerCells/Sample/Launchboard.storyboard similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample/Launchboard.storyboard rename to examples_extra/CollectionViewWithViewControllerCells/Sample/Launchboard.storyboard diff --git a/examples/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.h b/examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.h similarity index 52% rename from examples/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.h rename to examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.h index 03b8af5f7c..0acb1dde08 100644 --- a/examples/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.h +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.h @@ -3,7 +3,18 @@ // Sample // // Created by McCallum, Levi on 11/22/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.m b/examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.m similarity index 91% rename from examples/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.m rename to examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.m index 0e2c65d027..9e70ad0fd1 100644 --- a/examples/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.m +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.m @@ -3,7 +3,18 @@ // Sample // // Created by McCallum, Levi on 11/22/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "MosaicCollectionViewLayout.h" diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.h b/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.h new file mode 100644 index 0000000000..906fc50bdc --- /dev/null +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.h @@ -0,0 +1,24 @@ +// +// SupplementaryNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface SupplementaryNode : ASCellNode + +- (instancetype)initWithText:(NSString *)text; + +@end diff --git a/examples/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.m b/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.m similarity index 57% rename from examples/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.m rename to examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.m index 76ba17b4b6..c006b70fb2 100644 --- a/examples/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.m +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.m @@ -1,13 +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. - */ +// +// SupplementaryNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "SupplementaryNode.h" diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.h b/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.h new file mode 100644 index 0000000000..fc52c022f2 --- /dev/null +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface ViewController : UIViewController + +@end diff --git a/examples/CollectionViewWithViewControllerCells/Sample/ViewController.m b/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.m similarity index 81% rename from examples/CollectionViewWithViewControllerCells/Sample/ViewController.m rename to examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.m index a6613ea11c..c1ae6628dc 100644 --- a/examples/CollectionViewWithViewControllerCells/Sample/ViewController.m +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/main.m b/examples_extra/CollectionViewWithViewControllerCells/Sample/main.m new file mode 100644 index 0000000000..d5794dca4c --- /dev/null +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/main.m @@ -0,0 +1,25 @@ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/examples/Multiplex/Default-568h@2x.png b/examples_extra/EditableText/Default-568h@2x.png similarity index 100% rename from examples/Multiplex/Default-568h@2x.png rename to examples_extra/EditableText/Default-568h@2x.png diff --git a/examples/Multiplex/Default-667h@2x.png b/examples_extra/EditableText/Default-667h@2x.png similarity index 100% rename from examples/Multiplex/Default-667h@2x.png rename to examples_extra/EditableText/Default-667h@2x.png diff --git a/examples/Multiplex/Default-736h@3x.png b/examples_extra/EditableText/Default-736h@3x.png similarity index 100% rename from examples/Multiplex/Default-736h@3x.png rename to examples_extra/EditableText/Default-736h@3x.png diff --git a/examples_extra/EditableText/Podfile b/examples_extra/EditableText/Podfile new file mode 100644 index 0000000000..5c30ce798e --- /dev/null +++ b/examples_extra/EditableText/Podfile @@ -0,0 +1,6 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end + diff --git a/examples/Multiplex/Sample.xcodeproj/project.pbxproj b/examples_extra/EditableText/Sample.xcodeproj/project.pbxproj similarity index 84% rename from examples/Multiplex/Sample.xcodeproj/project.pbxproj rename to examples_extra/EditableText/Sample.xcodeproj/project.pbxproj index 1383d38552..46aa0e9425 100644 --- a/examples/Multiplex/Sample.xcodeproj/project.pbxproj +++ b/examples_extra/EditableText/Sample.xcodeproj/project.pbxproj @@ -11,10 +11,9 @@ 05E2128719D4DB510098F589 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128619D4DB510098F589 /* main.m */; }; 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128919D4DB510098F589 /* AppDelegate.m */; }; 05E2128D19D4DB510098F589 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128C19D4DB510098F589 /* ViewController.m */; }; - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; + 536169B9EF7CEDECCE1B60F0 /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B6B3820335D6E75E7E0BE9FF /* libPods-Sample.a */; }; 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; - ACC945AE1BA9EFBA005E1FB8 /* ScreenNode.m in Sources */ = {isa = PBXBuildFile; fileRef = ACC945AD1BA9EFBA005E1FB8 /* ScreenNode.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -26,13 +25,12 @@ 05E2128919D4DB510098F589 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 05E2128B19D4DB510098F589 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 05E2128C19D4DB510098F589 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 5C6A0F715CB9F7DF29FC026B /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; - ACC945AC1BA9EFB3005E1FB8 /* ScreenNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScreenNode.h; sourceTree = ""; }; - ACC945AD1BA9EFBA005E1FB8 /* ScreenNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScreenNode.m; sourceTree = ""; }; - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + B6B3820335D6E75E7E0BE9FF /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + DED40FC71CCB2096003C123B /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; + DED40FC81CCB2096003C123B /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -40,7 +38,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */, + 536169B9EF7CEDECCE1B60F0 /* libPods-Sample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -75,8 +73,6 @@ 05E2128919D4DB510098F589 /* AppDelegate.m */, 05E2128B19D4DB510098F589 /* ViewController.h */, 05E2128C19D4DB510098F589 /* ViewController.m */, - ACC945AC1BA9EFB3005E1FB8 /* ScreenNode.h */, - ACC945AD1BA9EFBA005E1FB8 /* ScreenNode.m */, 05E2128419D4DB510098F589 /* Supporting Files */, ); path = Sample; @@ -97,7 +93,8 @@ 1A943BF0259746F18D6E423F /* Frameworks */ = { isa = PBXGroup; children = ( - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */, + 5C6A0F715CB9F7DF29FC026B /* libPods.a */, + B6B3820335D6E75E7E0BE9FF /* libPods-Sample.a */, ); name = Frameworks; sourceTree = ""; @@ -105,8 +102,8 @@ 1AE410B73DA5C3BD087ACDD7 /* Pods */ = { isa = PBXGroup; children = ( - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */, - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */, + DED40FC71CCB2096003C123B /* Pods-Sample.debug.xcconfig */, + DED40FC81CCB2096003C123B /* Pods-Sample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -123,6 +120,7 @@ 05E2127E19D4DB510098F589 /* Frameworks */, 05E2127F19D4DB510098F589 /* Resources */, F012A6F39E0149F18F564F50 /* Copy Pods Resources */, + 6FBCCC34F8CCA9B610492536 /* Embed Pods Frameworks */, ); buildRules = ( ); @@ -139,7 +137,7 @@ 05E2127919D4DB510098F589 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0600; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = Facebook; TargetAttributes = { 05E2128019D4DB510098F589 = { @@ -179,6 +177,21 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 6FBCCC34F8CCA9B610492536 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -206,7 +219,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -219,7 +232,6 @@ 05E2128D19D4DB510098F589 /* ViewController.m in Sources */, 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */, 05E2128719D4DB510098F589 /* main.m in Sources */, - ACC945AE1BA9EFBA005E1FB8 /* ScreenNode.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -246,6 +258,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -304,22 +317,24 @@ }; 05E212A519D4DB510098F589 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */; + baseConfigurationReference = DED40FC71CCB2096003C123B /* Pods-Sample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 05E212A619D4DB510098F589 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */; + baseConfigurationReference = DED40FC81CCB2096003C123B /* Pods-Sample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/examples/SynchronousConcurrency/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples_extra/EditableText/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/SynchronousConcurrency/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to examples_extra/EditableText/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/examples_extra/EditableText/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples_extra/EditableText/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme new file mode 100644 index 0000000000..d41d58c5d8 --- /dev/null +++ b/examples_extra/EditableText/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples_extra/EditableText/Sample/AppDelegate.h b/examples_extra/EditableText/Sample/AppDelegate.h new file mode 100644 index 0000000000..27e560aafe --- /dev/null +++ b/examples_extra/EditableText/Sample/AppDelegate.h @@ -0,0 +1,24 @@ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples_extra/EditableText/Sample/AppDelegate.m b/examples_extra/EditableText/Sample/AppDelegate.m new file mode 100644 index 0000000000..c62355c06c --- /dev/null +++ b/examples_extra/EditableText/Sample/AppDelegate.m @@ -0,0 +1,33 @@ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/VideoTableView/Sample/Info.plist b/examples_extra/EditableText/Sample/Info.plist similarity index 92% rename from examples/VideoTableView/Sample/Info.plist rename to examples_extra/EditableText/Sample/Info.plist index 35d842827b..fb4115c84c 100644 --- a/examples/VideoTableView/Sample/Info.plist +++ b/examples_extra/EditableText/Sample/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.facebook.AsyncDisplayKit.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/examples_extra/EditableText/Sample/ViewController.h b/examples_extra/EditableText/Sample/ViewController.h new file mode 100644 index 0000000000..fc52c022f2 --- /dev/null +++ b/examples_extra/EditableText/Sample/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface ViewController : UIViewController + +@end diff --git a/examples/EditableText/Sample/ViewController.m b/examples_extra/EditableText/Sample/ViewController.m similarity index 77% rename from examples/EditableText/Sample/ViewController.m rename to examples_extra/EditableText/Sample/ViewController.m index 539f045480..9e6eceb782 100644 --- a/examples/EditableText/Sample/ViewController.m +++ b/examples_extra/EditableText/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples_extra/EditableText/Sample/main.m b/examples_extra/EditableText/Sample/main.m new file mode 100644 index 0000000000..756080fb2b --- /dev/null +++ b/examples_extra/EditableText/Sample/main.m @@ -0,0 +1,26 @@ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/examples/Placeholders/Default-568h@2x.png b/examples_extra/Multiplex/Default-568h@2x.png similarity index 100% rename from examples/Placeholders/Default-568h@2x.png rename to examples_extra/Multiplex/Default-568h@2x.png diff --git a/examples/Placeholders/Default-667h@2x.png b/examples_extra/Multiplex/Default-667h@2x.png similarity index 100% rename from examples/Placeholders/Default-667h@2x.png rename to examples_extra/Multiplex/Default-667h@2x.png diff --git a/examples/Placeholders/Default-736h@3x.png b/examples_extra/Multiplex/Default-736h@3x.png similarity index 100% rename from examples/Placeholders/Default-736h@3x.png rename to examples_extra/Multiplex/Default-736h@3x.png diff --git a/examples_extra/Multiplex/Podfile b/examples_extra/Multiplex/Podfile new file mode 100644 index 0000000000..919de4b311 --- /dev/null +++ b/examples_extra/Multiplex/Podfile @@ -0,0 +1,5 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/EditableText/Sample.xcodeproj/project.pbxproj b/examples_extra/Multiplex/Sample.xcodeproj/project.pbxproj similarity index 90% rename from examples/EditableText/Sample.xcodeproj/project.pbxproj rename to examples_extra/Multiplex/Sample.xcodeproj/project.pbxproj index 3440a43995..9c8770b730 100644 --- a/examples/EditableText/Sample.xcodeproj/project.pbxproj +++ b/examples_extra/Multiplex/Sample.xcodeproj/project.pbxproj @@ -120,6 +120,7 @@ 05E2128D19D4DB510098F589 05E2128A19D4DB510098F589 05E2128719D4DB510098F589 + ACC945AE1BA9EFBA005E1FB8 isa PBXSourcesBuildPhase @@ -132,7 +133,7 @@ 2147483647 files - 3EC0CDCBA10D483D9F386E5E + AD61969DBDF7FD632C7D07F8 isa PBXFrameworksBuildPhase @@ -165,7 +166,7 @@ 05E2127E19D4DB510098F589 05E2127F19D4DB510098F589 F012A6F39E0149F18F564F50 - 6FBCCC34F8CCA9B610492536 + 682D6483AA9410CE0AF21363 buildRules @@ -216,6 +217,8 @@ 05E2128919D4DB510098F589 05E2128B19D4DB510098F589 05E2128C19D4DB510098F589 + ACC945AC1BA9EFB3005E1FB8 + ACC945AD1BA9EFBA005E1FB8 05E2128419D4DB510098F589 isa @@ -491,7 +494,7 @@ 05E212A519D4DB510098F589 baseConfigurationReference - C068F1D3F0CC317E895FCDAB + 4E60AE604B72B745B8D6B008 buildSettings ASSETCATALOG_COMPILER_APPICON_NAME @@ -511,7 +514,7 @@ 05E212A619D4DB510098F589 baseConfigurationReference - 088AA6578212BE9BFBB07B70 + 1F2942882A3B5220B7506FFC buildSettings ASSETCATALOG_COMPILER_APPICON_NAME @@ -528,26 +531,11 @@ name Release - 088AA6578212BE9BFBB07B70 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - name - Pods.release.xcconfig - path - Pods/Target Support Files/Pods/Pods.release.xcconfig - sourceTree - <group> - 1A943BF0259746F18D6E423F children - 3D24B17D1E4A4E7A9566C5E9 + 4F8E019F6C75C267AC72A2F3 isa PBXGroup @@ -560,8 +548,8 @@ children - C068F1D3F0CC317E895FCDAB - 088AA6578212BE9BFBB07B70 + 4E60AE604B72B745B8D6B008 + 1F2942882A3B5220B7506FFC isa PBXGroup @@ -570,7 +558,37 @@ sourceTree <group> - 3D24B17D1E4A4E7A9566C5E9 + 1F2942882A3B5220B7506FFC + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + + 4E60AE604B72B745B8D6B008 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.debug.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig + sourceTree + <group> + + 4F8E019F6C75C267AC72A2F3 explicitFileType archive.ar @@ -579,16 +597,33 @@ isa PBXFileReference path - libPods.a + libPods-Sample.a sourceTree BUILT_PRODUCTS_DIR - 3EC0CDCBA10D483D9F386E5E + 682D6483AA9410CE0AF21363 - fileRef - 3D24B17D1E4A4E7A9566C5E9 + buildActionMask + 2147483647 + files + + inputPaths + isa - PBXBuildFile + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" + + showEnvVarsInLog + 0 6C2C82AA19EE274300767484 @@ -626,45 +661,44 @@ isa PBXBuildFile - 6FBCCC34F8CCA9B610492536 + ACC945AC1BA9EFB3005E1FB8 - buildActionMask - 2147483647 - files - - inputPaths - - isa - PBXShellScriptBuildPhase - name - Embed Pods Frameworks - outputPaths - - runOnlyForDeploymentPostprocessing - 0 - shellPath - /bin/sh - shellScript - "${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh" - - showEnvVarsInLog - 0 - - C068F1D3F0CC317E895FCDAB - - includeInIndex - 1 isa PBXFileReference lastKnownFileType - text.xcconfig - name - Pods.debug.xcconfig + sourcecode.c.h path - Pods/Target Support Files/Pods/Pods.debug.xcconfig + ScreenNode.h sourceTree <group> + ACC945AD1BA9EFBA005E1FB8 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ScreenNode.m + sourceTree + <group> + + ACC945AE1BA9EFBA005E1FB8 + + fileRef + ACC945AD1BA9EFBA005E1FB8 + isa + PBXBuildFile + + AD61969DBDF7FD632C7D07F8 + + fileRef + 4F8E019F6C75C267AC72A2F3 + isa + PBXBuildFile + E080B80F89C34A25B3488E26 buildActionMask @@ -714,7 +748,7 @@ fi shellPath /bin/sh shellScript - "${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh" + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" showEnvVarsInLog 0 diff --git a/examples/SynchronousKittens/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples_extra/Multiplex/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/SynchronousKittens/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to examples_extra/Multiplex/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/examples/Placeholders/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples_extra/Multiplex/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme similarity index 100% rename from examples/Placeholders/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme rename to examples_extra/Multiplex/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme diff --git a/examples_extra/Multiplex/Sample/AppDelegate.h b/examples_extra/Multiplex/Sample/AppDelegate.h new file mode 100644 index 0000000000..27e560aafe --- /dev/null +++ b/examples_extra/Multiplex/Sample/AppDelegate.h @@ -0,0 +1,24 @@ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples_extra/Multiplex/Sample/AppDelegate.m b/examples_extra/Multiplex/Sample/AppDelegate.m new file mode 100644 index 0000000000..c62355c06c --- /dev/null +++ b/examples_extra/Multiplex/Sample/AppDelegate.m @@ -0,0 +1,33 @@ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/EditableText/Sample/Info.plist b/examples_extra/Multiplex/Sample/Info.plist similarity index 100% rename from examples/EditableText/Sample/Info.plist rename to examples_extra/Multiplex/Sample/Info.plist diff --git a/examples_extra/Multiplex/Sample/ScreenNode.h b/examples_extra/Multiplex/Sample/ScreenNode.h new file mode 100644 index 0000000000..ecfb4c2220 --- /dev/null +++ b/examples_extra/Multiplex/Sample/ScreenNode.h @@ -0,0 +1,30 @@ +// +// ScreenNode.h +// Sample +// +// Created by Huy Nguyen on 16/09/15. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface ScreenNode : ASDisplayNode + +@property (nonatomic, strong) ASMultiplexImageNode *imageNode; +@property (nonatomic, strong) ASButtonNode *buttonNode; + +- (void)start; +- (void)reload; + +@end diff --git a/examples/Multiplex/Sample/ScreenNode.m b/examples_extra/Multiplex/Sample/ScreenNode.m similarity index 87% rename from examples/Multiplex/Sample/ScreenNode.m rename to examples_extra/Multiplex/Sample/ScreenNode.m index 02df45922e..d07574bb41 100644 --- a/examples/Multiplex/Sample/ScreenNode.m +++ b/examples_extra/Multiplex/Sample/ScreenNode.m @@ -3,7 +3,18 @@ // Sample // // Created by Huy Nguyen on 16/09/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ScreenNode.h" diff --git a/examples_extra/Multiplex/Sample/ViewController.h b/examples_extra/Multiplex/Sample/ViewController.h new file mode 100644 index 0000000000..c4af5a3e0d --- /dev/null +++ b/examples_extra/Multiplex/Sample/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface ViewController : ASViewController + +@end diff --git a/examples_extra/Multiplex/Sample/ViewController.m b/examples_extra/Multiplex/Sample/ViewController.m new file mode 100644 index 0000000000..5cb4532a15 --- /dev/null +++ b/examples_extra/Multiplex/Sample/ViewController.m @@ -0,0 +1,48 @@ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ScreenNode.h" + +@interface ViewController() +{ + ScreenNode *_screenNode; +} + +@end + +@implementation ViewController + +- (instancetype)init +{ + ScreenNode *node = [[ScreenNode alloc] init]; + if (!(self = [super initWithNode:node])) + return nil; + + _screenNode = node; + + return self; +} + +- (void)viewWillAppear:(BOOL)animated +{ + // This should be done before calling super's viewWillAppear which triggers data fetching on the node. + [_screenNode start]; + [super viewWillAppear:animated]; +} + +@end diff --git a/examples_extra/Multiplex/Sample/main.m b/examples_extra/Multiplex/Sample/main.m new file mode 100644 index 0000000000..756080fb2b --- /dev/null +++ b/examples_extra/Multiplex/Sample/main.m @@ -0,0 +1,26 @@ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/examples/Multiplex/best.png b/examples_extra/Multiplex/best.png similarity index 100% rename from examples/Multiplex/best.png rename to examples_extra/Multiplex/best.png diff --git a/examples/Multiplex/medium.png b/examples_extra/Multiplex/medium.png similarity index 100% rename from examples/Multiplex/medium.png rename to examples_extra/Multiplex/medium.png diff --git a/examples/Multiplex/worst.png b/examples_extra/Multiplex/worst.png similarity index 100% rename from examples/Multiplex/worst.png rename to examples_extra/Multiplex/worst.png diff --git a/examples/SynchronousConcurrency/Default-568h@2x.png b/examples_extra/Placeholders/Default-568h@2x.png similarity index 100% rename from examples/SynchronousConcurrency/Default-568h@2x.png rename to examples_extra/Placeholders/Default-568h@2x.png diff --git a/examples/SynchronousConcurrency/Default-667h@2x.png b/examples_extra/Placeholders/Default-667h@2x.png similarity index 100% rename from examples/SynchronousConcurrency/Default-667h@2x.png rename to examples_extra/Placeholders/Default-667h@2x.png diff --git a/examples/SynchronousConcurrency/Default-736h@3x.png b/examples_extra/Placeholders/Default-736h@3x.png similarity index 100% rename from examples/SynchronousConcurrency/Default-736h@3x.png rename to examples_extra/Placeholders/Default-736h@3x.png diff --git a/examples_extra/Placeholders/Podfile b/examples_extra/Placeholders/Podfile new file mode 100644 index 0000000000..919de4b311 --- /dev/null +++ b/examples_extra/Placeholders/Podfile @@ -0,0 +1,5 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples_extra/Placeholders/Sample.xcodeproj/project.pbxproj b/examples_extra/Placeholders/Sample.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..af976bea62 --- /dev/null +++ b/examples_extra/Placeholders/Sample.xcodeproj/project.pbxproj @@ -0,0 +1,894 @@ + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 0585427F19D4DBE100606EA6 + + isa + PBXFileReference + lastKnownFileType + image.png + name + Default-568h@2x.png + path + ../Default-568h@2x.png + sourceTree + <group> + + 0585428019D4DBE100606EA6 + + fileRef + 0585427F19D4DBE100606EA6 + isa + PBXBuildFile + + 05E2127819D4DB510098F589 + + children + + 05E2128319D4DB510098F589 + 05E2128219D4DB510098F589 + 1A943BF0259746F18D6E423F + 1AE410B73DA5C3BD087ACDD7 + + indentWidth + 2 + isa + PBXGroup + sourceTree + <group> + tabWidth + 2 + usesTabs + 0 + + 05E2127919D4DB510098F589 + + attributes + + LastUpgradeCheck + 0600 + ORGANIZATIONNAME + Facebook + TargetAttributes + + 05E2128019D4DB510098F589 + + CreatedOnToolsVersion + 6.0.1 + + + + buildConfigurationList + 05E2127C19D4DB510098F589 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + 05E2127819D4DB510098F589 + productRefGroup + 05E2128219D4DB510098F589 + projectDirPath + + projectReferences + + projectRoot + + targets + + 05E2128019D4DB510098F589 + + + 05E2127C19D4DB510098F589 + + buildConfigurations + + 05E212A219D4DB510098F589 + 05E212A319D4DB510098F589 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 05E2127D19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 29A7F3A51A3638DE00CF34F2 + 29E35E9B1A2F8DB0007B4B17 + 29E35E9E1A2F8DBC007B4B17 + 05E2128D19D4DB510098F589 + 05E2128A19D4DB510098F589 + 29E35EA31A2FD0E9007B4B17 + 05E2128719D4DB510098F589 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2127E19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 37563A5CF6FA5205CCAB18B2 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2127F19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 29E35EA01A2F9650007B4B17 + 0585428019D4DBE100606EA6 + 6C2C82AC19EE274300767484 + 6C2C82AD19EE274300767484 + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2128019D4DB510098F589 + + buildConfigurationList + 05E212A419D4DB510098F589 + buildPhases + + E080B80F89C34A25B3488E26 + 05E2127D19D4DB510098F589 + 05E2127E19D4DB510098F589 + 05E2127F19D4DB510098F589 + F012A6F39E0149F18F564F50 + 8DF84F9CA640D8BF98C61D50 + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Sample + productName + Sample + productReference + 05E2128119D4DB510098F589 + productType + com.apple.product-type.application + + 05E2128119D4DB510098F589 + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + Sample.app + sourceTree + BUILT_PRODUCTS_DIR + + 05E2128219D4DB510098F589 + + children + + 05E2128119D4DB510098F589 + + isa + PBXGroup + name + Products + sourceTree + <group> + + 05E2128319D4DB510098F589 + + children + + 05E2128819D4DB510098F589 + 05E2128919D4DB510098F589 + 29E35E9F1A2F9650007B4B17 + 29E35EA11A2FD0E9007B4B17 + 29E35EA21A2FD0E9007B4B17 + 29E35E991A2F8DB0007B4B17 + 29E35E9A1A2F8DB0007B4B17 + 29E35E9C1A2F8DBC007B4B17 + 29E35E9D1A2F8DBC007B4B17 + 29A7F3A31A3638DE00CF34F2 + 29A7F3A41A3638DE00CF34F2 + 05E2128419D4DB510098F589 + 05E2128B19D4DB510098F589 + 05E2128C19D4DB510098F589 + + isa + PBXGroup + path + Sample + sourceTree + <group> + + 05E2128419D4DB510098F589 + + children + + 0585427F19D4DBE100606EA6 + 6C2C82AA19EE274300767484 + 6C2C82AB19EE274300767484 + 05E2128519D4DB510098F589 + 05E2128619D4DB510098F589 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + 05E2128519D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Info.plist + sourceTree + <group> + + 05E2128619D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + 05E2128719D4DB510098F589 + + fileRef + 05E2128619D4DB510098F589 + isa + PBXBuildFile + + 05E2128819D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AppDelegate.h + sourceTree + <group> + + 05E2128919D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AppDelegate.m + sourceTree + <group> + + 05E2128A19D4DB510098F589 + + fileRef + 05E2128919D4DB510098F589 + isa + PBXBuildFile + + 05E2128B19D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ViewController.h + sourceTree + <group> + + 05E2128C19D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ViewController.m + sourceTree + <group> + + 05E2128D19D4DB510098F589 + + fileRef + 05E2128C19D4DB510098F589 + isa + PBXBuildFile + + 05E212A219D4DB510098F589 + + 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 + + isa + XCBuildConfiguration + name + Debug + + 05E212A319D4DB510098F589 + + 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 + + isa + XCBuildConfiguration + name + Release + + 05E212A419D4DB510098F589 + + buildConfigurations + + 05E212A519D4DB510098F589 + 05E212A619D4DB510098F589 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 05E212A519D4DB510098F589 + + baseConfigurationReference + 719D9CF4B9A9C5DC6EE4934C + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 7.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + + isa + XCBuildConfiguration + name + Debug + + 05E212A619D4DB510098F589 + + baseConfigurationReference + 2D75070E7AB95D12F1F0BAB6 + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 7.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + + isa + XCBuildConfiguration + name + Release + + 0B04B566CE0BBB69447C7222 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-Sample.a + sourceTree + BUILT_PRODUCTS_DIR + + 1A943BF0259746F18D6E423F + + children + + 0B04B566CE0BBB69447C7222 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 1AE410B73DA5C3BD087ACDD7 + + children + + 719D9CF4B9A9C5DC6EE4934C + 2D75070E7AB95D12F1F0BAB6 + + isa + PBXGroup + name + Pods + sourceTree + <group> + + 29A7F3A31A3638DE00CF34F2 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + SlowpokeTextNode.h + sourceTree + <group> + + 29A7F3A41A3638DE00CF34F2 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + SlowpokeTextNode.m + sourceTree + <group> + + 29A7F3A51A3638DE00CF34F2 + + fileRef + 29A7F3A41A3638DE00CF34F2 + isa + PBXBuildFile + + 29E35E991A2F8DB0007B4B17 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + SlowpokeImageNode.h + sourceTree + <group> + + 29E35E9A1A2F8DB0007B4B17 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + SlowpokeImageNode.m + sourceTree + <group> + + 29E35E9B1A2F8DB0007B4B17 + + fileRef + 29E35E9A1A2F8DB0007B4B17 + isa + PBXBuildFile + + 29E35E9C1A2F8DBC007B4B17 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + SlowpokeShareNode.h + sourceTree + <group> + + 29E35E9D1A2F8DBC007B4B17 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + SlowpokeShareNode.m + sourceTree + <group> + + 29E35E9E1A2F8DBC007B4B17 + + fileRef + 29E35E9D1A2F8DBC007B4B17 + isa + PBXBuildFile + + 29E35E9F1A2F9650007B4B17 + + isa + PBXFileReference + lastKnownFileType + image.png + path + logo.png + sourceTree + <group> + + 29E35EA01A2F9650007B4B17 + + fileRef + 29E35E9F1A2F9650007B4B17 + isa + PBXBuildFile + + 29E35EA11A2FD0E9007B4B17 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + PostNode.h + sourceTree + <group> + + 29E35EA21A2FD0E9007B4B17 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + PostNode.m + sourceTree + <group> + + 29E35EA31A2FD0E9007B4B17 + + fileRef + 29E35EA21A2FD0E9007B4B17 + isa + PBXBuildFile + + 2D75070E7AB95D12F1F0BAB6 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + + 37563A5CF6FA5205CCAB18B2 + + fileRef + 0B04B566CE0BBB69447C7222 + isa + PBXBuildFile + + 6C2C82AA19EE274300767484 + + isa + PBXFileReference + lastKnownFileType + image.png + path + Default-667h@2x.png + sourceTree + SOURCE_ROOT + + 6C2C82AB19EE274300767484 + + isa + PBXFileReference + lastKnownFileType + image.png + path + Default-736h@3x.png + sourceTree + SOURCE_ROOT + + 6C2C82AC19EE274300767484 + + fileRef + 6C2C82AA19EE274300767484 + isa + PBXBuildFile + + 6C2C82AD19EE274300767484 + + fileRef + 6C2C82AB19EE274300767484 + isa + PBXBuildFile + + 719D9CF4B9A9C5DC6EE4934C + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.debug.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig + sourceTree + <group> + + 8DF84F9CA640D8BF98C61D50 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" + + showEnvVarsInLog + 0 + + E080B80F89C34A25B3488E26 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + 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 + + showEnvVarsInLog + 0 + + F012A6F39E0149F18F564F50 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" + + showEnvVarsInLog + 0 + + + rootObject + 05E2127919D4DB510098F589 + + diff --git a/examples/VideoTableView/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples_extra/Placeholders/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/VideoTableView/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to examples_extra/Placeholders/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/examples/SynchronousConcurrency/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples_extra/Placeholders/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme similarity index 100% rename from examples/SynchronousConcurrency/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme rename to examples_extra/Placeholders/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme diff --git a/examples_extra/Placeholders/Sample/AppDelegate.h b/examples_extra/Placeholders/Sample/AppDelegate.h new file mode 100644 index 0000000000..27e560aafe --- /dev/null +++ b/examples_extra/Placeholders/Sample/AppDelegate.h @@ -0,0 +1,24 @@ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples_extra/Placeholders/Sample/AppDelegate.m b/examples_extra/Placeholders/Sample/AppDelegate.m new file mode 100644 index 0000000000..c62355c06c --- /dev/null +++ b/examples_extra/Placeholders/Sample/AppDelegate.m @@ -0,0 +1,33 @@ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples/Multiplex/Sample/Info.plist b/examples_extra/Placeholders/Sample/Info.plist similarity index 100% rename from examples/Multiplex/Sample/Info.plist rename to examples_extra/Placeholders/Sample/Info.plist diff --git a/examples_extra/Placeholders/Sample/PostNode.h b/examples_extra/Placeholders/Sample/PostNode.h new file mode 100644 index 0000000000..844d8e4606 --- /dev/null +++ b/examples_extra/Placeholders/Sample/PostNode.h @@ -0,0 +1,22 @@ +// +// PostNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface PostNode : ASDisplayNode + +@end diff --git a/examples/Placeholders/Sample/PostNode.m b/examples_extra/Placeholders/Sample/PostNode.m similarity index 74% rename from examples/Placeholders/Sample/PostNode.m rename to examples_extra/Placeholders/Sample/PostNode.m index b23636b17d..438430547a 100644 --- a/examples/Placeholders/Sample/PostNode.m +++ b/examples_extra/Placeholders/Sample/PostNode.m @@ -1,13 +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. - */ +// +// PostNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "PostNode.h" @@ -60,6 +66,10 @@ - (UIImage *)placeholderImage { CGSize size = self.calculatedSize; + if (CGSizeEqualToSize(size, CGSizeZero)) { + return nil; + } + UIGraphicsBeginImageContext(size); [[UIColor colorWithWhite:0.9 alpha:1] setFill]; UIRectFill((CGRect){CGPointZero, size}); @@ -78,6 +88,8 @@ - (void)layout { + [super layout]; + CGSize textSize = _textNode.calculatedSize; CGSize needyChildSize = _needyChildNode.calculatedSize; diff --git a/examples_extra/Placeholders/Sample/SlowpokeImageNode.h b/examples_extra/Placeholders/Sample/SlowpokeImageNode.h new file mode 100644 index 0000000000..ba9706e1b5 --- /dev/null +++ b/examples_extra/Placeholders/Sample/SlowpokeImageNode.h @@ -0,0 +1,22 @@ +// +// SlowpokeImageNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface SlowpokeImageNode : ASImageNode + +@end diff --git a/examples/Placeholders/Sample/SlowpokeImageNode.m b/examples_extra/Placeholders/Sample/SlowpokeImageNode.m similarity index 55% rename from examples/Placeholders/Sample/SlowpokeImageNode.m rename to examples_extra/Placeholders/Sample/SlowpokeImageNode.m index 36fce4d726..ad607c71c2 100644 --- a/examples/Placeholders/Sample/SlowpokeImageNode.m +++ b/examples_extra/Placeholders/Sample/SlowpokeImageNode.m @@ -1,13 +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. - */ +// +// SlowpokeImageNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "SlowpokeImageNode.h" @@ -15,9 +21,14 @@ static CGFloat const kASDKLogoAspectRatio = 2.79; +@interface ASImageNode (ForwardWorkaround) +// This is a workaround until subclass overriding of custom drawing class methods is fixed +- (UIImage *)displayWithParameters:(id)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock; +@end + @implementation SlowpokeImageNode -+ (UIImage *)displayWithParameters:(id)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock +- (UIImage *)displayWithParameters:(id)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock { usleep( (long)(0.5 * USEC_PER_SEC) ); // artificial delay of 0.5s @@ -46,6 +57,10 @@ static CGFloat const kASDKLogoAspectRatio = 2.79; - (UIImage *)placeholderImage { CGSize size = self.calculatedSize; + if (CGSizeEqualToSize(size, CGSizeZero)) { + return nil; + } + UIGraphicsBeginImageContext(size); [[UIColor whiteColor] setFill]; [[UIColor colorWithWhite:0.9 alpha:1] setStroke]; diff --git a/examples_extra/Placeholders/Sample/SlowpokeShareNode.h b/examples_extra/Placeholders/Sample/SlowpokeShareNode.h new file mode 100644 index 0000000000..deb3a640af --- /dev/null +++ b/examples_extra/Placeholders/Sample/SlowpokeShareNode.h @@ -0,0 +1,22 @@ +// +// SlowpokeShareNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface SlowpokeShareNode : ASControlNode + +@end diff --git a/examples/Placeholders/Sample/SlowpokeShareNode.m b/examples_extra/Placeholders/Sample/SlowpokeShareNode.m similarity index 57% rename from examples/Placeholders/Sample/SlowpokeShareNode.m rename to examples_extra/Placeholders/Sample/SlowpokeShareNode.m index e00a739d37..4dcfe0547b 100644 --- a/examples/Placeholders/Sample/SlowpokeShareNode.m +++ b/examples_extra/Placeholders/Sample/SlowpokeShareNode.m @@ -1,13 +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. - */ +// +// SlowpokeShareNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "SlowpokeShareNode.h" diff --git a/examples_extra/Placeholders/Sample/SlowpokeTextNode.h b/examples_extra/Placeholders/Sample/SlowpokeTextNode.h new file mode 100644 index 0000000000..d99968e1f0 --- /dev/null +++ b/examples_extra/Placeholders/Sample/SlowpokeTextNode.h @@ -0,0 +1,22 @@ +// +// SlowpokeTextNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface SlowpokeTextNode : ASTextNode + +@end diff --git a/examples_extra/Placeholders/Sample/SlowpokeTextNode.m b/examples_extra/Placeholders/Sample/SlowpokeTextNode.m new file mode 100644 index 0000000000..7b3e133471 --- /dev/null +++ b/examples_extra/Placeholders/Sample/SlowpokeTextNode.m @@ -0,0 +1,36 @@ +// +// SlowpokeTextNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "SlowpokeTextNode.h" + +#import + +@interface ASTextNode (ForwardWorkaround) +// This is a workaround until subclass overriding of custom drawing class methods is fixed +- (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing; +@end + +@implementation SlowpokeTextNode + +- (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing +{ + usleep( (long)(1.0 * USEC_PER_SEC) ); // artificial delay of 1.0 + + [super drawRect:bounds withParameters:parameters isCancelled:isCancelledBlock isRasterizing:isRasterizing]; +} + +@end diff --git a/examples_extra/Placeholders/Sample/ViewController.h b/examples_extra/Placeholders/Sample/ViewController.h new file mode 100644 index 0000000000..fc52c022f2 --- /dev/null +++ b/examples_extra/Placeholders/Sample/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface ViewController : UIViewController + +@end diff --git a/examples/Placeholders/Sample/ViewController.m b/examples_extra/Placeholders/Sample/ViewController.m similarity index 76% rename from examples/Placeholders/Sample/ViewController.m rename to examples_extra/Placeholders/Sample/ViewController.m index dc3b94830a..c631740d3a 100644 --- a/examples/Placeholders/Sample/ViewController.m +++ b/examples_extra/Placeholders/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/Placeholders/Sample/logo.png b/examples_extra/Placeholders/Sample/logo.png similarity index 100% rename from examples/Placeholders/Sample/logo.png rename to examples_extra/Placeholders/Sample/logo.png diff --git a/examples_extra/Placeholders/Sample/main.m b/examples_extra/Placeholders/Sample/main.m new file mode 100644 index 0000000000..756080fb2b --- /dev/null +++ b/examples_extra/Placeholders/Sample/main.m @@ -0,0 +1,26 @@ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/examples/SynchronousKittens/Default-568h@2x.png b/examples_extra/SynchronousConcurrency/Default-568h@2x.png similarity index 100% rename from examples/SynchronousKittens/Default-568h@2x.png rename to examples_extra/SynchronousConcurrency/Default-568h@2x.png diff --git a/examples/SynchronousKittens/Default-667h@2x.png b/examples_extra/SynchronousConcurrency/Default-667h@2x.png similarity index 100% rename from examples/SynchronousKittens/Default-667h@2x.png rename to examples_extra/SynchronousConcurrency/Default-667h@2x.png diff --git a/examples/SynchronousKittens/Default-736h@3x.png b/examples_extra/SynchronousConcurrency/Default-736h@3x.png similarity index 100% rename from examples/SynchronousKittens/Default-736h@3x.png rename to examples_extra/SynchronousConcurrency/Default-736h@3x.png diff --git a/examples_extra/SynchronousConcurrency/Podfile b/examples_extra/SynchronousConcurrency/Podfile new file mode 100644 index 0000000000..919de4b311 --- /dev/null +++ b/examples_extra/SynchronousConcurrency/Podfile @@ -0,0 +1,5 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples_extra/SynchronousConcurrency/Sample.xcodeproj/project.pbxproj b/examples_extra/SynchronousConcurrency/Sample.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..74034a24f4 --- /dev/null +++ b/examples_extra/SynchronousConcurrency/Sample.xcodeproj/project.pbxproj @@ -0,0 +1,806 @@ + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 0342F7A1563F38A62746D4B8 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" + + showEnvVarsInLog + 0 + + 0585427F19D4DBE100606EA6 + + isa + PBXFileReference + lastKnownFileType + image.png + name + Default-568h@2x.png + path + ../Default-568h@2x.png + sourceTree + <group> + + 0585428019D4DBE100606EA6 + + fileRef + 0585427F19D4DBE100606EA6 + isa + PBXBuildFile + + 05E2127819D4DB510098F589 + + children + + 05E2128319D4DB510098F589 + 05E2128219D4DB510098F589 + 1A943BF0259746F18D6E423F + 1AE410B73DA5C3BD087ACDD7 + + indentWidth + 2 + isa + PBXGroup + sourceTree + <group> + tabWidth + 2 + usesTabs + 0 + + 05E2127919D4DB510098F589 + + attributes + + LastUpgradeCheck + 0600 + ORGANIZATIONNAME + Facebook + TargetAttributes + + 05E2128019D4DB510098F589 + + CreatedOnToolsVersion + 6.0.1 + + + + buildConfigurationList + 05E2127C19D4DB510098F589 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + 05E2127819D4DB510098F589 + productRefGroup + 05E2128219D4DB510098F589 + projectDirPath + + projectReferences + + projectRoot + + targets + + 05E2128019D4DB510098F589 + + + 05E2127C19D4DB510098F589 + + buildConfigurations + + 05E212A219D4DB510098F589 + 05E212A319D4DB510098F589 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 05E2127D19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 18C2ED861B9B8CE700F627B3 + 18748FDB1BB727B20053A9C1 + 05E2128D19D4DB510098F589 + 05E2128A19D4DB510098F589 + 05E2128719D4DB510098F589 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2127E19D4DB510098F589 + + buildActionMask + 2147483647 + files + + C3B2A32888B988D317F5DDE1 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2127F19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 0585428019D4DBE100606EA6 + 6C2C82AC19EE274300767484 + 6C2C82AD19EE274300767484 + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2128019D4DB510098F589 + + buildConfigurationList + 05E212A419D4DB510098F589 + buildPhases + + E080B80F89C34A25B3488E26 + 05E2127D19D4DB510098F589 + 05E2127E19D4DB510098F589 + 05E2127F19D4DB510098F589 + F012A6F39E0149F18F564F50 + 0342F7A1563F38A62746D4B8 + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Sample + productName + Sample + productReference + 05E2128119D4DB510098F589 + productType + com.apple.product-type.application + + 05E2128119D4DB510098F589 + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + Sample.app + sourceTree + BUILT_PRODUCTS_DIR + + 05E2128219D4DB510098F589 + + children + + 05E2128119D4DB510098F589 + + isa + PBXGroup + name + Products + sourceTree + <group> + + 05E2128319D4DB510098F589 + + children + + 05E2128819D4DB510098F589 + 05E2128919D4DB510098F589 + 05E2128B19D4DB510098F589 + 05E2128C19D4DB510098F589 + 18748FD91BB727B20053A9C1 + 18748FDA1BB727B20053A9C1 + 18C2ED841B9B8CE700F627B3 + 18C2ED851B9B8CE700F627B3 + 05E2128419D4DB510098F589 + + isa + PBXGroup + path + Sample + sourceTree + <group> + + 05E2128419D4DB510098F589 + + children + + 0585427F19D4DBE100606EA6 + 6C2C82AA19EE274300767484 + 6C2C82AB19EE274300767484 + 05E2128519D4DB510098F589 + 05E2128619D4DB510098F589 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + 05E2128519D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Info.plist + sourceTree + <group> + + 05E2128619D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + 05E2128719D4DB510098F589 + + fileRef + 05E2128619D4DB510098F589 + isa + PBXBuildFile + + 05E2128819D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AppDelegate.h + sourceTree + <group> + + 05E2128919D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AppDelegate.m + sourceTree + <group> + + 05E2128A19D4DB510098F589 + + fileRef + 05E2128919D4DB510098F589 + isa + PBXBuildFile + + 05E2128B19D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AsyncTableViewController.h + sourceTree + <group> + + 05E2128C19D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AsyncTableViewController.m + sourceTree + <group> + + 05E2128D19D4DB510098F589 + + fileRef + 05E2128C19D4DB510098F589 + isa + PBXBuildFile + + 05E212A219D4DB510098F589 + + 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 + + isa + XCBuildConfiguration + name + Debug + + 05E212A319D4DB510098F589 + + 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 + + isa + XCBuildConfiguration + name + Release + + 05E212A419D4DB510098F589 + + buildConfigurations + + 05E212A519D4DB510098F589 + 05E212A619D4DB510098F589 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 05E212A519D4DB510098F589 + + baseConfigurationReference + 86D5AE7D8306374F99D2E0F7 + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 7.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Debug + + 05E212A619D4DB510098F589 + + baseConfigurationReference + 3673DB8C60BCB89039CAD924 + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 7.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Release + + 18748FD91BB727B20053A9C1 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AsyncViewController.h + sourceTree + <group> + + 18748FDA1BB727B20053A9C1 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AsyncViewController.m + sourceTree + <group> + + 18748FDB1BB727B20053A9C1 + + fileRef + 18748FDA1BB727B20053A9C1 + isa + PBXBuildFile + + 18C2ED841B9B8CE700F627B3 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + RandomCoreGraphicsNode.h + sourceTree + <group> + + 18C2ED851B9B8CE700F627B3 + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + RandomCoreGraphicsNode.m + sourceTree + <group> + + 18C2ED861B9B8CE700F627B3 + + fileRef + 18C2ED851B9B8CE700F627B3 + isa + PBXBuildFile + + 1A943BF0259746F18D6E423F + + children + + 7D3384C58256708C51C64523 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 1AE410B73DA5C3BD087ACDD7 + + children + + 86D5AE7D8306374F99D2E0F7 + 3673DB8C60BCB89039CAD924 + + isa + PBXGroup + name + Pods + sourceTree + <group> + + 3673DB8C60BCB89039CAD924 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + + 6C2C82AA19EE274300767484 + + isa + PBXFileReference + lastKnownFileType + image.png + path + Default-667h@2x.png + sourceTree + SOURCE_ROOT + + 6C2C82AB19EE274300767484 + + isa + PBXFileReference + lastKnownFileType + image.png + path + Default-736h@3x.png + sourceTree + SOURCE_ROOT + + 6C2C82AC19EE274300767484 + + fileRef + 6C2C82AA19EE274300767484 + isa + PBXBuildFile + + 6C2C82AD19EE274300767484 + + fileRef + 6C2C82AB19EE274300767484 + isa + PBXBuildFile + + 7D3384C58256708C51C64523 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-Sample.a + sourceTree + BUILT_PRODUCTS_DIR + + 86D5AE7D8306374F99D2E0F7 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.debug.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig + sourceTree + <group> + + C3B2A32888B988D317F5DDE1 + + fileRef + 7D3384C58256708C51C64523 + isa + PBXBuildFile + + E080B80F89C34A25B3488E26 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + 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 + + showEnvVarsInLog + 0 + + F012A6F39E0149F18F564F50 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" + + showEnvVarsInLog + 0 + + + rootObject + 05E2127919D4DB510098F589 + + diff --git a/examples_extra/SynchronousConcurrency/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples_extra/SynchronousConcurrency/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..a80c038249 --- /dev/null +++ b/examples_extra/SynchronousConcurrency/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/examples/SynchronousKittens/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples_extra/SynchronousConcurrency/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme similarity index 100% rename from examples/SynchronousKittens/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme rename to examples_extra/SynchronousConcurrency/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme diff --git a/examples_extra/SynchronousConcurrency/Sample/AppDelegate.h b/examples_extra/SynchronousConcurrency/Sample/AppDelegate.h new file mode 100644 index 0000000000..5274628a9e --- /dev/null +++ b/examples_extra/SynchronousConcurrency/Sample/AppDelegate.h @@ -0,0 +1,26 @@ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#define UseAutomaticLayout 1 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples_extra/SynchronousConcurrency/Sample/AppDelegate.m b/examples_extra/SynchronousConcurrency/Sample/AppDelegate.m new file mode 100644 index 0000000000..c7da0d3cb1 --- /dev/null +++ b/examples_extra/SynchronousConcurrency/Sample/AppDelegate.m @@ -0,0 +1,39 @@ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "AsyncTableViewController.h" +#import "AsyncViewController.h" + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + self.window.backgroundColor = [UIColor whiteColor]; + + UITabBarController *tabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil]; + self.window.rootViewController = tabBarController; + + [tabBarController setViewControllers:@[[[AsyncTableViewController alloc] init], [[AsyncViewController alloc] init]]]; + + [self.window makeKeyAndVisible]; + return YES; +} + +@end diff --git a/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.h b/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.h new file mode 100644 index 0000000000..9a2e1a09b4 --- /dev/null +++ b/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.h @@ -0,0 +1,22 @@ +// +// AsyncTableViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface AsyncTableViewController : UIViewController + +@end diff --git a/examples/SynchronousConcurrency/Sample/AsyncTableViewController.m b/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.m similarity index 72% rename from examples/SynchronousConcurrency/Sample/AsyncTableViewController.m rename to examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.m index 80efd81209..328cbba515 100644 --- a/examples/SynchronousConcurrency/Sample/AsyncTableViewController.m +++ b/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.m @@ -1,13 +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. - */ +// +// AsyncTableViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 #import diff --git a/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.h b/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.h new file mode 100644 index 0000000000..fd357593ca --- /dev/null +++ b/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.h @@ -0,0 +1,24 @@ +// +// AsyncViewController.h +// Sample +// +// Created by Scott Goodson on 9/26/15. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "ASViewController.h" + +@interface AsyncViewController : ASViewController + +@end diff --git a/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.m b/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.m new file mode 100644 index 0000000000..5354915b51 --- /dev/null +++ b/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.m @@ -0,0 +1,48 @@ +// +// AsyncViewController.m +// Sample +// +// Created by Scott Goodson on 9/26/15. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "AsyncViewController.h" +#import "RandomCoreGraphicsNode.h" + +@implementation AsyncViewController + +- (instancetype)init +{ + if (!(self = [super initWithNode:[[RandomCoreGraphicsNode alloc] init]])) { + return nil; + } + + self.neverShowPlaceholders = YES; + self.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0]; + return self; +} + +- (void)viewWillAppear:(BOOL)animated +{ + // FIXME: This is only being called on the first time the UITabBarController shows us. + [super viewWillAppear:animated]; +} + +- (void)viewDidDisappear:(BOOL)animated +{ + [self.node recursivelyClearContents]; + [super viewDidDisappear:animated]; +} + +@end diff --git a/examples/Placeholders/Sample/Info.plist b/examples_extra/SynchronousConcurrency/Sample/Info.plist similarity index 100% rename from examples/Placeholders/Sample/Info.plist rename to examples_extra/SynchronousConcurrency/Sample/Info.plist diff --git a/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.h b/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.h new file mode 100644 index 0000000000..1690acf54a --- /dev/null +++ b/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.h @@ -0,0 +1,27 @@ +// +// RandomCoreGraphicsNode.h +// Sample +// +// Created by Scott Goodson on 9/5/15. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface RandomCoreGraphicsNode : ASCellNode +{ + ASTextNode *_textNode; +} + +@end diff --git a/examples/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.m b/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.m similarity index 79% rename from examples/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.m rename to examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.m index 046a71e22e..70e07b95eb 100644 --- a/examples/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.m +++ b/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.m @@ -3,7 +3,18 @@ // Sample // // Created by Scott Goodson on 9/5/15. -// Copyright (c) 2015 Facebook. All rights reserved. +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "RandomCoreGraphicsNode.h" diff --git a/examples_extra/SynchronousConcurrency/Sample/main.m b/examples_extra/SynchronousConcurrency/Sample/main.m new file mode 100644 index 0000000000..756080fb2b --- /dev/null +++ b/examples_extra/SynchronousConcurrency/Sample/main.m @@ -0,0 +1,26 @@ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/examples/VideoTableView/Default-568h@2x.png b/examples_extra/SynchronousKittens/Default-568h@2x.png similarity index 100% rename from examples/VideoTableView/Default-568h@2x.png rename to examples_extra/SynchronousKittens/Default-568h@2x.png diff --git a/examples/VideoTableView/Default-667h@2x.png b/examples_extra/SynchronousKittens/Default-667h@2x.png similarity index 100% rename from examples/VideoTableView/Default-667h@2x.png rename to examples_extra/SynchronousKittens/Default-667h@2x.png diff --git a/examples/VideoTableView/Default-736h@3x.png b/examples_extra/SynchronousKittens/Default-736h@3x.png similarity index 100% rename from examples/VideoTableView/Default-736h@3x.png rename to examples_extra/SynchronousKittens/Default-736h@3x.png diff --git a/examples_extra/SynchronousKittens/Podfile b/examples_extra/SynchronousKittens/Podfile new file mode 100644 index 0000000000..919de4b311 --- /dev/null +++ b/examples_extra/SynchronousKittens/Podfile @@ -0,0 +1,5 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples_extra/SynchronousKittens/Sample.xcodeproj/project.pbxproj b/examples_extra/SynchronousKittens/Sample.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..549bd30cbe --- /dev/null +++ b/examples_extra/SynchronousKittens/Sample.xcodeproj/project.pbxproj @@ -0,0 +1,806 @@ + + + + + archiveVersion + 1 + classes + + objectVersion + 46 + objects + + 05561CF819D4E77700CBA93C + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + BlurbNode.h + sourceTree + <group> + + 05561CF919D4E77700CBA93C + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + BlurbNode.m + sourceTree + <group> + + 05561CFA19D4E77700CBA93C + + fileRef + 05561CF919D4E77700CBA93C + isa + PBXBuildFile + + 05561CFB19D4F94A00CBA93C + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + KittenNode.h + sourceTree + <group> + + 05561CFC19D4F94A00CBA93C + + fileEncoding + 4 + isa + PBXFileReference + lastKnownFileType + sourcecode.cpp.objcpp + path + KittenNode.mm + sourceTree + <group> + + 05561CFD19D4F94A00CBA93C + + fileRef + 05561CFC19D4F94A00CBA93C + isa + PBXBuildFile + + 0585427F19D4DBE100606EA6 + + isa + PBXFileReference + lastKnownFileType + image.png + name + Default-568h@2x.png + path + ../Default-568h@2x.png + sourceTree + <group> + + 0585428019D4DBE100606EA6 + + fileRef + 0585427F19D4DBE100606EA6 + isa + PBXBuildFile + + 05E2127819D4DB510098F589 + + children + + 05E2128319D4DB510098F589 + 05E2128219D4DB510098F589 + 1A943BF0259746F18D6E423F + 1AE410B73DA5C3BD087ACDD7 + + indentWidth + 2 + isa + PBXGroup + sourceTree + <group> + tabWidth + 2 + usesTabs + 0 + + 05E2127919D4DB510098F589 + + attributes + + LastUpgradeCheck + 0600 + ORGANIZATIONNAME + Facebook + TargetAttributes + + 05E2128019D4DB510098F589 + + CreatedOnToolsVersion + 6.0.1 + + + + buildConfigurationList + 05E2127C19D4DB510098F589 + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 + isa + PBXProject + knownRegions + + en + Base + + mainGroup + 05E2127819D4DB510098F589 + productRefGroup + 05E2128219D4DB510098F589 + projectDirPath + + projectReferences + + projectRoot + + targets + + 05E2128019D4DB510098F589 + + + 05E2127C19D4DB510098F589 + + buildConfigurations + + 05E212A219D4DB510098F589 + 05E212A319D4DB510098F589 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 05E2127D19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 05561CFD19D4F94A00CBA93C + 05E2128D19D4DB510098F589 + 05E2128A19D4DB510098F589 + 05561CFA19D4E77700CBA93C + 05E2128719D4DB510098F589 + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2127E19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 4186058E3E168D53D99777F3 + + isa + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2127F19D4DB510098F589 + + buildActionMask + 2147483647 + files + + 0585428019D4DBE100606EA6 + 6C2C82AC19EE274300767484 + 6C2C82AD19EE274300767484 + + isa + PBXResourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 + + 05E2128019D4DB510098F589 + + buildConfigurationList + 05E212A419D4DB510098F589 + buildPhases + + E080B80F89C34A25B3488E26 + 05E2127D19D4DB510098F589 + 05E2127E19D4DB510098F589 + 05E2127F19D4DB510098F589 + F012A6F39E0149F18F564F50 + 626F666C417D1641EB1FF73D + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Sample + productName + Sample + productReference + 05E2128119D4DB510098F589 + productType + com.apple.product-type.application + + 05E2128119D4DB510098F589 + + explicitFileType + wrapper.application + includeInIndex + 0 + isa + PBXFileReference + path + Sample.app + sourceTree + BUILT_PRODUCTS_DIR + + 05E2128219D4DB510098F589 + + children + + 05E2128119D4DB510098F589 + + isa + PBXGroup + name + Products + sourceTree + <group> + + 05E2128319D4DB510098F589 + + children + + 05E2128819D4DB510098F589 + 05E2128919D4DB510098F589 + 05E2128B19D4DB510098F589 + 05E2128C19D4DB510098F589 + 05561CFB19D4F94A00CBA93C + 05561CFC19D4F94A00CBA93C + 05561CF819D4E77700CBA93C + 05561CF919D4E77700CBA93C + 05E2128419D4DB510098F589 + + isa + PBXGroup + path + Sample + sourceTree + <group> + + 05E2128419D4DB510098F589 + + children + + 0585427F19D4DBE100606EA6 + 6C2C82AA19EE274300767484 + 6C2C82AB19EE274300767484 + 05E2128519D4DB510098F589 + 05E2128619D4DB510098F589 + + isa + PBXGroup + name + Supporting Files + sourceTree + <group> + + 05E2128519D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + text.plist.xml + path + Info.plist + sourceTree + <group> + + 05E2128619D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + main.m + sourceTree + <group> + + 05E2128719D4DB510098F589 + + fileRef + 05E2128619D4DB510098F589 + isa + PBXBuildFile + + 05E2128819D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + AppDelegate.h + sourceTree + <group> + + 05E2128919D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + AppDelegate.m + sourceTree + <group> + + 05E2128A19D4DB510098F589 + + fileRef + 05E2128919D4DB510098F589 + isa + PBXBuildFile + + 05E2128B19D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + ViewController.h + sourceTree + <group> + + 05E2128C19D4DB510098F589 + + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + ViewController.m + sourceTree + <group> + + 05E2128D19D4DB510098F589 + + fileRef + 05E2128C19D4DB510098F589 + isa + PBXBuildFile + + 05E212A219D4DB510098F589 + + 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 + + isa + XCBuildConfiguration + name + Debug + + 05E212A319D4DB510098F589 + + 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 + + isa + XCBuildConfiguration + name + Release + + 05E212A419D4DB510098F589 + + buildConfigurations + + 05E212A519D4DB510098F589 + 05E212A619D4DB510098F589 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 05E212A519D4DB510098F589 + + baseConfigurationReference + BE330B4179344E0F8E899043 + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 7.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Debug + + 05E212A619D4DB510098F589 + + baseConfigurationReference + F51793F3B0AD498E5C28A426 + buildSettings + + ASSETCATALOG_COMPILER_APPICON_NAME + AppIcon + INFOPLIST_FILE + Sample/Info.plist + IPHONEOS_DEPLOYMENT_TARGET + 7.1 + LD_RUNPATH_SEARCH_PATHS + $(inherited) @executable_path/Frameworks + PRODUCT_NAME + $(TARGET_NAME) + TARGETED_DEVICE_FAMILY + 1,2 + + isa + XCBuildConfiguration + name + Release + + 1A943BF0259746F18D6E423F + + children + + 77BD0D94BEDD0C95E94180C7 + + isa + PBXGroup + name + Frameworks + sourceTree + <group> + + 1AE410B73DA5C3BD087ACDD7 + + children + + BE330B4179344E0F8E899043 + F51793F3B0AD498E5C28A426 + + isa + PBXGroup + name + Pods + sourceTree + <group> + + 4186058E3E168D53D99777F3 + + fileRef + 77BD0D94BEDD0C95E94180C7 + isa + PBXBuildFile + + 626F666C417D1641EB1FF73D + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Embed Pods Frameworks + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh" + + showEnvVarsInLog + 0 + + 6C2C82AA19EE274300767484 + + isa + PBXFileReference + lastKnownFileType + image.png + path + Default-667h@2x.png + sourceTree + SOURCE_ROOT + + 6C2C82AB19EE274300767484 + + isa + PBXFileReference + lastKnownFileType + image.png + path + Default-736h@3x.png + sourceTree + SOURCE_ROOT + + 6C2C82AC19EE274300767484 + + fileRef + 6C2C82AA19EE274300767484 + isa + PBXBuildFile + + 6C2C82AD19EE274300767484 + + fileRef + 6C2C82AB19EE274300767484 + isa + PBXBuildFile + + 77BD0D94BEDD0C95E94180C7 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-Sample.a + sourceTree + BUILT_PRODUCTS_DIR + + BE330B4179344E0F8E899043 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.debug.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig + sourceTree + <group> + + E080B80F89C34A25B3488E26 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Check Pods Manifest.lock + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + 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 + + showEnvVarsInLog + 0 + + F012A6F39E0149F18F564F50 + + buildActionMask + 2147483647 + files + + inputPaths + + isa + PBXShellScriptBuildPhase + name + Copy Pods Resources + outputPaths + + runOnlyForDeploymentPostprocessing + 0 + shellPath + /bin/sh + shellScript + "${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh" + + showEnvVarsInLog + 0 + + F51793F3B0AD498E5C28A426 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.xcconfig + name + Pods-Sample.release.xcconfig + path + Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig + sourceTree + <group> + + + rootObject + 05E2127919D4DB510098F589 + + diff --git a/examples_extra/SynchronousKittens/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples_extra/SynchronousKittens/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..a80c038249 --- /dev/null +++ b/examples_extra/SynchronousKittens/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/examples/VideoTableView/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples_extra/SynchronousKittens/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme similarity index 100% rename from examples/VideoTableView/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme rename to examples_extra/SynchronousKittens/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme diff --git a/examples/CollectionViewWithViewControllerCells/Sample.xcworkspace/contents.xcworkspacedata b/examples_extra/SynchronousKittens/Sample.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/CollectionViewWithViewControllerCells/Sample.xcworkspace/contents.xcworkspacedata rename to examples_extra/SynchronousKittens/Sample.xcworkspace/contents.xcworkspacedata diff --git a/examples_extra/SynchronousKittens/Sample/AppDelegate.h b/examples_extra/SynchronousKittens/Sample/AppDelegate.h new file mode 100644 index 0000000000..5274628a9e --- /dev/null +++ b/examples_extra/SynchronousKittens/Sample/AppDelegate.h @@ -0,0 +1,26 @@ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#define UseAutomaticLayout 1 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples_extra/SynchronousKittens/Sample/AppDelegate.m b/examples_extra/SynchronousKittens/Sample/AppDelegate.m new file mode 100644 index 0000000000..58fe564898 --- /dev/null +++ b/examples_extra/SynchronousKittens/Sample/AppDelegate.m @@ -0,0 +1,33 @@ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples_extra/SynchronousKittens/Sample/BlurbNode.h b/examples_extra/SynchronousKittens/Sample/BlurbNode.h new file mode 100644 index 0000000000..e6574bcd05 --- /dev/null +++ b/examples_extra/SynchronousKittens/Sample/BlurbNode.h @@ -0,0 +1,25 @@ +// +// BlurbNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +/** + * Simple node that displays a placekitten.com attribution. + */ +@interface BlurbNode : ASCellNode + +@end diff --git a/examples/SynchronousKittens/Sample/BlurbNode.m b/examples_extra/SynchronousKittens/Sample/BlurbNode.m similarity index 83% rename from examples/SynchronousKittens/Sample/BlurbNode.m rename to examples_extra/SynchronousKittens/Sample/BlurbNode.m index 693ec0cd03..4f580098ff 100644 --- a/examples/SynchronousKittens/Sample/BlurbNode.m +++ b/examples_extra/SynchronousKittens/Sample/BlurbNode.m @@ -1,13 +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. - */ +// +// BlurbNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/SynchronousConcurrency/Sample/Info.plist b/examples_extra/SynchronousKittens/Sample/Info.plist similarity index 100% rename from examples/SynchronousConcurrency/Sample/Info.plist rename to examples_extra/SynchronousKittens/Sample/Info.plist diff --git a/examples_extra/SynchronousKittens/Sample/KittenNode.h b/examples_extra/SynchronousKittens/Sample/KittenNode.h new file mode 100644 index 0000000000..9193b9df29 --- /dev/null +++ b/examples_extra/SynchronousKittens/Sample/KittenNode.h @@ -0,0 +1,30 @@ +// +// KittenNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +/** + * 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; + +- (void)toggleImageEnlargement; + +@end diff --git a/examples/SynchronousKittens/Sample/KittenNode.mm b/examples_extra/SynchronousKittens/Sample/KittenNode.mm similarity index 90% rename from examples/SynchronousKittens/Sample/KittenNode.mm rename to examples_extra/SynchronousKittens/Sample/KittenNode.mm index 847a2629c7..e3be59ed25 100644 --- a/examples/SynchronousKittens/Sample/KittenNode.mm +++ b/examples_extra/SynchronousKittens/Sample/KittenNode.mm @@ -1,13 +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. - */ +// +// KittenNode.mm +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 "AppDelegate.h" diff --git a/examples_extra/SynchronousKittens/Sample/ViewController.h b/examples_extra/SynchronousKittens/Sample/ViewController.h new file mode 100644 index 0000000000..fc52c022f2 --- /dev/null +++ b/examples_extra/SynchronousKittens/Sample/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface ViewController : UIViewController + +@end diff --git a/examples/SynchronousKittens/Sample/ViewController.m b/examples_extra/SynchronousKittens/Sample/ViewController.m similarity index 88% rename from examples/SynchronousKittens/Sample/ViewController.m rename to examples_extra/SynchronousKittens/Sample/ViewController.m index 9b39e79e0a..1eebe66646 100644 --- a/examples/SynchronousKittens/Sample/ViewController.m +++ b/examples_extra/SynchronousKittens/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples_extra/SynchronousKittens/Sample/main.m b/examples_extra/SynchronousKittens/Sample/main.m new file mode 100644 index 0000000000..756080fb2b --- /dev/null +++ b/examples_extra/SynchronousKittens/Sample/main.m @@ -0,0 +1,26 @@ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/examples_extra/VideoTableView/Default-568h@2x.png b/examples_extra/VideoTableView/Default-568h@2x.png new file mode 100644 index 0000000000..6ee80b9393 Binary files /dev/null and b/examples_extra/VideoTableView/Default-568h@2x.png differ diff --git a/examples_extra/VideoTableView/Default-667h@2x.png b/examples_extra/VideoTableView/Default-667h@2x.png new file mode 100644 index 0000000000..e7b975e21b Binary files /dev/null and b/examples_extra/VideoTableView/Default-667h@2x.png differ diff --git a/examples_extra/VideoTableView/Default-736h@3x.png b/examples_extra/VideoTableView/Default-736h@3x.png new file mode 100644 index 0000000000..c8949cae16 Binary files /dev/null and b/examples_extra/VideoTableView/Default-736h@3x.png differ diff --git a/examples_extra/VideoTableView/Podfile b/examples_extra/VideoTableView/Podfile new file mode 100644 index 0000000000..919de4b311 --- /dev/null +++ b/examples_extra/VideoTableView/Podfile @@ -0,0 +1,5 @@ +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '7.0' +target 'Sample' do + pod 'AsyncDisplayKit', :path => '../..' +end diff --git a/examples/VideoTableView/Sample.xcodeproj/project.pbxproj b/examples_extra/VideoTableView/Sample.xcodeproj/project.pbxproj similarity index 87% rename from examples/VideoTableView/Sample.xcodeproj/project.pbxproj rename to examples_extra/VideoTableView/Sample.xcodeproj/project.pbxproj index 9e585d3265..f579b25bce 100644 --- a/examples/VideoTableView/Sample.xcodeproj/project.pbxproj +++ b/examples_extra/VideoTableView/Sample.xcodeproj/project.pbxproj @@ -13,7 +13,7 @@ 05E2128719D4DB510098F589 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128619D4DB510098F589 /* main.m */; }; 05E2128A19D4DB510098F589 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128919D4DB510098F589 /* AppDelegate.m */; }; 05E2128D19D4DB510098F589 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E2128C19D4DB510098F589 /* ViewController.m */; }; - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */; }; + 67ADD7A0A11DF37B2D73094B /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 12CBA11A5870DDF5A5626B7B /* libPods-Sample.a */; }; 6C2C82AC19EE274300767484 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AA19EE274300767484 /* Default-667h@2x.png */; }; 6C2C82AD19EE274300767484 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6C2C82AB19EE274300767484 /* Default-736h@3x.png */; }; /* End PBXBuildFile section */ @@ -31,11 +31,11 @@ 05E2128919D4DB510098F589 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 05E2128B19D4DB510098F589 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 05E2128C19D4DB510098F589 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 12CBA11A5870DDF5A5626B7B /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 246853115611E4007B767EA5 /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = ""; }; 6C2C82AA19EE274300767484 /* Default-667h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h@2x.png"; sourceTree = SOURCE_ROOT; }; 6C2C82AB19EE274300767484 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = SOURCE_ROOT; }; - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + C822FB25F4C6DBD8EA3CE6EC /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -43,7 +43,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3EC0CDCBA10D483D9F386E5E /* libPods.a in Frameworks */, + 67ADD7A0A11DF37B2D73094B /* libPods-Sample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -102,7 +102,7 @@ 1A943BF0259746F18D6E423F /* Frameworks */ = { isa = PBXGroup; children = ( - 3D24B17D1E4A4E7A9566C5E9 /* libPods.a */, + 12CBA11A5870DDF5A5626B7B /* libPods-Sample.a */, ); name = Frameworks; sourceTree = ""; @@ -110,8 +110,8 @@ 1AE410B73DA5C3BD087ACDD7 /* Pods */ = { isa = PBXGroup; children = ( - C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */, - 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */, + 246853115611E4007B767EA5 /* Pods-Sample.debug.xcconfig */, + C822FB25F4C6DBD8EA3CE6EC /* Pods-Sample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -123,12 +123,12 @@ isa = PBXNativeTarget; buildConfigurationList = 05E212A419D4DB510098F589 /* Build configuration list for PBXNativeTarget "Sample" */; buildPhases = ( - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */, + E080B80F89C34A25B3488E26 /* πŸ“¦ Check Pods Manifest.lock */, 05E2127D19D4DB510098F589 /* Sources */, 05E2127E19D4DB510098F589 /* Frameworks */, 05E2127F19D4DB510098F589 /* Resources */, - F012A6F39E0149F18F564F50 /* Copy Pods Resources */, - EBE12F047824F0A2C6353B54 /* Embed Pods Frameworks */, + F012A6F39E0149F18F564F50 /* πŸ“¦ Copy Pods Resources */, + EBE12F047824F0A2C6353B54 /* πŸ“¦ Embed Pods Frameworks */, ); buildRules = ( ); @@ -185,14 +185,14 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - E080B80F89C34A25B3488E26 /* Check Pods Manifest.lock */ = { + E080B80F89C34A25B3488E26 /* πŸ“¦ Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "πŸ“¦ Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; @@ -200,34 +200,34 @@ 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; }; - EBE12F047824F0A2C6353B54 /* Embed Pods Frameworks */ = { + EBE12F047824F0A2C6353B54 /* πŸ“¦ Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Embed Pods Frameworks"; + name = "πŸ“¦ Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - F012A6F39E0149F18F564F50 /* Copy Pods Resources */ = { + F012A6F39E0149F18F564F50 /* πŸ“¦ Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "πŸ“¦ Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -326,7 +326,7 @@ }; 05E212A519D4DB510098F589 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C068F1D3F0CC317E895FCDAB /* Pods.debug.xcconfig */; + baseConfigurationReference = 246853115611E4007B767EA5 /* Pods-Sample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; @@ -339,7 +339,7 @@ }; 05E212A619D4DB510098F589 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 088AA6578212BE9BFBB07B70 /* Pods.release.xcconfig */; + baseConfigurationReference = C822FB25F4C6DBD8EA3CE6EC /* Pods-Sample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Sample/Info.plist; diff --git a/examples_extra/VideoTableView/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples_extra/VideoTableView/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..a80c038249 --- /dev/null +++ b/examples_extra/VideoTableView/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/examples_extra/VideoTableView/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples_extra/VideoTableView/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme new file mode 100644 index 0000000000..1e14aa0329 --- /dev/null +++ b/examples_extra/VideoTableView/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CustomCollectionView/Sample.xcworkspace/contents.xcworkspacedata b/examples_extra/VideoTableView/Sample.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/CustomCollectionView/Sample.xcworkspace/contents.xcworkspacedata rename to examples_extra/VideoTableView/Sample.xcworkspace/contents.xcworkspacedata diff --git a/examples_extra/VideoTableView/Sample/AppDelegate.h b/examples_extra/VideoTableView/Sample/AppDelegate.h new file mode 100644 index 0000000000..5274628a9e --- /dev/null +++ b/examples_extra/VideoTableView/Sample/AppDelegate.h @@ -0,0 +1,26 @@ +// +// AppDelegate.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#define UseAutomaticLayout 1 + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples_extra/VideoTableView/Sample/AppDelegate.m b/examples_extra/VideoTableView/Sample/AppDelegate.m new file mode 100644 index 0000000000..58fe564898 --- /dev/null +++ b/examples_extra/VideoTableView/Sample/AppDelegate.m @@ -0,0 +1,33 @@ +// +// AppDelegate.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 diff --git a/examples_extra/VideoTableView/Sample/BlurbNode.h b/examples_extra/VideoTableView/Sample/BlurbNode.h new file mode 100644 index 0000000000..e6574bcd05 --- /dev/null +++ b/examples_extra/VideoTableView/Sample/BlurbNode.h @@ -0,0 +1,25 @@ +// +// BlurbNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +/** + * Simple node that displays a placekitten.com attribution. + */ +@interface BlurbNode : ASCellNode + +@end diff --git a/examples/VideoTableView/Sample/BlurbNode.m b/examples_extra/VideoTableView/Sample/BlurbNode.m similarity index 80% rename from examples/VideoTableView/Sample/BlurbNode.m rename to examples_extra/VideoTableView/Sample/BlurbNode.m index fa9533fd69..f6f24cbbba 100644 --- a/examples/VideoTableView/Sample/BlurbNode.m +++ b/examples_extra/VideoTableView/Sample/BlurbNode.m @@ -1,13 +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. - */ +// +// BlurbNode.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples/SynchronousKittens/Sample/Info.plist b/examples_extra/VideoTableView/Sample/Info.plist similarity index 100% rename from examples/SynchronousKittens/Sample/Info.plist rename to examples_extra/VideoTableView/Sample/Info.plist diff --git a/examples_extra/VideoTableView/Sample/NicCageNode.h b/examples_extra/VideoTableView/Sample/NicCageNode.h new file mode 100644 index 0000000000..6dbff3ffa5 --- /dev/null +++ b/examples_extra/VideoTableView/Sample/NicCageNode.h @@ -0,0 +1,30 @@ +// +// NicCageNode.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +/** + * 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 diff --git a/examples/VideoTableView/Sample/NicCageNode.mm b/examples_extra/VideoTableView/Sample/NicCageNode.mm similarity index 77% rename from examples/VideoTableView/Sample/NicCageNode.mm rename to examples_extra/VideoTableView/Sample/NicCageNode.mm index c2277762ed..367d4967e6 100644 --- a/examples/VideoTableView/Sample/NicCageNode.mm +++ b/examples_extra/VideoTableView/Sample/NicCageNode.mm @@ -1,13 +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. - */ +// +// NicCageNode.mm +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" @@ -80,16 +86,43 @@ static const CGFloat kInnerPadding = 10.0f; return nil; _kittenSize = size; - - _videoNode = [[ASVideoNode alloc] init]; -// _videoNode.shouldAutoplay = YES; + + 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(); - _videoNode.asset = [AVAsset assetWithURL:[NSURL URLWithString:@"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-753fe655-86bb-46da-89b7-aa59c60e49c0-niccage.mp4"]]; [self addSubnode:_videoNode]; _textNode = [[ASTextNode alloc] init]; - _textNode.attributedString = [[NSAttributedString alloc] initWithString:[self kittyIpsum] + _textNode.attributedString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ %@ %@", methodArray[videoInitMethod], autoPlayArray[autoPlay], [self kittyIpsum]] attributes:[self textStyle]]; [self addSubnode:_textNode]; diff --git a/examples_extra/VideoTableView/Sample/ViewController.h b/examples_extra/VideoTableView/Sample/ViewController.h new file mode 100644 index 0000000000..fc52c022f2 --- /dev/null +++ b/examples_extra/VideoTableView/Sample/ViewController.h @@ -0,0 +1,22 @@ +// +// ViewController.h +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +@interface ViewController : UIViewController + +@end diff --git a/examples/VideoTableView/Sample/ViewController.m b/examples_extra/VideoTableView/Sample/ViewController.m similarity index 88% rename from examples/VideoTableView/Sample/ViewController.m rename to examples_extra/VideoTableView/Sample/ViewController.m index 062433ba4a..fd8d2851ca 100644 --- a/examples/VideoTableView/Sample/ViewController.m +++ b/examples_extra/VideoTableView/Sample/ViewController.m @@ -1,13 +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. - */ +// +// ViewController.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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" diff --git a/examples_extra/VideoTableView/Sample/main.m b/examples_extra/VideoTableView/Sample/main.m new file mode 100644 index 0000000000..756080fb2b --- /dev/null +++ b/examples_extra/VideoTableView/Sample/main.m @@ -0,0 +1,26 @@ +// +// main.m +// Sample +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// +// 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 + +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/smoke-tests/Framework/Sample/AppDelegate.swift b/smoke-tests/Framework/Sample/AppDelegate.swift index a2b00b1727..9c90c393af 100644 --- a/smoke-tests/Framework/Sample/AppDelegate.swift +++ b/smoke-tests/Framework/Sample/AppDelegate.swift @@ -1,13 +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. - */ +// +// AppDelegate.swift +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// import UIKit diff --git a/smoke-tests/Framework/Sample/ViewController.swift b/smoke-tests/Framework/Sample/ViewController.swift index b21fa5e201..af3ca74cef 100644 --- a/smoke-tests/Framework/Sample/ViewController.swift +++ b/smoke-tests/Framework/Sample/ViewController.swift @@ -1,13 +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. - */ +// +// ViewController.swift +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// import UIKit import AsyncDisplayKit diff --git a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.h b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.h index 593a1df02c..56ca2c187d 100644 --- a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.h +++ b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// AppDelegate.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.m b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.m index 2463c4f11f..3090429202 100644 --- a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.m +++ b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// AppDelegate.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "AppDelegate.h" diff --git a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.h b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.h index fb7ca5f33a..31443d62eb 100644 --- a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.h +++ b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.h @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ViewController.h +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import diff --git a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.m b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.m index 994d827dcc..6fe33cada7 100644 --- a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.m +++ b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// ViewController.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import "ViewController.h" diff --git a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/main.m b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/main.m index 65c5c16fa8..d99695b526 100644 --- a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/main.m +++ b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/main.m @@ -1,10 +1,12 @@ -/* Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +// +// main.m +// AsyncDisplayKit +// +// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// #import #import "AppDelegate.h"