QMUIAlbumViewController
@interface QMUIAlbumViewController
当前设备照片里的相簿列表,使用方式:
- 使用 init 初始化。
- 指定一个 albumViewControllerDelegate,并实现 @required 方法。
Warning
注意,iOS 访问相册需要得到授权,建议先询问用户授权,通过了再进行 QMUIAlbumViewController 的初始化工作。关于授权的代码,可参考 QMUI Demo 项目里的 [QDImagePickerExampleViewController authorizationPresentAlbumViewControllerWithTitle] 方法。See
[QMUIAssetsManager requestAuthorization:]-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, weak) id<QMUIAlbumViewControllerDelegate> albumViewControllerDelegate
Swift
weak var albumViewControllerDelegate: QMUIAlbumViewControllerDelegate? { get set }
-
相册列表 cell 的高度,同时也是相册预览图的宽高,默认57
Declaration
Objective-C
@property (nonatomic) CGFloat albumTableViewCellHeight;
Swift
var albumTableViewCellHeight: CGFloat { get set }
-
相册展示内容的类型,可以控制只展示照片、视频或音频的其中一种,也可以同时展示所有类型的资源,默认展示所有类型的资源。
Declaration
Objective-C
@property (nonatomic) int contentType;
Swift
var contentType: Int32 { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, copy) NSString *tipTextWhenNoPhotosAuthorization
Swift
var tipTextWhenNoPhotosAuthorization: String? { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, copy) NSString *tipTextWhenPhotosEmpty
Swift
var tipTextWhenPhotosEmpty: String? { get set }
-
加载相册列表时会出现 loading,若需要自定义 loading 的形式,可将该属性置为 NO,默认为 YES。
See
albumViewControllerWillStartLoading: & albumViewControllerWillFinishLoading:Declaration
Objective-C
@property (nonatomic) BOOL shouldShowDefaultLoadingView;
Swift
var shouldShowDefaultLoadingView: Bool { get set }
-
在 QMUIAlbumViewController 被放到 UINavigationController 里之后,可通过调用这个方法,来尝试直接进入上一次选中的相册列表
Declaration
Objective-C
- (void)pickLastAlbumGroupDirectlyIfCan;
Swift
func pickLastAlbumGroupDirectlyIfCan()
-
Undocumented
Declaration
Objective-C
+ (instancetype)appearance;
Swift
class func appearance() -> Self