AJPhotoListView.m 972 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // AJPhotoListView.m
  3. // AJPhotoPicker
  4. //
  5. // Created by AlienJunX on 15/11/2.
  6. // Copyright (c) 2015 AlienJunX
  7. //
  8. // This source code is licensed under the MIT-style license found in the
  9. // LICENSE file in the root directory of this source tree.
  10. //
  11. #import "AJPhotoListView.h"
  12. #import "AJPhotoListCell.h"
  13. @implementation AJPhotoListView
  14. #pragma mark - init
  15. - (instancetype)init {
  16. UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
  17. [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
  18. self = [[AJPhotoListView alloc] initWithFrame:CGRectMake(0, 64, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) collectionViewLayout:flowLayout];
  19. if (self) {
  20. [self registerClass:[AJPhotoListCell class] forCellWithReuseIdentifier:@"cell"];
  21. self.backgroundColor = [UIColor whiteColor];
  22. self.userInteractionEnabled = YES;
  23. }
  24. return self;
  25. }
  26. @end