CTAssetsPageViewController.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. MIT License (MIT)
  3. Copyright (c) 2015 Clement CN Tsang
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18. THE SOFTWARE.
  19. */
  20. #import <UIKit/UIKit.h>
  21. #import <Photos/Photos.h>
  22. NS_ASSUME_NONNULL_BEGIN
  23. /**
  24. * A view controller that shows selected photos and vidoes from user's photo library that let the user navigate the item page by page.
  25. */
  26. @interface CTAssetsPageViewController : UIPageViewController
  27. /**
  28. * The index of the photo or video with the currently showing item.
  29. */
  30. @property (nonatomic, assign) NSInteger pageIndex;
  31. /**
  32. * @name Creating a Assets Page View Controller
  33. */
  34. /**
  35. * Initializes a newly created view controller with a fetech result.
  36. *
  37. * @param fetchResult A fetch result of `PHAsset` objects.
  38. *
  39. * @return An instance of `CTAssetPageViewController` initialized to show the asset items in `fetchResult`.
  40. */
  41. - (instancetype)initWithFetchResult:(PHFetchResult *)fetchResult;
  42. /**
  43. * Initializes a newly created view controller with an array of assets.
  44. *
  45. * @param assets An array of `PHAsset` objects.
  46. *
  47. * @return An instance of `CTAssetPageViewController` initialized to show the asset items in `assets`.
  48. */
  49. - (instancetype)initWithAssets:(NSArray<PHAsset*> *)assets;
  50. @end
  51. NS_ASSUME_NONNULL_END