Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 14a3c73

Browse files
committed
Merge branch 'release/0.7.3'
2 parents 270ab13 + 444cf24 commit 14a3c73

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

Example/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- WPMediaPicker (0.7.2)
2+
- WPMediaPicker (0.7.3)
33

44
DEPENDENCIES:
55
- WPMediaPicker (from `../`)
@@ -9,6 +9,6 @@ EXTERNAL SOURCES:
99
:path: ../
1010

1111
SPEC CHECKSUMS:
12-
WPMediaPicker: 22beabf079a54ece002208efd934e472eaedeed4
12+
WPMediaPicker: 6bbce465f5a5c071267ae28bdf31d0fd6e109721
1313

1414
COCOAPODS: 0.39.0

Example/WPMediaPicker/DemoViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ - (void)viewDidLoad
3131
self.dateFormatter.timeStyle = NSDateFormatterMediumStyle;
3232
[self.tableView registerClass:[WPMediaGroupTableViewCell class] forCellReuseIdentifier:NSStringFromClass([WPMediaGroupTableViewCell class])];
3333
self.options = @{
34-
MediaPickerOptionsShowMostRecentFirst:@(NO),
35-
MediaPickerOptionsUsePhotosLibrary:@(NO),
34+
MediaPickerOptionsShowMostRecentFirst:@(YES),
35+
MediaPickerOptionsUsePhotosLibrary:@(YES),
3636
MediaPickerOptionsShowCameraCapture:@(YES),
3737
MediaPickerOptionsAllowMultipleSelection:@(YES)
3838
};

Pod/Classes/WPMediaCollectionViewController.m

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,20 @@ - (BOOL)isMediaDeviceAvailable
559559
- (void)showMediaCaptureViewController
560560
{
561561
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
562-
imagePickerController.mediaTypes =
563-
[UIImagePickerController availableMediaTypesForSourceType:
564-
UIImagePickerControllerSourceTypeCamera];
562+
NSMutableSet *mediaTypes = [NSMutableSet setWithArray:[UIImagePickerController availableMediaTypesForSourceType:
563+
UIImagePickerControllerSourceTypeCamera]];
564+
switch (self.filter) {
565+
case(WPMediaTypeImage): {
566+
[mediaTypes intersectSet:[NSSet setWithArray:@[(__bridge NSString *)kUTTypeImage]]];
567+
} break;
568+
case(WPMediaTypeVideo): {
569+
[mediaTypes intersectSet:[NSSet setWithArray:@[(__bridge NSString *)kUTTypeMovie]]];
570+
} break;
571+
default: {
572+
//Don't intersect at all
573+
}
574+
}
575+
imagePickerController.mediaTypes = [mediaTypes allObjects];
565576
imagePickerController.delegate = self;
566577
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
567578
imagePickerController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

WPMediaPicker.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WPMediaPicker"
3-
s.version = "0.7.2"
3+
s.version = "0.7.3"
44
s.summary = "WPMediaPicker is an iOS controller that allows capture and picking of media assets."
55
s.description = <<-DESC
66
WPMediaPicker is an iOS controller that allows capture and picking of media assets.

0 commit comments

Comments
 (0)