Skip to content
This repository was archived by the owner on Jul 15, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions YangMingShan/YMSPhotoPicker/Private/YMSCameraCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
//

#import <AVFoundation/AVFoundation.h>
#import <UIKit/UIKit.h>
#import "YMSCollectionViewCell.h"

/**
* This is the customized UICollectionViewCell for photo picker as the camera preview.
*/
@interface YMSCameraCell : UICollectionViewCell
@interface YMSCameraCell : YMSCollectionViewCell

/**
* @brief It is the session for monitoring current camera preview status.
Expand Down
7 changes: 7 additions & 0 deletions YangMingShan/YMSPhotoPicker/Private/YMSCameraCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,11 @@ - (void)layoutSubviews
self.previewLayer.connection.videoOrientation = orientation;
}

#pragma mark - Accessibility

- (NSString *)accessibilityLabel
{
return NSLocalizedString(@"Open camera", nil);
}

@end
13 changes: 13 additions & 0 deletions YangMingShan/YMSPhotoPicker/Private/YMSCollectionViewCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// YMSCollectionViewCell.h
// YangMingShanDemo
//
// Created by Vyacheslav Khlichkin on 24.04.2018.
// Copyright © 2018 Yahoo. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface YMSCollectionViewCell : UICollectionViewCell

@end
32 changes: 32 additions & 0 deletions YangMingShan/YMSPhotoPicker/Private/YMSCollectionViewCell.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// YMSCollectionViewCell.m
// YangMingShanDemo
//
// Created by Vyacheslav Khlichkin on 24.04.2018.
// Copyright © 2018 Yahoo. All rights reserved.
//

#import "YMSCollectionViewCell.h"

@implementation YMSCollectionViewCell

#pragma mark - Accessibility

- (BOOL)isAccessibilityElement
{
return YES;
}

- (UIAccessibilityTraits)accessibilityTraits
{
return UIAccessibilityTraitButton;
}

- (void)accessibilityElementDidBecomeFocused
{
UICollectionView *collectionView = (UICollectionView *)self.superview;
[collectionView scrollToItemAtIndexPath:[collectionView indexPathForCell:self] atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally|UICollectionViewScrollPositionCenteredVertically animated:NO];
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, self);
}

@end
4 changes: 2 additions & 2 deletions YangMingShan/YMSPhotoPicker/Private/YMSPhotoCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
// Part of this code was derived from code authored by David Robles

#import <Photos/Photos.h>
#import <UIKit/UIKit.h>
#import "YMSCollectionViewCell.h"

/**
* This is the customized UICollectionViewCell for photo picker to display single photo.
*/
@interface YMSPhotoCell : UICollectionViewCell
@interface YMSPhotoCell : YMSCollectionViewCell

/**
* @brief It is the identifier for photo picker to display single photo in current album.
Expand Down
7 changes: 7 additions & 0 deletions YangMingShan/YMSPhotoPicker/Private/YMSPhotoCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,11 @@ - (void)setSelected:(BOOL)selected animated:(BOOL)animated
self.animateSelection = NO;
}

#pragma mark - Accessibility

- (NSString *)accessibilityLabel
{
return NSLocalizedString(@"Select photo", nil);
}

@end
8 changes: 8 additions & 0 deletions YangMingShanDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
5130731A1D13D5A400C98705 /* YangMingShanDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 513073171D13D59D00C98705 /* YangMingShanDemoUITests.m */; };
51FF32391D129D020029197B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 51FF32291D129D020029197B /* Assets.xcassets */; };
897897DD1F7F72920054FB81 /* YMSNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 89B3BF9F1F7F38DB00DD2C21 /* YMSNavigationController.m */; };
F9AD7F1E208EF2DC00B35B4E /* YMSCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F9AD7F1B208EF2DC00B35B4E /* YMSCollectionViewCell.m */; };
F9AD7F1F208EF2DC00B35B4E /* YMSCollectionViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = F9AD7F1C208EF2DC00B35B4E /* YMSCollectionViewCell.h */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -181,6 +183,8 @@
51FF322B1D129D020029197B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
89B3BF9E1F7F38DB00DD2C21 /* YMSNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = YMSNavigationController.h; path = Private/YMSNavigationController.h; sourceTree = "<group>"; };
89B3BF9F1F7F38DB00DD2C21 /* YMSNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = YMSNavigationController.m; path = Private/YMSNavigationController.m; sourceTree = "<group>"; };
F9AD7F1B208EF2DC00B35B4E /* YMSCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = YMSCollectionViewCell.m; path = Private/YMSCollectionViewCell.m; sourceTree = "<group>"; };
F9AD7F1C208EF2DC00B35B4E /* YMSCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YMSCollectionViewCell.h; path = Private/YMSCollectionViewCell.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -344,6 +348,8 @@
51F2EEE81CEC4D5F006DFC4B /* YMSPhotoPickerAssets.xcassets */,
51FF31EB1D129B4C0029197B /* Categories */,
5130733C1D1B8DC000C98705 /* YMSPhotoPickerTheme.h */,
F9AD7F1C208EF2DC00B35B4E /* YMSCollectionViewCell.h */,
F9AD7F1B208EF2DC00B35B4E /* YMSCollectionViewCell.m */,
5130733D1D1B8DC000C98705 /* YMSPhotoPickerTheme.m */,
5130733E1D1B8DC000C98705 /* YMSPhotoPickerViewController.h */,
5130733F1D1B8DC000C98705 /* YMSPhotoPickerViewController.m */,
Expand Down Expand Up @@ -411,6 +417,7 @@
3EFA1FC51E92829000FD8984 /* YMSAlbumCell.h in Headers */,
3EFA1FC61E92829000FD8984 /* YMSAlbumPickerViewController.h in Headers */,
3EFA1FC71E92829000FD8984 /* YMSCameraCell.h in Headers */,
F9AD7F1F208EF2DC00B35B4E /* YMSCollectionViewCell.h in Headers */,
3EFA1FC81E92829000FD8984 /* YMSPhotoCell.h in Headers */,
3EFA1FC91E92829000FD8984 /* YMSSinglePhotoViewController.h in Headers */,
);
Expand Down Expand Up @@ -630,6 +637,7 @@
3EFA1FD71E92844B00FD8984 /* YMSPhotoPickerTheme.m in Sources */,
3EFA1FD81E92844B00FD8984 /* YMSPhotoPickerViewController.m in Sources */,
3EFA1FD91E92844B00FD8984 /* YMSAlbumCell.m in Sources */,
F9AD7F1E208EF2DC00B35B4E /* YMSCollectionViewCell.m in Sources */,
897897DD1F7F72920054FB81 /* YMSNavigationController.m in Sources */,
3EFA1FDA1E92844B00FD8984 /* YMSAlbumPickerViewController.m in Sources */,
3EFA1FDB1E92844B00FD8984 /* YMSCameraCell.m in Sources */,
Expand Down