RITLPhotosViewController.m 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // RITLPhotosNavigationViewController.m
  3. // RITLPhotoDemo
  4. //
  5. // Created by YueWen on 2018/3/7.
  6. // Copyright © 2018年 YueWen. All rights reserved.
  7. //
  8. #import "RITLPhotosViewController.h"
  9. #import "RITLPhotosMaker.h"
  10. #import "RITLPhotosDataManager.h"
  11. #import "RITLPhotosGroupTableViewController.h"
  12. #import "RITLPhotosCollectionViewController.h"
  13. @interface RITLPhotosViewController ()
  14. @property (nonatomic, strong, readwrite) RITLPhotosConfiguration *configuration;
  15. @property (nonatomic, strong) RITLPhotosMaker *maker;
  16. @property (nonatomic, strong) RITLPhotosDataManager *dataManager;
  17. @end
  18. @implementation RITLPhotosViewController
  19. + (instancetype)photosViewController
  20. {
  21. return self.new;
  22. }
  23. - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  24. {
  25. if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
  26. self.maker = RITLPhotosMaker.sharedInstance;
  27. self.dataManager = RITLPhotosDataManager.sharedInstance;
  28. self.configuration = RITLPhotosConfiguration.defaultConfiguration;
  29. self.viewControllers = @[
  30. // RITLPhotosGroupTableViewController.new,
  31. RITLPhotosCollectionViewController.new];
  32. self.modalPresentationStyle = UIModalPresentationFullScreen;
  33. }
  34. return self;
  35. }
  36. - (void)setThumbnailSize:(CGSize)thumbnailSize
  37. {
  38. self.maker.thumbnailSize = thumbnailSize;
  39. }
  40. - (void)setPhoto_delegate:(id<RITLPhotosViewControllerDelegate>)photo_delegate
  41. {
  42. self.maker.delegate = photo_delegate;
  43. self.maker.bindViewController = self;
  44. }
  45. - (void)setDefaultIdentifers:(NSArray<NSString *> *)defaultIdentifers
  46. {
  47. self.dataManager.defaultIdentifers = defaultIdentifers;
  48. }
  49. - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
  50. {
  51. return UIInterfaceOrientationPortrait;
  52. }
  53. @end