代码库> 选择器> 非常容易使用的图片媒体选择视图
非常容易使用的图片媒体选择视图
关注
上传者:k-cat 分类:选择器(Pickerview)
查看次数:2358 下载次数:281
上传时间:2015-08-12 大小:2 KB
非常简单使用的图片媒体选择器,并且有预览媒体的视图
[lang=objc]#import "CatMediaPickerController"

CatMediaPickerController *mediaPickerController =
      [[CatMediaPickerController alloc]
          initWithMediaType:CatMediaTypePhoto
            mediaSelectType:CatMediaSelectTypeSingle
                 appearance:[CatMediaPickerControllerAppearance appearance]];
  [self presentViewController:mediaPickerController
                     animated:YES
                   completion:nil];

//Media select complete handler
[mediaPickerController
      setCompleteSelectMediaHandler:^(CatMediaPickerController
                                          *tempMediaPickerController,
                                      NSArray *mediaArray) {
        [tempMediaPickerController dismissViewControllerAnimated:YES
                                                      completion:nil];
        //Do something...
      }];

//Media select cancel handler
[mediaPickerController
      setCancelSelectMediaHandler:^(CatMediaPickerController
                                        *tempMediaPickerController) {
        [tempMediaPickerController dismissViewControllerAnimated:YES
                                                      completion:nil];
        //Do something
      }];[/lang]

测试环境:Xcode 6.2,iOS 6.0 以上
收藏
我来说两句
发表评论
您还没有登录!请登录注册
所有评论(0


综合评论
提示
sina weixin mail 回到顶部