Permalink
Browse files

PSPDFKit 2.2.0 - PSPDFPageScrollContinuousTransition, smarter annotat…

…ion selection, pdf link annotations to other documents and countless other improvements & bug fixes.

Former-commit-id: 5f91c3d
  • Loading branch information...
1 parent be1212d commit 280b726e5423559d53a063fdd1e456335d9fe416 @steipete steipete committed Oct 3, 2012
Showing with 1,762 additions and 1,028 deletions.
  1. +1 −1 .gitignore
  2. +76 −0 CHANGELOG.md
  3. +1 −2 Examples/PSPDFCatalog/Kiosk/PSCSettingsController.m
  4. +0 −186 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSCollectionView.h
  5. +0 −50 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSCollectionViewCommon.h
  6. +0 −21 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSCollectionViewController.h
  7. +0 −122 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSCollectionViewFlowLayout.h
  8. +37 −31 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFAnnotation.h
  9. +5 −5 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFAnnotationParser.h
  10. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFAnnotationToolbar.h
  11. +1 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFAnnotationView.h
  12. +1 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFBarButtonItem.h
  13. +1 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFBookmark.h
  14. +7 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFBookmarkParser.h
  15. +39 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFBrightnessViewController.h
  16. +17 −17 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFCache.h
  17. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFColorButton.h
  18. +38 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFColorSelectionViewController.h
  19. +26 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFColorView.h
  20. +4 −4 ...amework/PSPDFKit.framework/Versions/A/Headers/{PSPDFPagedScrollView.h → PSPDFContentScrollView.h}
  21. +32 −0 ...Kit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFContinuousScrollViewController.h
  22. +104 −78 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocument.h
  23. +8 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocumentDelegate.h
  24. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocumentLabelView.h
  25. +4 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocumentParser.h
  26. +34 −29 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDocumentProvider.h
  27. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFDrawView.h
  28. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFFreeTextAnnotation.h
  29. +10 −10 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFGlyph.h
  30. +28 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFGradientView.h
  31. +1 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFGraphicsState.h
  32. +1 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFHighlightAnnotation.h
  33. +1 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFHighlightAnnotationView.h
  34. +2 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFIconGenerator.h
  35. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFImageAnnotationView.h
  36. +5 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFKit.h
  37. +19 −6 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFKitGlobal.h
  38. +7 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFLabelParser.h
  39. +18 −16 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFLinkAnnotation.h
  40. +1 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFLinkAnnotationBaseView.h
  41. +7 −7 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFLinkAnnotationView.h
  42. +0 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFLongPressGestureRecognizer.h
  43. +6 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFLoupeView.h
  44. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFMenuItem.h
  45. +1 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFNoteAnnotation.h
  46. +10 −6 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFNoteAnnotationController.h
  47. +39 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFOrderedDictionary.h
  48. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFOutlineCell.h
  49. +5 −5 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFOutlineElement.h
  50. +7 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFOutlineParser.h
  51. +4 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFOutlineViewController.h
  52. +6 −6 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPageInfo.h
  53. +10 −9 ...FKit.framework/Versions/A/Headers/{PSPDFPagingViewController.h → PSPDFPageScrollViewController.h}
  54. +37 −25 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPageView.h
  55. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPageViewController.h
  56. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPasswordView.h
  57. +1 −7 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPatches.h
  58. +38 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPopoverBackgroundView.h
  59. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFPositionView.h
  60. +9 −9 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFRenderQueue.h
  61. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFScrobbleBar.h
  62. +31 −26 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFScrollView.h
  63. +1 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSearchHighlightView.h
  64. +14 −12 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSearchOperation.h
  65. +6 −6 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSearchResult.h
  66. +1 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSearchStatusCell.h
  67. +8 −5 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSearchViewController.h
  68. +1 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSelectionView.h
  69. +1 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFShapeAnnotation.h
  70. +15 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSimplePageViewController.h
  71. +5 −5 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFSinglePageViewController.h
  72. +32 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFStyleable.h
  73. +5 −5 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTabBarButton.h
  74. +15 −7 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTabBarView.h
  75. +12 −9 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTabbedViewController.h
  76. +3 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTextBlock.h
  77. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTextLine.h
  78. +9 −11 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTextParser.h
  79. +4 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTextSearch.h
  80. +6 −10 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTextSelectionView.h
  81. +9 −9 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFThumbnailGridViewCell.h
  82. +3 −3 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTransitionHelper.h
  83. +7 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFTransitionProtocol.h
  84. +7 −7 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFVideoAnnotationView.h
  85. +91 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFViewController+Delegates.h
  86. +112 −86 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFViewController.h
  87. +2 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFViewControllerDelegate.h
  88. +4 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFViewState.h
  89. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFWebAnnotationView.h
  90. +19 −11 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFWebViewController.h
  91. +6 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFWord.h
  92. +4 −4 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSPDFYouTubeAnnotationView.h
  93. +164 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSTCollectionView.h
  94. +11 −23 ...ramework/PSPDFKit.framework/Versions/A/Headers/{PSCollectionViewCell.h → PSTCollectionViewCell.h}
  95. +94 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSTCollectionViewCommon.h
  96. +20 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSTCollectionViewController.h
  97. +125 −0 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Headers/PSTCollectionViewFlowLayout.h
  98. +40 −39 ...work/PSPDFKit.framework/Versions/A/Headers/{PSCollectionViewLayout.h → PSTCollectionViewLayout.h}
  99. +2 −2 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/Info.plist
  100. BIN PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/Play@2x.png
  101. +13 −2 ...beddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/de.lproj/PSPDFKit.strings
  102. +14 −2 ...beddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/en.lproj/PSPDFKit.strings
  103. +13 −2 ...beddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/fr.lproj/PSPDFKit.strings
  104. BIN PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/freetext.png
  105. BIN PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/freetext@2x.png
  106. BIN PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/highlight.png
  107. BIN PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/highlight@2x.png
  108. +87 −0 ...beddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/it.lproj/PSPDFKit.strings
  109. BIN PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/newcomment@2x.png
  110. BIN PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/strikeout.png
  111. BIN PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/strikeout@2x.png
  112. BIN PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/PSPDFKit.bundle/underline.png
  113. +1 −1 PSPDFKit.embeddedframework/PSPDFKit.framework/Versions/A/Resources/VERSION
View
@@ -27,4 +27,4 @@ Development
Releases
Products
Samples
-InfoPlist.h
+InfoPlist.h
View
@@ -1,5 +1,81 @@
# Changelog
+__v2.2.0 - 4/October/2012__
+
+Note: This will be the last release that supports iOS 4.3*. The next version will be iOS 5+ only and will require Xcode 4.5+ (iOS SDK 6.0)
+ If you're having any comments on this, I would love to hear from you: pspdfkit@petersteinberger.com
+
+(*) There is no device that supports iOS 4.3 and can't be upgraded to iOS5, and PSPDFKit alrady dropped iOS4.2 and with it armv6 in 2.0.
+
+* New scrolling mode: PSPDFPageScrollContinuousTransition (similar to UIWebView's default mode)
+* Support text selection on rotated PDF documents.
+* UIPopoverController is now styleable with a tintColor. This is enabled by default if tintColor is set. Use .shouldTintPopovers to disable this.
+ As long as you use presentViewControllerModalOrPopover:embeddedInNavigationController:withCloseButton:animated:sender:options: your custom popovers will be styled the same way.
+* Adds support for adding annotations for double page mode on the right page. (Note: drawing still isn't perfect)
+* Add new property renderAnnotationTypes to PSPDFViewController to allow control about the types of annotations that should be rendered.
+* Add support for PDF Link Launch annotations (link to a different PDF within a PDF, see http://pspdfkit.com/documentation.html#annotations)
+* Annotation selection is now smarter and selects the annotation that's most likely chosen (e.g. a small note annotation now is clickable even if it's behind a big ink drawing annotation)
+* It's not possible to properly select an annotation while in highlight mode.
+* Allow changing the drawing color using the menu. (invokes the color picker)
+* Add a isEditable property to be able to lock certain annotations against future edits.
+* Add printing support for small CGDataProviderRef-based PSPDFDocuments.
+* Improve OpenIn… feature, annotations are auto-saved before opening in another app and a log warning will be displated for incompatible document compositions.
+* The password in PSPDFDocument is now saved and will be relayed to any added file (e.g. when using appendFile)
+* Improved performance for outline and annotation parsing (up to 400% faster, especially for large complex documents with huge outlines)
+* Massively improved performance for search, especially for documents with many fonts.
+* Text loupe is faster; less delays on the main thread when waiting for a textParser (more fine-grained locking)
+* PSPDFViewController now saves any unsaved annotation data when app moves to background.
+* Add PSPDFBrightnessBarButtonItem and optional software-dimming to darken the screen all the way down to black.
+* PSPDFDocuments objectsAtPDFRect:page:options: now can also search for annotations and text blocks.
+* Smart Zoom is now even smarter and picks the most likely tapped text block if the detection shows multiple overlaying blocks.
+* Adds italian translation.
+* Restores PDF page label feature from v1.
+* removeCacheForDocument:deleteDocument:error: now also removes any document metadata files (bookmarks, annotations [if they were saved externally])
+* The cancel button in PSPDFSearchViewController can now be localized.
+* PSPDFKit now uses UICollectionView on iOS6, and PSTCollectionView on iOS4/5.
+* When annotations are deserialized from disk, the proper annotation subclasses set in document.overrideClassNames will be used.
+* Ensure annotation toolbar is closed when view controller pops.
+* Thumbnails no longer are layed out behind the tab bar if PSPDFTabbedViewController is used. (they now correctly align beneath the bar)
+* Add workaround for a UIKit problem where a UIPopoverController could be resized to zero on iPad/landscape when it's just above the keyboard.
+* Greatly reduced the black hair line that was visible in double page modes between the pages. Should now be invisible in most cases.
+* The last used drawing color is now saved in the user defaults.
+* The bookmark image is now saved proportionaly to the thumbnail image.
+* Ensures that for PSPDFTabbedViewController, tabs always have a title.
+* The close button added when using the presentModal: api of PSPDFViewController now uses the Done-button style.
+* API: bookmark save/load now exposes NSError object. Also new; clearAllBookmarks.
+* API: willStartSearchOperation:forString:isFullSearch: in PSPDFSearchOperationDelegate is now optional.
+* API: PSPDFDocument now implements PSPDFDocumentProviderDelegate and also is set as the default delegate.
+* API: PSPDFDocumentDelegate now has methods for didSaveAnnotations and failedToSaveAnnotations.
+* API: removeCacheForDocument:deleteDocument:waitUntilDone: is now removeCacheForDocument:deleteDocument:error: - use dispatch_async to make the call async.
+* API: tabbedPDFController:willChangeVisibleDocument: has been renamed to tabbedPDFController:shouldChangeVisibleDocument:
+* Fixes a bug where annotations were not saved correctly on multi-file documents when saving into external file was used. You need to delete the annotations.pspdfkit file in /Library/PrivateDocuments/UID to update to the new saving version (PSPDFKit still first tries to read that file to be backwards compatible)
+* Fixes freezing if there are A LOT of search results. They are not limited to 600 by default. This can be changed in PSPDFSearchViewController, see maximumNumberOfSearchResultsDisplayed.
+* Fixes a issue where similar PDF documents could create a equal UID when initialized via NSData.
+* Fixes "jumping" of the annotation toolbar when the default toolbar style was used.
+* Fixes calling the shouldChangeDocuments delegate in PSPDFTabbedViewController.
+* Fixes issue with rotation handling under iOS6.
+* Fixes a bug that prevented selecting annotations for documents with multiple files on all but the first file
+* Fixes a bug where the text editor sometimes could have a transparent background.
+* Fixes a toolbar bug when using UIStoryboard and modal transitions to PSPDFViewController.
+* Fixes a rare placement bug with the document title label overlay on iPhone.
+* Fixes a regression of 2.1 where search on iPhone sometimes didn't jump to the correct page.
+* Fixes issue with certain unselectable words.
+* Fixes always-spinning activity indicator when internal WebBrowser was closed while page was still loading. ActivityIndicator management now also can be customized and/or disabled.
+* Fixes a page displacement issue with pageCurl and the app starting up in landscape, directly showing a PSPDFViewController. (workaround for a UIKit issue; has been fixed in iOS6)
+* Fixes invalid page coordinates sent to didTapOnPageView:atPoint: delegate on right page in landscape mode.
+* Fixes a race condition where annotations could be missing on display after repeated saving until the document has been reloaded.
+* Fixes issue with word detection where sometimes words were split apart after the first letter on the beginning of a line.
+* Fixes viewState generation. (Was always using page instead of realPage which lead to errors when using landscape mode)
+* Fixes missing background drawing for shape annotations.
+* Fixes a issue where certain link-annotations did not work when using the long-press and then tap on the sheet-button way.
+* Fixes a rare bug where pages could been missing when reloading the view of the PSPDFPerPageScrollTransition in a certain way.
+* Fixes issue where viewLockEnabled was ignored after calling reloadData.
+
+Known Issues:
+* Dragging note anotations from one page to another doesn't yet work.
+* Drawing across multiple pages doesn't yet work.
+
+
__v2.1.0 - 17/September/2012__
* New: PSPDFAESCryptoDataProvider. Allows fast, secure on-the-fly decryption of AES256-secured PDF documents. (PSPDFKit Annotate feature)
@@ -64,8 +64,7 @@ + (NSDictionary *)settings { return _settings; }
_settings[StringSEL(pageMode)] = @(PSIsIpad() ? PSPDFPageModeAutomatic : PSPDFPageModeSingle);
_settings[StringSEL(isFitToWidthEnabled)] = @(!PSIsIpad());
_settings[StringSEL(linkAction)] = @(PSPDFLinkActionInlineBrowser);
- _settings[StringSEL(pageTransition)] = @(PSPDFPageScrollContinuousTransition);
- PSPDF_IF_PRE_IOS5(_settings[StringSEL(pageTransition)] = @(PSPDFPageScrollPerPageTransition);)
+ _settings[StringSEL(pageTransition)] = @(PSPDFPageScrollPerPageTransition);
_settings[StringSEL(pageScrolling)] = @(PSPDFScrollDirectionHorizontal);
_settings[StringSEL(isScrobbleBarEnabled)] = @(YES);
_settings[StringSEL(isZoomingSmallDocumentsEnabled)] = @(YES);
@@ -1,186 +0,0 @@
-//
-// PSCollectionView.h
-// PSPDFKit
-//
-// Copyright (c) 2012 Peter Steinberger. All rights reserved.
-//
-
-#import "PSCollectionViewLayout.h"
-#import "PSCollectionViewFlowLayout.h"
-#import "PSCollectionViewCell.h"
-
-@class PSCollectionViewController;
-
-// Define this to automatically return UICollection* variants on init if they are available.
-//#define kPSCollectionViewRelayToUICollectionViewIfAvailable
-
-// Allows code to just use UICollectionView as if it would be avaiable on iOS SDK 5.
-// http://developer.apple.com/legacy/mac/library/#documentation/DeveloperTools/gcc-3.3/gcc/compatibility_005falias.html
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000
-@compatibility_alias UICollectionViewController PSCollectionViewController;
-@compatibility_alias UICollectionView PSCollectionView;
-@compatibility_alias UICollectionReusableView PSCollectionReusableView;
-@compatibility_alias UICollectionViewCell PSCollectionViewCell;
-@compatibility_alias UICollectionViewLayout PSCollectionViewLayout;
-@compatibility_alias UICollectionViewFlowLayout PSCollectionViewFlowLayout;
-@compatibility_alias UICollectionViewLayoutAttributes PSCollectionViewLayoutAttributes;
-@protocol UICollectionViewDataSource <PSCollectionViewDataSource> @end
-@protocol UICollectionViewDelegate <PSCollectionViewDelegate> @end
-#endif
-
-@protocol PSCollectionViewDataSource <NSObject>
-@required
-
-- (NSInteger)collectionView:(PSCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section;
-
-// The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath:
-- (PSCollectionViewCell *)collectionView:(PSCollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath;
-
-@optional
-
-- (NSInteger)numberOfSectionsInCollectionView:(PSCollectionView *)collectionView;
-
-// The view that is returned must be retrieved from a call to -dequeueReusableSupplementaryViewOfKind:withReuseIdentifier:forIndexPath:
-- (PSCollectionReusableView *)collectionView:(PSCollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;
-
-@end
-
-@protocol PSCollectionViewDelegate <UIScrollViewDelegate>
-@optional
-
-// Methods for notification of selection/deselection and highlight/unhighlight events.
-// The sequence of calls leading to selection from a user touch is:
-//
-// (when the touch begins)
-// 1. -collectionView:shouldHighlightItemAtIndexPath:
-// 2. -collectionView:didHighlightItemAtIndexPath:
-//
-// (when the touch lifts)
-// 3. -collectionView:shouldSelectItemAtIndexPath: or -collectionView:shouldDeselectItemAtIndexPath:
-// 4. -collectionView:didSelectItemAtIndexPath: or -collectionView:didDeselectItemAtIndexPath:
-// 5. -collectionView:didUnhighlightItemAtIndexPath:
-- (BOOL)collectionView:(PSCollectionView *)collectionView shouldHighlightItemAtIndexPath:(NSIndexPath *)indexPath;
-- (void)collectionView:(PSCollectionView *)collectionView didHighlightItemAtIndexPath:(NSIndexPath *)indexPath;
-- (void)collectionView:(PSCollectionView *)collectionView didUnhighlightItemAtIndexPath:(NSIndexPath *)indexPath;
-- (BOOL)collectionView:(PSCollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath;
-- (BOOL)collectionView:(PSCollectionView *)collectionView shouldDeselectItemAtIndexPath:(NSIndexPath *)indexPath; // called when the user taps on an already-selected item in multi-select mode
-- (void)collectionView:(PSCollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath;
-- (void)collectionView:(PSCollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath;
-
-- (void)collectionView:(PSCollectionView *)collectionView didEndDisplayingCell:(PSCollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath;
-- (void)collectionView:(PSCollectionView *)collectionView didEndDisplayingSupplementaryView:(PSCollectionReusableView *)view forElementOfKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath;
-
-// These methods provide support for copy/paste actions on cells.
-// All three should be implemented if any are.
-- (BOOL)collectionView:(PSCollectionView *)collectionView shouldShowMenuForItemAtIndexPath:(NSIndexPath *)indexPath;
-- (BOOL)collectionView:(PSCollectionView *)collectionView canPerformAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender;
-- (void)collectionView:(PSCollectionView *)collectionView performAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender;
-
-@end
-
-typedef NS_OPTIONS(NSUInteger, PSCollectionViewScrollPosition) {
- PSCollectionViewScrollPositionNone = 0,
-
- // The vertical positions are mutually exclusive to each other, but are bitwise or-able with the horizontal scroll positions.
- // Combining positions from the same grouping (horizontal or vertical) will result in an NSInvalidArgumentException.
- PSCollectionViewScrollPositionTop = 1 << 0,
- PSCollectionViewScrollPositionCenteredVertically = 1 << 1,
- PSCollectionViewScrollPositionBottom = 1 << 2,
-
- // Likewise, the horizontal positions are mutually exclusive to each other.
- PSCollectionViewScrollPositionLeft = 1 << 3,
- PSCollectionViewScrollPositionCenteredHorizontally = 1 << 4,
- PSCollectionViewScrollPositionRight = 1 << 5
-};
-
-#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000
-typedef NS_OPTIONS(NSUInteger, UICollectionViewScrollPosition) {
- UICollectionViewScrollPositionNone = 0,
-
- // The vertical positions are mutually exclusive to each other, but are bitwise or-able with the horizontal scroll positions.
- // Combining positions from the same grouping (horizontal or vertical) will result in an NSInvalidArgumentException.
- UICollectionViewScrollPositionTop = 1 << 0,
- UICollectionViewScrollPositionCenteredVertically = 1 << 1,
- UICollectionViewScrollPositionBottom = 1 << 2,
-
- // Likewise, the horizontal positions are mutually exclusive to each other.
- UICollectionViewScrollPositionLeft = 1 << 3,
- UICollectionViewScrollPositionCenteredHorizontally = 1 << 4,
- UICollectionViewScrollPositionRight = 1 << 5
-};
-#endif
-
-#import "PSCollectionViewController.h"
-
-/**
- Replacement for UICollectionView for iOS4/5.
- Only supports a subset of the features of UICollectionView.
- e.g. animations won't be handled.
- */
-@interface PSCollectionView : UIScrollView
-
-- (id)initWithFrame:(CGRect)frame collectionViewLayout:(PSCollectionViewLayout *)layout; // the designated initializer
-
-@property (nonatomic, retain) PSCollectionViewLayout *collectionViewLayout;
-@property (nonatomic, assign) id <PSCollectionViewDelegate> delegate;
-@property (nonatomic, assign) id <PSCollectionViewDataSource> dataSource;
-@property (nonatomic, retain) UIView *backgroundView; // will be automatically resized to track the size of the collection view and placed behind all cells and supplementary views.
-
-// For each reuse identifier that the collection view will use, register either a class or a nib from which to instantiate a cell.
-// If a nib is registered, it must contain exactly 1 top level object which is a PSCollectionViewCell.
-// If a class is registered, it will be instantiated via alloc/initWithFrame:
-- (void)registerClass:(Class)cellClass forCellWithReuseIdentifier:(NSString *)identifier;
-- (void)registerClass:(Class)viewClass forSupplementaryViewOfKind:(NSString *)elementKind withReuseIdentifier:(NSString *)identifier;
-- (void)registerNib:(UINib *)nib forCellWithReuseIdentifier:(NSString *)identifier;
-
-/*
-- (void)registerNib:(UINib *)nib forSupplementaryViewOfKind:(NSString *)kind withReuseIdentifier:(NSString *)identifier;
- */
-
-- (id)dequeueReusableCellWithReuseIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath;
-- (id)dequeueReusableSupplementaryViewOfKind:(NSString *)elementKind withReuseIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath;
-// These properties control whether items can be selected, and if so, whether multiple items can be simultaneously selected.
-@property (nonatomic) BOOL allowsSelection; // default is YES
-@property (nonatomic) BOOL allowsMultipleSelection; // default is NO
-
-- (NSArray *)indexPathsForSelectedItems; // returns nil or an array of selected index paths
-- (void)selectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(PSCollectionViewScrollPosition)scrollPosition;
-- (void)deselectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated;
-
-- (void)reloadData; // discard the dataSource and delegate data and requery as necessary
-
-- (void)setCollectionViewLayout:(PSCollectionViewLayout *)layout animated:(BOOL)animated; // transition from one layout to another
-
-// Information about the current state of the collection view.
-
-- (NSInteger)numberOfSections;
-- (NSInteger)numberOfItemsInSection:(NSInteger)section;
-
-- (PSCollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath;
-- (PSCollectionViewLayoutAttributes *)layoutAttributesForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;
-
-- (NSIndexPath *)indexPathForItemAtPoint:(CGPoint)point;
-- (NSIndexPath *)indexPathForCell:(PSCollectionViewCell *)cell;
-
-- (PSCollectionViewCell *)cellForItemAtIndexPath:(NSIndexPath *)indexPath;
-- (NSArray *)visibleCells;
-- (NSArray *)indexPathsForVisibleItems;
-
-// Interacting with the collection view.
-
-- (void)scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(PSCollectionViewScrollPosition)scrollPosition animated:(BOOL)animated;
-
-// These methods allow dynamic modification of the current set of items in the collection view
-- (void)insertSections:(NSIndexSet *)sections;
-- (void)deleteSections:(NSIndexSet *)sections;
-- (void)reloadSections:(NSIndexSet *)sections;
-- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection;
-
-- (void)insertItemsAtIndexPaths:(NSArray *)indexPaths;
-- (void)deleteItemsAtIndexPaths:(NSArray *)indexPaths;
-- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths;
-- (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath;
-
-- (void)performBatchUpdates:(void (^)(void))updates completion:(void (^)(BOOL finished))completion; // allows multiple insert/delete/reload/move calls to be animated simultaneously. Nestable.
-
-@end
Oops, something went wrong.

0 comments on commit 280b726

Please sign in to comment.