├── .gitmodules ├── Cartfile ├── Examples ├── Pods │ ├── Headers │ │ ├── Private │ │ │ ├── AHEasing │ │ │ │ ├── easing.h │ │ │ │ └── CAKeyframeAnimation+AHEasing.h │ │ │ ├── TLIndexPathTools │ │ │ │ ├── TLIndexPathTools.h │ │ │ │ ├── TLIndexPathItem.h │ │ │ │ ├── TLDynamicHeightCell.h │ │ │ │ ├── TLIndexPathUpdates.h │ │ │ │ ├── TLTreeDataModel.h │ │ │ │ ├── TLDynamicSizeView.h │ │ │ │ ├── TLIndexPathController.h │ │ │ │ ├── TLIndexPathDataModel.h │ │ │ │ ├── TLIndexPathTreeItem.h │ │ │ │ ├── TLDynamicHeightLabelCell.h │ │ │ │ ├── TLIndexPathSectionInfo.h │ │ │ │ ├── TLTableViewController.h │ │ │ │ ├── TLCollapsibleDataModel.h │ │ │ │ ├── TLCollapsibleHeaderView.h │ │ │ │ ├── TLCollectionViewController.h │ │ │ │ ├── TLTreeTableViewController.h │ │ │ │ ├── UITableView+ScrollOptimizer.h │ │ │ │ ├── TLNoResultsTableDataModel.h │ │ │ │ ├── TLCollapsibleTableViewController.h │ │ │ │ └── UITableViewController+ScrollOptimizer.h │ │ │ └── TLLayoutTransitioning │ │ │ │ ├── TLTransitionLayout.h │ │ │ │ ├── TLLayoutTransitioning.h │ │ │ │ └── UICollectionView+TLTransitioning.h │ │ └── Public │ │ │ ├── AHEasing │ │ │ ├── easing.h │ │ │ └── CAKeyframeAnimation+AHEasing.h │ │ │ ├── TLIndexPathTools │ │ │ ├── TLIndexPathTools.h │ │ │ ├── TLIndexPathItem.h │ │ │ ├── TLDynamicHeightCell.h │ │ │ ├── TLIndexPathUpdates.h │ │ │ ├── TLTreeDataModel.h │ │ │ ├── TLDynamicSizeView.h │ │ │ ├── TLIndexPathController.h │ │ │ ├── TLIndexPathDataModel.h │ │ │ ├── TLIndexPathSectionInfo.h │ │ │ ├── TLIndexPathTreeItem.h │ │ │ ├── TLDynamicHeightLabelCell.h │ │ │ ├── TLTableViewController.h │ │ │ ├── UITableView+ScrollOptimizer.h │ │ │ ├── TLCollapsibleDataModel.h │ │ │ ├── TLCollapsibleHeaderView.h │ │ │ ├── TLCollectionViewController.h │ │ │ ├── TLTreeTableViewController.h │ │ │ ├── TLNoResultsTableDataModel.h │ │ │ ├── UITableViewController+ScrollOptimizer.h │ │ │ └── TLCollapsibleTableViewController.h │ │ │ └── TLLayoutTransitioning │ │ │ ├── TLTransitionLayout.h │ │ │ ├── TLLayoutTransitioning.h │ │ │ └── UICollectionView+TLTransitioning.h │ ├── Target Support Files │ │ ├── Pods-AHEasing │ │ │ ├── Pods-AHEasing.xcconfig │ │ │ ├── Pods-AHEasing-prefix.pch │ │ │ ├── Pods-AHEasing.modulemap │ │ │ ├── Pods-AHEasing-dummy.m │ │ │ ├── Pods-AHEasing-umbrella.h │ │ │ ├── Pods-AHEasing-Private.xcconfig │ │ │ └── Info.plist │ │ ├── Pods │ │ │ ├── Pods.modulemap │ │ │ ├── Pods-dummy.m │ │ │ ├── Pods-umbrella.h │ │ │ ├── Pods.debug.xcconfig │ │ │ ├── Pods.release.xcconfig │ │ │ ├── Info.plist │ │ │ ├── Pods-environment.h │ │ │ ├── Pods-frameworks.sh │ │ │ ├── Pods-acknowledgements.markdown │ │ │ ├── Pods-acknowledgements.plist │ │ │ └── Pods-resources.sh │ │ ├── Pods-TLIndexPathTools │ │ │ ├── Pods-TLIndexPathTools-prefix.pch │ │ │ ├── Pods-TLIndexPathTools.xcconfig │ │ │ ├── Pods-TLIndexPathTools.modulemap │ │ │ ├── Pods-TLIndexPathTools-dummy.m │ │ │ ├── Pods-TLIndexPathTools-Private.xcconfig │ │ │ ├── Info.plist │ │ │ └── Pods-TLIndexPathTools-umbrella.h │ │ └── Pods-TLLayoutTransitioning │ │ │ ├── Pods-TLLayoutTransitioning-prefix.pch │ │ │ ├── Pods-TLLayoutTransitioning.xcconfig │ │ │ ├── Pods-TLLayoutTransitioning.modulemap │ │ │ ├── Pods-TLLayoutTransitioning-dummy.m │ │ │ ├── Pods-TLLayoutTransitioning-umbrella.h │ │ │ ├── Pods-TLLayoutTransitioning-Private.xcconfig │ │ │ └── Info.plist │ ├── TLIndexPathTools │ │ ├── TLIndexPathTools │ │ │ ├── Extensions │ │ │ │ ├── TLDynamicHeightCell.m │ │ │ │ ├── UITableViewController+ScrollOptimizer.h │ │ │ │ ├── TLDynamicHeightCell.h │ │ │ │ ├── TLDynamicHeightLabelCell.h │ │ │ │ ├── TLDynamicHeightLabelCell.m │ │ │ │ ├── Tree │ │ │ │ │ ├── TLIndexPathTreeItem.h │ │ │ │ │ ├── TLIndexPathTreeItem.m │ │ │ │ │ ├── TLTreeDataModel.h │ │ │ │ │ ├── TLTreeDataModel.m │ │ │ │ │ └── TLTreeTableViewController.h │ │ │ │ ├── Collapsible │ │ │ │ │ ├── TLCollapsibleHeaderView.h │ │ │ │ │ ├── TLCollapsibleDataModel.h │ │ │ │ │ ├── TLCollapsibleTableViewController.h │ │ │ │ │ ├── TLCollapsibleDataModel.m │ │ │ │ │ ├── TLCollapsibleHeaderView.m │ │ │ │ │ └── TLCollapsibleTableViewController.m │ │ │ │ ├── No Results │ │ │ │ │ ├── TLNoResultsTableDataModel.h │ │ │ │ │ └── TLNoResultsTableDataModel.m │ │ │ │ ├── UITableView+ScrollOptimizer.h │ │ │ │ ├── UITableView+ScrollOptimizer.m │ │ │ │ └── UITableViewController+ScrollOptimizer.m │ │ │ ├── TLIndexPathTools.h │ │ │ ├── Data Model │ │ │ │ ├── TLIndexPathSectionInfo.m │ │ │ │ ├── TLIndexPathSectionInfo.h │ │ │ │ ├── TLIndexPathItem.h │ │ │ │ ├── TLIndexPathItem.m │ │ │ │ └── TLIndexPathUpdates.h │ │ │ └── View Controllers │ │ │ │ ├── TLDynamicSizeView.h │ │ │ │ ├── TLCollectionViewController.h │ │ │ │ └── TLTableViewController.h │ │ └── LICENSE │ ├── AHEasing │ │ ├── COPYING │ │ ├── README.md │ │ └── AHEasing │ │ │ ├── CAKeyframeAnimation+AHEasing.h │ │ │ ├── easing.h │ │ │ ├── CAKeyframeAnimation+AHEasing.m │ │ │ └── easing.c │ ├── Manifest.lock │ └── Local Podspecs │ │ └── TLLayoutTransitioning.podspec.json ├── Examples │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── UIColor+Hex.h │ ├── AppDelegate.h │ ├── SelectorTableViewController.h │ ├── PinchCollectionViewController.h │ ├── main.m │ ├── Examples-Prefix.pch │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── UIColor+Hex.m │ ├── ResizeCollectionViewController.h │ ├── ResizeSettingsTableViewController.h │ ├── Examples-Info.plist │ ├── AppDelegate.m │ ├── SelectorTableViewController.m │ ├── PinchCollectionViewController.m │ ├── ResizeSettingsTableViewController.m │ └── ResizeCollectionViewController.m ├── Podfile ├── Examples.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── Examples.xcworkspace │ └── contents.xcworkspacedata └── Podfile.lock ├── TLLayoutTransitioning.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── TLLayoutTransitioning.xcscheme ├── .gitignore ├── TLLayoutTransitioning ├── TLLayoutTransitioning-Prefix.pch ├── TLLayoutTransitioning.h ├── Info.plist └── TLTransitionLayout.h ├── LICENSE ├── TLLayoutTransitioning.podspec └── README.md /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "wtmoose/AHEasing" 2 | -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/AHEasing/easing.h: -------------------------------------------------------------------------------- 1 | ../../../AHEasing/AHEasing/easing.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/AHEasing/easing.h: -------------------------------------------------------------------------------- 1 | ../../../AHEasing/AHEasing/easing.h -------------------------------------------------------------------------------- /Examples/Examples/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/AHEasing/CAKeyframeAnimation+AHEasing.h: -------------------------------------------------------------------------------- 1 | ../../../AHEasing/AHEasing/CAKeyframeAnimation+AHEasing.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLIndexPathTools.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/TLIndexPathTools.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/AHEasing/CAKeyframeAnimation+AHEasing.h: -------------------------------------------------------------------------------- 1 | ../../../AHEasing/AHEasing/CAKeyframeAnimation+AHEasing.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLIndexPathTools.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/TLIndexPathTools.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLLayoutTransitioning/TLTransitionLayout.h: -------------------------------------------------------------------------------- 1 | ../../../../../TLLayoutTransitioning/TLTransitionLayout.h -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-AHEasing/Pods-AHEasing.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_AHEASING_OTHER_LDFLAGS = -framework "QuartzCore" -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLLayoutTransitioning/TLTransitionLayout.h: -------------------------------------------------------------------------------- 1 | ../../../../../TLLayoutTransitioning/TLTransitionLayout.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLIndexPathItem.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathItem.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLLayoutTransitioning/TLLayoutTransitioning.h: -------------------------------------------------------------------------------- 1 | ../../../../../TLLayoutTransitioning/TLLayoutTransitioning.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLIndexPathItem.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathItem.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLLayoutTransitioning/TLLayoutTransitioning.h: -------------------------------------------------------------------------------- 1 | ../../../../../TLLayoutTransitioning/TLLayoutTransitioning.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLDynamicHeightCell.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/TLDynamicHeightCell.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLIndexPathUpdates.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathUpdates.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLTreeDataModel.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/Tree/TLTreeDataModel.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLDynamicHeightCell.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/TLDynamicHeightCell.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLIndexPathUpdates.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathUpdates.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLTreeDataModel.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/Tree/TLTreeDataModel.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLDynamicSizeView.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/View Controllers/TLDynamicSizeView.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLIndexPathController.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Controllers/TLIndexPathController.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLIndexPathDataModel.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathDataModel.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLIndexPathTreeItem.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/Tree/TLIndexPathTreeItem.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLDynamicSizeView.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/View Controllers/TLDynamicSizeView.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLIndexPathController.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Controllers/TLIndexPathController.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLIndexPathDataModel.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathDataModel.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLIndexPathSectionInfo.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathSectionInfo.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLIndexPathTreeItem.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/Tree/TLIndexPathTreeItem.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLDynamicHeightLabelCell.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/TLDynamicHeightLabelCell.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLIndexPathSectionInfo.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathSectionInfo.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLTableViewController.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/View Controllers/TLTableViewController.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLDynamicHeightLabelCell.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/TLDynamicHeightLabelCell.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLTableViewController.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/View Controllers/TLTableViewController.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLLayoutTransitioning/UICollectionView+TLTransitioning.h: -------------------------------------------------------------------------------- 1 | ../../../../../TLLayoutTransitioning/UICollectionView+TLTransitioning.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/UITableView+ScrollOptimizer.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/UITableView+ScrollOptimizer.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLLayoutTransitioning/UICollectionView+TLTransitioning.h: -------------------------------------------------------------------------------- 1 | ../../../../../TLLayoutTransitioning/UICollectionView+TLTransitioning.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLCollapsibleDataModel.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/Collapsible/TLCollapsibleDataModel.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLCollapsibleHeaderView.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/Collapsible/TLCollapsibleHeaderView.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLCollectionViewController.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/View Controllers/TLCollectionViewController.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLTreeTableViewController.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/Tree/TLTreeTableViewController.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/UITableView+ScrollOptimizer.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/UITableView+ScrollOptimizer.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLCollapsibleDataModel.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/Collapsible/TLCollapsibleDataModel.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLCollapsibleHeaderView.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/Collapsible/TLCollapsibleHeaderView.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLCollectionViewController.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/View Controllers/TLCollectionViewController.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLTreeTableViewController.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/Tree/TLTreeTableViewController.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLNoResultsTableDataModel.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/No Results/TLNoResultsTableDataModel.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLNoResultsTableDataModel.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/No Results/TLNoResultsTableDataModel.h -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-AHEasing/Pods-AHEasing-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/UITableViewController+ScrollOptimizer.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/UITableViewController+ScrollOptimizer.h -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods/Pods.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods { 2 | umbrella header "Pods-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/TLCollapsibleTableViewController.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/Collapsible/TLCollapsibleTableViewController.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Private/TLIndexPathTools/UITableViewController+ScrollOptimizer.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/UITableViewController+ScrollOptimizer.h -------------------------------------------------------------------------------- /Examples/Pods/Headers/Public/TLIndexPathTools/TLCollapsibleTableViewController.h: -------------------------------------------------------------------------------- 1 | ../../../TLIndexPathTools/TLIndexPathTools/Extensions/Collapsible/TLCollapsibleTableViewController.h -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLIndexPathTools/Pods-TLIndexPathTools-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLLayoutTransitioning/Pods-TLLayoutTransitioning-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-environment.h" 6 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-AHEasing/Pods-AHEasing.modulemap: -------------------------------------------------------------------------------- 1 | framework module AHEasing { 2 | umbrella header "Pods-AHEasing-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLLayoutTransitioning/Pods-TLLayoutTransitioning.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_TLLAYOUTTRANSITIONING_OTHER_LDFLAGS = -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLIndexPathTools/Pods-TLIndexPathTools.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_TLINDEXPATHTOOLS_OTHER_LDFLAGS = -framework "CoreData" -framework "Foundation" -framework "QuartzCore" -framework "UIKit" -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods/Pods-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double PodsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char PodsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Examples/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, "8.0" 2 | use_frameworks! 3 | workspace 'Examples.xcworkspace' 4 | xcodeproj 'Examples.xcodeproj' 5 | pod 'TLIndexPathTools', :head 6 | pod 'TLLayoutTransitioning', :path => '../' 7 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-AHEasing/Pods-AHEasing-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_AHEasing : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_AHEasing 5 | @end 6 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLIndexPathTools/Pods-TLIndexPathTools.modulemap: -------------------------------------------------------------------------------- 1 | framework module TLIndexPathTools { 2 | umbrella header "Pods-TLIndexPathTools-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Examples/Examples.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLIndexPathTools/Pods-TLIndexPathTools-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_TLIndexPathTools : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_TLIndexPathTools 5 | @end 6 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLLayoutTransitioning/Pods-TLLayoutTransitioning.modulemap: -------------------------------------------------------------------------------- 1 | framework module TLLayoutTransitioning { 2 | umbrella header "Pods-TLLayoutTransitioning-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLLayoutTransitioning/Pods-TLLayoutTransitioning-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_TLLayoutTransitioning : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_TLLayoutTransitioning 5 | @end 6 | -------------------------------------------------------------------------------- /TLLayoutTransitioning.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-AHEasing/Pods-AHEasing-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "easing.h" 4 | #import "CAKeyframeAnimation+AHEasing.h" 5 | 6 | FOUNDATION_EXPORT double AHEasingVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char AHEasingVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | -------------------------------------------------------------------------------- /Examples/Examples.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Examples/Examples/UIColor+Hex.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Hex.h 3 | // Resize 4 | // 5 | // Created by Tim Moose on 5/30/13. 6 | // Copyright (c) 2013 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (Hex) 12 | + (UIColor *)colorWithHexRGB:(unsigned)rgbValue; 13 | @end 14 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/TLDynamicHeightCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // TLDynamicHeightCell.m 3 | // TLIndexPathTools 4 | // 5 | // Created by Tim Moose on 4/8/15. 6 | // Copyright (c) 2015 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import "TLDynamicHeightCell.h" 10 | 11 | @implementation TLDynamicHeightCell 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Examples/Examples/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Examples 4 | // 5 | // Created by Tim Moose on 2/11/14. 6 | // Copyright (c) 2014 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Examples/Examples/SelectorTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Examples 4 | // 5 | // Created by Tim Moose on 2/11/14. 6 | // Copyright (c) 2014 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface SelectorTableViewController : TLTableViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Examples/Examples/PinchCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Collection 4 | // 5 | // Created by Tim Moose on 6/30/13. 6 | // Copyright (c) 2013 wtm@tractablelabs.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface PinchCollectionViewController : TLCollectionViewController 13 | @end 14 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLLayoutTransitioning/Pods-TLLayoutTransitioning-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "TLLayoutTransitioning.h" 4 | #import "TLTransitionLayout.h" 5 | #import "UICollectionView+TLTransitioning.h" 6 | 7 | FOUNDATION_EXPORT double TLLayoutTransitioningVersionNumber; 8 | FOUNDATION_EXPORT const unsigned char TLLayoutTransitioningVersionString[]; 9 | 10 | -------------------------------------------------------------------------------- /Examples/Examples/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Examples 4 | // 5 | // Created by Tim Moose on 2/11/14. 6 | // Copyright (c) 2014 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Examples/Examples/Examples-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /TLLayoutTransitioning/TLLayoutTransitioning-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Examples/Examples/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Examples/Examples/UIColor+Hex.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Hex.m 3 | // Resize 4 | // 5 | // Created by Tim Moose on 5/30/13. 6 | // Copyright (c) 2013 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import "UIColor+Hex.h" 10 | 11 | @implementation UIColor (Hex) 12 | 13 | + (UIColor *)colorWithHexRGB:(unsigned)rgbValue 14 | { 15 | return [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Examples/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AHEasing (1.2) 3 | - TLIndexPathTools (HEAD based on 0.4.1) 4 | - TLLayoutTransitioning (1.0.8): 5 | - AHEasing 6 | 7 | DEPENDENCIES: 8 | - TLIndexPathTools (HEAD) 9 | - TLLayoutTransitioning (from `../`) 10 | 11 | EXTERNAL SOURCES: 12 | TLLayoutTransitioning: 13 | :path: ../ 14 | 15 | SPEC CHECKSUMS: 16 | AHEasing: 847f583bcd83a2bb850e38ccdb26d22e2593f34d 17 | TLIndexPathTools: 569dfaa167ed1a409f6ffed9e50393d1ba3cf9f2 18 | TLLayoutTransitioning: 82e9e3c8c6e422d77526d27f085e96f782f72f8e 19 | 20 | COCOAPODS: 0.37.2 21 | -------------------------------------------------------------------------------- /Examples/Pods/AHEasing/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 14 rue de Plaisance, 75014 Paris, France 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. -------------------------------------------------------------------------------- /Examples/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AHEasing (1.2) 3 | - TLIndexPathTools (HEAD based on 0.4.1) 4 | - TLLayoutTransitioning (1.0.8): 5 | - AHEasing 6 | 7 | DEPENDENCIES: 8 | - TLIndexPathTools (HEAD) 9 | - TLLayoutTransitioning (from `../`) 10 | 11 | EXTERNAL SOURCES: 12 | TLLayoutTransitioning: 13 | :path: ../ 14 | 15 | SPEC CHECKSUMS: 16 | AHEasing: 847f583bcd83a2bb850e38ccdb26d22e2593f34d 17 | TLIndexPathTools: 569dfaa167ed1a409f6ffed9e50393d1ba3cf9f2 18 | TLLayoutTransitioning: 82e9e3c8c6e422d77526d27f085e96f782f72f8e 19 | 20 | COCOAPODS: 0.37.2 21 | -------------------------------------------------------------------------------- /Examples/Examples/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/UITableViewController+ScrollOptimizer.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewController+ScrollOptimizer.h 3 | // 4 | // 5 | // Created by Tim Moose on 5/28/13. 6 | // 7 | // 8 | 9 | #import 10 | #import "TLIndexPathDataModel.h" 11 | 12 | @interface UITableViewController (ScrollOptimizer) 13 | 14 | /** 15 | Deprectated. Use the `UITableView+ScrollOptimizer` instead 16 | */ 17 | - (void)optimizeScrollPositionForSection:(NSInteger)section headerView:(UIView *)headerView dataModel:(TLIndexPathDataModel *)dataModel animated:(BOOL)animated DEPRECATED_ATTRIBUTE; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/TLDynamicHeightCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLDynamicHeightCell.h 3 | // TLIndexPathTools 4 | // 5 | // Created by Tim Moose on 4/8/15. 6 | // Copyright (c) 2015 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TLDynamicSizeView.h" 11 | 12 | /* 13 | Table view cells can use this base class in conjunction with 14 | TLTableViewController to automatically get the TLIndexPathTools 15 | implementation of dynamic height calculation (which is fully compatible 16 | with Auto Layout). 17 | */ 18 | 19 | @interface TLDynamicHeightCell : UITableViewCell 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /TLLayoutTransitioning/TLLayoutTransitioning.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLLayoutTransitioning.h 3 | // TLLayoutTransitioning 4 | // 5 | // Created by Tim Moose on 6/29/15. 6 | // Copyright (c) 2015 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for TLLayoutTransitioning. 12 | FOUNDATION_EXPORT double TLLayoutTransitioningVersionNumber; 13 | 14 | //! Project version string for TLLayoutTransitioning. 15 | FOUNDATION_EXPORT const unsigned char TLLayoutTransitioningVersionString[]; 16 | 17 | #import 18 | #import 19 | 20 | 21 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-AHEasing/Pods-AHEasing-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-AHEasing.xcconfig" 2 | CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH 3 | FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AHEasing" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AHEasing" "${PODS_ROOT}/Headers/Public/TLIndexPathTools" "${PODS_ROOT}/Headers/Public/TLLayoutTransitioning" 6 | OTHER_LDFLAGS = ${PODS_AHEASING_OTHER_LDFLAGS} -ObjC 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods 8 | PODS_ROOT = ${SRCROOT} 9 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Examples/Examples/ResizeCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Collection 4 | // 5 | // Created by Tim Moose on 6/30/13. 6 | // Copyright (c) 2013 wtm@tractablelabs.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import 13 | 14 | @interface ResizeCollectionViewController : TLCollectionViewController 15 | @property (nonatomic) CGFloat duration; 16 | @property (nonatomic) AHEasingFunction easingFunction; 17 | @property (nonatomic) TLTransitionLayoutIndexPathPlacement toContentOffset; 18 | @property (nonatomic) BOOL showSectionHeaders; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLIndexPathTools/Pods-TLIndexPathTools-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-TLIndexPathTools.xcconfig" 2 | CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH 3 | FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/TLIndexPathTools" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AHEasing" "${PODS_ROOT}/Headers/Public/TLIndexPathTools" "${PODS_ROOT}/Headers/Public/TLLayoutTransitioning" 6 | OTHER_LDFLAGS = ${PODS_TLINDEXPATHTOOLS_OTHER_LDFLAGS} -ObjC 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods 8 | PODS_ROOT = ${SRCROOT} 9 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLLayoutTransitioning/Pods-TLLayoutTransitioning-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-TLLayoutTransitioning.xcconfig" 2 | CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH 3 | FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/TLLayoutTransitioning" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AHEasing" "${PODS_ROOT}/Headers/Public/TLIndexPathTools" "${PODS_ROOT}/Headers/Public/TLLayoutTransitioning" 6 | OTHER_LDFLAGS = ${PODS_TLLAYOUTTRANSITIONING_OTHER_LDFLAGS} -ObjC 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods 8 | PODS_ROOT = ${SRCROOT} 9 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods/Pods.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/AHEasing.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/TLIndexPathTools.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/TLLayoutTransitioning.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "AHEasing" -framework "TLIndexPathTools" -framework "TLLayoutTransitioning" 6 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods/Pods.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/AHEasing.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/TLIndexPathTools.framework/Headers" -iquote "$PODS_FRAMEWORK_BUILD_PATH/TLLayoutTransitioning.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -framework "AHEasing" -framework "TLIndexPathTools" -framework "TLLayoutTransitioning" 6 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/TLDynamicHeightLabelCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLDynamicHeightLabelCell.h 3 | // Dynamic Height Label Cell 4 | // 5 | // Created by Tim Moose on 5/31/13. 6 | // Copyright (c) 2013 Tractable Labs. All rights reserved. 7 | // 8 | 9 | /** 10 | Note that this class is not necessary with Auto Layout because TLIndexPathTools 11 | can calculate the height of Auto Layout cells automatically without any help. 12 | To enable this automatic behavior, see the comments in `TLDynamicSizeView`. 13 | */ 14 | 15 | #import 16 | 17 | #import "TLDynamicSizeView.h" 18 | 19 | @interface TLDynamicHeightLabelCell : UITableViewCell 20 | @property (weak, nonatomic) IBOutlet UILabel *label; 21 | - (void)configureWithText:(NSString *)text; 22 | @end 23 | -------------------------------------------------------------------------------- /TLLayoutTransitioning/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.tractablelabs.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Examples/Examples/ResizeSettingsTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Collection 4 | // 5 | // Created by Tim Moose on 10/9/13. 6 | // Copyright (c) 2013 wtm@tractablelabs.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ResizeSettingsTableViewController : UITableViewController 13 | @property (weak, nonatomic) IBOutlet UISegmentedControl *toContentOffset; 14 | @property (weak, nonatomic) IBOutlet UIPickerView *easingCurvePicker; 15 | @property (weak, nonatomic) IBOutlet UISlider *durationSlider; 16 | @property (weak, nonatomic) IBOutlet UILabel *durationLabel; 17 | @property (weak, nonatomic) IBOutlet UISwitch *showSectionHeaders; 18 | - (IBAction)durationChanged:(UISlider *)sender; 19 | - (IBAction)toContentOffsetChanged:(UISegmentedControl *)sender; 20 | - (IBAction)showSectionHeadersChanged:(UISwitch *)sender; 21 | @end 22 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-AHEasing/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLLayoutTransitioning/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.8 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLIndexPathTools/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | HEAD based on 0.4.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods/Pods-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // AHEasing 10 | #define COCOAPODS_POD_AVAILABLE_AHEasing 11 | #define COCOAPODS_VERSION_MAJOR_AHEasing 1 12 | #define COCOAPODS_VERSION_MINOR_AHEasing 2 13 | #define COCOAPODS_VERSION_PATCH_AHEasing 0 14 | 15 | // TLIndexPathTools 16 | #define COCOAPODS_POD_AVAILABLE_TLIndexPathTools 17 | #define COCOAPODS_VERSION_MAJOR_TLIndexPathTools 0 18 | #define COCOAPODS_VERSION_MINOR_TLIndexPathTools 4 19 | #define COCOAPODS_VERSION_PATCH_TLIndexPathTools 1 20 | 21 | // TLLayoutTransitioning 22 | #define COCOAPODS_POD_AVAILABLE_TLLayoutTransitioning 23 | #define COCOAPODS_VERSION_MAJOR_TLLayoutTransitioning 1 24 | #define COCOAPODS_VERSION_MINOR_TLLayoutTransitioning 0 25 | #define COCOAPODS_VERSION_PATCH_TLLayoutTransitioning 8 26 | 27 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods-TLIndexPathTools/Pods-TLIndexPathTools-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "TLIndexPathController.h" 4 | #import "TLIndexPathDataModel.h" 5 | #import "TLIndexPathItem.h" 6 | #import "TLIndexPathSectionInfo.h" 7 | #import "TLIndexPathUpdates.h" 8 | #import "TLCollapsibleDataModel.h" 9 | #import "TLCollapsibleHeaderView.h" 10 | #import "TLCollapsibleTableViewController.h" 11 | #import "TLNoResultsTableDataModel.h" 12 | #import "TLDynamicHeightCell.h" 13 | #import "TLDynamicHeightLabelCell.h" 14 | #import "TLIndexPathTreeItem.h" 15 | #import "TLTreeDataModel.h" 16 | #import "TLTreeTableViewController.h" 17 | #import "UITableView+ScrollOptimizer.h" 18 | #import "UITableViewController+ScrollOptimizer.h" 19 | #import "TLIndexPathTools.h" 20 | #import "TLCollectionViewController.h" 21 | #import "TLDynamicSizeView.h" 22 | #import "TLTableViewController.h" 23 | 24 | FOUNDATION_EXPORT double TLIndexPathToolsVersionNumber; 25 | FOUNDATION_EXPORT const unsigned char TLIndexPathToolsVersionString[]; 26 | 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 wtmoose 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/TLDynamicHeightLabelCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // TLDynamicHeightLabelCell.m 3 | // Dynamic Height Label Cell 4 | // 5 | // Created by Tim Moose on 5/31/13. 6 | // Copyright (c) 2013 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import "TLDynamicHeightLabelCell.h" 10 | 11 | @interface TLDynamicHeightLabelCell () 12 | @property (nonatomic) CGSize originalSize; 13 | @property (nonatomic) CGSize originalLabelSize; 14 | @end 15 | 16 | @implementation TLDynamicHeightLabelCell 17 | 18 | - (void)awakeFromNib 19 | { 20 | [super awakeFromNib]; 21 | [self layoutIfNeeded]; 22 | self.originalSize = self.bounds.size; 23 | self.originalLabelSize = self.label.bounds.size; 24 | } 25 | 26 | - (void)configureWithText:(NSString *)text 27 | { 28 | self.label.text = text; 29 | [self.label sizeToFit]; 30 | } 31 | 32 | #pragma mark - TLDynamicSizeView 33 | 34 | - (CGSize)sizeWithData:(id)data 35 | { 36 | [self configureWithText:data]; 37 | CGSize labelSize = self.label.intrinsicContentSize; 38 | CGSize size = self.originalSize; 39 | size.width += labelSize.width - self.originalLabelSize.width; 40 | size.height += labelSize.height - self.originalLabelSize.height; 41 | return size; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/TLIndexPathTools.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLIndexPathTools.h 3 | // TLIndexPathTools 4 | // 5 | // Created by Tim Moose on 4/27/15. 6 | // Copyright (c) 2015 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for TLIndexPathTools. 12 | FOUNDATION_EXPORT double TLIndexPathToolsVersionNumber; 13 | 14 | //! Project version string for TLIndexPathTools. 15 | FOUNDATION_EXPORT const unsigned char TLIndexPathToolsVersionString[]; 16 | 17 | #pragma mark - Core data mode components 18 | 19 | #import "TLIndexPathDataModel.h" 20 | #import "TLIndexPathItem.h" 21 | #import "TLIndexPathSectionInfo.h" 22 | #import "TLIndexPathUpdates.h" 23 | 24 | #pragma mark - Index path controller 25 | 26 | #import "TLIndexPathController.h" 27 | 28 | #pragma mark - View controllers 29 | 30 | #import "TLTableViewController.h" 31 | #import "TLCollectionViewController.h" 32 | #import "TLDynamicSizeView.h" 33 | 34 | #pragma mark - Extensions 35 | 36 | #import "TLDynamicHeightCell.h" 37 | #import "TLDynamicHeightLabelCell.h" 38 | #import "UITableView+ScrollOptimizer.h" 39 | #import "UITableViewController+ScrollOptimizer.h" 40 | #import "TLIndexPathTreeItem.h" 41 | #import "TLTreeDataModel.h" 42 | #import "TLTreeTableViewController.h" 43 | #import "TLNoResultsTableDataModel.h" 44 | #import "TLCollapsibleDataModel.h" 45 | #import "TLCollapsibleHeaderView.h" 46 | #import "TLCollapsibleTableViewController.h" 47 | 48 | 49 | -------------------------------------------------------------------------------- /Examples/Examples/Examples-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.tractablelabs.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIMainStoryboardFile~ipad 30 | Examples 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/Tree/TLIndexPathTreeItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLIndexPathTreeItem.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "TLIndexPathItem.h" 25 | 26 | @interface TLIndexPathTreeItem : TLIndexPathItem 27 | @property (strong, nonatomic, readonly) NSArray *childItems; 28 | - (instancetype)initWithIdentifier:(id)identifier sectionName:(NSString *)sectionName 29 | cellIdentifier:(NSString *)cellIdentifier 30 | data:(id)data 31 | andChildItems:(NSArray *)childItems; 32 | - (TLIndexPathTreeItem *)copyWithChildren:(NSArray *)children; 33 | @end 34 | -------------------------------------------------------------------------------- /Examples/Pods/AHEasing/README.md: -------------------------------------------------------------------------------- 1 | AHEasing 2 | ======== 3 | A supplemental library of easing functions for C, C++, and Objective-C 4 | -------- 5 | 6 | The useful portion of this project consists of two parts: 7 | 8 | 1. A stand-alone easing function library, implemented in C (easing.h/easing.c) 9 | 2. CAAnimation category methods to more easily use easing in your Core Animation projects 10 | 11 | Supported functions 12 | -------- 13 | 14 | The following types of easing functions are planned to be supported: 15 | 16 | * Linear 17 | * Quadratic 18 | * Cubic 19 | * Quartic 20 | * Quintic 21 | * Sine 22 | * Circular 23 | * Elastic 24 | * Bounce 25 | * Back 26 | 27 | Each of these has corresponding ease-in, ease-out, and ease-in-out variants. The core easing functions are implemented as C functions that take a time parameter and return a progress parameter, which can subsequently be used to interpolate any quantity. 28 | 29 | Goals 30 | -------- 31 | 32 | The design goals of AHEasing are: 33 | 34 | * To be as fast as conceivably possible while maintaining human readability 35 | * To be portable to any system with a C runtime 36 | * To elucidate the mathematical underpinnings of common easing functions 37 | 38 | Inspiration 39 | -------- 40 | 41 | This work is a spiritual descendent (not to say derivative work) of works done by the following individuals: 42 | 43 | * Robert Penner (http://www.robertpenner.com/easing/) 44 | * George McGinley Smith (http://gsgd.co.uk/sandbox/jquery/easing/) 45 | * James Padolsey (http://james.padolsey.com/demos/jquery/easing/) 46 | * Authors of jQuery (http://plugins.jquery.com/project/Easing) 47 | * Matt Gallagher (http://cocoawithlove.com/2008/09/parametric-acceleration-curves-in-core.html) 48 | * Jesse Crossen (http://stackoverflow.com/questions/5161465/how-to-create-custom-easing-function-with-core-animation) -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/Collapsible/TLCollapsibleHeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLCollapsibleHeaderView.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | @interface TLCollapsibleHeaderView : UIView 27 | @property (nonatomic) UIEdgeInsets contentInsets; 28 | @property (strong, nonatomic) UIColor *separatorColor; 29 | @property (strong, nonatomic) UIImageView *iconView; 30 | @property (strong, nonatomic, readonly) UILabel *titleLabel; 31 | @property (strong, nonatomic) UIView *backgroundView; 32 | @property (nonatomic, readonly) NSInteger section; 33 | - (id)initWithFrame:(CGRect)frame andSection:(NSInteger)section; 34 | @end 35 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathSectionInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // TLIndexPathSectionInfo.m 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "TLIndexPathSectionInfo.h" 25 | #import "TLIndexPathDataModel.h" 26 | 27 | @implementation TLIndexPathSectionInfo 28 | 29 | - (instancetype)initWithItems:(NSArray *)items name:(NSString *)name 30 | { 31 | return [self initWithItems:items name:name indexTitle:name]; 32 | } 33 | 34 | - (instancetype)initWithItems:(NSArray *)items name:(NSString *)name indexTitle:(NSString *)indexTitle 35 | { 36 | if (self = [super init]) { 37 | _name = name; 38 | _indexTitle = indexTitle; 39 | _objects = items; 40 | _numberOfObjects = items.count; 41 | } 42 | return self; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/Collapsible/TLCollapsibleDataModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLCollapsibleDataModel.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "TLIndexPathDataModel.h" 25 | 26 | @interface TLCollapsibleDataModel : TLIndexPathDataModel 27 | @property (copy, nonatomic, readonly) NSSet *collapsedSectionNames; 28 | @property (copy, nonatomic, readonly) NSSet *expandedSectionNames; 29 | @property (strong, nonatomic, readonly) TLIndexPathDataModel *backingDataModel; 30 | - (BOOL)isSectionCollapsed:(NSInteger)section; 31 | - (id)initWithBackingDataModel:(TLIndexPathDataModel *)backingDataModel collapsedSectionNames:(NSSet *)collapsedSectionNames; 32 | - (id)initWithBackingDataModel:(TLIndexPathDataModel *)backingDataModel expandedSectionNames:(NSSet *)expandedSectionNames; 33 | @end 34 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/No Results/TLNoResultsTableDataModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLNoResultsTableDataModel.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | /** 25 | A subclass of TLIndexPathDataModel that will automatically provide a "no results" 26 | row when there are no data items. 27 | */ 28 | 29 | #import "TLIndexPathDataModel.h" 30 | 31 | @interface TLNoResultsTableDataModel : TLIndexPathDataModel 32 | @property (nonatomic, readonly) NSInteger rows; 33 | @property (strong, nonatomic, readonly) NSString *blankCellIdentifier; 34 | @property (strong, nonatomic, readonly) NSString *noResultsCellIdentifier; 35 | @property (strong, nonatomic, readonly) NSString *noResultsText; 36 | - initWithRows:(NSInteger)rows blankCellId:(NSString *)blankCellId noResultsCellId:(NSString *)noResultsCellId noResultsText:(NSString *)noResultsText; 37 | @end 38 | -------------------------------------------------------------------------------- /Examples/Examples/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Examples 4 | // 5 | // Created by Tim Moose on 2/11/14. 6 | // Copyright (c) 2014 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // 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. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/UITableView+ScrollOptimizer.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+ScrollOptimizer.h 3 | // TLIndexPathTools 4 | // 5 | // Created by Tim Moose on 4/17/14. 6 | // Copyright (c) 2014 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSInteger, TLTableViewScrollOptions) { 12 | TLTableViewScrollOptionsNone = 0, 13 | /** 14 | Include the section headers of the given `indexPaths when in calculating the 15 | optimal `contentOffset`. 16 | */ 17 | TLTableViewScrollOptionsIncludeHeaderViews = 1 << 0, 18 | /** 19 | Include the section footers of the given `indexPaths when in calculating the 20 | optimal `contentOffset`. 21 | */ 22 | TLTableViewScrollOptionsIncludeFooterViews = 1 << 1, 23 | }; 24 | 25 | @interface UITableView (ScrollOptimizer) 26 | 27 | /** 28 | Optimize the scroll postion to ensure as many rows of the given section as 29 | possible are visible. 30 | */ 31 | - (void)optimizeScrollPositionForSection:(NSInteger)section 32 | options:(TLTableViewScrollOptions)options 33 | topInset:(CGFloat)topInset 34 | animated:(BOOL)animated; 35 | - (void)optimizeScrollPositionForSection:(NSInteger)section 36 | options:(TLTableViewScrollOptions)options 37 | animated:(BOOL)animated __attribute__ ((deprecated("added a topInset option"))); 38 | 39 | /** 40 | Optimize the scroll postion to ensure as many rows of the given index 41 | paths are visible. 42 | */ 43 | - (void)optimizeScrollPositionForIndexPaths:(NSArray *)indexPaths 44 | options:(TLTableViewScrollOptions)options 45 | topInset:(CGFloat)topInset 46 | animated:(BOOL)animated; 47 | - (void)optimizeScrollPositionForIndexPaths:(NSArray *)indexPaths 48 | options:(TLTableViewScrollOptions)options 49 | animated:(BOOL)animated __attribute__ ((deprecated("added a topInset option"))); 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Examples/Pods/Local Podspecs/TLLayoutTransitioning.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TLLayoutTransitioning", 3 | "version": "1.0.8", 4 | "summary": "Enhanced transitioning between UICollectionView layouts in iOS.", 5 | "description": " TLLayoutTransitioning provides a `TLLayoutTransition` transition layout subclass and a `UICollectionView+TLTransitioning` category that combine to solve a few problems with collection view layout transitioning:\n\n 1. `UICollectionViewLayoutTransition` does not handle content offset well, often leaving cells where you don't want them. `TLTransitionLayout` provides elegant control of content offset with Minimal, Visible, Center, Top, Left, Bottom or Right placement options relative to one or more index paths.\n\n 2. `UICollectionViewLayoutTransition` does not support supplementary views. `TLTransitionLayout` provides support for any supplementary view kinds specified in the initializer.\n\n 3. `-[UICollectionView setCollectionViewLayout:animated:completion]` has [serious known bugs][3] in iOS7 and does not provide any animation options. TLLayoutTransitioning provides a robust alternative to this API with support for animation duration, 30+ easing curves and content offset control. This is done by using `CADisplayLink` to drive an interactive `TLTransitionLayout` as a non-interactive animation.\n\n Check out the demos in the Examples workspace!\n \n Changes in 1.0.8\n * Fix #23 \"Exception during pinch gesture handling\"\n", 6 | "homepage": "https://github.com/wtmoose/TLLayoutTransitioning", 7 | "license": { 8 | "type": "MIT" 9 | }, 10 | "authors": { 11 | "wtmoose": "wtm@tractablelabs.com" 12 | }, 13 | "source": { 14 | "git": "https://github.com/wtmoose/TLLayoutTransitioning.git", 15 | "tag": "1.0.8" 16 | }, 17 | "platforms": { 18 | "ios": "7.0" 19 | }, 20 | "source_files": "TLLayoutTransitioning/**/*.{h,m,c}", 21 | "dependencies": { 22 | "AHEasing": [ 23 | 24 | ] 25 | }, 26 | "frameworks": [ 27 | "UIKit", 28 | "QuartzCore", 29 | "Foundation" 30 | ], 31 | "requires_arc": true 32 | } 33 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/Tree/TLIndexPathTreeItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // TLIndexPathTreeItem.m 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "TLIndexPathTreeItem.h" 25 | 26 | @implementation TLIndexPathTreeItem 27 | 28 | - (instancetype)initWithIdentifier:(id)identifier sectionName:(NSString *)sectionName 29 | cellIdentifier:(NSString *)cellIdentifier 30 | data:(id)data 31 | andChildItems:(NSArray *)childItems 32 | { 33 | if (self = [super initWithIdentifier:identifier sectionName:sectionName cellIdentifier:cellIdentifier data:data]) { 34 | _childItems = childItems; 35 | } 36 | return self; 37 | } 38 | 39 | - (TLIndexPathTreeItem *)copyWithChildren:(NSArray *)children 40 | { 41 | TLIndexPathTreeItem *copy = [[TLIndexPathTreeItem alloc] initWithIdentifier:self.identifier sectionName:self.sectionName cellIdentifier:self.cellIdentifier data:self.data andChildItems:children]; 42 | return copy; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /TLLayoutTransitioning.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "TLLayoutTransitioning" 3 | s.version = "1.0.10" 4 | s.summary = "Enhanced transitioning between UICollectionView layouts in iOS." 5 | s.description = <<-DESC 6 | TLLayoutTransitioning provides a `TLLayoutTransition` transition layout subclass and a `UICollectionView+TLTransitioning` category that combine to solve a few problems with collection view layout transitioning: 7 | 8 | 1. `UICollectionViewLayoutTransition` does not handle content offset well, often leaving cells where you don't want them. `TLTransitionLayout` provides elegant control of content offset with Minimal, Visible, Center, Top, Left, Bottom or Right placement options relative to one or more index paths. 9 | 10 | 2. `UICollectionViewLayoutTransition` does not support supplementary views. `TLTransitionLayout` provides support for any supplementary view kinds specified in the initializer. 11 | 12 | 3. `-[UICollectionView setCollectionViewLayout:animated:completion]` has [serious known bugs][3] in iOS7 and does not provide any animation options. TLLayoutTransitioning provides a robust alternative to this API with support for animation duration, 30+ easing curves and content offset control. This is done by using `CADisplayLink` to drive an interactive `TLTransitionLayout` as a non-interactive animation. 13 | 14 | Check out the demos in the Examples workspace! 15 | 16 | Changes in 1.0.10 17 | * Move c function declarations out of interface to make Swift happy 18 | DESC 19 | s.homepage = "https://github.com/wtmoose/TLLayoutTransitioning" 20 | s.license = { :type => "MIT" } 21 | s.author = { "wtmoose" => "wtm@tractablelabs.com" } 22 | s.source = { :git => "https://github.com/wtmoose/TLLayoutTransitioning.git", :tag => '1.0.10' } 23 | s.platform = :ios, '7.0' 24 | s.ios.deployment_target = '7.0' 25 | s.source_files = 'TLLayoutTransitioning/**/*.{h,m,c}' 26 | s.dependency 'AHEasing' 27 | s.frameworks = 'UIKit', 'QuartzCore', 'Foundation' 28 | s.requires_arc = true 29 | end 30 | -------------------------------------------------------------------------------- /Examples/Pods/AHEasing/AHEasing/CAKeyframeAnimation+AHEasing.h: -------------------------------------------------------------------------------- 1 | // 2 | // CAKeyframeAnimation+AHEasing.h 3 | // 4 | // Copyright (c) 2011, Auerhaus Development, LLC 5 | // 6 | // This program is free software. It comes without any warranty, to 7 | // the extent permitted by applicable law. You can redistribute it 8 | // and/or modify it under the terms of the Do What The Fuck You Want 9 | // To Public License, Version 2, as published by Sam Hocevar. See 10 | // http://sam.zoy.org/wtfpl/COPYING for more details. 11 | // 12 | 13 | #import 14 | #include "easing.h" 15 | 16 | @interface CAKeyframeAnimation (AHEasing) 17 | 18 | // Factory method to create a keyframe animation for animating a scalar value 19 | + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromValue:(CGFloat)fromValue toValue:(CGFloat)toValue keyframeCount:(size_t)keyframeCount; 20 | 21 | // Factory method to create a keyframe animation for animating a scalar value, with keyFrameCount set to AHEasingDefaultKeyframeCount 22 | + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromValue:(CGFloat)fromValue toValue:(CGFloat)toValue; 23 | 24 | // Factory method to create a keyframe animation for animating between two points 25 | + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint keyframeCount:(size_t)keyframeCount; 26 | 27 | // Factory method to create a keyframe animation for animating between two points, with keyFrameCount set to AHEasingDefaultKeyframeCount 28 | + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromPoint:(CGPoint)fromValue toPoint:(CGPoint)toValue; 29 | 30 | // Factory method to create a keyframe animation for animating between two sizes 31 | + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromSize:(CGSize)fromSize toSize:(CGSize)toSize keyframeCount:(size_t)keyframeCount; 32 | 33 | // Factory method to create a keyframe animation for animating between two sizes, with keyFrameCount set to AHEasingDefaultKeyframeCount 34 | + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromSize:(CGSize)fromValue toSize:(CGSize)toValue; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathSectionInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLIndexPathSectionInfo.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | #import 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | /** 30 | An implementation of the `NSFetchedResultsSectionInfo` protocol. `TLIndexPathDataModel` 31 | uses this class to organize data into sections. You can also explicitly create these 32 | objects (including empty ones) and use them to create a data model with the 33 | [TLIndexPathDataModel initWithSectionInfos:identifierKeyPath:] initializer. 34 | */ 35 | 36 | @interface TLIndexPathSectionInfo : NSObject 37 | @property (nonatomic, readonly, nullable) NSString *name; 38 | @property (nonatomic, readonly, nullable) NSString *indexTitle; 39 | @property (nonatomic, readonly) NSUInteger numberOfObjects; 40 | @property (nonatomic, readonly) NSArray *objects; 41 | - (instancetype)initWithItems:(NSArray *)items name:(NSString * __nullable)name; 42 | - (instancetype)initWithItems:(NSArray *)items name:(NSString * __nullable)name indexTitle:(NSString * __nullable)indexTitle; 43 | @end 44 | 45 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/No Results/TLNoResultsTableDataModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // TLNoResultsTableDataModel.m 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "TLNoResultsTableDataModel.h" 25 | #import "TLIndexPathItem.h" 26 | 27 | @implementation TLNoResultsTableDataModel 28 | 29 | - (id)initWithRows:(NSInteger)rows blankCellId:(NSString *)blankCellId noResultsCellId:(NSString *)noResultsCellId noResultsText:(NSString *)noResultsText 30 | { 31 | rows = MAX(rows, 1); 32 | NSMutableArray *items = [[NSMutableArray alloc] initWithCapacity:rows]; 33 | for (NSInteger i = 0; i < rows; i++) { 34 | NSString *identifier = [NSString stringWithFormat:@"%d", (int)i]; 35 | if (i == rows-1) { 36 | TLIndexPathItem *item = [[TLIndexPathItem alloc] initWithIdentifier:identifier sectionName:nil cellIdentifier:noResultsCellId data:noResultsText]; 37 | [items addObject:item]; 38 | } else { 39 | TLIndexPathItem *item = [[TLIndexPathItem alloc] initWithIdentifier:identifier sectionName:nil cellIdentifier:blankCellId data:nil]; 40 | [items addObject:item]; 41 | } 42 | } 43 | return [self initWithItems:items]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Examples/Pods/AHEasing/AHEasing/easing.h: -------------------------------------------------------------------------------- 1 | // 2 | // easing.h 3 | // 4 | // Copyright (c) 2011, Auerhaus Development, LLC 5 | // 6 | // This program is free software. It comes without any warranty, to 7 | // the extent permitted by applicable law. You can redistribute it 8 | // and/or modify it under the terms of the Do What The Fuck You Want 9 | // To Public License, Version 2, as published by Sam Hocevar. See 10 | // http://sam.zoy.org/wtfpl/COPYING for more details. 11 | // 12 | 13 | #ifndef AH_EASING_H 14 | #define AH_EASING_H 15 | 16 | #if defined(__LP64__) && !defined(AH_EASING_USE_DBL_PRECIS) 17 | #define AH_EASING_USE_DBL_PRECIS 18 | #endif 19 | 20 | #ifdef AH_EASING_USE_DBL_PRECIS 21 | #define AHFloat double 22 | #else 23 | #define AHFloat float 24 | #endif 25 | 26 | typedef AHFloat (*AHEasingFunction)(AHFloat); 27 | 28 | // Linear interpolation (no easing) 29 | AHFloat LinearInterpolation(AHFloat p); 30 | 31 | // Quadratic easing; p^2 32 | AHFloat QuadraticEaseIn(AHFloat p); 33 | AHFloat QuadraticEaseOut(AHFloat p); 34 | AHFloat QuadraticEaseInOut(AHFloat p); 35 | 36 | // Cubic easing; p^3 37 | AHFloat CubicEaseIn(AHFloat p); 38 | AHFloat CubicEaseOut(AHFloat p); 39 | AHFloat CubicEaseInOut(AHFloat p); 40 | 41 | // Quartic easing; p^4 42 | AHFloat QuarticEaseIn(AHFloat p); 43 | AHFloat QuarticEaseOut(AHFloat p); 44 | AHFloat QuarticEaseInOut(AHFloat p); 45 | 46 | // Quintic easing; p^5 47 | AHFloat QuinticEaseIn(AHFloat p); 48 | AHFloat QuinticEaseOut(AHFloat p); 49 | AHFloat QuinticEaseInOut(AHFloat p); 50 | 51 | // Sine wave easing; sin(p * PI/2) 52 | AHFloat SineEaseIn(AHFloat p); 53 | AHFloat SineEaseOut(AHFloat p); 54 | AHFloat SineEaseInOut(AHFloat p); 55 | 56 | // Circular easing; sqrt(1 - p^2) 57 | AHFloat CircularEaseIn(AHFloat p); 58 | AHFloat CircularEaseOut(AHFloat p); 59 | AHFloat CircularEaseInOut(AHFloat p); 60 | 61 | // Exponential easing, base 2 62 | AHFloat ExponentialEaseIn(AHFloat p); 63 | AHFloat ExponentialEaseOut(AHFloat p); 64 | AHFloat ExponentialEaseInOut(AHFloat p); 65 | 66 | // Exponentially-damped sine wave easing 67 | AHFloat ElasticEaseIn(AHFloat p); 68 | AHFloat ElasticEaseOut(AHFloat p); 69 | AHFloat ElasticEaseInOut(AHFloat p); 70 | 71 | // Overshooting cubic easing; 72 | AHFloat BackEaseIn(AHFloat p); 73 | AHFloat BackEaseOut(AHFloat p); 74 | AHFloat BackEaseInOut(AHFloat p); 75 | 76 | // Exponentially-decaying bounce easing 77 | AHFloat BounceEaseIn(AHFloat p); 78 | AHFloat BounceEaseOut(AHFloat p); 79 | AHFloat BounceEaseInOut(AHFloat p); 80 | 81 | #endif -------------------------------------------------------------------------------- /Examples/Examples/SelectorTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Examples 4 | // 5 | // Created by Tim Moose on 2/11/14. 6 | // Copyright (c) 2014 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import "SelectorTableViewController.h" 10 | #import 11 | 12 | @implementation SelectorTableViewController 13 | 14 | - (void)viewDidLoad 15 | { 16 | [super viewDidLoad]; 17 | 18 | TLIndexPathItem *resizeItem = [[TLIndexPathItem alloc] initWithIdentifier:@"Resize" 19 | sectionName:nil 20 | cellIdentifier:nil 21 | data:@"Animated, non-interactive transitioning between layouts with duration, easing curves and content offset control. A better alternative to setCollectionViewLayout. Also demonstrates the use of the progressChanged callback to scale the font size."]; 22 | 23 | TLIndexPathItem *pinchItem = [[TLIndexPathItem alloc] initWithIdentifier:@"Pinch" 24 | sectionName:nil 25 | cellIdentifier:nil 26 | data:@"Simple interactive pinch transition with content offset control."]; 27 | self.indexPathController.items = @[resizeItem, pinchItem]; 28 | } 29 | 30 | - (void)viewWillAppear:(BOOL)animated 31 | { 32 | [super viewWillAppear:animated]; 33 | [self performSegueWithIdentifier:@"MainDetail" sender:self]; 34 | } 35 | 36 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 37 | { 38 | UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; 39 | TLIndexPathItem *item = [self.indexPathController.dataModel itemAtIndexPath:indexPath]; 40 | UILabel *textLabel = (UILabel *)[cell viewWithTag:1]; 41 | UILabel *detailLabel = (UILabel *)[cell viewWithTag:2]; 42 | textLabel.text = item.identifier; 43 | detailLabel.text = item.data; 44 | return cell; 45 | } 46 | 47 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 48 | { 49 | NSString *identifier = [self.indexPathController.dataModel identifierAtIndexPath:indexPath]; 50 | [self performSegueWithIdentifier:identifier sender:self]; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/View Controllers/TLDynamicSizeView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLDynamicSizeView.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | /** 25 | Table view cells that implement this protocol will have their dynamic heights 26 | calculated automatically by `TLTableViewController` in its 27 | `heightForRow:atIndexPath` implementation. 28 | 29 | With Auto Layout, the protocol should only be used as a marker to tell 30 | `TLTableViewController` to calculate the dynamic height. The `sizeWithData` 31 | method should not be implemented. In the `TLTableViewController` subclass, 32 | cell configuration should be one in `tableView:configureCell:atIndexPath:` 33 | because the `heightForRow:atIndexPath` implementation needs to configure 34 | a prototype instance before calculating the height. See the Dynamic Height 35 | example project. 36 | 37 | If Auto Layout is not being used, the `sizeWithData` method should be implemented. 38 | */ 39 | 40 | #import 41 | 42 | @protocol TLDynamicSizeView 43 | @optional 44 | /** 45 | Returns the computed size of the view for the given data. This method only needs 46 | to be implemented when Auto Layout is not being used. 47 | 48 | @param data data that affects the view's size 49 | @return the computed size of the view 50 | */ 51 | - (CGSize) sizeWithData:(id)data; 52 | @end 53 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/Collapsible/TLCollapsibleTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLCollapsibleTableViewController.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "TLTableViewController.h" 25 | #import "TLCollapsibleDataModel.h" 26 | #import "TLCollapsibleHeaderView.h" 27 | 28 | @class TLCollapsibleTableViewController; 29 | 30 | @protocol TLCollapsibleTableViewControllerDelegate 31 | @optional 32 | - (void)controller:(TLCollapsibleTableViewController *)controller didChangeSection:(NSInteger)section collapsed:(BOOL)collapsed; 33 | @end 34 | 35 | @interface TLCollapsibleTableViewController : TLTableViewController 36 | 37 | @property (weak, nonatomic) iddelegate; 38 | 39 | /** 40 | A type-safe shortcut for getting and setting the collapsible data model on the 41 | underlying index path controller. 42 | */ 43 | @property (strong, nonatomic) TLCollapsibleDataModel *dataModel; 44 | 45 | /** 46 | If YES, exanding a section collapses all other sections. The default value of NO 47 | is recommended for better overall usability. 48 | */ 49 | @property (nonatomic) BOOL singleExpandedSection; 50 | 51 | /** 52 | If YES, expanding a section scrolls the table view to display as many rows in the 53 | section as possible. Defaults to YES. 54 | */ 55 | @property (nonatomic) BOOL optimizeScrollOnExpand; 56 | 57 | /** 58 | */ 59 | - (void)configureHeaderView:(TLCollapsibleHeaderView *)headerView forSection:(NSInteger)section; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods/Pods-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | local source="${BUILT_PRODUCTS_DIR}/Pods/$1" 12 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | 14 | if [ -L "${source}" ]; then 15 | echo "Symlinked..." 16 | source=$(readlink "${source}") 17 | fi 18 | 19 | # use filter instead of exclude so missing patterns dont' throw errors 20 | echo "rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" ${source} ${destination}" 21 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" "${source}" "${destination}" 22 | # Resign the code if required by the build settings to avoid unstable apps 23 | if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then 24 | code_sign "${destination}/$1" 25 | fi 26 | 27 | # Embed linked Swift runtime libraries 28 | local basename 29 | basename=$(echo $1 | sed -E s/\\..+// && exit ${PIPESTATUS[0]}) 30 | local swift_runtime_libs 31 | swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/$1/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 32 | for lib in $swift_runtime_libs; do 33 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 34 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 35 | if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then 36 | code_sign "${destination}/${lib}" 37 | fi 38 | done 39 | } 40 | 41 | # Signs a framework with the provided identity 42 | code_sign() { 43 | # Use the current code_sign_identitiy 44 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 45 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1" 46 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 47 | } 48 | 49 | 50 | if [[ "$CONFIGURATION" == "Debug" ]]; then 51 | install_framework 'AHEasing.framework' 52 | install_framework 'TLIndexPathTools.framework' 53 | install_framework 'TLLayoutTransitioning.framework' 54 | fi 55 | if [[ "$CONFIGURATION" == "Release" ]]; then 56 | install_framework 'AHEasing.framework' 57 | install_framework 'TLIndexPathTools.framework' 58 | install_framework 'TLLayoutTransitioning.framework' 59 | fi 60 | -------------------------------------------------------------------------------- /TLLayoutTransitioning.xcodeproj/xcshareddata/xcschemes/TLLayoutTransitioning.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 60 | 61 | 63 | 64 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/Tree/TLTreeDataModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLTreeDataModel.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | /** 25 | A data model representing a heirarchy of `TLIndexPathTreeItem` nodes in a given 26 | collapsed stated. This class must be initialized by using one of the two initializers 27 | defined here, providing either an array of top level `TLIndexPathTreeItem` nodes 28 | or an array of `TLIndexPathSectionInfos` containing top level nodes (particularly 29 | if empty sections are needed) and the current set of collapsed node identifiers. 30 | 31 | These initializers flatten the heirarchy into the array of items to be displayed 32 | in the table. This flattened data is passed up to the `TLIndexPathDataModel` 33 | initializer and, thus, the basic data model APIs reflect only the flattened data 34 | to be displayed. The full data heirarchy is retained in the `treeItems` 35 | and `treeItemSections` properties. 36 | 37 | This data model can be plugged into a `TLTableViewController`, but 38 | one should normally use `TLTreeTableViewController` because it contains the 39 | additional logic to automatically update the data model as rows are expanded 40 | and collapsed. It also provides a mechanism to lazy load nodes. 41 | */ 42 | 43 | #import "TLIndexPathDataModel.h" 44 | 45 | @interface TLTreeDataModel : TLIndexPathDataModel 46 | @property (copy, nonatomic, readonly) NSArray *collapsedNodeIdentifiers; 47 | @property (copy, nonatomic, readonly) NSArray *treeItems; 48 | @property (copy, nonatomic, readonly) NSArray *treeItemSections; 49 | - (instancetype)initWithTreeItems:(NSArray *)treeItems collapsedNodeIdentifiers:(NSArray *)collapsedNodeIdentifiers; 50 | - (instancetype)initWithTreeItemSections:(NSArray *)treeItemSections collapsedNodeIdentifiers:(NSArray *)collapsedNodeIdentifiers; 51 | @end 52 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AHEasing 5 | 6 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 7 | Version 2, December 2004 8 | 9 | Copyright (C) 2004 Sam Hocevar 10 | 14 rue de Plaisance, 75014 Paris, France 11 | Everyone is permitted to copy and distribute verbatim or modified 12 | copies of this license document, and changing it is allowed as long 13 | as the name is changed. 14 | 15 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 16 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 17 | 18 | 0. You just DO WHAT THE FUCK YOU WANT TO. 19 | 20 | ## TLIndexPathTools 21 | 22 | Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 23 | 24 | Permission is hereby granted, free of charge, to any person obtaining a copy 25 | of this software and associated documentation files (the "Software"), to deal 26 | in the Software without restriction, including without limitation the rights 27 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 28 | copies of the Software, and to permit persons to whom the Software is 29 | furnished to do so, subject to the following conditions: 30 | 31 | The above copyright notice and this permission notice shall be included in 32 | all copies or substantial portions of the Software. 33 | 34 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 39 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 40 | THE SOFTWARE. 41 | 42 | ## TLLayoutTransitioning 43 | 44 | The MIT License (MIT) 45 | 46 | Copyright (c) 2013 wtmoose 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a copy of 49 | this software and associated documentation files (the "Software"), to deal in 50 | the Software without restriction, including without limitation the rights to 51 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 52 | the Software, and to permit persons to whom the Software is furnished to do so, 53 | subject to the following conditions: 54 | 55 | The above copyright notice and this permission notice shall be included in all 56 | copies or substantial portions of the Software. 57 | 58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 60 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 61 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 62 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 63 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 64 | 65 | Generated by CocoaPods - http://cocoapods.org 66 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLIndexPathItem.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | /** 25 | A data item wrapper class that provides identifier and section name properties. 26 | TLIndexPathTools knows about and will use these properties automatically as specified 27 | in the `TLIndexPathDataModel` identifier and section name rules. This means the more 28 | verbose `[TLIndexPathTools initWithItems:sectionNameKeyPath:identifierKeyPath]` 29 | initializer is unneccessary. Use the [TLIndexPathTools initWithItems:] initializer. 30 | 31 | This class also provides a `cellIdentifier` property. If this property is set, 32 | `TLTableViewController` and `TLCollectionViewController` automatically use this 33 | value as the reuse identifier when dequeing cells. 34 | 35 | This class can be useful for settings-type views where there are multiple cell 36 | prototypes, heterogeneous data and sections. 37 | */ 38 | 39 | #import 40 | 41 | NS_ASSUME_NONNULL_BEGIN 42 | 43 | @interface TLIndexPathItem : NSObject 44 | @property (strong, nonatomic) id identifier; 45 | @property (strong, nonatomic, nullable) NSString *sectionName; 46 | @property (strong, nonatomic, nullable) NSString *cellIdentifier; 47 | @property (strong, nonatomic, nullable) id data; 48 | 49 | /** 50 | Returns YES if the item should be considered modified if the data is modified. 51 | This affects whether or not the corresponding cell is reloaded in a batch update. 52 | Specifically, if the value is YES, the `hash` and `isEqual` methods take into 53 | account the value of `data`. The default value is NO. 54 | */ 55 | @property (nonatomic) BOOL shouldCompareData; 56 | 57 | - (id)initWithIdentifier:(id)identifier sectionName:(NSString * __nullable)sectionName cellIdentifier:(NSString * __nullable)cellIdentifier data:(id __nullable)data; 58 | 59 | /** 60 | Prefixes "data." to the given keyPath. 61 | */ 62 | + (NSString *)keyPathForDataKeyPath:(NSString *)dataKeyPath; 63 | 64 | /** 65 | Returns the array of identifiers for the given `NSIndexPathItems` 66 | */ 67 | + (NSArray *)identifiersForIndexPathItems:(NSArray *)indexPathItems; 68 | 69 | @end 70 | 71 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/UITableView+ScrollOptimizer.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+ScrollOptimizer.m 3 | // TLIndexPathTools 4 | // 5 | // Created by Tim Moose on 4/17/14. 6 | // Copyright (c) 2014 Tractable Labs. All rights reserved. 7 | // 8 | 9 | #import "UITableView+ScrollOptimizer.h" 10 | 11 | @implementation UITableView (ScrollOptimizer) 12 | 13 | - (void)optimizeScrollPositionForSection:(NSInteger)section options:(TLTableViewScrollOptions)options animated:(BOOL)animated 14 | { 15 | [self optimizeScrollPositionForSection:section options:options topInset:0 animated:animated]; 16 | } 17 | 18 | - (void)optimizeScrollPositionForSection:(NSInteger)section options:(TLTableViewScrollOptions)options topInset:(CGFloat)topInset animated:(BOOL)animated 19 | { 20 | NSIndexPath *firstIndexPath = [NSIndexPath indexPathForRow:0 inSection:section]; 21 | NSIndexPath *lastIndexPath = [NSIndexPath indexPathForRow:[self.dataSource tableView:self numberOfRowsInSection:section] - 1 inSection:section]; 22 | [self optimizeScrollPositionForIndexPaths:@[firstIndexPath, lastIndexPath] options:options topInset:topInset animated:animated]; 23 | } 24 | 25 | - (void)optimizeScrollPositionForIndexPaths:(NSArray *)indexPaths options:(TLTableViewScrollOptions)options animated:(BOOL)animated 26 | { 27 | [self optimizeScrollPositionForIndexPaths:indexPaths options:options topInset:0 animated:animated]; 28 | } 29 | 30 | - (void)optimizeScrollPositionForIndexPaths:(NSArray *)indexPaths options:(TLTableViewScrollOptions)options topInset:(CGFloat)topInset animated:(BOOL)animated 31 | { 32 | [self layoutIfNeeded]; 33 | CGRect rect = CGRectNull; 34 | NSInteger section = -1; 35 | for (NSIndexPath *indexPath in indexPaths) { 36 | if (indexPath.section != section) { 37 | section = indexPath.section; 38 | if (options & TLTableViewScrollOptionsIncludeHeaderViews) { 39 | CGRect headerFrame = [self rectForHeaderInSection:section]; 40 | rect = CGRectUnion(rect, headerFrame); 41 | } 42 | if (options & TLTableViewScrollOptionsIncludeFooterViews) { 43 | CGRect footerFrame = [self rectForFooterInSection:section]; 44 | rect = CGRectUnion(rect, footerFrame); 45 | } 46 | } 47 | CGRect indexPathFrame = [self rectForRowAtIndexPath:indexPath]; 48 | rect = CGRectUnion(rect, indexPathFrame); 49 | } 50 | CGFloat maxY = CGRectGetMaxY(rect); 51 | CGSize contentSize = self.contentSize; 52 | if (maxY > contentSize.height) { 53 | // the situation where the max calculated Y value of the given index paths 54 | // is greater than the content size occurs during batch updates when the 55 | // table hasn't yet recalculated content size. Modifying the content size 56 | // allows `scrollRectToVisible` to work and the value gets overridden later 57 | // by the table with the official value. 58 | contentSize.height = maxY; 59 | self.contentSize = contentSize; 60 | } 61 | // truncate the height of the positioning rect if it's greater than the 62 | // table view's height because we want to ensure the top cells are visible. 63 | rect.size.height = MIN(self.bounds.size.height - topInset, rect.size.height); 64 | [self scrollRectToVisible:rect animated:animated]; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // TLIndexPathItem.m 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "TLIndexPathItem.h" 25 | 26 | @implementation TLIndexPathItem 27 | 28 | - (id)initWithIdentifier:(id)identifier sectionName:(NSString *)sectionName cellIdentifier:(NSString *)cellIdentifier data:(id)data 29 | { 30 | if (self = [super init]) { 31 | _identifier = identifier; 32 | _sectionName = sectionName; 33 | _cellIdentifier = cellIdentifier; 34 | _data = data; 35 | } 36 | return self; 37 | } 38 | 39 | + (NSString *)keyPathForDataKeyPath:(NSString *)dataKeyPath 40 | { 41 | return [NSString stringWithFormat:@"data.%@", dataKeyPath]; 42 | } 43 | 44 | + (NSArray *)identifiersForIndexPathItems:(NSArray *)indexPathItems 45 | { 46 | NSArray *identifiers = [indexPathItems valueForKeyPath:@"@distinctUnionOfObjects.identifier"]; 47 | return identifiers; 48 | } 49 | 50 | - (NSUInteger)hash 51 | { 52 | NSInteger hash = 0; 53 | hash += 31 * hash + [self.identifier hash]; 54 | hash += 31 * hash + [self.sectionName hash]; 55 | hash += 31 * hash + [self.cellIdentifier hash]; 56 | if (self.shouldCompareData) { 57 | hash += 31 * hash + [self.data hash]; 58 | } 59 | return hash; 60 | } 61 | 62 | - (BOOL)isEqual:(id)object 63 | { 64 | if (self == object) return YES; 65 | if (object == nil) return NO; 66 | if (![object isKindOfClass:[TLIndexPathItem class]]) return NO; 67 | TLIndexPathItem *other = (TLIndexPathItem *)object; 68 | if (![TLIndexPathItem nilSafeObject:self.identifier isEqual:other.identifier]) return NO; 69 | if (![TLIndexPathItem nilSafeObject:self.sectionName isEqual:other.sectionName]) return NO; 70 | if (![TLIndexPathItem nilSafeObject:self.cellIdentifier isEqual:other.cellIdentifier]) return NO; 71 | if (self.shouldCompareData) { 72 | if (![TLIndexPathItem nilSafeObject:self.data isEqual:other.data]) return NO; 73 | } 74 | return YES; 75 | } 76 | 77 | - (NSString *)description 78 | { 79 | return [NSString stringWithFormat:@"sectionName=%@, identifier=%@", self.sectionName, self.identifier]; 80 | } 81 | 82 | + (BOOL) nilSafeObject:(NSObject *)object isEqual:(NSObject *)other 83 | { 84 | if (object == nil && other == nil) return YES; 85 | if (object == nil || other == nil) return NO; 86 | return [object isEqual:other]; 87 | } 88 | 89 | - (id)valueForUndefinedKey:(NSString *)key 90 | { 91 | // return nil instead of the default behavior of throwing an exception so that 92 | // items of this type can be mixed into data models that use an `identifierKeyPath`. 93 | return nil; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/Tree/TLTreeDataModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // TLTreeDataModel.m 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "TLTreeDataModel.h" 25 | #import "TLIndexPathTreeItem.h" 26 | #import "TLIndexPathSectionInfo.h" 27 | 28 | @implementation TLTreeDataModel 29 | 30 | - (instancetype)initWithTreeItems:(NSArray *)treeItems collapsedNodeIdentifiers:(NSArray *)collapsedNodeIdentifiers 31 | { 32 | // let `TLIndexPathDataModel` organize the tree items into sections and then 33 | // use the section-based inititializer 34 | TLIndexPathDataModel *tempDataModel = [[TLIndexPathDataModel alloc] initWithItems:treeItems]; 35 | return [self initWithTreeItemSections:tempDataModel.sections collapsedNodeIdentifiers:collapsedNodeIdentifiers]; 36 | } 37 | 38 | - (instancetype)initWithTreeItemSections:(NSArray *)treeItemSections collapsedNodeIdentifiers:(NSArray *)collapsedNodeIdentifiers 39 | { 40 | NSMutableArray *treeItems = [NSMutableArray array]; 41 | NSMutableArray *sections = [NSMutableArray arrayWithCapacity:[treeItemSections count]]; 42 | for (idtreeItemSection in treeItemSections) { 43 | [treeItems addObjectsFromArray:[treeItemSection objects]]; 44 | NSMutableArray *items = [NSMutableArray array]; 45 | for (TLIndexPathTreeItem *item in [treeItemSection objects]) { 46 | [self flattenTreeItem:item intoArray:items withCollapsedNodeIdentifiers:collapsedNodeIdentifiers]; 47 | } 48 | TLIndexPathSectionInfo *section = [[TLIndexPathSectionInfo alloc] initWithItems:items 49 | name:treeItemSection.name 50 | indexTitle:treeItemSection.indexTitle]; 51 | [sections addObject:section]; 52 | } 53 | if (self = [super initWithSectionInfos:sections identifierKeyPath:nil]) { 54 | _treeItems = treeItems; 55 | _treeItemSections = treeItemSections; 56 | _collapsedNodeIdentifiers = collapsedNodeIdentifiers; 57 | } 58 | return self; 59 | } 60 | 61 | - (void)flattenTreeItem:(TLIndexPathTreeItem *)item intoArray:(NSMutableArray *)items withCollapsedNodeIdentifiers:(NSArray *)collapsedNodeIdentifiers 62 | { 63 | if (item) { 64 | [items addObject:item]; 65 | if (![collapsedNodeIdentifiers containsObject:item.identifier]) { 66 | for (TLIndexPathTreeItem *childItem in item.childItems) { 67 | [self flattenTreeItem:childItem intoArray:items withCollapsedNodeIdentifiers:collapsedNodeIdentifiers]; 68 | } 69 | } 70 | } 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/Tree/TLTreeTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLTreeTableViewController.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "TLTableViewController.h" 25 | #import "TLTreeDataModel.h" 26 | #import "TLIndexPathTreeItem.h" 27 | 28 | /** 29 | Basic view controller implementation for `TLTreeDataModel` with support for expanding 30 | and collapsing rows. Also supports lazy loading child items. The controller treats 31 | a `TLIndexPathTreeItem` with `childItems == nil` as a leaf node and will not attempt 32 | to expand or collapse the item. So for items that will have lazy loaded children, 33 | the child items should be set to an empty array. 34 | */ 35 | 36 | @class TLTreeTableViewController; 37 | 38 | @protocol TLTreeTableViewControllerDelegate 39 | @optional 40 | 41 | /** 42 | Gives the delegate an opportunity to decide if a node should be expanded or collapsed when selected. 43 | */ 44 | - (BOOL)controller:(TLTreeTableViewController *)controller shouldChangeNode:(TLIndexPathTreeItem *)treeItem collapsed:(BOOL)collapsed; 45 | 46 | /** 47 | Gives the delegate an opportunity to make changes before the node is expanded. 48 | This can be used to lazy load child items on expand or prune child items on collapse 49 | with a call to `setNewVersionOfItem:collapsedChildNodeIdentifiers`. 50 | 51 | If the app needs to load child nodes asynchronously, this method should be used to initiate 52 | the fetch and then call `setNewVersionOfItem:collapsedChildNodeIdentifiers` in the 53 | completion handler of the fetch. 54 | */ 55 | - (void)controller:(TLTreeTableViewController *)controller willChangeNode:(TLIndexPathTreeItem *)treeItem collapsed:(BOOL)collapsed; 56 | 57 | /** 58 | Called after a node is expanded or collapsed so the delegate can make any needed updates, 59 | such as toggling an expand/collapse icon. 60 | */ 61 | - (void)controller:(TLTreeTableViewController *)controller didChangeNode:(TLIndexPathTreeItem *)treeItem collapsed:(BOOL)collapsed; 62 | 63 | @end 64 | 65 | @interface TLTreeTableViewController : TLTableViewController 66 | 67 | @property (weak, nonatomic) iddelegate; 68 | 69 | /** 70 | Replaces an existing item with a new version. If there is no item in the existing 71 | tree with a matching identifier, no change is made. Use this method to lazy load child 72 | nodes asynchrnously when a node is expanded. 73 | */ 74 | - (void)setNewVersionOfItem:(TLIndexPathTreeItem *)item collapsedChildNodeIdentifiers:(NSArray *)collapsedChildNodeIdentifiers optimizeScroll:(BOOL)optimizeScroll; 75 | - (void)setNewVersionOfItem:(TLIndexPathTreeItem *)item collapsedChildNodeIdentifiers:(NSArray *)collapsedChildNodeIdentifiers DEPRECATED_ATTRIBUTE; 76 | 77 | /** 78 | A type-safe shortcut for getting and setting the tree data model on the 79 | underlying index path controller. 80 | */ 81 | @property (strong, nonatomic) TLTreeDataModel *dataModel; 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/Collapsible/TLCollapsibleDataModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // TLCollapsibleDataModel.m 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "TLCollapsibleDataModel.h" 25 | #import "TLIndexPathSectionInfo.h" 26 | 27 | @implementation TLCollapsibleDataModel 28 | 29 | #pragma mark - Initialization 30 | 31 | - (id)initWithBackingDataModel:(TLIndexPathDataModel *)backingDataModel collapsedSectionNames:(NSSet *)collapsedSectionNames 32 | { 33 | NSSet *expandedSectionNames = [TLCollapsibleDataModel sectionNamesForDataModel:backingDataModel notInSet:collapsedSectionNames]; 34 | return [self initWithBackingDataModel:backingDataModel expandedSectionNames:expandedSectionNames collapsedSectionNames:collapsedSectionNames]; 35 | } 36 | 37 | - (id)initWithBackingDataModel:(TLIndexPathDataModel *)backingDataModel expandedSectionNames:(NSSet *)expandedSectionNames 38 | { 39 | NSSet *collapsedSectionNames = [TLCollapsibleDataModel sectionNamesForDataModel:backingDataModel notInSet:expandedSectionNames]; 40 | return [self initWithBackingDataModel:backingDataModel expandedSectionNames:expandedSectionNames collapsedSectionNames:collapsedSectionNames]; 41 | } 42 | 43 | - (id)initWithBackingDataModel:(TLIndexPathDataModel *)backingDataModel expandedSectionNames:(NSSet *)expandedSectionNames collapsedSectionNames:(NSSet *)collapsedSectionNames 44 | { 45 | NSMutableArray *sectionInfos = [NSMutableArray arrayWithCapacity:backingDataModel.numberOfSections]; 46 | for (idbackingSectionInfo in backingDataModel.sections) { 47 | if ([collapsedSectionNames containsObject:backingSectionInfo.name]) { 48 | TLIndexPathSectionInfo *sectionInfo = [[TLIndexPathSectionInfo alloc] initWithItems:@[] name:backingSectionInfo.name indexTitle:backingSectionInfo.indexTitle]; 49 | [sectionInfos addObject:sectionInfo]; 50 | } else { 51 | [sectionInfos addObject:backingSectionInfo]; 52 | } 53 | } 54 | 55 | if (self = [super initWithSectionInfos:sectionInfos identifierKeyPath:backingDataModel.identifierKeyPath]) { 56 | _collapsedSectionNames = collapsedSectionNames; 57 | _expandedSectionNames = expandedSectionNames; 58 | _backingDataModel = backingDataModel; 59 | } 60 | 61 | return self; 62 | } 63 | 64 | + (NSSet *)sectionNamesForDataModel:(TLIndexPathDataModel *)dataModel notInSet:(NSSet *)sectionNames 65 | { 66 | NSMutableSet *otherSectionNames = [NSMutableSet set]; 67 | for (NSString *sectionName in dataModel.sectionNames) { 68 | if (![sectionNames containsObject:sectionName]) { 69 | [otherSectionNames addObject:sectionName]; 70 | } 71 | } 72 | return otherSectionNames; 73 | } 74 | 75 | #pragma mark - Collapsed state information 76 | 77 | - (BOOL)isSectionCollapsed:(NSInteger)section 78 | { 79 | NSString *sectionName = [self sectionNameForSection:section]; 80 | BOOL isCollapsed = [self.collapsedSectionNames containsObject:sectionName]; 81 | return isCollapsed; 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /Examples/Pods/AHEasing/AHEasing/CAKeyframeAnimation+AHEasing.m: -------------------------------------------------------------------------------- 1 | // 2 | // CAKeyframeAnimation+AHEasing.m 3 | // 4 | // Copyright (c) 2011, Auerhaus Development, LLC 5 | // 6 | // This program is free software. It comes without any warranty, to 7 | // the extent permitted by applicable law. You can redistribute it 8 | // and/or modify it under the terms of the Do What The Fuck You Want 9 | // To Public License, Version 2, as published by Sam Hocevar. See 10 | // http://sam.zoy.org/wtfpl/COPYING for more details. 11 | // 12 | 13 | #import "CAKeyframeAnimation+AHEasing.h" 14 | 15 | #if !defined(AHEasingDefaultKeyframeCount) 16 | 17 | // The larger this number, the smoother the animation 18 | #define AHEasingDefaultKeyframeCount 60 19 | 20 | #endif 21 | 22 | @implementation CAKeyframeAnimation (AHEasing) 23 | 24 | + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromValue:(CGFloat)fromValue toValue:(CGFloat)toValue keyframeCount:(size_t)keyframeCount 25 | { 26 | NSMutableArray *values = [NSMutableArray arrayWithCapacity:keyframeCount]; 27 | 28 | CGFloat t = 0.0; 29 | CGFloat dt = 1.0 / (keyframeCount - 1); 30 | for(size_t frame = 0; frame < keyframeCount; ++frame, t += dt) 31 | { 32 | CGFloat value = fromValue + function(t) * (toValue - fromValue); 33 | [values addObject:[NSNumber numberWithFloat:(float)value]]; 34 | } 35 | 36 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:path]; 37 | [animation setValues:values]; 38 | return animation; 39 | } 40 | 41 | + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromValue:(CGFloat)fromValue toValue:(CGFloat)toValue 42 | { 43 | return [self animationWithKeyPath:path function:function fromValue:fromValue toValue:toValue keyframeCount:AHEasingDefaultKeyframeCount]; 44 | } 45 | 46 | + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint keyframeCount:(size_t)keyframeCount 47 | { 48 | NSMutableArray *values = [NSMutableArray arrayWithCapacity:keyframeCount]; 49 | 50 | CGFloat t = 0.0; 51 | CGFloat dt = 1.0 / (keyframeCount - 1); 52 | for(size_t frame = 0; frame < keyframeCount; ++frame, t += dt) 53 | { 54 | CGFloat x = fromPoint.x + function(t) * (toPoint.x - fromPoint.x); 55 | CGFloat y = fromPoint.y + function(t) * (toPoint.y - fromPoint.y); 56 | #if TARGET_OS_IPHONE 57 | [values addObject:[NSValue valueWithCGPoint:CGPointMake(x, y)]]; 58 | #else 59 | [values addObject:[NSValue valueWithPoint:NSMakePoint(x, y)]]; 60 | #endif 61 | } 62 | 63 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:path]; 64 | [animation setValues:values]; 65 | return animation; 66 | } 67 | 68 | + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint 69 | { 70 | return [self animationWithKeyPath:path function:function fromPoint:fromPoint toPoint:toPoint keyframeCount:AHEasingDefaultKeyframeCount]; 71 | } 72 | 73 | + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromSize:(CGSize)fromSize toSize:(CGSize)toSize keyframeCount:(size_t)keyframeCount 74 | { 75 | NSMutableArray *values = [NSMutableArray arrayWithCapacity:keyframeCount]; 76 | 77 | CGFloat t = 0.0; 78 | CGFloat dt = 1.0 / (keyframeCount - 1); 79 | for(size_t frame = 0; frame < keyframeCount; ++frame, t += dt) 80 | { 81 | CGFloat w = fromSize.width + function(t) * (toSize.width - fromSize.width); 82 | CGFloat h = fromSize.height + function(t) * (toSize.height - fromSize.height); 83 | #if TARGET_OS_IPHONE 84 | [values addObject:[NSValue valueWithCGSize:CGSizeMake(w, h)]]; 85 | #else 86 | [values addObject:[NSValue valueWithSize:NSMakeSize(w, h)]]; 87 | #endif 88 | } 89 | 90 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:path]; 91 | [animation setValues:values]; 92 | return animation; 93 | } 94 | 95 | + (id)animationWithKeyPath:(NSString *)path function:(AHEasingFunction)function fromSize:(CGSize)fromSize toSize:(CGSize)toSize 96 | { 97 | return [self animationWithKeyPath:path function:function fromSize:fromSize toSize:toSize keyframeCount:AHEasingDefaultKeyframeCount]; 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods/Pods-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 18 | Version 2, December 2004 19 | 20 | Copyright (C) 2004 Sam Hocevar 21 | 14 rue de Plaisance, 75014 Paris, France 22 | Everyone is permitted to copy and distribute verbatim or modified 23 | copies of this license document, and changing it is allowed as long 24 | as the name is changed. 25 | 26 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 27 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 28 | 29 | 0. You just DO WHAT THE FUCK YOU WANT TO. 30 | Title 31 | AHEasing 32 | Type 33 | PSGroupSpecifier 34 | 35 | 36 | FooterText 37 | Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 38 | 39 | Permission is hereby granted, free of charge, to any person obtaining a copy 40 | of this software and associated documentation files (the "Software"), to deal 41 | in the Software without restriction, including without limitation the rights 42 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 43 | copies of the Software, and to permit persons to whom the Software is 44 | furnished to do so, subject to the following conditions: 45 | 46 | The above copyright notice and this permission notice shall be included in 47 | all copies or substantial portions of the Software. 48 | 49 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 50 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 51 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 52 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 53 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 54 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 55 | THE SOFTWARE. 56 | Title 57 | TLIndexPathTools 58 | Type 59 | PSGroupSpecifier 60 | 61 | 62 | FooterText 63 | The MIT License (MIT) 64 | 65 | Copyright (c) 2013 wtmoose 66 | 67 | Permission is hereby granted, free of charge, to any person obtaining a copy of 68 | this software and associated documentation files (the "Software"), to deal in 69 | the Software without restriction, including without limitation the rights to 70 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 71 | the Software, and to permit persons to whom the Software is furnished to do so, 72 | subject to the following conditions: 73 | 74 | The above copyright notice and this permission notice shall be included in all 75 | copies or substantial portions of the Software. 76 | 77 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 78 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 79 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 80 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 81 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 82 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 83 | 84 | Title 85 | TLLayoutTransitioning 86 | Type 87 | PSGroupSpecifier 88 | 89 | 90 | FooterText 91 | Generated by CocoaPods - http://cocoapods.org 92 | Title 93 | 94 | Type 95 | PSGroupSpecifier 96 | 97 | 98 | StringsTable 99 | Acknowledgements 100 | Title 101 | Acknowledgements 102 | 103 | 104 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/UITableViewController+ScrollOptimizer.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewController+ScrollOptimizer.m 3 | // 4 | // 5 | // Created by Tim Moose on 5/28/13. 6 | // 7 | // 8 | 9 | #import "UITableViewController+ScrollOptimizer.h" 10 | 11 | @implementation UITableViewController (ScrollOptimizer) 12 | 13 | - (void)optimizeScrollPositionForSection:(NSInteger)section headerView:(UIView *)headerView dataModel:(TLIndexPathDataModel *)dataModel animated:(BOOL)animated 14 | { 15 | // TODO Why is headerViewForSection: returning nil??? Shouldn't need to pass it in 16 | // UIView *headerView = [self.tableView headerViewForSection:section]; 17 | // if (!headerView) { 18 | // return; 19 | // } 20 | CGFloat sectionTop = headerView.frame.origin.y - self.tableView.contentOffset.y; 21 | if (sectionTop > 0) { 22 | 23 | // If top of section is visible, see if we can scroll up to expose more rows in the section 24 | 25 | // Compute how much space visible below the top of the section so we can calculate 26 | // what parts of the section will not be visible 27 | CGFloat visibleSpaceBelowSectionTop = self.tableView.bounds.size.height - sectionTop; 28 | 29 | // Start calculating how much space can be made visible before the section 30 | // top scrolls out of view above 31 | CGFloat offsetBelowTopToMakeVisible = headerView.bounds.size.height; 32 | 33 | // Calculate how much of the header is not visible 34 | CGFloat spaceNotVisible = offsetBelowTopToMakeVisible - visibleSpaceBelowSectionTop; 35 | 36 | // If there is not enough room to make the header visible, scroll the header to the top 37 | if (spaceNotVisible > sectionTop) { 38 | CGFloat locationToMakeVisible = headerView.frame.origin.y + visibleSpaceBelowSectionTop + sectionTop; 39 | [self forceTableScrollBasedOnExpectedSize:locationToMakeVisible animated:animated]; 40 | return; 41 | } 42 | 43 | // Iterate over rows to find out how many can be made visible 44 | idsectionInfo = dataModel.sections[section]; 45 | for (id item in sectionInfo.objects) { 46 | NSIndexPath *indexPath = [dataModel indexPathForItem:item]; 47 | offsetBelowTopToMakeVisible += [self tableView:self.tableView heightForRowAtIndexPath:indexPath]; 48 | spaceNotVisible = offsetBelowTopToMakeVisible - visibleSpaceBelowSectionTop; 49 | // If we run out of space to display all rows, scroll the header to the top 50 | if (spaceNotVisible > sectionTop) { 51 | CGSize contentSize = self.tableView.contentSize; 52 | contentSize.height = 1000; 53 | self.tableView.contentSize = contentSize; 54 | CGFloat locationToMakeVisible = headerView.frame.origin.y + visibleSpaceBelowSectionTop + sectionTop; 55 | [self forceTableScrollBasedOnExpectedSize:locationToMakeVisible animated:animated]; 56 | return; 57 | } 58 | } 59 | 60 | // The entire section can be displayed, so scroll as much as needed 61 | if (spaceNotVisible > 0) { 62 | CGFloat locationToMakeVisible = headerView.frame.origin.y + offsetBelowTopToMakeVisible; 63 | [self forceTableScrollBasedOnExpectedSize:locationToMakeVisible animated:animated]; 64 | return; 65 | } 66 | 67 | } else { 68 | [self.tableView scrollRectToVisible:headerView.frame animated:animated]; 69 | } 70 | } 71 | 72 | /* 73 | Force table to scroll to the specified location even if it is beyond the current 74 | content area. Use this to scroll to a future location during animiated table updates 75 | with the assumption that the location will be valid after the updates. 76 | */ 77 | - (void)forceTableScrollBasedOnExpectedSize:(CGFloat)scrollLocation animated:(BOOL)animated 78 | { 79 | CGSize expectedMinimumContentSize = self.tableView.contentSize; 80 | if (expectedMinimumContentSize.height < scrollLocation) { 81 | // Temporarily expand the content area to contain the scroll location. 82 | // The table will overwrite this during the update process. 83 | expectedMinimumContentSize.height = scrollLocation; 84 | self.tableView.contentSize = expectedMinimumContentSize; 85 | } 86 | [self.tableView scrollRectToVisible:CGRectMake(0, scrollLocation-1, 1, 1) animated:animated]; 87 | } 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /Examples/Pods/Target Support Files/Pods/Pods-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY=$(cd "${1%/*}" && pwd) 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | if [[ "${ACTION}" == "install" ]]; then 63 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 64 | fi 65 | rm -f "$RESOURCES_TO_COPY" 66 | 67 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 68 | then 69 | case "${TARGETED_DEVICE_FAMILY}" in 70 | 1,2) 71 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 72 | ;; 73 | 1) 74 | TARGET_DEVICE_ARGS="--target-device iphone" 75 | ;; 76 | 2) 77 | TARGET_DEVICE_ARGS="--target-device ipad" 78 | ;; 79 | *) 80 | TARGET_DEVICE_ARGS="--target-device mac" 81 | ;; 82 | esac 83 | 84 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 85 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 86 | while read line; do 87 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 88 | XCASSET_FILES+=("$line") 89 | fi 90 | done <<<"$OTHER_XCASSETS" 91 | 92 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 93 | fi 94 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/Collapsible/TLCollapsibleHeaderView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TLCollapsibleHeaderView.m 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "TLCollapsibleHeaderView.h" 25 | 26 | @implementation TLCollapsibleHeaderView 27 | 28 | - (void)setSeparatorColor:(UIColor *)separatorColor 29 | { 30 | _separatorColor = separatorColor; 31 | [self setNeedsLayout]; 32 | } 33 | 34 | - (void)setIconView:(UIImageView *)iconView 35 | { 36 | if (_iconView != iconView) { 37 | [_iconView removeFromSuperview]; 38 | [self addSubview:iconView]; 39 | _iconView = iconView; 40 | [self setNeedsLayout]; 41 | } 42 | } 43 | 44 | - (void)setBackgroundView:(UIView *)backgroundView 45 | { 46 | if (_backgroundView != backgroundView) { 47 | [_backgroundView removeFromSuperview]; 48 | [self addSubview:backgroundView]; 49 | [self sendSubviewToBack:backgroundView]; 50 | _backgroundView = backgroundView; 51 | } 52 | } 53 | 54 | - (void)setContentInsets:(UIEdgeInsets)contentInsets 55 | { 56 | _contentInsets = contentInsets; 57 | [self setNeedsLayout]; 58 | } 59 | 60 | - (void)layoutSubviews 61 | { 62 | CGRect contentFrame = UIEdgeInsetsInsetRect(self.bounds, self.contentInsets); 63 | if (self.iconView) { 64 | CGRect iconFrame = self.iconView.bounds; 65 | iconFrame.origin.x = contentFrame.origin.x; 66 | self.iconView.frame = iconFrame; 67 | CGPoint iconCenter = self.iconView.center; 68 | iconCenter.y = contentFrame.origin.y + contentFrame.size.height/2.0; 69 | self.iconView.center = iconCenter; 70 | CGRect titleFrame = self.titleLabel.frame; 71 | titleFrame.origin.x = iconFrame.origin.x + iconFrame.size.width + 10; 72 | titleFrame.size.width = MAX(0, contentFrame.origin.x + contentFrame.size.width - titleFrame.origin.x); 73 | self.titleLabel.frame = titleFrame; 74 | } else { 75 | self.titleLabel.frame = contentFrame; 76 | } 77 | CGRect backgroundFrame = self.bounds; 78 | if (self.separatorColor) { 79 | backgroundFrame.size.height--; 80 | } 81 | self.backgroundView.frame = backgroundFrame; 82 | } 83 | 84 | - (void)drawRect:(CGRect)rect 85 | { 86 | [super drawRect:rect]; 87 | if (self.separatorColor) { 88 | CGContextRef context = UIGraphicsGetCurrentContext(); 89 | CGContextMoveToPoint(context, 0, self.bounds.size.height - 0.5); 90 | CGContextAddLineToPoint(context, self.bounds.size.width, self.bounds.size.height - 0.5); 91 | CGContextSetStrokeColorWithColor(context, self.separatorColor.CGColor); 92 | CGContextSetLineWidth(context, 1); 93 | CGContextStrokePath(context); 94 | } 95 | } 96 | 97 | - (id)initWithFrame:(CGRect)frame 98 | { 99 | if (self = [super initWithFrame:frame]) { 100 | _titleLabel = [[UILabel alloc] initWithFrame:self.bounds]; 101 | _titleLabel.backgroundColor = [UIColor clearColor]; 102 | _titleLabel.font = [UIFont boldSystemFontOfSize:20]; 103 | [self addSubview:_titleLabel]; 104 | self.backgroundView = [[UIView alloc] initWithFrame:self.bounds]; 105 | self.backgroundView.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1]; 106 | self.contentInsets = UIEdgeInsetsMake(0, 10, 0, 10); 107 | self.separatorColor = [UIColor colorWithWhite:0.85 alpha:1]; 108 | } 109 | return self; 110 | } 111 | 112 | - (id)initWithFrame:(CGRect)frame andSection:(NSInteger)section 113 | { 114 | if (self = [self initWithFrame:frame]) { 115 | _section = section; 116 | } 117 | return self; 118 | } 119 | 120 | @end 121 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Data Model/TLIndexPathUpdates.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLIndexPathUpdates.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | #import "TLIndexPathDataModel.h" 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | /** 30 | Takes two versions of a data model and computes the changes, i.e. the inserts, 31 | moves, deletes and modifications. A variety of `performBatchUpdatesOn*` methods 32 | are provided for performing batch updates on the table or collection view. 33 | */ 34 | 35 | @interface TLIndexPathUpdates : NSObject 36 | 37 | #pragma mark - Creating updates 38 | 39 | /** 40 | * Takes two versions of a data model and computes the changes, i.e. the inserts, 41 | * moves, deletes and modifications. 42 | * 43 | * @param oldDataModel The previous data model. 44 | * @param updatedDataModel The updated data model. 45 | * @return A newly initialized TLIndexPathUpdates object. 46 | * @see initWithOldDataModel:updatedDataModel:modificationComparatorBlock: 47 | */ 48 | - (id)initWithOldDataModel:(TLIndexPathDataModel * __nullable)oldDataModel updatedDataModel:(TLIndexPathDataModel * __nullable)updatedDataModel; 49 | 50 | /** 51 | * Takes two versions of a data model and computes the changes, i.e. the inserts, 52 | * moves, deletes and modifications. 53 | * 54 | * @param oldDataModel The previous data model. 55 | * @param updatedDataModel The updated data model. 56 | * @param modificationComparatorBlock A block which is used to determine if an old data model object has been modified. This is passed two objects and should return `NO` if the objects are to be considered the same, or `YES` if modifications have occurred. This block can be `nil`. 57 | * 58 | * @return A newly initialized TLIndexPathUpdates object. 59 | * @see initWithOldDataModel:updatedDataModel: 60 | */ 61 | - (id)initWithOldDataModel:(TLIndexPathDataModel * __nullable)oldDataModel updatedDataModel:(TLIndexPathDataModel * __nullable)updatedDataModel modificationComparatorBlock:(BOOL(^ __nullable)(id item1, id item2))modificationComparatorBlock; 62 | 63 | #pragma mark - Performing batch updates 64 | 65 | - (void)performBatchUpdatesOnTableView:(UITableView *)tableView withRowAnimation:(UITableViewRowAnimation)animation; 66 | - (void)performBatchUpdatesOnTableView:(UITableView *)tableView withRowAnimation:(UITableViewRowAnimation)animation completion:(void(^ __nullable)(BOOL finished))completion; 67 | - (void)performBatchUpdatesOnCollectionView:(UICollectionView *)collectionView; 68 | - (void)performBatchUpdatesOnCollectionView:(UICollectionView *)collectionView completion:(void(^ __nullable)(BOOL finished))completion; 69 | 70 | #pragma mark - Customizing batch update behavior 71 | 72 | /* 73 | If `NO`, modified items will be ignored in the `performBatchUpdates*` methods. 74 | This can be useful for updating modified items with custom animation. 75 | Default value is `YES`. 76 | */ 77 | @property (nonatomic) BOOL updateModifiedItems; 78 | 79 | #pragma mark - Comparing data models 80 | 81 | @property (strong, readonly, nonatomic, nullable) TLIndexPathDataModel *oldDataModel; 82 | @property (strong, readonly, nonatomic, nullable) TLIndexPathDataModel *updatedDataModel; 83 | @property (readonly, nonatomic) BOOL hasChanges; 84 | @property (copy, readonly, nonatomic) NSArray *insertedSectionNames; 85 | @property (copy, readonly, nonatomic) NSArray *deletedSectionNames; 86 | @property (copy, readonly, nonatomic) NSArray *movedSectionNames; 87 | @property (copy, readonly, nonatomic) NSArray *insertedItems; 88 | @property (copy, readonly, nonatomic) NSArray *deletedItems; 89 | @property (copy, readonly, nonatomic) NSArray *movedItems; 90 | @property (copy, readonly, nonatomic) NSArray *modifiedItems; 91 | @end 92 | 93 | NS_ASSUME_NONNULL_END 94 | -------------------------------------------------------------------------------- /TLLayoutTransitioning/TLTransitionLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLTransitionLayout.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | /** 25 | A subclass of `UICollectionViewTransitionLayout` that interpolates linearly between 26 | layouts and optionally content offsets. The target offset can be specified directly 27 | by setting the `toContentOffset` property. The `UICollectionView+TLTransitioning` category 28 | provides API for calculating useful values for `toContentOffset`. 29 | 30 | When the transition is finalized, the collection view will set `contentOffset` 31 | back to it's original value. To negate this, one can set it back to the value 32 | of `toContentOffset` in the transition's completion block. This class conforms 33 | to the `TLTransitionAnimatorLayout` protocol, so when used with 34 | `[UICollectionView+TLTransitioning transitionToCollectionViewLayout:duration:completion:]`, 35 | this negation happens automatically. 36 | */ 37 | 38 | #import 39 | #import "UICollectionView+TLTransitioning.h" 40 | 41 | @interface TLTransitionLayout : UICollectionViewTransitionLayout 42 | 43 | /** 44 | Initializer with additional `supplementaryKinds` argument used to inform the layout 45 | what supplementary view kinds are registered with the collection view. This parameter 46 | must be supplied in order to support supplementary views. 47 | */ 48 | - (id)initWithCurrentLayout:(UICollectionViewLayout *)currentLayout nextLayout:(UICollectionViewLayout *)newLayout supplementaryKinds:(NSArray *)supplementaryKinds; 49 | 50 | /** 51 | When specified, the content offset will be transitioned from the current value 52 | to this value. 53 | */ 54 | @property (nonatomic) CGPoint toContentOffset; 55 | 56 | /** 57 | The initial content offset. 58 | */ 59 | @property (readonly, nonatomic) CGPoint fromContentOffset; 60 | 61 | /** 62 | The current relative time in terms of the transition progress. The value varies 63 | from 0 to 1 over the course of the transition. The value is equal to `transitionProgress` 64 | unless progress is being updated through calls to `setTransitionProgress:time:`. 65 | If `setTransitionProgress:time:` is being used, `transitionTime` progresses linearly, 66 | regardless of the easing curve being used. This can be useful when some elements 67 | of the transition need to progress along another easing curve, which can be accomplished 68 | by passing `transitionTimee` to another easing function. 69 | */ 70 | @property (readonly, nonatomic) CGFloat transitionTime; 71 | 72 | /** 73 | */ 74 | - (void)cancelInPlace; 75 | 76 | @property (readonly, nonatomic) BOOL cancelledInPlace; 77 | 78 | /** 79 | Optional callback to modify the interpolated layout attributes. Can be used to 80 | customize the animation. Return a non-nil value to replace the given `layoutAttributes` 81 | with the returned instance. 82 | */ 83 | @property (strong, nonatomic) UICollectionViewLayoutAttributes *(^updateLayoutAttributes)(UICollectionViewLayoutAttributes *layoutAttributes, UICollectionViewLayoutAttributes *fromAttributes, UICollectionViewLayoutAttributes *toAttributes, CGFloat progress); 84 | 85 | /** 86 | Set the transition progress and time. This method can optionally be called instead 87 | of `setTransitionProgress` when the transition is following a non-linear easing 88 | curve and there is a need to know the linear time. This can be useful when some 89 | elements of the transition need to progress along another easing curve, which can 90 | be accomplished by passing the value of `transitionTimee` to another easing function. 91 | The `transitionToCollectionViewLayout:duration:easing:completion transition in 92 | `UICollectionView+Transitioning` utilizes this feature. 93 | */ 94 | - (void)setTransitionProgress:(CGFloat)transitionProgress time:(CGFloat)time; 95 | 96 | /** 97 | Optional callback when progress changes. Can be used to modify things outside of the 98 | scope of the layout. 99 | */ 100 | @property (strong, nonatomic) void(^progressChanged)(CGFloat progress); 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/View Controllers/TLCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLCollectionViewController.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | /** 27 | A subclass of `UICollectionViewController` that works with `TLIndexPathController` 28 | and provide default impelementations of the essential data source and delegate 29 | methods to get your collection views up-and-running as quickly as possible. 30 | 31 | This class also supports view controller-backed cells. 32 | */ 33 | 34 | #import "TLIndexPathController.h" 35 | 36 | @interface TLCollectionViewController : UICollectionViewController 37 | 38 | /** 39 | The collection view's index path controller. A default controller is 40 | created automatically with `nil` for `identifierKeyPath`, `sectionNameKeyPath`. 41 | It is not uncommon to replace this default instance with a custom 42 | controller. For example, if Core Data is being used, one would 43 | typically provide a controller created with the 44 | `initWithFetchRequest:managedObjectContext:sectionNameKeyPath:identifierKeyPath:cacheName:` 45 | initializer. 46 | */ 47 | @property (strong, nonatomic) TLIndexPathController *indexPathController; 48 | 49 | /** 50 | The implementation of `collectionView:cellForItemAtIndexPath:` calls this method 51 | to ask for the cell's identifier before attempting to dequeue a cell. The default 52 | implementation of this method first asks the data model for an identifier and, 53 | if none is provided, returns the "Cell". Data models that don't use 54 | `TLIndexPathItem` as their item type typically return `nil` and so it is not 55 | uncommon to override this method with custom logic. 56 | */ 57 | - (NSString *)collectionView:(UICollectionView *)collectionView cellIdentifierAtIndexPath:(NSIndexPath *)indexPath; 58 | 59 | /* 60 | This method is intended to be overridden with the cell's configuration logic. 61 | It is called by by this classes implementation of `collectionView:cellForItemAtIndexPath:` 62 | after the cell has been created/dequeued. The default implementation does nothing. 63 | 64 | Alternatively, one can override `collectionView:cellForItemAtIndexPath:` and either 65 | call the super implementation to get the unconfigured cell or or create/dequeue 66 | the cell directly. 67 | */ 68 | - (void)collectionView:(UICollectionView *)collectionView configureCell:(UICollectionViewCell *)cell atIndexPath:(NSIndexPath *)indexPath; 69 | 70 | - (void)reconfigureVisibleCells; 71 | 72 | #pragma mark - Backing cells with view controllers 73 | 74 | /** 75 | This method should be overridden to enable view controller-backed cells. The default 76 | implementation returns `nil`. If this method returns a view controller for the given 77 | cell and index path, the table view controller will automatically install the backing 78 | controller as a child view controller in `cellForItemAtIndexPath` and uninstall it 79 | in `collectionView:didEndDisplayingCell:forItemAtIndexPath:`. This method is responsible 80 | for installing the view controller's view into the cell's view heirarchy. 81 | */ 82 | - (UIViewController *)collectionView:(UICollectionView *)collectionView instantiateViewControllerForCell:(UICollectionViewCell *)cell atIndexPath:(NSIndexPath *)indexPath; 83 | 84 | /** 85 | Returns the backing view controller for the given cell, if any. This method is used 86 | internally and can also be called in custom code, for example when configuring the 87 | cell in `cellForItemAtIndexPath`. To enable view controller-backed cells, override 88 | the companion method `collectionView:instantiateViewControllerForCell:atIndexPath:`. 89 | */ 90 | - (UIViewController *)collectionView:(UICollectionView *)collectionView viewControllerForCell:(UICollectionViewCell *)cell; 91 | 92 | /** 93 | If set to NO, the view controller will not establish a containment relationship 94 | with view controllers instantiated for cells. This option exists because cases have 95 | been observed where the collection view can get in a bad state where cells fail 96 | to be removed from view as they move offscreen during an interactive transition. 97 | This seems to be a collection view bug and no workaround has been found. If you're 98 | not experiencing this issue, stick with the default value of YES to retain all of 99 | the normal view controller view containment behavior (view appearance calls, 100 | screen rotation calls, etc.). 101 | */ 102 | @property (nonatomic) BOOL establishContainmentRelationshipWithViewControllerForCell; 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/View Controllers/TLTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TLTableViewController.h 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import 25 | 26 | #import "TLIndexPathController.h" 27 | 28 | /** 29 | A subclass of `UITableViewController` that works with `TLIndexPathController` 30 | and provide default impelementations of the essential data source and delegate 31 | methods to get your table views up-and-running as quickly as possible. 32 | 33 | This class also supports view controller-backed cells and automatically 34 | calculates static or dynamic cell heights using prototype cells. For dynamic 35 | height cells, the cell must implement the `DynamicSizeView` protocol. 36 | */ 37 | 38 | @interface TLTableViewController : UITableViewController 39 | 40 | /** 41 | The table view's index path controller. A default controller is 42 | created automatically with `nil` for `identifierKeyPath`, `sectionNameKeyPath` 43 | and `cellIdentifierKeyPath`. It is not uncommon to replace this default instance 44 | with a custom controller. For example, if Core Data is being used, one would 45 | typically provide a controller created with the 46 | `initWithFetchRequest:managedObjectContext:sectionNameKeyPath:identifierKeyPath:cacheName:` 47 | initializer. 48 | */ 49 | @property (strong, nonatomic) TLIndexPathController *indexPathController; 50 | 51 | /** 52 | Set this property to specify the row animation style. 53 | Defaults to UITableViewRowAnimationAutomatic. 54 | */ 55 | @property (nonatomic) UITableViewRowAnimation rowAnimationStyle; 56 | 57 | /** 58 | The implementation of `tableView:cellForRowAtIndexPath:` calls this method 59 | to ask for the cell's identifier before attempting to dequeue a cell. The default 60 | implementation of this method first asks the data model for an identifier and, 61 | if none is provided, returns the "Cell". Data models that don't use 62 | `TLIndexPathItem` as their item type typically return `nil` and so it is not 63 | uncommon to override this method with custom logic. 64 | */ 65 | - (NSString *)tableView:(UITableView *)tableView cellIdentifierAtIndexPath:(NSIndexPath *)indexPath; 66 | 67 | /* 68 | This method is intended to be overridden with the cell's configuration logic. 69 | It is called by by this classes implementation of `tableView:cellForRowAtIndexPath:` 70 | after the cell has been created/dequeued. The default implementation does nothing. 71 | 72 | Alternatively, one can override `tableView:cellForRowAtIndexPath:` and either 73 | call the super implementation to get the unconfigured cell or or create/dequeue 74 | the cell directly. 75 | */ 76 | - (void)tableView:(UITableView *)tableView configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath; 77 | 78 | - (void)reconfigureVisibleCells; 79 | 80 | #pragma mark - Prototype cells 81 | 82 | /** 83 | Returns a prototype instance of the specified cell. This can be useful for getting 84 | basic information about the table view's cells outside of the scope of any specific 85 | cell. For example, this method is used internally to automatically calculate 86 | the cell's height in `tableView:heightForRowAtIndexPath:`. 87 | */ 88 | - (UITableViewCell *)tableView:(UITableView *)tableView prototypeForCellIdentifier:(NSString *)cellIdentifier; 89 | 90 | #pragma mark - Backing cells with view controllers 91 | 92 | /** 93 | This method should be overridden to enable view controller-backed cells. The default 94 | implementation returns `nil`. If this method returns a view controller for the given 95 | cell and index path, the table view controller will automatically install the backing 96 | controller as a child view controller in `cellForRowAtIndexPath` and uninstall it 97 | in `tableView:didEndDisplayingCell:forRowAtIndexPath:`. This method is responsible 98 | for installing the view controller's view into the cell's view heirarchy. 99 | */ 100 | - (UIViewController *)tableView:(UITableView *)tableView instantiateViewControllerForCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath; 101 | 102 | /** 103 | Returns the backing view controller for the given cell, if any. This method is used 104 | internally and can also be called in custom code, for example when configuring the 105 | cell in `cellForRowAtIndexPath`. To enable view controller-backed cells, override 106 | the companion method `tableView:instantiateViewControllerForCell:atIndexPath:`. 107 | */ 108 | - (UIViewController *)tableView:(UITableView *)tableView viewControllerForCell:(UITableViewCell *)cell; 109 | 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /Examples/Pods/TLIndexPathTools/TLIndexPathTools/Extensions/Collapsible/TLCollapsibleTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TLCollapsibleTableViewController.m 3 | // 4 | // Copyright (c) 2013 Tim Moose (http://tractablelabs.com) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #import "TLCollapsibleTableViewController.h" 25 | #import "TLCollapsibleHeaderView.h" 26 | #import "UITableView+ScrollOptimizer.h" 27 | 28 | @interface TLCollapsibleTableViewController () 29 | 30 | @end 31 | 32 | @implementation TLCollapsibleTableViewController 33 | 34 | - (void)commonInit { 35 | _optimizeScrollOnExpand = YES; 36 | } 37 | 38 | - (id)initWithCoder:(NSCoder *)aDecoder 39 | { 40 | if (self = [super initWithCoder:aDecoder]) { 41 | [self commonInit]; 42 | } 43 | return self; 44 | } 45 | 46 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 47 | { 48 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { 49 | [self commonInit]; 50 | } 51 | return self; 52 | } 53 | 54 | - (id)initWithStyle:(UITableViewStyle)style 55 | { 56 | if (self = [super initWithStyle:style]) { 57 | [self commonInit]; 58 | } 59 | return self; 60 | } 61 | 62 | - (TLCollapsibleDataModel *)dataModel { 63 | return (TLCollapsibleDataModel *)self.indexPathController.dataModel; 64 | } 65 | 66 | - (void)setDataModel:(TLCollapsibleDataModel *)dataModel 67 | { 68 | self.indexPathController.dataModel = dataModel; 69 | } 70 | 71 | - (void)configureHeaderView:(TLCollapsibleHeaderView *)headerView forSection:(NSInteger)section 72 | { 73 | } 74 | 75 | #pragma mark - UITableViewDelegate 76 | 77 | /** 78 | Override this to customize header view height 79 | */ 80 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 81 | { 82 | return 45; 83 | } 84 | 85 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 86 | { 87 | CGFloat width = self.tableView.frame.size.width; 88 | CGFloat height = [self tableView:self.tableView heightForHeaderInSection:section]; 89 | TLCollapsibleHeaderView *headerView = [[TLCollapsibleHeaderView alloc] initWithFrame:CGRectMake(0, 0, width, height) andSection:section]; 90 | UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSectionTap:)]; 91 | headerView.titleLabel.text = [self tableView:tableView titleForHeaderInSection:section]; 92 | [headerView addGestureRecognizer:tapRecognizer]; 93 | [self configureHeaderView:headerView forSection:section]; 94 | return headerView; 95 | } 96 | 97 | - (void) handleSectionTap:(UITapGestureRecognizer *)sender 98 | { 99 | TLCollapsibleHeaderView *headerView = (TLCollapsibleHeaderView *)sender.view; 100 | NSInteger section = headerView.section; 101 | NSString *sectionName = [self.dataModel sectionNameForSection:section]; 102 | NSMutableSet *collapsedSectionNames = [NSMutableSet setWithSet:self.dataModel.collapsedSectionNames]; 103 | BOOL collapsed = NO; 104 | if ([collapsedSectionNames containsObject:sectionName]) { 105 | if (self.singleExpandedSection) { 106 | [collapsedSectionNames removeAllObjects]; 107 | [collapsedSectionNames addObjectsFromArray:[self.dataModel sectionNames]]; 108 | } 109 | [collapsedSectionNames removeObject:sectionName]; 110 | } else { 111 | [collapsedSectionNames addObject:sectionName]; 112 | collapsed = YES; 113 | } 114 | 115 | self.dataModel = [[TLCollapsibleDataModel alloc] initWithBackingDataModel:self.dataModel.backingDataModel collapsedSectionNames:collapsedSectionNames]; 116 | 117 | if ([self.delegate respondsToSelector:@selector(controller:didChangeSection:collapsed:)]) { 118 | [self.delegate controller:self didChangeSection:section collapsed:collapsed]; 119 | } 120 | if (!collapsed && self.optimizeScrollOnExpand) { 121 | [self.tableView optimizeScrollPositionForSection:section options:TLTableViewScrollOptionsIncludeHeaderViews topInset:0 animated:YES]; 122 | } 123 | 124 | [self configureHeaderView:headerView forSection:section]; 125 | } 126 | 127 | #pragma mark - TLIndexPathControllerDelegate 128 | 129 | - (TLIndexPathDataModel *)controller:(TLIndexPathController *)controller willUpdateDataModel:(TLIndexPathDataModel *)oldDataModel withDataModel:(TLIndexPathDataModel *)updatedDataModel 130 | { 131 | // If `updatedDataModel` is already a `TLCollapsibleDataModel`, we don't need to do anything. 132 | if ([updatedDataModel isKindOfClass:[TLCollapsibleDataModel class]]) { 133 | return nil; 134 | } 135 | // Otherwise, we assume `updatedDataModel` is the backing model - maybe it came from a 136 | // Core Data fetch request or maybe it was provided by custom code - and we need to 137 | // constructe the `TLCollapsibleDataModel`. 138 | NSMutableSet *expandedSectionNames = nil; 139 | // If `oldDataModel` is a `TLCollapsibleDataModel`, we need to preserve the 140 | // expanded state of known sections. 141 | if ([oldDataModel isKindOfClass:[TLCollapsibleDataModel class]]) { 142 | expandedSectionNames = [NSMutableSet setWithSet:((TLCollapsibleDataModel *)oldDataModel).expandedSectionNames]; 143 | // Now filter out any section names that are no longer present in `updatedDataModel` 144 | [expandedSectionNames intersectSet:[NSSet setWithArray:updatedDataModel.sectionNames]]; 145 | } 146 | // Construct and return the `TLCollapsibleDataModel` 147 | TLCollapsibleDataModel *dataModel = [[TLCollapsibleDataModel alloc] initWithBackingDataModel:updatedDataModel expandedSectionNames:expandedSectionNames]; 148 | return dataModel; 149 | } 150 | 151 | @end 152 | -------------------------------------------------------------------------------- /Examples/Examples/PinchCollectionViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Collection 4 | // 5 | // Created by Tim Moose on 6/30/13. 6 | // Copyright (c) 2013 wtm@tractablelabs.com. All rights reserved. 7 | // 8 | 9 | #import "PinchCollectionViewController.h" 10 | #import 11 | #import "UIColor+Hex.h" 12 | #import 13 | 14 | @interface PinchCollectionViewController () 15 | @property (strong, nonatomic) UICollectionViewFlowLayout *smallLayout; 16 | @property (strong, nonatomic) UICollectionViewFlowLayout *largeLayout; 17 | @property (strong, nonatomic) NSArray *colors; 18 | @property (strong, nonatomic) TLTransitionLayout *transitionLayout; 19 | @property (strong, nonatomic) UIPinchGestureRecognizer *pinch; 20 | @property (nonatomic) CGFloat initialScale; 21 | @property (nonatomic) BOOL isLayoutInTransition; 22 | @end 23 | 24 | static const CGFloat kLargeLayoutScale = 2.5; 25 | 26 | @implementation PinchCollectionViewController 27 | 28 | - (void)viewDidLoad 29 | { 30 | [super viewDidLoad]; 31 | 32 | //stash small layout from storyboard 33 | self.smallLayout = (UICollectionViewFlowLayout *)self.collectionView.collectionViewLayout; 34 | 35 | //create large layout 36 | self.largeLayout = [[UICollectionViewFlowLayout alloc] init]; 37 | self.largeLayout.scrollDirection = self.smallLayout.scrollDirection; 38 | self.largeLayout.minimumLineSpacing = self.smallLayout.minimumLineSpacing; 39 | self.largeLayout.minimumInteritemSpacing = self.smallLayout.minimumInteritemSpacing; 40 | self.largeLayout.itemSize = CGSizeMake(336, 336); 41 | self.largeLayout.sectionInset = self.smallLayout.sectionInset; 42 | 43 | //set up data model 44 | NSMutableArray *items = [[NSMutableArray alloc] init]; 45 | for (int i = 0; i < 200; i++) { 46 | [items addObject:[NSString stringWithFormat:@"%d", i]]; 47 | } 48 | self.indexPathController.items = items; 49 | 50 | self.colors = @[ 51 | [UIColor colorWithHexRGB:0xBF0C43], 52 | [UIColor colorWithHexRGB:0xF9BA15], 53 | [UIColor colorWithHexRGB:0x8EAC00], 54 | [UIColor colorWithHexRGB:0x127A97], 55 | [UIColor colorWithHexRGB:0x452B72], 56 | ]; 57 | 58 | self.pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinch:)]; 59 | [self.collectionView addGestureRecognizer:self.pinch]; 60 | } 61 | 62 | - (void)handlePinch:(UIPinchGestureRecognizer *)pinch 63 | { 64 | if (self.isLayoutInTransition) { 65 | return; 66 | } 67 | 68 | if (pinch.state == UIGestureRecognizerStateBegan && !self.transitionLayout) { 69 | 70 | // remember initial scale factor for progress calculation 71 | self.initialScale = pinch.scale; 72 | 73 | UICollectionViewLayout *toLayout = self.smallLayout == self.collectionView.collectionViewLayout ? self.largeLayout : self.smallLayout; 74 | 75 | // NSLog(@"will begin transition; pinch: %@", pinch); 76 | self.transitionLayout = (TLTransitionLayout *)[self.collectionView startInteractiveTransitionToCollectionViewLayout:toLayout completion:^(BOOL completed, BOOL finish) { 77 | if (finish) { 78 | // NSLog(@"did finish"); 79 | self.collectionView.contentOffset = self.transitionLayout.toContentOffset; 80 | } else { 81 | // NSLog(@"did cancel"); 82 | self.collectionView.contentOffset = self.transitionLayout.fromContentOffset; 83 | } 84 | self.transitionLayout = nil; 85 | self.isLayoutInTransition = NO; 86 | }]; 87 | 88 | NSArray *visiblePoses = [self.collectionView.collectionViewLayout layoutAttributesForElementsInRect:self.collectionView.bounds]; 89 | NSMutableArray *visibleIndexPaths = [NSMutableArray arrayWithCapacity:visiblePoses.count]; 90 | for (UICollectionViewLayoutAttributes *pose in visiblePoses) { 91 | [visibleIndexPaths addObject:pose.indexPath]; 92 | } 93 | self.transitionLayout.toContentOffset = [self.collectionView toContentOffsetForLayout:self.transitionLayout indexPaths:visibleIndexPaths placement:TLTransitionLayoutIndexPathPlacementCenter]; 94 | 95 | } 96 | 97 | else if (pinch.state == UIGestureRecognizerStateChanged && self.transitionLayout && pinch.numberOfTouches > 1) { 98 | 99 | CGFloat finalScale = self.transitionLayout.nextLayout == self.largeLayout ? kLargeLayoutScale : 1 / kLargeLayoutScale; 100 | self.transitionLayout.transitionProgress = transitionProgress(self.initialScale, pinch.scale, finalScale, nil); 101 | 102 | } 103 | 104 | else if ((pinch.state == UIGestureRecognizerStateEnded || pinch.state == UIGestureRecognizerStateCancelled) && self.transitionLayout) { 105 | self.isLayoutInTransition = YES; 106 | if (self.transitionLayout.transitionProgress > 0.5) { 107 | // NSLog(@"will finish; pinch: %@", pinch); 108 | [self.collectionView finishInteractiveTransition]; 109 | } else { 110 | // NSLog(@"will cancel; pinch: %@", pinch); 111 | [self.collectionView cancelInteractiveTransition]; 112 | } 113 | } 114 | } 115 | 116 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 117 | { 118 | UICollectionViewCell *cell = [super collectionView:collectionView cellForItemAtIndexPath:indexPath]; 119 | UILabel *label = (UILabel *)[cell viewWithTag:1]; 120 | label.text = [self.indexPathController.dataModel itemAtIndexPath:indexPath]; 121 | cell.backgroundColor = self.colors[indexPath.item % [self.colors count]]; 122 | return cell; 123 | } 124 | 125 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath 126 | { 127 | [[UIApplication sharedApplication] beginIgnoringInteractionEvents]; 128 | UICollectionViewLayout *toLayout = self.smallLayout == self.collectionView.collectionViewLayout ? self.largeLayout : self.smallLayout; 129 | self.transitionLayout = (TLTransitionLayout *)[self.collectionView startInteractiveTransitionToCollectionViewLayout:toLayout completion:^(BOOL completed, BOOL finish) { 130 | self.collectionView.contentOffset = self.transitionLayout.toContentOffset; 131 | self.transitionLayout = nil; 132 | [[UIApplication sharedApplication] endIgnoringInteractionEvents]; 133 | }]; 134 | self.transitionLayout.toContentOffset = [self.collectionView toContentOffsetForLayout:self.transitionLayout indexPaths:@[indexPath] placement:TLTransitionLayoutIndexPathPlacementCenter]; 135 | [collectionView finishInteractiveTransition]; 136 | } 137 | 138 | - (UICollectionViewTransitionLayout *)collectionView:(UICollectionView *)collectionView transitionLayoutForOldLayout:(UICollectionViewLayout *)fromLayout newLayout:(UICollectionViewLayout *)toLayout 139 | { 140 | return [[TLTransitionLayout alloc] initWithCurrentLayout:fromLayout nextLayout:toLayout]; 141 | } 142 | 143 | @end 144 | -------------------------------------------------------------------------------- /Examples/Examples/ResizeSettingsTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Collection 4 | // 5 | // Created by Tim Moose on 10/9/13. 6 | // Copyright (c) 2013 wtm@tractablelabs.com. All rights reserved. 7 | // 8 | 9 | #import "ResizeSettingsTableViewController.h" 10 | #import "ResizeCollectionViewController.h" 11 | #import 12 | 13 | @interface ResizeSettingsTableViewController () 14 | @property (strong, nonatomic) ResizeCollectionViewController *collectionViewController; 15 | @property (strong, nonatomic) TLIndexPathDataModel *easingCurveDataModel; 16 | @end 17 | 18 | @implementation ResizeSettingsTableViewController 19 | 20 | - (void)viewDidLoad 21 | { 22 | [super viewDidLoad]; 23 | [self initialize]; 24 | } 25 | 26 | - (void)viewWillAppear:(BOOL)animated 27 | { 28 | [super viewWillAppear:animated]; 29 | [self performSegueWithIdentifier:@"ResizeExampleDetail" sender:self]; 30 | } 31 | 32 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 33 | { 34 | self.collectionViewController = (ResizeCollectionViewController *)segue.destinationViewController; 35 | [self initialize]; 36 | } 37 | 38 | - (void)initialize 39 | { 40 | if (self.isViewLoaded && self.collectionViewController) { 41 | // duration 42 | self.durationSlider.minimumValue = 0.05; 43 | self.durationSlider.maximumValue = 2.0; 44 | self.durationSlider.value = .75; 45 | [self updateDuration]; 46 | 47 | // target content offset 48 | self.toContentOffset.apportionsSegmentWidthsByContent = YES; 49 | self.toContentOffset.selectedSegmentIndex = 2; 50 | [self updateToContentOffset]; 51 | 52 | // easing curve 53 | self.easingCurvePicker.dataSource = self; 54 | self.easingCurvePicker.delegate = self; 55 | self.easingCurveDataModel = [self newEasingCurveDataModel]; 56 | [self.easingCurvePicker selectRow:5 inComponent:0 animated:NO]; 57 | [self.easingCurvePicker selectRow:2 inComponent:1 animated:NO]; 58 | [self updateEasingCurve]; 59 | 60 | // section headers 61 | self.collectionViewController.showSectionHeaders = self.showSectionHeaders.isOn; 62 | } 63 | } 64 | 65 | #pragma mark - Duration 66 | 67 | - (IBAction)durationChanged:(UISlider *)sender { 68 | [self updateDuration]; 69 | } 70 | 71 | - (void)updateDuration 72 | { 73 | self.collectionViewController.duration = self.durationSlider.value; 74 | self.durationLabel.text = [NSString stringWithFormat:@"%.2f seconds", self.durationSlider.value]; 75 | } 76 | 77 | #pragma mark - Target content offset 78 | 79 | - (void)toContentOffsetChanged:(UISegmentedControl *)sender 80 | { 81 | [self updateToContentOffset]; 82 | } 83 | 84 | - (void)updateToContentOffset 85 | { 86 | NSNumber *placement = [@[@(TLTransitionLayoutIndexPathPlacementMinimal), 87 | @(TLTransitionLayoutIndexPathPlacementVisible), 88 | @(TLTransitionLayoutIndexPathPlacementCenter), 89 | @(TLTransitionLayoutIndexPathPlacementTop), 90 | @(TLTransitionLayoutIndexPathPlacementBottom)] 91 | objectAtIndex:self.toContentOffset.selectedSegmentIndex]; 92 | self.collectionViewController.toContentOffset = [placement integerValue]; 93 | } 94 | 95 | #pragma mark - Easing curve 96 | 97 | - (void)updateEasingCurve 98 | { 99 | NSInteger selectedCurve = [self.easingCurvePicker selectedRowInComponent:0]; 100 | NSInteger selectedEasing = [self.easingCurvePicker selectedRowInComponent:1]; 101 | NSIndexPath *curveIndexPath = [NSIndexPath indexPathForRow:selectedCurve inSection:0]; 102 | TLIndexPathItem *curveItem = [self.easingCurveDataModel itemAtIndexPath:curveIndexPath]; 103 | NSValue *easingValue = curveItem.data[selectedEasing]; 104 | self.collectionViewController.easingFunction = [easingValue pointerValue]; 105 | } 106 | 107 | - (TLIndexPathDataModel *)newEasingCurveDataModel 108 | { 109 | NSMutableArray *curveItems = [NSMutableArray arrayWithCapacity:10]; 110 | [curveItems addObject:curveItem(@"Linear", LinearInterpolation, LinearInterpolation, LinearInterpolation)]; 111 | [curveItems addObject:curveItem(@"Exponential", ExponentialEaseIn, ExponentialEaseOut, ExponentialEaseInOut)]; 112 | [curveItems addObject:curveItem(@"Bounce", BounceEaseIn, BounceEaseOut, BounceEaseInOut)]; 113 | [curveItems addObject:curveItem(@"Quadratic", QuadraticEaseIn, QuadraticEaseOut, QuadraticEaseInOut)]; 114 | [curveItems addObject:curveItem(@"Cubic", CubicEaseIn, CubicEaseOut, CubicEaseInOut)]; 115 | [curveItems addObject:curveItem(@"Quartic", QuarticEaseIn, QuarticEaseOut, QuarticEaseInOut)]; 116 | [curveItems addObject:curveItem(@"Quintic", QuinticEaseIn, QuinticEaseOut, QuinticEaseInOut)]; 117 | [curveItems addObject:curveItem(@"Sine", SineEaseIn, SineEaseOut, SineEaseInOut)]; 118 | [curveItems addObject:curveItem(@"Circular", CircularEaseIn, CircularEaseOut, CircularEaseInOut)]; 119 | [curveItems addObject:curveItem(@"Elastic", ElasticEaseIn, ElasticEaseOut, ElasticEaseInOut)]; 120 | [curveItems addObject:curveItem(@"Back", BackEaseIn, BackEaseOut, BackEaseInOut)]; 121 | TLIndexPathSectionInfo *curvesSection = [[TLIndexPathSectionInfo alloc] initWithItems:curveItems name:@"Curves"]; 122 | TLIndexPathSectionInfo *easingSection = [[TLIndexPathSectionInfo alloc] initWithItems:@[@"EaseIn", @"EaseOut", @"EaseInOut"] name:@"Easing"]; 123 | return [[TLIndexPathDataModel alloc] initWithSectionInfos:@[curvesSection, easingSection] identifierKeyPath:nil]; 124 | } 125 | 126 | TLIndexPathItem *curveItem(NSString *name, AHEasingFunction inFunc, AHEasingFunction outFunc, AHEasingFunction inOutFunc) 127 | { 128 | NSValue *inValue = [NSValue valueWithPointer:inFunc]; 129 | NSValue *outValue = [NSValue valueWithPointer:outFunc]; 130 | NSValue *inOutValue = [NSValue valueWithPointer:inOutFunc]; 131 | return [[TLIndexPathItem alloc] initWithIdentifier:name sectionName:nil cellIdentifier:nil data:@[inValue, outValue, inOutValue]]; 132 | } 133 | 134 | #pragma mark - UIPickerViewDataSource 135 | 136 | - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView 137 | { 138 | return self.easingCurveDataModel.numberOfSections; 139 | } 140 | 141 | - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component 142 | { 143 | return [self.easingCurveDataModel numberOfRowsInSection:component]; 144 | } 145 | 146 | #pragma mark - UIPickerViewDelegate 147 | 148 | - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component 149 | { 150 | return [self.easingCurveDataModel identifierAtIndexPath:[NSIndexPath indexPathForRow:row inSection:component]]; 151 | } 152 | 153 | - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component 154 | { 155 | [self updateEasingCurve]; 156 | } 157 | 158 | #pragma mark - Sections 159 | 160 | - (IBAction)showSectionHeadersChanged:(UISwitch *)sender { 161 | self.collectionViewController.showSectionHeaders = sender.isOn; 162 | } 163 | 164 | @end 165 | -------------------------------------------------------------------------------- /Examples/Pods/AHEasing/AHEasing/easing.c: -------------------------------------------------------------------------------- 1 | // 2 | // easing.c 3 | // 4 | // Copyright (c) 2011, Auerhaus Development, LLC 5 | // 6 | // This program is free software. It comes without any warranty, to 7 | // the extent permitted by applicable law. You can redistribute it 8 | // and/or modify it under the terms of the Do What The Fuck You Want 9 | // To Public License, Version 2, as published by Sam Hocevar. See 10 | // http://sam.zoy.org/wtfpl/COPYING for more details. 11 | // 12 | 13 | #include 14 | #include "easing.h" 15 | 16 | // Modeled after the line y = x 17 | AHFloat LinearInterpolation(AHFloat p) 18 | { 19 | return p; 20 | } 21 | 22 | // Modeled after the parabola y = x^2 23 | AHFloat QuadraticEaseIn(AHFloat p) 24 | { 25 | return p * p; 26 | } 27 | 28 | // Modeled after the parabola y = -x^2 + 2x 29 | AHFloat QuadraticEaseOut(AHFloat p) 30 | { 31 | return -(p * (p - 2)); 32 | } 33 | 34 | // Modeled after the piecewise quadratic 35 | // y = (1/2)((2x)^2) ; [0, 0.5) 36 | // y = -(1/2)((2x-1)*(2x-3) - 1) ; [0.5, 1] 37 | AHFloat QuadraticEaseInOut(AHFloat p) 38 | { 39 | if(p < 0.5) 40 | { 41 | return 2 * p * p; 42 | } 43 | else 44 | { 45 | return (-2 * p * p) + (4 * p) - 1; 46 | } 47 | } 48 | 49 | // Modeled after the cubic y = x^3 50 | AHFloat CubicEaseIn(AHFloat p) 51 | { 52 | return p * p * p; 53 | } 54 | 55 | // Modeled after the cubic y = (x - 1)^3 + 1 56 | AHFloat CubicEaseOut(AHFloat p) 57 | { 58 | AHFloat f = (p - 1); 59 | return f * f * f + 1; 60 | } 61 | 62 | // Modeled after the piecewise cubic 63 | // y = (1/2)((2x)^3) ; [0, 0.5) 64 | // y = (1/2)((2x-2)^3 + 2) ; [0.5, 1] 65 | AHFloat CubicEaseInOut(AHFloat p) 66 | { 67 | if(p < 0.5) 68 | { 69 | return 4 * p * p * p; 70 | } 71 | else 72 | { 73 | AHFloat f = ((2 * p) - 2); 74 | return 0.5 * f * f * f + 1; 75 | } 76 | } 77 | 78 | // Modeled after the quartic x^4 79 | AHFloat QuarticEaseIn(AHFloat p) 80 | { 81 | return p * p * p * p; 82 | } 83 | 84 | // Modeled after the quartic y = 1 - (x - 1)^4 85 | AHFloat QuarticEaseOut(AHFloat p) 86 | { 87 | AHFloat f = (p - 1); 88 | return f * f * f * (1 - p) + 1; 89 | } 90 | 91 | // Modeled after the piecewise quartic 92 | // y = (1/2)((2x)^4) ; [0, 0.5) 93 | // y = -(1/2)((2x-2)^4 - 2) ; [0.5, 1] 94 | AHFloat QuarticEaseInOut(AHFloat p) 95 | { 96 | if(p < 0.5) 97 | { 98 | return 8 * p * p * p * p; 99 | } 100 | else 101 | { 102 | AHFloat f = (p - 1); 103 | return -8 * f * f * f * f + 1; 104 | } 105 | } 106 | 107 | // Modeled after the quintic y = x^5 108 | AHFloat QuinticEaseIn(AHFloat p) 109 | { 110 | return p * p * p * p * p; 111 | } 112 | 113 | // Modeled after the quintic y = (x - 1)^5 + 1 114 | AHFloat QuinticEaseOut(AHFloat p) 115 | { 116 | AHFloat f = (p - 1); 117 | return f * f * f * f * f + 1; 118 | } 119 | 120 | // Modeled after the piecewise quintic 121 | // y = (1/2)((2x)^5) ; [0, 0.5) 122 | // y = (1/2)((2x-2)^5 + 2) ; [0.5, 1] 123 | AHFloat QuinticEaseInOut(AHFloat p) 124 | { 125 | if(p < 0.5) 126 | { 127 | return 16 * p * p * p * p * p; 128 | } 129 | else 130 | { 131 | AHFloat f = ((2 * p) - 2); 132 | return 0.5 * f * f * f * f * f + 1; 133 | } 134 | } 135 | 136 | // Modeled after quarter-cycle of sine wave 137 | AHFloat SineEaseIn(AHFloat p) 138 | { 139 | return sin((p - 1) * M_PI_2) + 1; 140 | } 141 | 142 | // Modeled after quarter-cycle of sine wave (different phase) 143 | AHFloat SineEaseOut(AHFloat p) 144 | { 145 | return sin(p * M_PI_2); 146 | } 147 | 148 | // Modeled after half sine wave 149 | AHFloat SineEaseInOut(AHFloat p) 150 | { 151 | return 0.5 * (1 - cos(p * M_PI)); 152 | } 153 | 154 | // Modeled after shifted quadrant IV of unit circle 155 | AHFloat CircularEaseIn(AHFloat p) 156 | { 157 | return 1 - sqrt(1 - (p * p)); 158 | } 159 | 160 | // Modeled after shifted quadrant II of unit circle 161 | AHFloat CircularEaseOut(AHFloat p) 162 | { 163 | return sqrt((2 - p) * p); 164 | } 165 | 166 | // Modeled after the piecewise circular function 167 | // y = (1/2)(1 - sqrt(1 - 4x^2)) ; [0, 0.5) 168 | // y = (1/2)(sqrt(-(2x - 3)*(2x - 1)) + 1) ; [0.5, 1] 169 | AHFloat CircularEaseInOut(AHFloat p) 170 | { 171 | if(p < 0.5) 172 | { 173 | return 0.5 * (1 - sqrt(1 - 4 * (p * p))); 174 | } 175 | else 176 | { 177 | return 0.5 * (sqrt(-((2 * p) - 3) * ((2 * p) - 1)) + 1); 178 | } 179 | } 180 | 181 | // Modeled after the exponential function y = 2^(10(x - 1)) 182 | AHFloat ExponentialEaseIn(AHFloat p) 183 | { 184 | return (p == 0.0) ? p : pow(2, 10 * (p - 1)); 185 | } 186 | 187 | // Modeled after the exponential function y = -2^(-10x) + 1 188 | AHFloat ExponentialEaseOut(AHFloat p) 189 | { 190 | return (p == 1.0) ? p : 1 - pow(2, -10 * p); 191 | } 192 | 193 | // Modeled after the piecewise exponential 194 | // y = (1/2)2^(10(2x - 1)) ; [0,0.5) 195 | // y = -(1/2)*2^(-10(2x - 1))) + 1 ; [0.5,1] 196 | AHFloat ExponentialEaseInOut(AHFloat p) 197 | { 198 | if(p == 0.0 || p == 1.0) return p; 199 | 200 | if(p < 0.5) 201 | { 202 | return 0.5 * pow(2, (20 * p) - 10); 203 | } 204 | else 205 | { 206 | return -0.5 * pow(2, (-20 * p) + 10) + 1; 207 | } 208 | } 209 | 210 | // Modeled after the damped sine wave y = sin(13pi/2*x)*pow(2, 10 * (x - 1)) 211 | AHFloat ElasticEaseIn(AHFloat p) 212 | { 213 | return sin(13 * M_PI_2 * p) * pow(2, 10 * (p - 1)); 214 | } 215 | 216 | // Modeled after the damped sine wave y = sin(-13pi/2*(x + 1))*pow(2, -10x) + 1 217 | AHFloat ElasticEaseOut(AHFloat p) 218 | { 219 | return sin(-13 * M_PI_2 * (p + 1)) * pow(2, -10 * p) + 1; 220 | } 221 | 222 | // Modeled after the piecewise exponentially-damped sine wave: 223 | // y = (1/2)*sin(13pi/2*(2*x))*pow(2, 10 * ((2*x) - 1)) ; [0,0.5) 224 | // y = (1/2)*(sin(-13pi/2*((2x-1)+1))*pow(2,-10(2*x-1)) + 2) ; [0.5, 1] 225 | AHFloat ElasticEaseInOut(AHFloat p) 226 | { 227 | if(p < 0.5) 228 | { 229 | return 0.5 * sin(13 * M_PI_2 * (2 * p)) * pow(2, 10 * ((2 * p) - 1)); 230 | } 231 | else 232 | { 233 | return 0.5 * (sin(-13 * M_PI_2 * ((2 * p - 1) + 1)) * pow(2, -10 * (2 * p - 1)) + 2); 234 | } 235 | } 236 | 237 | // Modeled after the overshooting cubic y = x^3-x*sin(x*pi) 238 | AHFloat BackEaseIn(AHFloat p) 239 | { 240 | return p * p * p - p * sin(p * M_PI); 241 | } 242 | 243 | // Modeled after overshooting cubic y = 1-((1-x)^3-(1-x)*sin((1-x)*pi)) 244 | AHFloat BackEaseOut(AHFloat p) 245 | { 246 | AHFloat f = (1 - p); 247 | return 1 - (f * f * f - f * sin(f * M_PI)); 248 | } 249 | 250 | // Modeled after the piecewise overshooting cubic function: 251 | // y = (1/2)*((2x)^3-(2x)*sin(2*x*pi)) ; [0, 0.5) 252 | // y = (1/2)*(1-((1-x)^3-(1-x)*sin((1-x)*pi))+1) ; [0.5, 1] 253 | AHFloat BackEaseInOut(AHFloat p) 254 | { 255 | if(p < 0.5) 256 | { 257 | AHFloat f = 2 * p; 258 | return 0.5 * (f * f * f - f * sin(f * M_PI)); 259 | } 260 | else 261 | { 262 | AHFloat f = (1 - (2*p - 1)); 263 | return 0.5 * (1 - (f * f * f - f * sin(f * M_PI))) + 0.5; 264 | } 265 | } 266 | 267 | AHFloat BounceEaseIn(AHFloat p) 268 | { 269 | return 1 - BounceEaseOut(1 - p); 270 | } 271 | 272 | AHFloat BounceEaseOut(AHFloat p) 273 | { 274 | if(p < 4/11.0) 275 | { 276 | return (121 * p * p)/16.0; 277 | } 278 | else if(p < 8/11.0) 279 | { 280 | return (363/40.0 * p * p) - (99/10.0 * p) + 17/5.0; 281 | } 282 | else if(p < 9/10.0) 283 | { 284 | return (4356/361.0 * p * p) - (35442/1805.0 * p) + 16061/1805.0; 285 | } 286 | else 287 | { 288 | return (54/5.0 * p * p) - (513/25.0 * p) + 268/25.0; 289 | } 290 | } 291 | 292 | AHFloat BounceEaseInOut(AHFloat p) 293 | { 294 | if(p < 0.5) 295 | { 296 | return 0.5 * BounceEaseIn(p*2); 297 | } 298 | else 299 | { 300 | return 0.5 * BounceEaseOut(p * 2 - 1) + 0.5; 301 | } 302 | } 303 | -------------------------------------------------------------------------------- /Examples/Examples/ResizeCollectionViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Collection 4 | // 5 | // Created by Tim Moose on 6/30/13. 6 | // Copyright (c) 2013 wtm@tractablelabs.com. All rights reserved. 7 | // 8 | 9 | #import "ResizeCollectionViewController.h" 10 | #import "UIColor+Hex.h" 11 | 12 | @interface ResizeCollectionViewController () 13 | @property (strong, nonatomic) UICollectionViewFlowLayout *smallLayout; 14 | @property (strong, nonatomic) UICollectionViewFlowLayout *largeLayout; 15 | @property (strong, nonatomic) NSArray *colors; 16 | @property (strong, nonatomic) UIColor *sectionHeaderColor; 17 | @property (strong, nonatomic) NSArray *transitionIndexPaths; 18 | @end 19 | 20 | @implementation ResizeCollectionViewController 21 | 22 | - (void)viewDidLoad 23 | { 24 | [super viewDidLoad]; 25 | 26 | //stash small layout from storyboard 27 | self.smallLayout = (UICollectionViewFlowLayout *)self.collectionView.collectionViewLayout; 28 | 29 | //create large layout 30 | self.largeLayout = [[UICollectionViewFlowLayout alloc] init]; 31 | self.largeLayout.scrollDirection = self.smallLayout.scrollDirection; 32 | self.largeLayout.minimumLineSpacing = self.smallLayout.minimumLineSpacing; 33 | self.largeLayout.minimumInteritemSpacing = self.smallLayout.minimumInteritemSpacing; 34 | self.largeLayout.itemSize = CGSizeMake(336, 336); 35 | self.largeLayout.sectionInset = self.smallLayout.sectionInset; 36 | self.largeLayout.headerReferenceSize = CGSizeMake(50, 50); 37 | 38 | [self updateDataModel]; 39 | 40 | self.colors = @[ 41 | [UIColor colorWithHexRGB:0xBF0C43], 42 | [UIColor colorWithHexRGB:0xF9BA15], 43 | [UIColor colorWithHexRGB:0x8EAC00], 44 | [UIColor colorWithHexRGB:0x127A97], 45 | [UIColor colorWithHexRGB:0x452B72], 46 | ]; 47 | self.sectionHeaderColor = [UIColor colorWithWhite:139.f/255.f alpha:1]; 48 | 49 | self.collectionView.contentInset = UIEdgeInsetsMake(10, 10, 10, 10); 50 | } 51 | 52 | - (void)updateDataModel 53 | { 54 | //set up data model 55 | NSMutableArray *items = [[NSMutableArray alloc] init]; 56 | if (self.showSectionHeaders) { 57 | for (int section = 0; section < 10; section++) { 58 | NSString *sectionName = [NSString stringWithFormat:@"Section %d", section]; 59 | for (int i = 0; i < 20; i++) { 60 | NSString *itemName = [NSString stringWithFormat:@"%d-%d", section, i]; 61 | TLIndexPathItem *item = [[TLIndexPathItem alloc] initWithIdentifier:itemName sectionName:sectionName cellIdentifier:nil data:nil]; 62 | [items addObject:item]; 63 | } 64 | } 65 | } else { 66 | for (int i = 0; i < 200; i++) { 67 | NSString *itemName = [NSString stringWithFormat:@"%d", i]; 68 | TLIndexPathItem *item = [[TLIndexPathItem alloc] initWithIdentifier:itemName sectionName:nil cellIdentifier:nil data:nil]; 69 | [items addObject:item]; 70 | } 71 | } 72 | self.indexPathController.items = items; 73 | } 74 | 75 | - (void)setSectionHeaderColor:(UIColor *)sectionHeaderColor 76 | { 77 | _sectionHeaderColor = sectionHeaderColor; 78 | [self.collectionView reloadData]; 79 | } 80 | 81 | - (void)setShowSectionHeaders:(BOOL)showSectionHeaders 82 | { 83 | if (_showSectionHeaders != showSectionHeaders) { 84 | _showSectionHeaders = showSectionHeaders; 85 | [self updateDataModel]; 86 | UIEdgeInsets sectionInset = UIEdgeInsetsZero; 87 | if (showSectionHeaders) { 88 | sectionInset.top = 10; 89 | sectionInset.bottom = 10; 90 | } 91 | self.largeLayout.sectionInset = sectionInset; 92 | self.smallLayout.sectionInset = sectionInset; 93 | [self.largeLayout invalidateLayout]; 94 | [self.smallLayout invalidateLayout]; 95 | } 96 | } 97 | 98 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 99 | { 100 | UICollectionViewCell *cell = [super collectionView:collectionView cellForItemAtIndexPath:indexPath]; 101 | UILabel *label = (UILabel *)[cell viewWithTag:1]; 102 | label.text = [self.indexPathController.dataModel identifierAtIndexPath:indexPath]; 103 | cell.backgroundColor = self.colors[indexPath.item % [self.colors count]]; 104 | [self updateLabelScale:label cellSize:cell.bounds.size]; 105 | return cell; 106 | } 107 | 108 | - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath 109 | { 110 | UICollectionReusableView *view = [super collectionView:collectionView viewForSupplementaryElementOfKind:kind atIndexPath:indexPath]; 111 | if ([UICollectionElementKindSectionHeader isEqualToString:kind]) { 112 | UILabel *label = (UILabel *)[view viewWithTag:1]; 113 | label.text = [self.indexPathController.dataModel sectionNameForSection:indexPath.section]; 114 | view.backgroundColor = self.sectionHeaderColor; 115 | label.textColor = [UIColor whiteColor]; 116 | } 117 | return view; 118 | } 119 | 120 | - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section 121 | { 122 | if (self.showSectionHeaders) { 123 | return CGSizeMake(50, 50); 124 | } 125 | return CGSizeZero; 126 | } 127 | 128 | - (void)updateLabelScale:(UILabel *)label cellSize:(CGSize)cellSize 129 | { 130 | // update the label's font size as a proportion of the cell's width and 131 | // let Auto Layout adjust the label's frame based on the intrinsic content size 132 | CGFloat pointSize = cellSize.width * 17 / 128.f; 133 | label.font = [UIFont fontWithName:label.font.fontName size:pointSize]; 134 | } 135 | 136 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath 137 | { 138 | UICollectionViewLayout *toLayout = self.smallLayout == collectionView.collectionViewLayout 139 | ? self.largeLayout 140 | : self.smallLayout; 141 | self.transitionIndexPaths = @[indexPath]; 142 | TLTransitionLayout *layout = (TLTransitionLayout *)[collectionView transitionToCollectionViewLayout:toLayout 143 | duration:self.duration 144 | easing:self.easingFunction 145 | completion:nil]; 146 | CGPoint toOffset = [collectionView toContentOffsetForLayout:layout 147 | indexPaths:self.transitionIndexPaths 148 | placement:self.toContentOffset 149 | placementAnchor:kTLPlacementAnchorDefault 150 | placementInset:UIEdgeInsetsZero 151 | toSize:self.collectionView.bounds.size 152 | toContentInset:self.collectionView.contentInset]; 153 | layout.toContentOffset = toOffset; 154 | __weak ResizeCollectionViewController *weakSelf = self; 155 | [layout setUpdateLayoutAttributes:^UICollectionViewLayoutAttributes *(UICollectionViewLayoutAttributes *pose, UICollectionViewLayoutAttributes *fromPose, UICollectionViewLayoutAttributes *toPose, CGFloat progress) { 156 | CGSize cellSize = pose.bounds.size; 157 | UICollectionViewCell *cell = [self.collectionView cellForItemAtIndexPath:pose.indexPath]; 158 | if (cell) { 159 | UILabel *label = (UILabel *)[cell viewWithTag:1]; 160 | [weakSelf updateLabelScale:label cellSize:cellSize]; 161 | } 162 | return nil; 163 | }]; 164 | } 165 | 166 | - (UICollectionViewTransitionLayout *)collectionView:(UICollectionView *)collectionView transitionLayoutForOldLayout:(UICollectionViewLayout *)fromLayout newLayout:(UICollectionViewLayout *)toLayout 167 | { 168 | NSArray *supplementaryKinds = self.showSectionHeaders ? @[UICollectionElementKindSectionHeader] : nil; 169 | TLTransitionLayout *layout = [[TLTransitionLayout alloc] initWithCurrentLayout:fromLayout nextLayout:toLayout supplementaryKinds:supplementaryKinds]; 170 | return layout; 171 | } 172 | 173 | @end 174 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TLLayoutTransitioning 2 | ===================== 3 | 4 | Enhanced transitioning between UICollectionView layouts in iOS. 5 | 6 | ##Overview 7 | 8 | TLLayoutTransitioning provides a `TLLayoutTransition` transition layout subclass and a `UICollectionView+TLTransitioning` category that combine to solve a few problems with collection view layout transitioning: 9 | 10 | 1. `UICollectionViewLayoutTransition` does not handle content offset well, often leaving cells where you don't want them. `TLTransitionLayout` provides elegant control of content offset with Minimal, Visible, Center, Top, Left, Bottom or Right placement options relative to one or more index paths. 11 | 12 | 2. `UICollectionViewLayoutTransition` does not support supplementary views. `TLTransitionLayout` provides support for any supplementary view kinds specified in the initializer. 13 | 14 | 3. `-[UICollectionView setCollectionViewLayout:animated:completion]` has [serious known bugs][3] in iOS7 and does not provide any animation options. TLLayoutTransitioning provides a robust alternative to this API with support for animation duration, 30+ easing curves and content offset control. This is done by using `CADisplayLink` to drive an interactive `TLTransitionLayout` as a non-interactive animation. Note that this approach may not perform as well as Core Animation with more complex cells. 15 | 16 | Check out the demos in the Examples workspace! 17 | 18 | ###TLTransitionLayout Class 19 | 20 | `TLTransitionLayout` is a subclass of `UICollectionViewTransitionLayout` that interpolates linearly between layouts and optionally between the current content offset and a specified final offset. 21 | 22 | The final offset is specified 23 | by setting the `toContentOffset` property. The `UICollectionView+TLTransitioning` category 24 | provides an API for calculating Minimal, Visible, Center, Top, Left, Bottom or Right offset placements relative to one or more index paths. 25 | 26 | The basic usage is as follows: 27 | 28 | ```Objective-C 29 | - (void)someViewControllerEventHandler 30 | { 31 | UICollectionViewLayout *nextLayout = ...; 32 | self.transitionLayout = (TLTransitionLayout *)[self.collectionView startInteractiveTransitionToCollectionViewLayout:nextLayout 33 | completion:^(BOOL completed, BOOL finish) { 34 | if (finish) { 35 | self.collectionView.contentOffset = self.transitionLayout.toContentOffset; 36 | self.transitionLayout = nil; 37 | } 38 | }]; 39 | NSArray *indexPaths = ...;// some selection of index paths to place 40 | self.transitionLayout.toContentOffset = [self.collectionView toContentOffsetForLayout:self.transitionLayout indexPaths:indexPaths placement:TLTransitionLayoutIndexPathPlacementCenter]; 41 | } 42 | 43 | - (UICollectionViewTransitionLayout *)collectionView:(UICollectionView *)collectionView transitionLayoutForOldLayout:(UICollectionViewLayout *)fromLayout newLayout:(UICollectionViewLayout *)toLayout 44 | { 45 | NSArray *supplementaryKinds = ...; // optional supplementary view kinds 46 | return [[TLTransitionLayout alloc] initWithCurrentLayout:fromLayout nextLayout:toLayout supplementaryKinds:supplementaryKinds]; 47 | } 48 | 49 | ``` 50 | 51 | Note that the collection view will reset `contentOffset` after the transition is finalized, but as illustrated above, this can be negated by setting it back to `toContentOffset` in the completion block. 52 | 53 | ####Canceling a Transition 54 | 55 | If you want to stop the current transition to start a new one from the current position, you need a way to stop the current transition in-place. Apple provides `finishInteractiveTransition` and `cancelInteractiveTransition` to end a transition, but neither of these stops the transition in-place. So, TLLayoutTransitioning provides such a method: 56 | 57 | ```Objective-C 58 | [self.collectionView cancelInteractiveTransitionInPlaceWithCompletion:^(){ 59 | // initiate new transition in the completion block 60 | }]; 61 | ``` 62 | 63 | You can find out if a transition is currently in progress by checking the `isInteractiveTransitionInProgress` on `UICollectionView`. 64 | 65 | ###UICollectionView+TLTransitioning Category 66 | 67 | The `UICollectionView+TLTransitioning` category provides some of useful methods for calculating for interactive transitions. In particular, the `toContentOffsetForLayout:indexPaths:placement` API calculates final content offset values to achieve Minimal, Visible, Center, Top, Left, Bottom or Right placements for one or more index paths. The expanded version of this API provides for even further fine-tuning and supports transitioning to a different collection view size and content inset: 68 | 69 | ```` 70 | - (CGPoint)toContentOffsetForLayout:(UICollectionViewTransitionLayout *)layout 71 | indexPaths:(NSArray *)indexPaths 72 | placement:(TLTransitionLayoutIndexPathPlacement)placement 73 | placementAnchor:(CGPoint)placementAnchor 74 | placementInset:(UIEdgeInsets)placementInset 75 | toSize:(CGSize)toSize 76 | toContentInset:(UIEdgeInsets)toContentInset 77 | ```` 78 | 79 | `UICollectionView+TLTransitioning` also provides an alternative to `-[UICollectionView setCollectionViewLayout:animated:completion]` for non-interactive animation between layouts with support for animation duration, 30 built-in easing curves (courtesy of Warren Moore's [AHEasing library][1]), user defined easing curves (by defining custom `AHEasingFunctions`) and content offset control. The basic transition call is as follows: 80 | 81 | ```Objective-C 82 | TLTransitionLayout *layout = (TLTransitionLayout *)[collectionView transitionToCollectionViewLayout:toLayout duration:2 easing:QuarticEaseInOut completion:nil]; 83 | CGPoint toOffset = [collectionView toContentOffsetForLayout:layout indexPaths:@[indexPath] placement:TLTransitionLayoutIndexPathPlacementCenter]; 84 | layout.toContentOffset = toOffset; 85 | ``` 86 | 87 | where the view controller is configured to provide an instance of `TLTransitionLayout` as described above. Check out the [Resize sample project][2] in the Examples workspace to see this in action. 88 | 89 | ##Installation 90 | 91 | ###CocoaPods 92 | 93 | Add the following to your Podfile 94 | 95 | pod 'TLLayoutTransitioning' 96 | 97 | ###Carthage 98 | 99 | Add the following to your Cartfile 100 | 101 | github "wtmoose/TLLayoutTransitioning" 102 | 103 | Note that TLLayoutTransitioning has a dependency on AHEasing, which 104 | does not support Carthage. As a workaround, TLLayoutTransitioning's Cartfile uses the `wtmoose/AHEasing` fork which adds Carthage support. 105 | 106 | To request Carthage support for the canonical AHEasing library, consider leaving a comment in favor of reopening the [Add dynamic frameworks support](https://github.com/warrenm/AHEasing/pull/19) pull request. 107 | 108 | ###Manual 109 | 110 | If you're not using a dependency manager, check out the **noframeworks** branch and copy the following files into your project: 111 | 112 | TLTransitionLayout.h 113 | TLTransitionLayout.m 114 | UICollectionView+TLTransitionAnimator.h 115 | UICollectionView+TLTransitionAnimator.m 116 | 117 | And copy the following files from [AHEasing][4]: 118 | 119 | easing.h 120 | easing.c 121 | 122 | ##Examples 123 | 124 | Open the Examples workspace (not the project) to run the sample app. The following examples are included: 125 | 126 | ###Resize 127 | 128 | The Resize example combines `TLTransitionLayout` and `-[UICollectionView+TLTransitioning transitionToCollectionViewLayout:duration:easing:completion:]` as a better alternative to `-[UICollectionView setCollectionViewLayout:animated:completion]`. Experiment with different durations, easing curves and content offset options on the settings panel. Toggle "show section headers" to see transitioning supplementary views. 129 | 130 | ###Pinch 131 | 132 | The Pinch example demonstrates a simple pinch-driven interactive transition using `TLTransitionLayout`. The destination `contentOffset` is selected such that the initial visible cells remain centered. Or if a cell is tapped, the `contentOffset` the cell is centered. 133 | 134 | ## About SwiftKick Mobile 135 | We build high quality apps! [Get in touch](http://www.swiftkickmobile.com) if you need help with a project. 136 | 137 | [1]:https://github.com/warrenm/AHEasing 138 | [2]:https://github.com/wtmoose/TLLayoutTransitioning/blob/master/Examples/Examples/ResizeCollectionViewController.m 139 | [3]:http://stackoverflow.com/questions/13780138/dynamically-setting-layout-on-uicollectionview-causes-inexplicable-contentoffset 140 | [4]:https://github.com/warrenm/AHEasing 141 | --------------------------------------------------------------------------------