33NSString const *MediaPickerOptionsShowMostRecentFirst = @" MediaPickerOptionsShowMostRecentFirst" ;
44NSString const *MediaPickerOptionsUsePhotosLibrary = @" MediaPickerOptionsUsePhotosLibrary" ;
55NSString const *MediaPickerOptionsShowCameraCapture = @" MediaPickerOptionsShowCameraCapture" ;
6+ NSString const *MediaPickerOptionsPreferFrontCamera = @" MediaPickerOptionsPreferFrontCamera" ;
67NSString const *MediaPickerOptionsAllowMultipleSelection = @" MediaPickerOptionsAllowMultipleSelection" ;
78NSString const *MediaPickerOptionsPostProcessingStep = @" MediaPickerOptionsPostProcessingStep" ;
89
910typedef NS_ENUM (NSInteger , OptionsViewControllerCell){
1011 OptionsViewControllerCellShowMostRecentFirst,
1112 OptionsViewControllerCellShowCameraCapture,
13+ OptionsViewControllerCellPreferFrontCamera,
1214 OptionsViewControllerCellAllowMultipleSelection,
1315 OptionsViewControllerCellPostProcessingStep,
1416 OptionsViewControllerCellTotal
@@ -18,6 +20,7 @@ @interface OptionsViewController ()
1820
1921@property (nonatomic , strong ) UITableViewCell *showMostRecentFirstCell;
2022@property (nonatomic , strong ) UITableViewCell *showCameraCaptureCell;
23+ @property (nonatomic , strong ) UITableViewCell *preferFrontCameraCell;
2124@property (nonatomic , strong ) UITableViewCell *allowMultipleSelectionCell;
2225@property (nonatomic , strong ) UITableViewCell *postProcessingStepCell;
2326
@@ -43,6 +46,10 @@ - (void)viewDidLoad
4346 self.showCameraCaptureCell .accessoryView = [[UISwitch alloc ] init ];
4447 ((UISwitch *)self.showCameraCaptureCell .accessoryView ).on = [self .options[MediaPickerOptionsShowCameraCapture] boolValue ];
4548 self.showCameraCaptureCell .textLabel .text = @" Show Capture Cell" ;
49+
50+ self.preferFrontCameraCell = [[UITableViewCell alloc ] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: nil ];
51+ self.preferFrontCameraCell .accessoryView = [[UISwitch alloc ] init ];
52+ self.preferFrontCameraCell .textLabel .text = @" Prefer Front Camera" ;
4653
4754 self.allowMultipleSelectionCell = [[UITableViewCell alloc ] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: nil ];
4855 self.allowMultipleSelectionCell .accessoryView = [[UISwitch alloc ] init ];
@@ -76,6 +83,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
7683 case OptionsViewControllerCellShowCameraCapture:
7784 return self.showCameraCaptureCell ;
7885 break ;
86+ case OptionsViewControllerCellPreferFrontCamera:
87+ return self.preferFrontCameraCell ;
88+ break ;
7989 case OptionsViewControllerCellAllowMultipleSelection:
8090 return self.allowMultipleSelectionCell ;
8191 break ;
@@ -95,6 +105,7 @@ - (void)done:(id) sender
95105 NSDictionary *newOptions = @{
96106 MediaPickerOptionsShowMostRecentFirst:@(((UISwitch *)self.showMostRecentFirstCell .accessoryView ).on ),
97107 MediaPickerOptionsShowCameraCapture:@(((UISwitch *)self.showCameraCaptureCell .accessoryView ).on ),
108+ MediaPickerOptionsPreferFrontCamera:@(((UISwitch *)self.preferFrontCameraCell .accessoryView ).on ),
98109 MediaPickerOptionsAllowMultipleSelection:@(((UISwitch *)self.allowMultipleSelectionCell .accessoryView ).on ),
99110 MediaPickerOptionsPostProcessingStep:@(((UISwitch *)self.postProcessingStepCell .accessoryView ).on )
100111 };
0 commit comments