Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/104.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用于iOS的自定义图像选择器_Ios_Iphone_Custom Controls_Uicollectionview_Uiimagepickercontroller - Fatal编程技术网

用于iOS的自定义图像选择器

用于iOS的自定义图像选择器,ios,iphone,custom-controls,uicollectionview,uiimagepickercontroller,Ios,Iphone,Custom Controls,Uicollectionview,Uiimagepickercontroller,我的应用程序中有自己的collectionView。我不想为我的应用程序使用默认的UIImagePicker&我想在我的集合视图中实现图像选择器 谁能告诉我如何实现自定义选择相册视图,以及在选择相册后,如何实现自定义视图以查看该相册中的所有图像 抱歉,如果这是一个非常简单的问题。这可以在ALASSETS的帮助下完成。您可以在下面找到关于它的文档。 ALAssetsLibrary *al = [[ALAssetsLibrary alloc] init]; assets = [[NSMutable

我的应用程序中有自己的collectionView。我不想为我的应用程序使用默认的UIImagePicker&我想在我的集合视图中实现图像选择器

谁能告诉我如何实现自定义选择相册视图,以及在选择相册后,如何实现自定义视图以查看该相册中的所有图像


抱歉,如果这是一个非常简单的问题。

这可以在ALASSETS的帮助下完成。您可以在下面找到关于它的文档。

ALAssetsLibrary *al = [[ALAssetsLibrary alloc] init];
assets = [[NSMutableArray alloc] init];
[al enumerateGroupsWithTypes:ALAssetsGroupAll

                  usingBlock:^(ALAssetsGroup *group, BOOL *stop)
 {
     [group enumerateAssetsUsingBlock:^(ALAsset *asset, NSUInteger index, BOOL *stop)
      {
          if (asset)
          {  
               NSLog(@"%@",asset);  

              NSLog(@".. do something with the asset");    
          }
      }
      ];
 }

                         failureBlock:^(NSError *error)
      {
          // User did not allow access to library
         // .. handle error 
      }
      ] ;
如果要将其填充到“集合”视图中,则需要创建一个自定义单元格,其中包含Alasset类型变量

请参见此自定义控件,这可能会有所帮助