diff --git a/.codecov.yml b/.codecov.yml index 6e8a3922..c56abd29 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -2,4 +2,4 @@ comment: layout: header, changes, diff coverage: ignore: - - HXPhotoPicker-Demo + - HXPhotoPickerExample diff --git a/.travis.yml b/.travis.yml index 890a8886..e58f76fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ before_install: script: - set -o pipefail - - xcodebuild clean -workspace HXPhotoPicker-Demo.xcworkspace -scheme "HXPhotoPicker" -sdk iphonesimulator build | xcpretty + - xcodebuild clean -workspace HXPhotoPickerExample.xcworkspace -scheme "HXPhotoPickerExample" -sdk iphonesimulator build | xcpretty after_success: - sleep 4 diff --git a/HXPHPicker/Bundle+HXPhotoPicker.swift b/HXPHPicker/Bundle+HXPhotoPicker.swift new file mode 100644 index 00000000..fca3e9af --- /dev/null +++ b/HXPHPicker/Bundle+HXPhotoPicker.swift @@ -0,0 +1,25 @@ +// +// Bundle+HXPhotoPicker.swift +// HXPHPickerExample +// +// Created by 洪欣 on 2020/11/15. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +extension Bundle { + + class func hx_localizedString(for key: String) -> String { + return hx_localizedString(for: key, value: nil) + } + + class func hx_localizedString(for key: String, value: String?) -> String { + let bundle = HXPHManager.shared.languageBundle + var newValue = bundle?.localizedString(forKey: key, value: value, table: nil) + if newValue == nil { + newValue = key + } + return newValue! + } +} diff --git a/HXPHPicker/HXAlbumView.swift b/HXPHPicker/HXAlbumView.swift new file mode 100644 index 00000000..0340a3c2 --- /dev/null +++ b/HXPHPicker/HXAlbumView.swift @@ -0,0 +1,71 @@ +// +// HXAlbumView.swift +// HXPHPickerExample +// +// Created by 洪欣 on 2020/11/17. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +protocol HXAlbumViewDelegate: NSObjectProtocol { + +} + +class HXAlbumView: UIView, UITableViewDataSource, UITableViewDelegate { + + weak var delegate: HXAlbumViewDelegate? + + lazy var tableView : UITableView = { + let tableView = UITableView.init(frame: CGRect.init(), style: UITableView.Style.plain) + tableView.backgroundColor = config!.backgroundColor + tableView.dataSource = self; + tableView.delegate = self; + tableView.separatorStyle = UITableViewCell.SeparatorStyle.none + tableView.register(HXAlbumViewCell.self, forCellReuseIdentifier: "cellId") + return tableView + }() + var config: HXPHAlbumListConfiguration? + var assetCollectionsArray: [HXPHAssetCollection] = [] + + init(config: HXPHAlbumListConfiguration) { + super.init(frame: CGRect.zero) + self.config = config + backgroundColor = config.backgroundColor + addSubview(tableView) + } + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return assetCollectionsArray.count + } + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "cellId") as! HXAlbumViewCell + let assetCollection = assetCollectionsArray[indexPath.row] + cell.assetCollection = assetCollection + cell.config = config + return cell + } + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return config!.cellHeight + } + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + tableView.deselectRow(at: indexPath, animated: true) + let assetCollection = assetCollectionsArray[indexPath.row] + + } + + func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) { + let myCell: HXAlbumViewCell = cell as! HXAlbumViewCell + myCell.cancelRequest() + } + + override func layoutSubviews() { + super.layoutSubviews() + tableView.frame = bounds + } + + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} diff --git a/HXPHPicker/HXAlbumViewCell.swift b/HXPHPicker/HXAlbumViewCell.swift new file mode 100644 index 00000000..a8a1ca66 --- /dev/null +++ b/HXPHPicker/HXAlbumViewCell.swift @@ -0,0 +1,103 @@ +// +// HXAlbumViewCell.swift +// 照片选择器-Swift +// +// Created by 洪欣 on 2019/6/28. +// Copyright © 2019年 洪欣. All rights reserved. +// + +import UIKit +import Photos + +class HXAlbumViewCell: UITableViewCell { + lazy var albumCoverView: UIImageView = { + let albumCoverView = UIImageView.init() + albumCoverView.contentMode = UIView.ContentMode.scaleAspectFill + albumCoverView.clipsToBounds = true + return albumCoverView + }() + lazy var albumNameLb: UILabel = { + let albumNameLb = UILabel.init() + return albumNameLb + }() + lazy var photoCountLb: UILabel = { + let photoCountLb = UILabel.init() + return photoCountLb + }() + lazy var bottomLineView: UIView = { + let bottomLineView = UIView.init() + bottomLineView.backgroundColor = UIColor.lightGray.withAlphaComponent(0.15) + return bottomLineView + }() + lazy var selectedBgView : UIView = { + let selectedBgView = UIView.init() + return selectedBgView + }() + var config : HXPHAlbumListConfiguration? { + didSet { + albumNameLb.textColor = config?.albumNameColor + albumNameLb.font = config?.albumNameFont + photoCountLb.textColor = config?.photoCountColor + photoCountLb.font = config?.photoCountFont + bottomLineView.backgroundColor = config?.separatorLineColor + backgroundColor = config?.cellBackgroudColor + if config?.cellSelectedColor != nil { + selectedBgView.backgroundColor = config?.cellSelectedColor + selectedBackgroundView = selectedBgView + } + } + } + var assetCollection: HXPHAssetCollection? { + didSet { + albumNameLb.text = assetCollection?.albumName + photoCountLb.text = String(assetCollection!.count) + requestID = assetCollection?.requestCoverImage(completion: { (image, assetCollection, info) in + if assetCollection == self.assetCollection && image != nil { + self.albumCoverView.image = image + if !HXPHAssetManager.assetDownloadIsDegraded(for: info) { + self.requestID = nil + } + } + }) + } + } + var requestID: PHImageRequestID? + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: style, reuseIdentifier: reuseIdentifier) + initView() + } + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + func initView() { + contentView.addSubview(albumCoverView) + contentView.addSubview(albumNameLb) + contentView.addSubview(photoCountLb) + contentView.addSubview(bottomLineView) + } + + override func layoutSubviews() { + super.layoutSubviews() + let coverMargin : CGFloat = 5 + let coverWidth = hx_height - (coverMargin * 2) + albumCoverView.frame = CGRect(x: coverMargin, y: coverMargin, width: coverWidth, height: coverWidth) + + albumNameLb.hx_x = albumCoverView.frame.maxX + 10 + albumNameLb.hx_size = CGSize(width: hx_width - albumNameLb.hx_x - 20, height: 16) + albumNameLb.hx_centerY = hx_height / CGFloat(2) - albumNameLb.hx_height / CGFloat(2) + + photoCountLb.hx_x = albumCoverView.frame.maxX + 10 + photoCountLb.hx_y = albumNameLb.frame.maxY + 5 + photoCountLb.hx_size = CGSize(width: hx_width - photoCountLb.hx_x - 20, height: 14) + + bottomLineView.frame = CGRect(x: coverMargin, y: hx_height - 0.5, width: hx_width - coverMargin * 2, height: 0.5) + } + + func cancelRequest() { + if requestID != nil { + PHImageManager.default().cancelImageRequest(requestID!) + requestID = nil + } + } +} diff --git a/HXPHPicker/HXAlbumViewController.swift b/HXPHPicker/HXAlbumViewController.swift new file mode 100644 index 00000000..45ee47eb --- /dev/null +++ b/HXPHPicker/HXAlbumViewController.swift @@ -0,0 +1,162 @@ +// +// HXAlbumViewController.swift +// 照片选择器-Swift +// +// Created by 洪欣 on 2019/6/28. +// Copyright © 2019年 洪欣. All rights reserved. +// + +import UIKit +import Photos + +class HXAlbumViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { + + lazy var tableView : UITableView = { + let tableView = UITableView.init(frame: CGRect.init(), style: UITableView.Style.plain) + tableView.backgroundColor = config!.backgroundColor + tableView.dataSource = self; + tableView.delegate = self; + tableView.separatorStyle = UITableViewCell.SeparatorStyle.none + tableView.register(HXAlbumViewCell.self, forCellReuseIdentifier: "cellId") + if #available(iOS 11.0, *) { + tableView.contentInsetAdjustmentBehavior = UIScrollView.ContentInsetAdjustmentBehavior.never + } else { + // Fallback on earlier versions + self.automaticallyAdjustsScrollViewInsets = false + } + return tableView + }() + var config: HXPHAlbumListConfiguration? + var assetCollectionsArray: [HXPHAssetCollection] = [] + var orientationDidChange : Bool = false + var beforeOrientationIndexPath: IndexPath? + var canFetchAssetCollections: Bool = false + init() { + super.init(nibName: nil, bundle: nil) + } + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + override func viewDidLoad() { + super.viewDidLoad() + extendedLayoutIncludesOpaqueBars = true; + edgesForExtendedLayout = UIRectEdge.all; + config = hx_pickerController()!.config.albumList + view.backgroundColor = config!.backgroundColor + let backItem = UIBarButtonItem.init(title: "取消".hx_localized(), style: UIBarButtonItem.Style.done, target: self, action: #selector(didCancelItemClick)) + navigationItem.rightBarButtonItem = backItem + view.addSubview(tableView) + fetchCameraAssetCollection() + NotificationCenter.default.addObserver(self, selector: #selector(deviceOrientationChanged(notify:)), name: UIApplication.didChangeStatusBarOrientationNotification, object: nil) + } + @objc func deviceOrientationChanged(notify: Notification) { + beforeOrientationIndexPath = tableView.indexPathsForVisibleRows?.first + orientationDidChange = true + } + func fetchCameraAssetCollection() { + if hx_pickerController()?.cameraAssetCollection != nil { + self.pushPhotoPickerContoller(assetCollection: hx_pickerController()?.cameraAssetCollection, animated: false) + self.canFetchAssetCollections = true + title = "相册".hx_localized() + }else { + hx_pickerController()?.fetchCameraAssetCollectionCompletion = { (assetCollection) in + var cameraAssetCollection = assetCollection + if cameraAssetCollection == nil { + cameraAssetCollection = HXPHAssetCollection.init(albumName: self.config?.emptyAlbumName, coverImage: UIImage.hx_named(named: self.config!.emptyCoverImageName)) + } + self.pushPhotoPickerContoller(assetCollection: cameraAssetCollection, animated: false) + self.canFetchAssetCollections = true + self.title = "相册".hx_localized() + } + } + } + + func fetchAssetCollections() { + HXPHProgressHUD.showLoadingHUD(addedTo: view, animated: true) + hx_pickerController()?.fetchAssetCollections() + hx_pickerController()?.fetchAssetCollectionsCompletion = { (assetCollectionsArray) in + self.reloadTableView(assetCollectionsArray: assetCollectionsArray) + HXPHProgressHUD.hideHUD(forView: self.view, animated: true) + } + } + func reloadTableView(assetCollectionsArray: [HXPHAssetCollection]) { + self.assetCollectionsArray = assetCollectionsArray + if self.assetCollectionsArray.isEmpty { + let assetCollection = HXPHAssetCollection.init(albumName: self.config?.emptyAlbumName, coverImage: UIImage.hx_named(named: self.config!.emptyCoverImageName)) + self.assetCollectionsArray.append(assetCollection) + } + self.tableView.reloadData() + } + private func pushPhotoPickerContoller(assetCollection: HXPHAssetCollection?, animated: Bool) { + let photoVC = HXPHPickerViewController.init() + photoVC.assetCollection = assetCollection + photoVC.showLoading = animated + navigationController?.pushViewController(photoVC, animated: animated) + } + + @objc func didCancelItemClick() { + hx_pickerController()?.cancelCallback() + dismiss(animated: true, completion: nil) + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return assetCollectionsArray.count + } + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "cellId") as! HXAlbumViewCell + let assetCollection = assetCollectionsArray[indexPath.row] + cell.assetCollection = assetCollection + cell.config = config + return cell + } + func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { + return config!.cellHeight + } + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + tableView.deselectRow(at: indexPath, animated: true) + let assetCollection = assetCollectionsArray[indexPath.row] + pushPhotoPickerContoller(assetCollection: assetCollection, animated: true) + } + + func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) { + let myCell: HXAlbumViewCell = cell as! HXAlbumViewCell + myCell.cancelRequest() + } + + func changeSubviewFrame() { + let margin: CGFloat = UIDevice.hx_leftMargin() + tableView.frame = CGRect(x: margin, y: 0, width: view.hx_width - 2 * margin, height: view.hx_height) + if navigationController?.modalPresentationStyle == UIModalPresentationStyle.fullScreen { + tableView.contentInset = UIEdgeInsets.init(top: UIDevice.hx_navigationBarHeight(), left: 0, bottom: UIDevice.hx_bottomMargin(), right: 0) + }else { + tableView.contentInset = UIEdgeInsets.init(top: navigationController!.navigationBar.hx_height, left: 0, bottom: UIDevice.hx_bottomMargin(), right: 0) + } + if orientationDidChange { + if !assetCollectionsArray.isEmpty { + tableView.scrollToRow(at: beforeOrientationIndexPath ?? IndexPath.init(row: 0, section: 0), at: UITableView.ScrollPosition.top, animated: false) + } + orientationDidChange = false + } + } + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + changeSubviewFrame() + } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + navigationController?.popoverPresentationController?.delegate = self as? UIPopoverPresentationControllerDelegate; + } + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + if assetCollectionsArray.isEmpty && canFetchAssetCollections { + fetchAssetCollections() + } + } + override var preferredStatusBarStyle: UIStatusBarStyle { + return UIStatusBarStyle.default + } + deinit { + NotificationCenter.default.removeObserver(self) + print("\(self) deinit") + } +} diff --git a/HXPHPicker/HXPHAsset.swift b/HXPHPicker/HXPHAsset.swift new file mode 100644 index 00000000..3f54271f --- /dev/null +++ b/HXPHPicker/HXPHAsset.swift @@ -0,0 +1,164 @@ +// +// HXPHAsset.swift +// HXPhotoPickerSwift +// +// Created by 洪欣 on 2020/11/12. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit +import Photos + +typealias HXPHAssetICloudHandlerHandler = (HXPHAsset, PHImageRequestID) -> Void +typealias HXPHAssetProgressHandler = (HXPHAsset, Double) -> Void +typealias HXPHAssetFailureHandler = (HXPHAsset, [AnyHashable : Any]?) -> Void + +class HXPHAsset: NSObject { + + /// 系统相册里的资源 + var asset: PHAsset? { + didSet { + setMediaType() + } + } + + /// 当前资源的图片大小 + var imageSize: CGSize { + get { + let size : CGSize + if asset != nil { + if asset!.pixelWidth == 0 || asset!.pixelHeight == 0 { + size = CGSize(width: 200, height: 200) + }else { + size = CGSize(width: asset!.pixelWidth, height: asset!.pixelHeight) + } + }else { + size = CGSize(width: 200, height: 200) + } + return size + } + } + + /// 媒体类型 + var mediaType: HXPHAssetMediaType = HXPHAssetMediaType.photo + + /// 媒体子类型 + var mediaSubType: HXPHAssetMediaSubType = HXPHAssetMediaSubType.image + + /// 视频时长 格式:00:00 + var videoTime: String? + + /// 视频时长 秒 + var videoDuration: TimeInterval = 0 + + /// 当前资源是否被选中 + var selected: Bool = false + + /// 选中时的下标 + var selectIndex: Int = 0 + + init(asset: PHAsset) { + super.init() + self.asset = asset + setMediaType() + } + private func setMediaType() { + if asset?.mediaType.rawValue == 1 { + mediaType = HXPHAssetMediaType.photo + mediaSubType = HXPHAssetMediaSubType.image + }else if asset?.mediaType.rawValue == 2 { + mediaType = HXPHAssetMediaType.video + mediaSubType = HXPHAssetMediaSubType.video + videoDuration = asset!.duration + videoTime = HXPHTools.transformVideoDurationToString(duration: asset!.duration) + } + } + + /// 请求缩略图 + /// - Parameter completion: 完成回调 + /// - Returns: 请求ID + func requestThumbnailImage(completion: ((UIImage?, HXPHAsset, [AnyHashable : Any]?) -> Void)?) -> PHImageRequestID? { + if asset == nil { + return nil + } + return HXPHAssetManager.requestThumbnailImage(for: asset!, targetWidth: 165) { (image, info) in + if completion != nil { + completion!(image, self, info) + } + } + } + + /// 请求imageData,如果资源在iCloud上会自动下载。如果需要更细节的处理请使用 PHAssetManager + /// - Parameters: + /// - iCloudHandler: 下载iCloud上的资源时回调iCloud的请求ID + /// - progressHandler: iCloud下载进度 + /// - Returns: 请求ID + func requestImageData(iCloudHandler: HXPHAssetICloudHandlerHandler?, progressHandler: HXPHAssetProgressHandler?, success: ((HXPHAsset, Data, UIImage.Orientation, [AnyHashable : Any]?) -> Void)?, failure: HXPHAssetFailureHandler?) -> PHImageRequestID { + if asset == nil { + if failure != nil { + failure!(self, nil) + } + return 0 + } + var version = PHImageRequestOptionsVersion.current + if mediaSubType == HXPHAssetMediaSubType.imageAnimated { + version = PHImageRequestOptionsVersion.original + } + return HXPHAssetManager.requestImageData(for: asset!, version: version, iCloudHandler: { (iCloudRequestID) in + if iCloudHandler != nil { + iCloudHandler!(self, iCloudRequestID) + } + }, progressHandler: { (progress, error, stop, info) in + if progressHandler != nil { + progressHandler!(self, progress) + } + }, resultHandler: { (data, dataUTI, imageOrientation, info, downloadSuccess) in + if downloadSuccess { + if success != nil { + success!(self, data!, imageOrientation, info) + } + }else { + if failure != nil { + failure!(self, info) + } + } + }) + } + + /// 请求LivePhoto,如果资源在iCloud上会自动下载。如果需要更细节的处理请使用 PHAssetManager + /// - Parameters: + /// - targetSize: 请求的大小 + /// - iCloudHandler: 下载iCloud上的资源时回调iCloud的请求ID + /// - progressHandler: iCloud下载进度 + /// - Returns: 请求ID + @available(iOS 9.1, *) + func requestLivePhoto(targetSize: CGSize, iCloudHandler: HXPHAssetICloudHandlerHandler?, progressHandler: HXPHAssetProgressHandler?, success: ((HXPHAsset, PHLivePhoto, [AnyHashable : Any]?) -> Void)?, failure: HXPHAssetFailureHandler?) -> PHImageRequestID { + if asset == nil { + if failure != nil { + failure?(self, nil) + } + return 0 + } + + return HXPHAssetManager.requestLivePhoto(for: asset!, targetSize: targetSize) { (iCloudRequestID) in + if iCloudHandler != nil { + iCloudHandler!(self, iCloudRequestID) + } + } progressHandler: { (progress, error, stop, info) in + if progressHandler != nil { + progressHandler!(self, progress) + } + } resultHandler: { (livePhoto, info, downloadSuccess) in + if downloadSuccess { + if success != nil { + success!(self, livePhoto!, info) + } + }else { + if failure != nil { + failure!(self, info) + } + } + } + + } +} diff --git a/HXPHPicker/HXPHAssetCollection.swift b/HXPHPicker/HXPHAssetCollection.swift new file mode 100644 index 00000000..8c232803 --- /dev/null +++ b/HXPHPicker/HXPHAssetCollection.swift @@ -0,0 +1,77 @@ +// +// HXPHAssetCollection.swift +// 照片选择器-Swift +// +// Created by 洪欣 on 2019/7/3. +// Copyright © 2019年 洪欣. All rights reserved. +// + +import UIKit +import Photos + +class HXPHAssetCollection: NSObject { + var albumName : String? + var count : Int = 0 + var result : PHFetchResult? + var collection : PHAssetCollection? + var options : PHFetchOptions? + var coverAsset: PHAsset? + private var coverImage: UIImage? + + init(collection: PHAssetCollection? , options: PHFetchOptions?) { + super.init() + self.collection = collection + self.options = options + fetchResult() + } + + init(albumName: String?, coverImage: UIImage?) { + super.init() + self.albumName = albumName + self.coverImage = coverImage + } + + func fetchResult() { + if collection == nil { + return + } + albumName = HXPHTools.transformAlbumName(for: collection!) + result = PHAsset.fetchAssets(in: collection!, options: options) + count = result?.count ?? 0 + coverAsset = result?.firstObject + } + + func changeResult(for result: PHFetchResult) { + self.result = result + count = result.count + coverAsset = result.firstObject + } + + /// 请求获取相册封面图片 + /// - Parameter completion: 会回调多次 + /// - Returns: 请求ID + func requestCoverImage(completion: ((UIImage?, HXPHAssetCollection, [AnyHashable : Any]?) -> Void)?) -> PHImageRequestID? { + if coverAsset == nil { + if completion != nil { + completion!(coverImage, self, nil) + } + return nil + } + return HXPHAssetManager.requestThumbnailImage(for: coverAsset!, targetWidth: 160) { (image, info) in + if completion != nil { + completion!(image, self, info) + } + } + } + + /// 枚举相册里的资源 + func enumerateAssets(usingBlock :@escaping (HXPHAsset)->()) { + if result == nil { + fetchResult() + } + result?.enumerateObjects({ (asset, index, stop) in + let photoAsset = HXPHAsset.init(asset: asset) + usingBlock(photoAsset) + }) + } +} diff --git a/HXPHPicker/HXPHAssetManager.swift b/HXPHPicker/HXPHAssetManager.swift new file mode 100644 index 00000000..a805b937 --- /dev/null +++ b/HXPHPicker/HXPHAssetManager.swift @@ -0,0 +1,389 @@ +// +// HXPHAssetManager.swift +// 照片选择器-Swift +// +// Created by 洪欣 on 2020/11/9. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit +import Photos + +class HXPHAssetManager: NSObject { + + /// 获取当前相册权限状态 + /// - Returns: 权限状态 + class func authorizationStatus() -> PHAuthorizationStatus { + let status : PHAuthorizationStatus; + if #available(iOS 14, *) { + status = PHPhotoLibrary.authorizationStatus(for: PHAccessLevel.readWrite) + } else { + // Fallback on earlier versions + status = PHPhotoLibrary.authorizationStatus(); + } + return status; + } + + class func authorizationStatusIsLimited() -> Bool{ + if #available(iOS 14, *) { + if authorizationStatus() == PHAuthorizationStatus.limited { + return true + } + } + return false + } + + /// 请求获取相册权限 + /// - Parameters: + /// - handler: 请求权限完成 + class func requestAuthorization(with handler : @escaping (PHAuthorizationStatus) -> ()) { + let status = authorizationStatus() + if status == PHAuthorizationStatus.notDetermined { + if #available(iOS 14, *) { + PHPhotoLibrary.requestAuthorization(for: PHAccessLevel.readWrite) { (authorizationStatus) in + DispatchQueue.main.async { + handler(authorizationStatus) + } + } + } else { + PHPhotoLibrary.requestAuthorization { (authorizationStatus) in + DispatchQueue.main.async { + handler(authorizationStatus) + } + } + } + }else { + handler(status) + } + } + + /// 获取系统相册 + /// - Parameter options: 选型 + /// - Returns: 相册列表 + class func fetchSmartAlbums(options : PHFetchOptions?) -> PHFetchResult { + return PHAssetCollection.fetchAssetCollections(with: PHAssetCollectionType.smartAlbum, subtype: PHAssetCollectionSubtype.any, options: options) + } + + /// 获取用户创建的相册 + /// - Parameter options: 选项 + /// - Returns: 相册列表 + class func fetchUserAlbums(options : PHFetchOptions?) -> PHFetchResult { + return PHAssetCollection.fetchAssetCollections(with: PHAssetCollectionType.album, subtype: PHAssetCollectionSubtype.any, options: options) + } + + + /// 获取所有相册 + /// - Parameters: + /// - filterInvalid: 过滤无效的相册 + /// - options: 可选项 + /// - usingBlock: 枚举每一个相册集合 + class func enumerateAllAlbums(filterInvalid: Bool, options : PHFetchOptions?, usingBlock :@escaping (PHAssetCollection)->()) { + let smartAlbums = fetchSmartAlbums(options: nil) + let userAlbums = fetchUserAlbums(options: nil) + let albums = [smartAlbums, userAlbums] + for result in albums { + result.enumerateObjects { (collection, index, stop) in + if !collection.isKind(of: PHAssetCollection.self) { + return; + } + if filterInvalid { + if collection.estimatedAssetCount <= 0 || + collection.assetCollectionSubtype.rawValue == 205 || + collection.assetCollectionSubtype.rawValue == 215 || + collection.assetCollectionSubtype.rawValue == 212 || + collection.assetCollectionSubtype.rawValue == 204 || + collection.assetCollectionSubtype.rawValue == 1000000201 { + return; + } + } + usingBlock(collection) + } + } + } + + /// 获取相机胶卷资源集合 + /// - Parameter options: 可选项 + /// - Returns: 相机胶卷集合 + class func fetchCameraRollAlbum(options: PHFetchOptions?) -> PHAssetCollection? { + let smartAlbums = fetchSmartAlbums(options: options) + var assetCollection : PHAssetCollection? + smartAlbums.enumerateObjects { (collection, index, stop) in + if !collection.isKind(of: PHAssetCollection.self) || + collection.estimatedAssetCount <= 0 { + return + } + if collectionIsCameraRollAlbum(collection: collection) { + assetCollection = collection + stop.initialize(to: true) + } + } + return assetCollection + } + + /// 判断是否是相机胶卷 + /// - Parameter collection: 相机胶卷集合 + class func collectionIsCameraRollAlbum(collection: PHAssetCollection?) -> Bool { + var versionStr = UIDevice.current.systemVersion.replacingOccurrences(of: ".", with: "") + if versionStr.count <= 1 { + versionStr.append("00") + }else if versionStr.count <= 2 { + versionStr.append("0") + } + let version = Int(versionStr) ?? 0 + if version >= 800 && version <= 802 { + return collection?.assetCollectionSubtype == PHAssetCollectionSubtype.smartAlbumRecentlyAdded + }else { + return collection?.assetCollectionSubtype == PHAssetCollectionSubtype.smartAlbumUserLibrary + } + } + + /// 判断是否是动图 + /// - Parameter asset: 需要判断的资源 + /// - Returns: 是否 + class func assetIsAnimated(asset: PHAsset) -> Bool { + var isAnimated : Bool = false + let fileName = asset.value(forKey: "filename") as? String + if fileName != nil { + isAnimated = fileName!.hasSuffix("GIF") + } + if #available(iOS 11, *) { + if asset.playbackStyle == PHAsset.PlaybackStyle.imageAnimated { + isAnimated = true + } + } + return isAnimated + } + + /// 判断否是LivePhoto + /// - Parameter asset: 需要判断的资源 + /// - Returns: 是否 + class func assetIsLivePhoto(asset: PHAsset) -> Bool { + var isLivePhoto : Bool = false + if #available(iOS 9.1, *) { + isLivePhoto = asset.mediaSubtypes == PHAssetMediaSubtype.photoLive + if #available(iOS 11, *) { + if asset.playbackStyle == PHAsset.PlaybackStyle.livePhoto { + isLivePhoto = true + } + } + } + return isLivePhoto + } + + private class func transformTargetWidthToSize(targetWidth: CGFloat, asset: PHAsset) -> CGSize { + let scale:CGFloat = 0.8 + let aspectRatio = CGFloat(asset.pixelWidth) / CGFloat(asset.pixelHeight) + var width = targetWidth + if asset.pixelWidth < Int(targetWidth) { + width *= 0.5 + } + var height = width / aspectRatio + let maxHeight = UIScreen.main.bounds.size.height + if height > maxHeight { + width = maxHeight / height * width * scale + height = maxHeight * scale + } + if height < targetWidth && width >= targetWidth { + width = targetWidth / height * width * scale + height = targetWidth * scale + } + return CGSize.init(width: width, height: height) + } + + /// 请求image + /// - Parameters: + /// - asset: 资源对象 + /// - targetSize: 指定大小 + /// - options: 可选项 + /// - resultHandler: 回调 + /// - Returns: 请求ID + class func requestImage(for asset: PHAsset, targetSize: CGSize, options: PHImageRequestOptions, resultHandler: @escaping (UIImage?, [AnyHashable : Any]?) -> Void) -> PHImageRequestID { + return PHImageManager.default().requestImage(for: asset, targetSize: targetSize, contentMode: PHImageContentMode.aspectFill, options: options, resultHandler: resultHandler) + } + + /// 请求获取缩略图 + /// - Parameters: + /// - asset: 资源对象 + /// - targetWidth: 获取的图片大小 + /// - completion: 完成 + /// - Returns: 请求ID + class func requestThumbnailImage(for asset: PHAsset, targetWidth: CGFloat, completion: ((UIImage?, [AnyHashable : Any]?) -> ())?) -> PHImageRequestID { + let options = PHImageRequestOptions.init() + options.resizeMode = PHImageRequestOptionsResizeMode.fast + return requestImage(for: asset, targetSize: transformTargetWidthToSize(targetWidth: targetWidth, asset: asset), options: options) { (image, info) in + if completion != nil { + completion!(image, info) + } + } + } + + class func requestImageData(for asset: PHAsset, options: PHImageRequestOptions, resultHandler: @escaping (Data?, String?, UIImage.Orientation, [AnyHashable : Any]?) -> Void) -> PHImageRequestID { + if #available(iOS 13, *) { + return PHImageManager.default().requestImageDataAndOrientation(for: asset, options: options) { (imageData, dataUTI, imageOrientation, info) in + var sureOrientation : UIImage.Orientation; + if (imageOrientation == CGImagePropertyOrientation.up) { + sureOrientation = UIImage.Orientation.up; + } else if (imageOrientation == CGImagePropertyOrientation.upMirrored) { + sureOrientation = UIImage.Orientation.upMirrored; + } else if (imageOrientation == CGImagePropertyOrientation.down) { + sureOrientation = UIImage.Orientation.down; + } else if (imageOrientation == CGImagePropertyOrientation.downMirrored) { + sureOrientation = UIImage.Orientation.downMirrored; + } else if (imageOrientation == CGImagePropertyOrientation.left) { + sureOrientation = UIImage.Orientation.left; + } else if (imageOrientation == CGImagePropertyOrientation.leftMirrored) { + sureOrientation = UIImage.Orientation.leftMirrored; + } else if (imageOrientation == CGImagePropertyOrientation.right) { + sureOrientation = UIImage.Orientation.right; + } else if (imageOrientation == CGImagePropertyOrientation.rightMirrored) { + sureOrientation = UIImage.Orientation.rightMirrored; + } else { + sureOrientation = UIImage.Orientation.up; + } + resultHandler(imageData, dataUTI, sureOrientation, info) + } + } else { + // Fallback on earlier versions + return PHImageManager.default().requestImageData(for: asset, options: options, resultHandler: resultHandler) + } + } + + class func requestImageData(for asset: PHAsset, version: PHImageRequestOptionsVersion, isNetworkAccessAllowed: Bool, progressHandler: @escaping PHAssetImageProgressHandler, resultHandler: @escaping (Data?, String?, UIImage.Orientation, [AnyHashable : Any]?) -> Void) -> PHImageRequestID { + let options = PHImageRequestOptions.init() + options.version = version + options.resizeMode = PHImageRequestOptionsResizeMode.fast + options.isNetworkAccessAllowed = isNetworkAccessAllowed + options.progressHandler = progressHandler + return requestImageData(for: asset, options: options, resultHandler: resultHandler) + } + + /// 请求imageData,如果资源在iCloud上会自动请求下载iCloud上的资源 + /// - Parameters: + /// - asset: 资源 + /// - version: 请求的版本 + /// - iCloudHandler: 如果资源在iCloud上,下载之前回先回调出请求ID + /// - progressHandler: 处理进度 + /// - resultHandler: 处理结果 + /// - Returns: 请求ID + class func requestImageData(for asset: PHAsset, version: PHImageRequestOptionsVersion, iCloudHandler: @escaping (PHImageRequestID) -> Void, progressHandler: @escaping PHAssetImageProgressHandler, resultHandler: @escaping (Data?, String?, UIImage.Orientation, [AnyHashable : Any]?, Bool) -> Void) -> PHImageRequestID { + return requestImageData(for: asset, version: version, isNetworkAccessAllowed: false, progressHandler: progressHandler) { (data, dataUTI, imageOrientation, info) in + if self.assetDownloadFinined(for: info) { + resultHandler(data, dataUTI, imageOrientation, info, true) + }else { + if self.assetIsInCloud(for: info) { + let iCloudRequestID = self.requestImageData(for: asset, version: version, isNetworkAccessAllowed: true, progressHandler: progressHandler, resultHandler: { (data, dataUTI, imageOrientation, info) in + resultHandler(data, dataUTI, imageOrientation, info, self.assetDownloadFinined(for: info)) + }) + iCloudHandler(iCloudRequestID) + }else { + resultHandler(data, dataUTI, imageOrientation, info, false) + } + } + } + } + + @available(iOS 9.1, *) + class func requestLivePhoto(for asset: PHAsset, targetSize: CGSize, options: PHLivePhotoRequestOptions, resultHandler: @escaping (PHLivePhoto?, [AnyHashable : Any]?) -> Void) -> PHImageRequestID { + return PHImageManager.default().requestLivePhoto(for: asset, targetSize: targetSize, contentMode: PHImageContentMode.aspectFill, options: options, resultHandler: resultHandler) + } + @available(iOS 9.1, *) + class func requestLivePhoto(for asset: PHAsset, targetSize: CGSize, isNetworkAccessAllowed: Bool, progressHandler: @escaping PHAssetImageProgressHandler, resultHandler: @escaping (PHLivePhoto?, [AnyHashable : Any]?) -> Void) -> PHImageRequestID { + let options = PHLivePhotoRequestOptions.init() + options.isNetworkAccessAllowed = isNetworkAccessAllowed + options.progressHandler = progressHandler + return requestLivePhoto(for: asset, targetSize: targetSize, options: options, resultHandler: resultHandler) + } + + /// 请求LivePhoto,如果资源在iCloud上会自动请求下载iCloud上的资源 + /// - Parameters: + /// - asset: 资源 + /// - targetSize: 请求的目标大小 + /// - iCloudHandler: 如果资源在iCloud上,下载之前回先回调出请求ID + /// - progressHandler: 处理进度 + /// - resultHandler: 处理结果 + /// - Returns: 请求ID + @available(iOS 9.1, *) + class func requestLivePhoto(for asset: PHAsset, targetSize: CGSize, iCloudHandler: @escaping (PHImageRequestID) -> Void, progressHandler: @escaping PHAssetImageProgressHandler, resultHandler: @escaping (PHLivePhoto?, [AnyHashable : Any]?, Bool) -> Void) -> PHImageRequestID { + return requestLivePhoto(for: asset, targetSize: targetSize, isNetworkAccessAllowed: false, progressHandler: progressHandler) { (livePhoto, info) in + if self.assetDownloadFinined(for: info) { + resultHandler(livePhoto, info, true) + }else { + if self.assetIsInCloud(for: info) { + let iCloudRequestID = self.requestLivePhoto(for: asset, targetSize: targetSize, isNetworkAccessAllowed: true, progressHandler: progressHandler) { (livePhoto, info) in + if self.assetDownloadFinined(for: info) { + resultHandler(livePhoto, info, true) + }else { + resultHandler(livePhoto, info, false) + } + } + iCloudHandler(iCloudRequestID) + }else { + resultHandler(livePhoto, info, false) + } + } + } + } + + + /// 根据下载获取的信息判断资源是否存在iCloud上 + /// - Parameter info: 下载获取的信息 + class func assetIsInCloud(for info: [AnyHashable : Any]?) -> Bool { + if info == nil { + return false + } + if info![AnyHashable(PHImageResultIsInCloudKey)] == nil { + return false + } + let isInCloud = info![AnyHashable(PHImageResultIsInCloudKey)] as! Int + return (isInCloud == 1) + } + + /// 判断资源是否取消了下载 + /// - Parameter info: 下载获取的信息 + class func assetDownloadCancel(for info: [AnyHashable : Any]?) -> Bool { + if info == nil { + return false + } + if info![AnyHashable(PHImageCancelledKey)] == nil { + return false + } + let isCancel = info![AnyHashable(PHImageCancelledKey)] as! Int + return (isCancel == 1) + } + + /// 判断资源是否下载错误 + /// - Parameter info: 下载获取的信息 + class func assetDownloadError(for info: [AnyHashable : Any]?) -> Bool { + if info == nil { + return false + } + if info![AnyHashable(PHImageErrorKey)] == nil { + return false + } + let error = info![AnyHashable(PHImageErrorKey)] + return (error != nil) + } + + /// 判断资源下载得到的是否为退化的 + /// - Parameter info: 下载获取的信息 + class func assetDownloadIsDegraded(for info: [AnyHashable : Any]?) -> Bool { + if info == nil { + return false + } + let isDegraded = info![AnyHashable(PHImageResultIsDegradedKey)] as! Int + return (isDegraded == 1) + } + + /// 判断资源是否下载完成 + /// - Parameter info: 下载获取的信息 + class func assetDownloadFinined(for info: [AnyHashable : Any]?) -> Bool { + if info == nil { + return false + } + let isCancel = assetDownloadCancel(for: info) + let isDegraded = assetDownloadIsDegraded(for: info) + let error = assetDownloadError(for: info) + + return (!isCancel && !error && !isDegraded) + } +} diff --git a/HXPHPicker/HXPHConfiguration.swift b/HXPHPicker/HXPHConfiguration.swift new file mode 100644 index 00000000..a32bdb37 --- /dev/null +++ b/HXPHPicker/HXPHConfiguration.swift @@ -0,0 +1,353 @@ +// +// HXPHConfiguration.swift +// 照片选择器-Swift +// +// Created by 洪欣 on 2020/11/9. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +class HXPHConfiguration: NSObject { + + /// 选择的类型 + var selectType : HXPHSelectType = HXPHSelectType.any + + /// 最多可以选择的照片数,如果为0则不限制 + var maximumSelectPhotoCount : Int = 0 + + /// 最多可以选择的视频数,如果为0则不限制 + var maximumSelectVideoCount : Int = 0 + + /// 最多可以选择的资源数,如果为0则不限制 + var maximumSelectCount: Int = 9 + + /// 视频最大选择时长,为0则不限制 + var videoMaximumSelectDuration: Int = 0 + + /// 视频最小选择时长,为0则不限制 + var videoMinimumSelectDuration: Int = 0 + + /// 照片和视频可以一起选择 + var photosAndVideosCanBeSelectedTogether: Bool = true + + /// 语言类型 + var languageType : HXPHLanguageType = HXPHLanguageType.system + + /// 相册展示类型 + var albumShowMode : HXAlbumShowMode = HXAlbumShowMode.normal + + /// 选择模式 + var selectMode : HXPHAssetSelectMode = HXPHAssetSelectMode.multiple + + /// 获取资源列表时是否按创建时间排序 + var creationDate : Bool = true + + /// 获取资源列表后是否按倒序展示 + var reverseOrder : Bool = false + + /// 展示动图 + var showAnimatedAsset : Bool = true + + /// 展示LivePhoto + var showLivePhotoAsset : Bool = true + + /// 状态栏样式 + var statusBarStyle : UIStatusBarStyle = UIStatusBarStyle.default + + /// 半透明效果 + var navigationBarIsTranslucent: Bool = true + + /// 相册列表配置 + lazy var albumList : HXPHAlbumListConfiguration = { + return HXPHAlbumListConfiguration.init() + }() + + /// 照片列表配置 + lazy var photoList: HXPHPhotoListConfiguration = { + return HXPHPhotoListConfiguration.init() + }() + + /// 预览界面配置 + lazy var previewView: HXPHPreviewViewConfiguration = { + return HXPHPreviewViewConfiguration.init() + }() + + /// 未授权提示界面相关配置 + lazy var notAuthorized : HXPHNotAuthorizedConfiguration = { + return HXPHNotAuthorizedConfiguration.init() + }() +} +// MARK: 相册列表配置类 +class HXPHAlbumListConfiguration: NSObject { + + /// 当相册里没有资源时的相册名称 + lazy var emptyAlbumName: String = { + return "所有照片" + }() + + /// 当相册里没有资源时的封面图片名 + lazy var emptyCoverImageName: String = { + return "" + }() + + /// 列表背景颜色 + lazy var backgroundColor : UIColor = { + return UIColor.white + }() + + /// cell高度 + var cellHeight : CGFloat = 100 + + /// cell背景颜色 + lazy var cellBackgroudColor: UIColor = { + return UIColor.white + }() + + /// cell选中时的颜色 + var cellSelectedColor : UIColor? + + /// 相册名称颜色 + lazy var albumNameColor : UIColor = { + return UIColor.black + }() + + /// 相册名称字体 + lazy var albumNameFont : UIFont = { + return UIFont.hx_mediumPingFang(size: 15) + }() + + /// 照片数量颜色 + lazy var photoCountColor : UIColor = { + return UIColor.init(hx_hexString: "#999999") + }() + + /// 照片数量字体 + lazy var photoCountFont : UIFont = { + return UIFont.hx_mediumPingFang(size: 12) + }() + + /// 分隔线颜色 + lazy var separatorLineColor: UIColor = { + return UIColor(hx_hexString: "#eeeeee") + }() +} +// MARK: 照片列表配置类 +class HXPHPhotoListConfiguration: NSObject { + + /// 背景颜色 + lazy var backgroundColor : UIColor = { + return UIColor.white + }() + + /// 每行显示数量 + var rowNumber : Int = 4 + + /// 横屏时每行显示数量 + var landscapeRowNumber : Int = 7 + + /// 每个照片之间的间隙 + var spacing : CGFloat = 1 + + /// cell相关配置 + lazy var cell: HXPHPhotoListCellConfiguration = { + return HXPHPhotoListCellConfiguration.init() + }() + + /// 底部视图相关配置 + lazy var bottomView: HXPHPickerBottomViewConfiguration = { + return HXPHPickerBottomViewConfiguration.init() + }() +} +// MARK: 照片列表Cell配置类 +class HXPHPhotoListCellConfiguration: NSObject { + + /// 背景颜色 + var backgroundColor: UIColor? + + /// 选择框顶部的间距 + var selectBoxTopMargin: CGFloat = 5 + + /// 选择框右边的间距 + var selectBoxRightMargin: CGFloat = 5 + + /// 选择框相关配置 + lazy var selectBox: HXPHSelectBoxConfiguration = { + return HXPHSelectBoxConfiguration.init() + }() +} +// MARK: 预览界面配置类 +class HXPHPreviewViewConfiguration: NSObject { + + /// 背景颜色 + lazy var backgroundColor : UIColor = { + return UIColor.white + }() + + /// 选择框配置 + lazy var selectBox: HXPHSelectBoxConfiguration = { + let config = HXPHSelectBoxConfiguration.init() + return config + }() + + /// 底部视图相关配置 + lazy var bottomView: HXPHPickerBottomViewConfiguration = { + let config = HXPHPickerBottomViewConfiguration.init() + config.previewButtonHidden = true + return config + }() +} +// MARK: 底部工具栏配置类 +class HXPHPickerBottomViewConfiguration: NSObject { + + /// UIToolbar + var backgroundColor: UIColor? + + /// UIToolbar + var barTintColor: UIColor? + + /// 半透明效果 + var isTranslucent: Bool = true + + /// barStyle + var barStyle: UIBarStyle = UIBarStyle.default + + /// 隐藏预览按钮 + var previewButtonHidden: Bool = false + + /// 预览按钮标题颜色 + lazy var previewButtonTitleColor: UIColor = { + return UIColor.init(red: 0, green: 0.47843137254901963, blue: 1, alpha: 1) + }() + + /// 预览按钮禁用下的标题颜色 + var previewButtonDisableTitleColor: UIColor? + + /// 隐藏原图按钮 + var originalButtonHidden : Bool = false + + /// 原图按钮标题颜色 + lazy var originalButtonTitleColor: UIColor = { + return UIColor.init(red: 0, green: 0.47843137254901963, blue: 1, alpha: 1) + }() + + /// 原图按钮选择框相关配置 + lazy var originalSelectBox: HXPHSelectBoxConfiguration = { + let config = HXPHSelectBoxConfiguration.init() + config.type = HXPHPickerCellSelectBoxType.tick + // 原图按钮选中时的背景颜色 + config.selectedBackgroudColor = UIColor.init(red: 0, green: 0.47843137254901963, blue: 1, alpha: 1) + // 原图按钮未选中时的边框宽度 + config.borderWidth = 1 + // 原图按钮未选中时的边框颜色 + config.borderColor = config.selectedBackgroudColor + // 原图按钮未选中时框框中间的颜色 + config.backgroudColor = UIColor.white.withAlphaComponent(0.3) + // 原图按钮选中时的勾勾颜色 + config.tickColor = UIColor.white + // 原图按钮选中时的勾勾宽度 + config.tickWidth = 1 + return config + }() + + /// 完成按钮标题颜色 + lazy var finishButtonTitleColor: UIColor = { + return UIColor.white + }() + + /// 完成按钮禁用下的标题颜色 + lazy var finishButtonDisableTitleColor: UIColor = { + return UIColor.white.withAlphaComponent(0.6) + }() + + /// 完成按钮选中时的背景颜色 + lazy var finishButtonBackgroudColor: UIColor = { + return UIColor.init(red: 0, green: 0.47843137254901963, blue: 1, alpha: 1) + }() + + /// 完成按钮禁用时的背景颜色 + lazy var finishButtonDisableBackgroudColor: UIColor = { + return UIColor.init(red: 0, green: 0.47843137254901963, blue: 1, alpha: 1).withAlphaComponent(0.4) + }() + + /// 未选择资源时是否禁用完成按钮 + var disableFinishButtonWhenNotSelected: Bool = false +} +// MARK: 选择框配置类 +class HXPHSelectBoxConfiguration: NSObject { + + /// 选择框的大小 + var size: CGSize = CGSize(width: 25, height: 25) + + /// 选择框的类型 + var type: HXPHPickerCellSelectBoxType = HXPHPickerCellSelectBoxType.number + + /// 标题的文字大小 + var titleFontSize: CGFloat = 16 + + /// 选中之后的 标题 颜色 + lazy var titleColor: UIColor = { + return UIColor.white + }() + + /// 选中状态下勾勾的宽度 + var tickWidth: CGFloat = 2 + + /// 选中之后的 勾勾 颜色 + lazy var tickColor: UIColor = { + return UIColor.white + }() + + /// 未选中时框框中间的颜色 + lazy var backgroudColor: UIColor = { + return UIColor.black.withAlphaComponent(0.4) + }() + + /// 选中之后的背景颜色 + lazy var selectedBackgroudColor: UIColor = { + return UIColor.init(red: 0, green: 0.47843137254901963, blue: 1, alpha: 1) + }() + + /// 未选中时的边框宽度 + var borderWidth: CGFloat = 1.5 + + /// 未选中时的边框颜色 + lazy var borderColor: UIColor = { + return UIColor.white + }() + +} + +// MARK: 未授权界面配置类 +class HXPHNotAuthorizedConfiguration: NSObject { + + /// 背景颜色 + lazy var backgroudColor: UIColor = { + return UIColor.white + }() + + /// 关闭按钮图片名 + lazy var closeButtonImageName: String = { + return "" + }() + + /// 标题颜色 + lazy var titleColor: UIColor = { + return UIColor.black + }() + + /// 子标题颜色 + lazy var subTitleColor: UIColor = { + return UIColor(hx_hexString: "#444444") + }() + + /// 跳转按钮背景颜色 + lazy var jumpButtonBackgroudColor: UIColor = { + return UIColor(hx_hexString: "666666") + }() + + /// 跳转按钮文字颜色 + lazy var jumpButtonTitleColor: UIColor = { + return UIColor(hx_hexString: "ffffff") + }() +} diff --git a/HXPHPicker/HXPHManager.swift b/HXPHPicker/HXPHManager.swift new file mode 100644 index 00000000..e8a3bd2d --- /dev/null +++ b/HXPHPicker/HXPHManager.swift @@ -0,0 +1,159 @@ +// +// HXPHManager.swift +// 照片选择器-Swift +// +// Created by 洪欣 on 2019/6/29. +// Copyright © 2019年 洪欣. All rights reserved. +// + +import UIKit +import Photos +import PhotosUI + +class HXPHManager: NSObject { + + static let shared = HXPHManager() + + var bundle: Bundle? + var languageBundle: Bundle? + var languageType: HXPHLanguageType? + + private lazy var cameraAlbumLocalIdentifier : String? = { + var identifier = UserDefaults.standard.string(forKey: "hxcameraAlbumLocalIdentifier") + return identifier + }() + + private lazy var cameraAlbumLocalIdentifierType : HXPHSelectType? = { + var identifierType = UserDefaults.standard.integer(forKey: "hxcameraAlbumLocalIdentifierType") + return HXPHSelectType(rawValue: identifierType) + }() + + /// 获取所有资源集合 + /// - Parameters: + /// - showEmptyCollection: 显示空集合 + /// - usingBlock: 枚举每一个集合 + func fetchAssetCollections(for options: PHFetchOptions, showEmptyCollection: Bool, usingBlock :@escaping ([HXPHAssetCollection])->()) { + DispatchQueue.global().async { + var assetCollectionsArray = [HXPHAssetCollection]() + HXPHAssetManager.enumerateAllAlbums(filterInvalid: true, options: nil) { (collection) in + let assetCollection = HXPHAssetCollection.init(collection: collection, options: options) + if showEmptyCollection == false && assetCollection.count == 0 { + return + } + if HXPHAssetManager.collectionIsCameraRollAlbum(collection: collection) { + assetCollectionsArray.insert(assetCollection, at: 0); + }else { + assetCollectionsArray.append(assetCollection) + } + } + DispatchQueue.main.async { + usingBlock(assetCollectionsArray); + } + } + } + + /// 获取相机胶卷资源集合 + func fetchCameraAssetCollection(for type: HXPHSelectType, options: PHFetchOptions, completion :@escaping (HXPHAssetCollection)->()) { + DispatchQueue.global().async { + var useLocalIdentifier = false + if self.cameraAlbumLocalIdentifier != nil { + if self.cameraAlbumLocalIdentifierType == HXPHSelectType.any || + type == self.cameraAlbumLocalIdentifierType { + useLocalIdentifier = true + } + } + let collection : PHAssetCollection? + if useLocalIdentifier == true { + let identifiers : [String] = [self.cameraAlbumLocalIdentifier!] + collection = PHAssetCollection.fetchAssetCollections(withLocalIdentifiers: identifiers, options: nil).firstObject + }else { + collection = HXPHAssetManager.fetchCameraRollAlbum(options: nil) + UserDefaults.standard.set(collection?.localIdentifier, forKey: "hxcameraAlbumLocalIdentifier") + UserDefaults.standard.set(type.rawValue, forKey: "hxcameraAlbumLocalIdentifierType") + } + let assetCollection = HXPHAssetCollection.init(collection: collection, options: options) + DispatchQueue.main.async { + completion(assetCollection) + } + } + } + + + private override init() { + super.init() + _ = createBundle() + } + func createBundle() -> Bundle? { + if self.bundle == nil { + let bundle = Bundle.init(for: HXPHPicker.self) + var path = bundle.path(forResource: "HXPHPicker", ofType: "bundle") + if path == nil { + var associateBundleURL = Bundle.main.url(forResource: "Frameworks", withExtension: nil) + if associateBundleURL != nil { + associateBundleURL = associateBundleURL?.appendingPathComponent("HXPHPicker") + associateBundleURL = associateBundleURL?.appendingPathExtension("framework") + let associateBunle = Bundle.init(url: associateBundleURL!) + path = associateBunle?.path(forResource: "HXPHPicker", ofType: "bundle") + } + } + self.bundle = (path != nil) ? Bundle.init(path: path!) : Bundle.main + } + return self.bundle + } + func createLanguageBundle(languageType: HXPHLanguageType) -> Bundle? { + if bundle == nil { + _ = createBundle() + } + if self.languageType != languageType { + languageBundle = nil + } + if languageBundle == nil { + var language = Locale.preferredLanguages.first + switch languageType { + case HXPHLanguageType.simplifiedChinese: + language = "zh-Hans" + break + case HXPHLanguageType.traditionalChinese: + language = "zh-Hant" + break + case HXPHLanguageType.japanese: + language = "ja" + break + case HXPHLanguageType.korean: + language = "ko" + break + case HXPHLanguageType.english: + language = "en" + break + default: + if language != nil { + if language!.hasPrefix("zh") { + if language!.range(of: "Hans") != nil { + language = "zh-Hans" + }else { + language = "zh-Hant" + } + }else if language!.hasPrefix("ja") { + language = "ja" + }else if language!.hasPrefix("ko") { + language = "ko" + }else { + language = "en" + } + }else { + language = "en" + } + } + let path = bundle?.path(forResource: language, ofType: "lproj") + if path != nil { + languageBundle = Bundle.init(path: path!) + } + self.languageType = languageType + } + return languageBundle + } + override class func copy() -> Any { return self } + override class func mutableCopy() -> Any { return self } +} + +class HXPHPicker: NSObject { } diff --git a/HXPHPicker/HXPHPicker.bundle/en.lproj/Localizable.strings b/HXPHPicker/HXPHPicker.bundle/en.lproj/Localizable.strings new file mode 100644 index 00000000..8afb1aed Binary files /dev/null and b/HXPHPicker/HXPHPicker.bundle/en.lproj/Localizable.strings differ diff --git a/HXPHPicker/HXPHPicker.bundle/ja.lproj/Localizable.strings b/HXPHPicker/HXPHPicker.bundle/ja.lproj/Localizable.strings new file mode 100644 index 00000000..1d039b9e --- /dev/null +++ b/HXPHPicker/HXPHPicker.bundle/ja.lproj/Localizable.strings @@ -0,0 +1,20 @@ +"无法访问相册中照片" = "アルバムの写真にアクセスできませんでした。"; +"当前无照片访问权限,建议前往系统设置,\n允许访问「照片」中的「所有照片」。" = "現在は写真のアクセス権限がありません。,システム設定に行くことをおすすめします。,\n写真のすべての写真にアクセスすることを許可します。"; +"前往系统设置" = "システム設定へ"; +"取消" = "キャンセル"; +"相册" = "アルバム"; + +"HXAlbumCameraRoll" = "カメラロール"; +"HXAlbumPanoramas" = "パノラマ"; +"HXAlbumVideos" = "ビデオ"; +"HXAlbumFavorites" = "お気に入り"; +"HXAlbumTimelapses" = "タイムラプス"; +"HXAlbumRecents" = "最近のプロジェクト"; +"HXAlbumRecentlyAdded" = "最後に追加した項目"; +"HXAlbumBursts" = "バースト"; +"HXAlbumSlomoVideos" = "スローモーション"; +"HXAlbumSelfPortraits" = "セルフイー"; +"HXAlbumScreenshots" = "スクリーンショット"; +"HXAlbumDepthEffect" = "ポートレート"; +"HXAlbumLivePhotos" = "実況写真"; +"HXAlbumAnimated" = "アニメーション"; diff --git a/HXPHPicker/HXPHPicker.bundle/ko.lproj/Localizable.strings b/HXPHPicker/HXPHPicker.bundle/ko.lproj/Localizable.strings new file mode 100644 index 00000000..4c0a8b4b --- /dev/null +++ b/HXPHPicker/HXPHPicker.bundle/ko.lproj/Localizable.strings @@ -0,0 +1,22 @@ +"无法访问相册中照片" = "앨범 사진 에 접근 할 수 없습니다."; +"当前无照片访问权限,建议前往系统设置,\n允许访问「照片」中的「所有照片」。" = "현재 사진 접근 권한 이 없습니다.시스템 설정 으로 가기 권장,\n사진 속 의 모든 사진 에 접근 할 수 있 도록 합 니 다."; +"前往系统设置" = "설치"; +"取消" = "취소 하 다"; +"相册" = "앨범"; + + +"HXAlbumCameraRoll" = "모든 사진"; +"HXAlbumPanoramas" = "파노라마 사진"; +"HXAlbumVideos" = "동영상"; +"HXAlbumFavorites" = "개인 소장"; +"HXAlbumTimelapses" = "시간 지연 촬영"; +"HXAlbumRecents" = "최근 프로젝트"; +"HXAlbumRecentlyAdded" = "최근에 추가"; +"HXAlbumBursts" = "스냅을 연속으로 찍다"; +"HXAlbumSlomoVideos" = "느린 동작"; +"HXAlbumSelfPortraits" = "셀 카"; +"HXAlbumScreenshots" = "화면 스냅"; +"HXAlbumDepthEffect" = "콜 롬"; +"HXAlbumLivePhotos" = "실황 사진"; +"HXAlbumAnimated" = "발생시키다 투"; + diff --git a/HXPHPicker/HXPHPicker.bundle/zh-Hans.lproj/Localizable.strings b/HXPHPicker/HXPHPicker.bundle/zh-Hans.lproj/Localizable.strings new file mode 100644 index 00000000..cd653fed Binary files /dev/null and b/HXPHPicker/HXPHPicker.bundle/zh-Hans.lproj/Localizable.strings differ diff --git a/HXPHPicker/HXPHPicker.bundle/zh-Hant.lproj/Localizable.strings b/HXPHPicker/HXPHPicker.bundle/zh-Hant.lproj/Localizable.strings new file mode 100644 index 00000000..1b87fe9d --- /dev/null +++ b/HXPHPicker/HXPHPicker.bundle/zh-Hant.lproj/Localizable.strings @@ -0,0 +1,22 @@ +"无法访问相册中照片" = "無法訪問相册中照片"; +"当前无照片访问权限,建议前往系统设置,\n允许访问「照片」中的「所有照片」。" = "當前無照片存取權限,建議前往系統設置,\n允許訪問「照片」中的「所有照片」。"; +"前往系统设置" = "前往系統設置"; +"取消" = "取消"; +"相册" = "相册"; + + + +"HXAlbumCameraRoll" = "所有照片"; +"HXAlbumPanoramas" = "全景照片"; +"HXAlbumVideos" = "視頻"; +"HXAlbumFavorites" = "個人收藏"; +"HXAlbumTimelapses" = "延時攝影"; +"HXAlbumRecents" = "最近項目"; +"HXAlbumRecentlyAdded" = "最近添加"; +"HXAlbumBursts" = "連拍快照"; +"HXAlbumSlomoVideos" = "慢動作"; +"HXAlbumSelfPortraits" = "自拍"; +"HXAlbumScreenshots" = "屏幕快照"; +"HXAlbumDepthEffect" = "人像"; +"HXAlbumLivePhotos" = "實況照片"; +"HXAlbumAnimated" = "動圖"; diff --git a/HXPHPicker/HXPHPickerController.swift b/HXPHPicker/HXPHPickerController.swift new file mode 100644 index 00000000..2c63d83a --- /dev/null +++ b/HXPHPicker/HXPHPickerController.swift @@ -0,0 +1,501 @@ +// +// HXPHPickerController.swift +// 照片选择器-Swift +// +// Created by 洪欣 on 2020/11/9. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit +import Photos + + +@objc protocol HXPHPickerControllerDelegate: NSObjectProtocol { + @objc optional func pickerContollerDidFinish(_ pickerController: HXPHPickerController, with selectedAssetArray:[HXPHAsset], isOriginal: Bool) + @objc optional func pickerContollerDidCancel(_ pickerController: HXPHPickerController) +} + +class HXPHPickerController: UINavigationController, PHPhotoLibraryChangeObserver { + + weak var pickerContollerDelegate : HXPHPickerControllerDelegate? + + /// 相关配置 + lazy var config : HXPHConfiguration = { + return HXPHConfiguration.init() + }() + + /// 当前被选择的资源对应的 HXPHAsset 对象数组 + var selectedAssetArray: [HXPHAsset] = [] { + didSet { + if !canAddedAsset { + canAddedAsset = true + return + } + for photoAsset in selectedAssetArray { + if photoAsset.mediaType == HXPHAssetMediaType.photo { + selectedPhotoAssetArray.append(photoAsset) + }else if photoAsset.mediaType == HXPHAssetMediaType.video { + selectedVideoAssetArray.append(photoAsset) + } + } + } + } + + /// 是否选中了原图 + var isOriginal: Bool = false + + /// 刷新数据 + /// 可以在传入 selectedPhotoAssetArray 之后重新加载数据将重新设置的被选择的 HXPHAsset 选中 + /// - Parameter assetCollection: 可以切换显示其他资源集合 + public func reloadData(assetCollection: HXPHAssetCollection?) { + let pickerVC = pickerViewController() + if pickerVC != nil { + pickerVC!.showLoading = true + if assetCollection == nil { + pickerVC!.fetchPhotoAssets() + }else { + pickerVC!.assetCollection = assetCollection + pickerVC!.updateTitle() + pickerVC!.fetchPhotoAssets() + } + } + reloadAlbumData() + } + + /// 所有资源集合 + private(set) var assetCollectionsArray : [HXPHAssetCollection] = [] + var fetchAssetCollectionsCompletion : (([HXPHAssetCollection])->())? + + /// 相机胶卷资源集合 + private(set) var cameraAssetCollection : HXPHAssetCollection? + var fetchCameraAssetCollectionCompletion : ((HXPHAssetCollection?)->())? + + // MARK: 私有 + private var selectType : HXPHSelectType? + private var canAddedAsset: Bool = true + private var selectedPhotoAssetArray: [HXPHAsset] = [] + private var selectedVideoAssetArray: [HXPHAsset] = [] + private lazy var options : PHFetchOptions = { + let options = PHFetchOptions.init() + return options + }() + private lazy var deniedView: HXPHDeniedAuthorizationView = { + let deniedView = HXPHDeniedAuthorizationView.init(config: config.notAuthorized) + deniedView.frame = view.bounds + return deniedView + }() + + init(config : HXPHConfiguration) { + _ = HXPHManager.shared.createLanguageBundle(languageType: config.languageType) + var photoVC : UIViewController? = nil + if config.albumShowMode == HXAlbumShowMode.normal { + photoVC = HXAlbumViewController.init() + }else if config.albumShowMode == HXAlbumShowMode.popup { + photoVC = HXPHPickerViewController.init() + } + super.init(rootViewController: photoVC!) + self.config = config + self.navigationBar.isTranslucent = config.navigationBarIsTranslucent + self.selectType = config.selectType + self.setOptions() + self.requestAuthorization() + } + override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { + super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) + } + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + private func setOptions() { + if selectType == HXPHSelectType.photo { + options.predicate = NSPredicate.init(format: "mediaType == %ld", argumentArray: [PHAssetMediaType.image.rawValue]) + }else if selectType == HXPHSelectType.video { + options.predicate = NSPredicate.init(format: "mediaType == %ld", argumentArray: [PHAssetMediaType.video.rawValue]) + }else { + options.predicate = nil + } + } + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = UIColor.white + } + private func requestAuthorization() { + let status = HXPHAssetManager.authorizationStatus() + if status.rawValue >= 3 { + // 有权限 + fetchData(status: status) + }else if status.rawValue >= 1 { + // 无权限 + view.addSubview(deniedView) + }else { + // 用户还没做出选择,请求权限 + HXPHAssetManager.requestAuthorization { (status) in + self.fetchData(status: status) + } + } + } + private func fetchData(status: PHAuthorizationStatus) { + if status.rawValue >= 3 { + PHPhotoLibrary.shared().register(self) + // 有权限 + HXPHProgressHUD.showLoadingHUD(addedTo: view, afterDelay: 0.15, animated: true) + fetchCameraAssetCollection() + }else if status.rawValue >= 1 { + // 无权限 + view.addSubview(deniedView) + } + } + // MARK: 暴露给子控制器的方法 + func finishCallback() { + pickerContollerDelegate?.pickerContollerDidFinish?(self, with: selectedAssetArray, isOriginal: isOriginal) + } + func cancelCallback() { + pickerContollerDelegate?.pickerContollerDidCancel?(self) + } + /// 获取相机胶卷资源集合 + func fetchCameraAssetCollection() { + options.sortDescriptors = [NSSortDescriptor.init(key: "creationDate", ascending: config.creationDate)] + HXPHManager.shared.fetchCameraAssetCollection(for: selectType ?? HXPHSelectType.any, options: options) { (assetCollection) in + if assetCollection.count == 0 { + self.cameraAssetCollection = HXPHAssetCollection.init(albumName: self.config.albumList.emptyAlbumName, coverImage: UIImage.hx_named(named: self.config.albumList.emptyCoverImageName)) + }else { + self.cameraAssetCollection = assetCollection + } + self.fetchCameraAssetCollectionCompletion?(self.cameraAssetCollection) + } + } + func fetchAssetCollections() { + options.sortDescriptors = [NSSortDescriptor.init(key: "creationDate", ascending: config.creationDate)] + HXPHManager.shared.fetchAssetCollections(for: options, showEmptyCollection: false) { (assetCollectionsArray) in + self.assetCollectionsArray = assetCollectionsArray + if !assetCollectionsArray.isEmpty, self.cameraAssetCollection != nil { + self.assetCollectionsArray[0] = self.cameraAssetCollection! + } + self.fetchAssetCollectionsCompletion?(self.assetCollectionsArray) + } + } + func addedPhotoAsset(photoAsset: HXPHAsset) -> Bool { + let canSelect = canSelectAsset(for: photoAsset) + if canSelect { + canAddedAsset = false + photoAsset.selected = true + photoAsset.selectIndex = selectedAssetArray.count + if photoAsset.mediaType == HXPHAssetMediaType.photo { + selectedPhotoAssetArray.append(photoAsset) + }else if photoAsset.mediaType == HXPHAssetMediaType.video { + selectedVideoAssetArray.append(photoAsset) + } + selectedAssetArray.append(photoAsset) + } + return canSelect + } + func removePhotoAsset(photoAsset: HXPHAsset) -> Bool { + if selectedAssetArray.isEmpty { + return false + } + photoAsset.selected = false + if photoAsset.mediaType == HXPHAssetMediaType.photo { + selectedPhotoAssetArray.remove(at: selectedPhotoAssetArray.firstIndex(of: photoAsset)!) + }else if photoAsset.mediaType == HXPHAssetMediaType.video { + selectedVideoAssetArray.remove(at: selectedVideoAssetArray.firstIndex(of: photoAsset)!) + } + selectedAssetArray.remove(at: selectedAssetArray.firstIndex(of: photoAsset)!) + for (index, asset) in selectedAssetArray.enumerated() { + asset.selectIndex = index + } + return true + } + func canSelectAsset(for photoAsset: HXPHAsset) -> Bool { + var canSelect = true + var text: String? + if photoAsset.mediaType == HXPHAssetMediaType.photo { + if !config.photosAndVideosCanBeSelectedTogether { + if selectedVideoAssetArray.count > 0 { + text = "照片和视频不能同时选择".hx_localized() + canSelect = false + } + } + if config.maximumSelectPhotoCount > 0 { + if selectedPhotoAssetArray.count >= config.maximumSelectPhotoCount { + text = String.init(format: "最多只能选择%d张照片".hx_localized(), arguments: [config.maximumSelectPhotoCount]) + canSelect = false + } + }else { + if selectedAssetArray.count >= config.maximumSelectCount && config.maximumSelectCount > 0 { + text = String.init(format: "已达到最大选择数".hx_localized(), arguments: [config.maximumSelectPhotoCount]) + canSelect = false + } + } + }else if photoAsset.mediaType == HXPHAssetMediaType.video { + if config.videoMaximumSelectDuration > 0 { + if round(photoAsset.videoDuration) > Double(config.videoMaximumSelectDuration) { + text = String.init(format: "视频最大时长为%d秒,无法选择".hx_localized(), arguments: [config.videoMaximumSelectDuration]) + canSelect = false + } + } + if config.videoMinimumSelectDuration > 0 { + if photoAsset.videoDuration < Double(config.videoMinimumSelectDuration) { + text = String.init(format: "视频最小时长为%d秒,无法选择".hx_localized(), arguments: [config.videoMinimumSelectDuration]) + canSelect = false + } + } + if !config.photosAndVideosCanBeSelectedTogether { + if selectedPhotoAssetArray.count > 0 { + text = "视频和照片不能同时选择".hx_localized() + canSelect = false + } + } + if config.maximumSelectVideoCount > 0 { + if selectedVideoAssetArray.count >= config.maximumSelectVideoCount { + text = String.init(format: "最多只能选择%d个视频".hx_localized(), arguments: [config.maximumSelectPhotoCount]) + canSelect = false + } + }else { + if selectedAssetArray.count >= config.maximumSelectCount && config.maximumSelectCount > 0 { + text = String.init(format: "已达到最大选择数".hx_localized(), arguments: [config.maximumSelectPhotoCount]) + canSelect = false + } + } + } + if !canSelect { + HXPHProgressHUD.showWarningHUD(addedTo: view, text: text!, afterDelay: 0, animated: true) + HXPHProgressHUD.hideHUD(forView: view, animated: true, afterDelay: 2) + } + return canSelect + } + + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + let status = HXPHAssetManager.authorizationStatus() + if status.rawValue >= 1 && status.rawValue < 3 { + deniedView.frame = view.bounds + } + } + override var preferredStatusBarStyle: UIStatusBarStyle { + return config.statusBarStyle + } + override var prefersStatusBarHidden: Bool { + return topViewController?.prefersStatusBarHidden ?? false + } + override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation { + return topViewController?.preferredStatusBarUpdateAnimation ?? UIStatusBarAnimation.fade + } + + // MARK: PHPhotoLibraryChangeObserver + + func photoLibraryDidChange(_ changeInstance: PHChange) { + if !HXPHAssetManager.authorizationStatusIsLimited() { + return + } + var needReload = false + if assetCollectionsArray.isEmpty { + if cameraAssetCollection != nil { + needReload = resultHasChanges(for: changeInstance, assetCollection: cameraAssetCollection!) + } + }else { + for assetCollection in assetCollectionsArray { + let hasChanges = resultHasChanges(for: changeInstance, assetCollection: assetCollection) + if !needReload { + needReload = hasChanges; + } + } + } + if needReload { + DispatchQueue.main.async { + self.reloadData(assetCollection: nil) + } + } + } + private func resultHasChanges(for changeInstance:PHChange, assetCollection: HXPHAssetCollection) -> Bool { + if assetCollection.result == nil { + return false + } + let changeResult : PHFetchResultChangeDetails? = changeInstance.changeDetails(for: assetCollection.result!) + if changeResult != nil { + if !changeResult!.hasIncrementalChanges { + let result = changeResult!.fetchResultAfterChanges + assetCollection.changeResult(for: result) + return true + } + } + return false + } + private func reloadAlbumData() { + let albumVC = albumViewController() + if albumVC != nil { + albumVC!.tableView.reloadData() + }else { + + } + } + private func albumViewController() -> HXAlbumViewController? { + for viewController in viewControllers { + if viewController is HXAlbumViewController { + return viewController as? HXAlbumViewController + } + } + return nil + } + private func pickerViewController() -> HXPHPickerViewController? { + for viewController in viewControllers { + if viewController is HXPHPickerViewController { + return viewController as? HXPHPickerViewController + } + } + return nil + } + override func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) { + + super.present(viewControllerToPresent, animated: flag, completion: completion) + } + deinit { + PHPhotoLibrary.shared().unregisterChangeObserver(self) + print("\(self) deinit") + } +} +/// 单独写个扩展,处理/获取数据 +extension HXPHPickerController { + + /// 获取相册里的资源 + /// - Parameters: + /// - assetCollection: 相册 + /// - completion: 完成回调 + func fetchPhotoAssets(assetCollection: HXPHAssetCollection?, completion: @escaping ([HXPHAsset], HXPHAsset?) -> Void) { + DispatchQueue.global().async { + var selectedAssets = [PHAsset]() + var selectedPhotoAssets = [HXPHAsset]() + for phAsset in self.selectedAssetArray { + if phAsset.asset != nil { + selectedAssets.append(phAsset.asset!) + selectedPhotoAssets.append(phAsset) + } + } + var photoAssets = [HXPHAsset]() + photoAssets.reserveCapacity(assetCollection?.count ?? 0) + var lastAsset: HXPHAsset? + assetCollection?.enumerateAssets(usingBlock: { (photoAsset) in + if photoAsset.mediaType == HXPHAssetMediaType.photo { + if self.selectType == HXPHSelectType.video { + return + } + if self.config.showAnimatedAsset == true { + if HXPHAssetManager.assetIsAnimated(asset: photoAsset.asset!) { + photoAsset.mediaSubType = HXPHAssetMediaSubType.imageAnimated + } + } + if self.config.showLivePhotoAsset == true { + if HXPHAssetManager.assetIsLivePhoto(asset: photoAsset.asset!) { + photoAsset.mediaSubType = HXPHAssetMediaSubType.livePhoto + } + } + }else if photoAsset.mediaType == HXPHAssetMediaType.video { + if self.selectType == HXPHSelectType.photo { + return + } + } + var asset = photoAsset + if selectedAssets.contains(asset.asset!) { + let index = selectedAssets.firstIndex(of: asset.asset!)! + let phAsset: HXPHAsset = selectedPhotoAssets[index] + asset = phAsset + lastAsset = phAsset + } + if self.config.reverseOrder == true { + photoAssets.insert(asset, at: 0) + }else { + photoAssets.append(asset) + } + }) + DispatchQueue.main.async { + completion(photoAssets, lastAsset) + } + } + } +} + +class HXPHDeniedAuthorizationView: UIView { + + var config: HXPHNotAuthorizedConfiguration? + + lazy var closeBtn: UIButton = { + let closeBtn = UIButton.init(type: UIButton.ButtonType.custom) + closeBtn.addTarget(self, action: #selector(didCloseClick), for: UIControl.Event.touchUpInside) + return closeBtn + }() + + lazy var titleLb: UILabel = { + let titleLb = UILabel.init() + titleLb.textAlignment = NSTextAlignment.center + titleLb.numberOfLines = 0 + return titleLb + }() + + lazy var subTitleLb: UILabel = { + let subTitleLb = UILabel.init() + subTitleLb.textAlignment = NSTextAlignment.center + subTitleLb.numberOfLines = 0 + return subTitleLb + }() + + lazy var jumpBtn: UIButton = { + let jumpBtn = UIButton.init(type: UIButton.ButtonType.custom) + jumpBtn.layer.cornerRadius = 5 + jumpBtn.addTarget(self, action: #selector(jumpSetting), for: UIControl.Event.touchUpInside) + return jumpBtn + }() + + init(config: HXPHNotAuthorizedConfiguration?) { + super.init(frame: CGRect.zero) + self.config = config + configView() + } + + func configView() { + addSubview(closeBtn) + addSubview(titleLb) + addSubview(subTitleLb) + addSubview(jumpBtn) + backgroundColor = config?.backgroudColor + closeBtn.setTitle("X", for: UIControl.State.normal) + closeBtn.setTitleColor(UIColor.white, for: UIControl.State.normal) + + titleLb.text = "无法访问相册中照片".hx_localized() + titleLb.textColor = config?.titleColor + titleLb.font = UIFont.hx_semiboldPingFang(size: 20) + + subTitleLb.text = "当前无照片访问权限,建议前往系统设置,\n允许访问「照片」中的「所有照片」。".hx_localized() + subTitleLb.textColor = config?.subTitleColor + subTitleLb.font = UIFont.hx_regularPingFang(size: 17) + + jumpBtn.backgroundColor = config?.jumpButtonBackgroudColor + jumpBtn.setTitle("前往系统设置".hx_localized(), for: UIControl.State.normal) + jumpBtn.setTitleColor(config?.jumpButtonTitleColor, for: UIControl.State.normal) + jumpBtn.titleLabel?.font = UIFont.hx_mediumPingFang(size: 16) + } + @objc func didCloseClick() { + self.hx_viewController()?.dismiss(animated: true, completion: nil) + } + @objc func jumpSetting() { + HXPHTools.openSettingsURL() + } + + override func layoutSubviews() { + super.layoutSubviews() + + closeBtn.frame = CGRect(x: 20, y: UIDevice.hx_statusBarHeight() + 5, width: 40, height: 40) + + let titleHeight = titleLb.text?.hx_stringHeight(ofFont: titleLb.font, maxWidth: hx_width) ?? 0 + titleLb.frame = CGRect(x: 0, y: 0, width: hx_width, height: titleHeight) + + let subTitleHeight = subTitleLb.text?.hx_stringHeight(ofFont: subTitleLb.font, maxWidth: hx_width - 40) ?? 0 + subTitleLb.frame = CGRect(x: 20, y: hx_height / 2 - subTitleHeight - 30 - UIDevice.hx_topMargin(), width: hx_width - 40, height: subTitleHeight) + titleLb.hx_y = subTitleLb.hx_y - 15 - titleHeight + + let jumpBtnBottomMargin : CGFloat = UIDevice.isProxy() ? 120 : 50 + jumpBtn.frame = CGRect(x: 0, y: hx_height - UIDevice.hx_bottomMargin() - 40 - jumpBtnBottomMargin, width: 150, height: 40) + jumpBtn.hx_centerX = hx_width * 0.5 + } + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} diff --git a/HXPHPicker/HXPHPickerViewCell.swift b/HXPHPicker/HXPHPickerViewCell.swift new file mode 100644 index 00000000..a1c9cd38 --- /dev/null +++ b/HXPHPicker/HXPHPickerViewCell.swift @@ -0,0 +1,286 @@ +// +// HXPHPickerViewCell.swift +// 照片选择器-Swift +// +// Created by 洪欣 on 2019/6/29. +// Copyright © 2019年 洪欣. All rights reserved. +// + +import UIKit +import Photos + +protocol HXPHPickerViewCellDelegate: NSObjectProtocol { + + func cellDidSelectControlClick(_ cell: HXPHPickerMultiSelectViewCell, isSelected: Bool) + +} + +class HXPHPickerViewCell: UICollectionViewCell { + + weak var delegate: HXPHPickerViewCellDelegate? + var config: HXPHPhotoListCellConfiguration? { + didSet { + backgroundColor = config?.backgroundColor + } + } + lazy var imageView: UIImageView = { + let imageView = UIImageView.init() + imageView.contentMode = UIView.ContentMode.scaleAspectFill + imageView.clipsToBounds = true + imageView.layer.addSublayer(assetTypeMaskLayer) + return imageView + }() + lazy var assetTypeMaskLayer: CAGradientLayer = { + let layer = CAGradientLayer.init() + let blackColor = UIColor.black + layer.colors = [blackColor.withAlphaComponent(0).cgColor, + blackColor.withAlphaComponent(0.15).cgColor, + blackColor.withAlphaComponent(0.35).cgColor, + blackColor.withAlphaComponent(0.6).cgColor] + layer.startPoint = CGPoint(x: 0, y: 0) + layer.endPoint = CGPoint(x: 0, y: 1) + layer.locations = [0.15, 0.35, 0.6, 0.9] + layer.borderWidth = 0.0 + layer.isHidden = true + return layer + }() + lazy var assetTypeLb: UILabel = { + let assetTypeLb = UILabel.init() + assetTypeLb.font = UIFont.hx_mediumPingFang(size: 14) + assetTypeLb.textColor = UIColor.white + assetTypeLb.textAlignment = NSTextAlignment.right + return assetTypeLb + }() + var requestID: PHImageRequestID? + var photoAsset: HXPHAsset? { + didSet { + switch photoAsset?.mediaSubType.rawValue { + case 1: + assetTypeLb.text = "GIF" + assetTypeMaskLayer.isHidden = false + break + case 2: + assetTypeLb.text = "Live" + assetTypeMaskLayer.isHidden = false + break + case 4, 5: + assetTypeLb.text = photoAsset?.videoTime + assetTypeMaskLayer.isHidden = false + break + default: + assetTypeLb.text = nil + assetTypeMaskLayer.isHidden = true + } + requestID = photoAsset?.requestThumbnailImage(completion: { (image, photoAsset, info) in + if photoAsset == self.photoAsset && image != nil { + self.imageView.image = image + if !HXPHAssetManager.assetDownloadIsDegraded(for: info) { + self.requestID = nil + } + } + }) + } + } + + var videoCanSelected = true + + override init(frame: CGRect) { + super.init(frame: frame) + initView() + } + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + func initView() { + contentView.addSubview(imageView) + contentView.addSubview(assetTypeLb) + } + + func cancelRequest() { + if requestID != nil { + PHImageManager.default().cancelImageRequest(requestID!) + requestID = nil + } + } + + override func layoutSubviews() { + super.layoutSubviews() + + imageView.frame = bounds + assetTypeMaskLayer.frame = CGRect(x: 0, y: imageView.hx_height - 25, width: hx_width, height: 25) + assetTypeLb.frame = CGRect(x: 0, y: hx_height - 19, width: hx_width - 5, height: 18) + } +} + +class HXPHPickerMultiSelectViewCell : HXPHPickerViewCell { + + lazy var selectControl: HXPHPickerCellSelectBoxControl = { + let selectControl = HXPHPickerCellSelectBoxControl.init() + selectControl.backgroundColor = UIColor.clear + selectControl.addTarget(self, action: #selector(didSelectControlClick(control:)), for: UIControl.Event.touchUpInside) + return selectControl + }() + + lazy var selectMaskLayer: CALayer = { + let selectMaskLayer = CALayer.init() + selectMaskLayer.backgroundColor = UIColor.white.withAlphaComponent(0.5).cgColor + selectMaskLayer.frame = bounds + selectMaskLayer.isHidden = true + return selectMaskLayer + }() + + override var photoAsset: HXPHAsset? { + didSet { + updateSelectedState(isSelected: photoAsset!.selected, animated: false) + } + } + + override var config: HXPHPhotoListCellConfiguration? { + didSet { + selectControl.config = config!.selectBox + } + } + + override init(frame: CGRect) { + super.init(frame: frame) + imageView.layer.addSublayer(selectMaskLayer) + contentView.addSubview(selectControl) + } + + @objc func didSelectControlClick(control: HXPHPickerCellSelectBoxControl) { + delegate?.cellDidSelectControlClick(self, isSelected: control.isSelected) + } + + func updateSelectedState(isSelected: Bool, animated: Bool) { + let boxWidth = config!.selectBox.size.width + let boxHeight = config!.selectBox.size.height + if isSelected { + selectMaskLayer.isHidden = false + if config!.selectBox.type == HXPHPickerCellSelectBoxType.number { + let text = String(format: "%d", arguments: [photoAsset!.selectIndex + 1]) + let font = UIFont.systemFont(ofSize: config!.selectBox.titleFontSize) + let textHeight = text.hx_stringHeight(ofFont: font, maxWidth: boxWidth) + var textWidth = text.hx_stringWidth(ofFont: font, maxHeight: textHeight) + selectControl.textSize = CGSize(width: textWidth, height: textHeight) + textWidth += boxHeight * 0.5 + if textWidth < boxWidth { + textWidth = boxWidth + } + selectControl.text = text + updateSelectControlFrame(width: textWidth, height: boxHeight) + }else { + updateSelectControlFrame(width: boxWidth, height: boxHeight) + } + }else { + selectMaskLayer.isHidden = true + updateSelectControlFrame(width: boxWidth, height: boxHeight) + } + selectControl.isSelected = isSelected + if animated { + selectControl.layer.removeAnimation(forKey: "SelectControlAnimation") + let keyAnimation = CAKeyframeAnimation.init(keyPath: "transform.scale") + keyAnimation.duration = 0.3 + keyAnimation.values = [1.2, 0.8, 1.1, 0.9, 1.0] + selectControl.layer.add(keyAnimation, forKey: "SelectControlAnimation") + } + } + + func updateSelectControlFrame(width: CGFloat, height: CGFloat) { + let topMargin = config?.selectBoxTopMargin ?? 5 + let rightMargin = config?.selectBoxRightMargin ?? 5 + selectControl.frame = CGRect(x: hx_width - rightMargin - width, y: topMargin, width: width, height: height) + } + + override func layoutSubviews() { + super.layoutSubviews() + selectMaskLayer.frame = imageView.bounds + if selectControl.hx_width != hx_width - 5 - selectControl.hx_width { + updateSelectControlFrame(width: selectControl.hx_width, height: selectControl.hx_height) + } + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} + +class HXPHPickerCellSelectBoxControl: UIControl { + var text: String = "0" + var textSize: CGSize = CGSize.zero + lazy var config: HXPHSelectBoxConfiguration = { + return HXPHSelectBoxConfiguration.init() + }() + + override func draw(_ rect: CGRect) { + super.draw(rect) + let ctx = UIGraphicsGetCurrentContext()! + var fillRect : CGRect + var fillColor : UIColor? + if isSelected { + fillRect = rect + fillColor = config.selectedBackgroudColor + }else { + let borderWidth = config.borderWidth + let height = hx_height - borderWidth + fillRect = CGRect(x: borderWidth, y: borderWidth, width: hx_width - borderWidth * 2, height: height - borderWidth) + let strokePath = UIBezierPath.init(roundedRect: CGRect(x: borderWidth * 0.5, y: borderWidth * 0.5, width: hx_width - borderWidth, height: height), cornerRadius: height / 2) + fillColor = config.backgroudColor + ctx.addPath(strokePath.cgPath) + ctx.setLineWidth(borderWidth) + ctx.setStrokeColor(config.borderColor.cgColor) + ctx.strokePath() + } + let fillPath = UIBezierPath.init(roundedRect: fillRect, cornerRadius: fillRect.size.height / 2) + ctx.addPath(fillPath.cgPath) + ctx.setFillColor(fillColor!.cgColor) + ctx.fillPath() + if isSelected { + if config.type == HXPHPickerCellSelectBoxType.number { + ctx.textMatrix = CGAffineTransform.identity + ctx.translateBy(x: 0, y: hx_height) + ctx.scaleBy(x: 1, y: -1) + let textPath = CGMutablePath() + let font = UIFont.systemFont(ofSize: config.titleFontSize) + var textHeight: CGFloat + var textWidth: CGFloat + if textSize.equalTo(CGSize.zero) { + textHeight = text.hx_stringHeight(ofFont: font, maxWidth: hx_width) + textWidth = text.hx_stringWidth(ofFont: font, maxHeight: textHeight) + }else { + textHeight = textSize.height + textWidth = textSize.width + } + textPath.addRect(CGRect(x: (hx_width - textWidth) * 0.5, y: (hx_height - textHeight) * 0.5, width: textWidth, height: textHeight)) + ctx.addPath(textPath) + let style = NSMutableParagraphStyle() + style.alignment = .center + let attrString = NSAttributedString(string: text, attributes: [NSAttributedString.Key.font : font , + NSAttributedString.Key.foregroundColor: config.titleColor , + NSAttributedString.Key.paragraphStyle: style]) + let framesetter = CTFramesetterCreateWithAttributedString(attrString) + let frame = CTFramesetterCreateFrame(framesetter, CFRange(location: 0, length: attrString.length), textPath, nil) + CTFrameDraw(frame, ctx) + }else if config.type == HXPHPickerCellSelectBoxType.tick { + let tickPath = UIBezierPath.init() + tickPath.move(to: CGPoint(x: scale(8), y: hx_height * 0.5 + scale(1))) + tickPath.addLine(to: CGPoint(x: hx_width * 0.5 - scale(2), y: hx_height - scale(8))) + tickPath.addLine(to: CGPoint(x: hx_width - scale(7), y: scale(9))) + ctx.addPath(tickPath.cgPath) + ctx.setLineWidth(config.tickWidth) + ctx.setStrokeColor(config.tickColor.cgColor) + ctx.strokePath() + } + } + } + + private func scale(_ numerator: CGFloat) -> CGFloat { + return numerator / 30 * hx_height + } + + override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { + if CGRect(x: -15, y: -15, width: hx_width + 30, height: hx_height + 30).contains(point) { + return self + } + return super.hitTest(point, with: event) + } +} diff --git a/HXPHPicker/HXPHPickerViewController.swift b/HXPHPicker/HXPHPickerViewController.swift new file mode 100644 index 00000000..34f47749 --- /dev/null +++ b/HXPHPicker/HXPHPickerViewController.swift @@ -0,0 +1,404 @@ +// +// HXPHPickerViewController.swift +// 照片选择器-Swift +// +// Created by 洪欣 on 2019/6/29. +// Copyright © 2019年 洪欣. All rights reserved. +// + +import UIKit + +class HXPHPickerViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, HXPHPickerViewCellDelegate, HXPHPickerBottomViewDelegate, HXPHPreviewViewControllerDelegate { + + var config: HXPHPhotoListConfiguration! + var assetCollection: HXPHAssetCollection! + var assets: [HXPHAsset] = [] + lazy var collectionViewLayout: UICollectionViewFlowLayout = { + let collectionViewLayout = UICollectionViewFlowLayout.init() + let space = config.spacing + collectionViewLayout.minimumLineSpacing = space + collectionViewLayout.minimumInteritemSpacing = space + return collectionViewLayout + }() + lazy var collectionView: UICollectionView = { + let collectionView = UICollectionView.init(frame: view.bounds, collectionViewLayout: collectionViewLayout) + collectionView.backgroundColor = config.backgroundColor + collectionView.dataSource = self + collectionView.delegate = self + collectionView.register(HXPHPickerViewCell.self, forCellWithReuseIdentifier: NSStringFromClass(HXPHPickerViewCell.classForCoder())) + collectionView.register(HXPHPickerMultiSelectViewCell.self, forCellWithReuseIdentifier: NSStringFromClass(HXPHPickerMultiSelectViewCell.classForCoder())) + + if #available(iOS 11.0, *) { + collectionView.contentInsetAdjustmentBehavior = UIScrollView.ContentInsetAdjustmentBehavior.never + } else { + // Fallback on earlier versions + self.automaticallyAdjustsScrollViewInsets = false + } + return collectionView + }() + var orientationDidChange : Bool = false + var beforeOrientationIndexPath: IndexPath? + var showLoading : Bool = false + var isMultipleSelect : Bool = false + var videoLoadSingleCell = false + + lazy var bottomView : HXPHPickerBottomView = { + let bottomView = HXPHPickerBottomView.init(config: config.bottomView) + bottomView.hx_delegate = self + bottomView.boxControl.isSelected = hx_pickerController()!.isOriginal + return bottomView + }() + + override func viewDidLoad() { + super.viewDidLoad() + configData() + initView() + fetchData() + NotificationCenter.default.addObserver(self, selector: #selector(deviceOrientationChanged(notify:)), name: UIApplication.didChangeStatusBarOrientationNotification, object: nil) + } + @objc func deviceOrientationChanged(notify: Notification) { + beforeOrientationIndexPath = collectionView.indexPathsForVisibleItems.first + orientationDidChange = true + } + func configData() { + isMultipleSelect = hx_pickerController()!.config.selectMode == HXPHAssetSelectMode.multiple + if !hx_pickerController()!.config.photosAndVideosCanBeSelectedTogether && hx_pickerController()!.config.maximumSelectVideoCount == 1 && + hx_pickerController()!.config.selectType == HXPHSelectType.any && + isMultipleSelect { + videoLoadSingleCell = true + } + config = hx_pickerController()!.config.photoList + view.backgroundColor = config.backgroundColor + updateTitle() + navigationItem.rightBarButtonItem = UIBarButtonItem.init(title: "取消".hx_localized(), style: UIBarButtonItem.Style.done, target: self, action: #selector(didCancelItemClick)) + } + @objc func didCancelItemClick() { + hx_pickerController()?.cancelCallback() + dismiss(animated: true, completion: nil) + } + + func initView() { + extendedLayoutIncludesOpaqueBars = true; + edgesForExtendedLayout = UIRectEdge.all; + view.addSubview(collectionView) + if isMultipleSelect { + view.addSubview(bottomView) + bottomView.updateFinishButtonTitle() + } + } + func updateTitle() { + title = assetCollection?.albumName + } + func fetchData() { + if hx_pickerController()!.config.albumShowMode == HXAlbumShowMode.popup { + HXPHAssetManager.requestAuthorization { (status) in + + } + }else { + if showLoading { + HXPHProgressHUD.showLoadingHUD(addedTo: view, afterDelay: 0.15, animated: true) + } + fetchPhotoAssets() + } + } + func fetchPhotoAssets() { + hx_pickerController()!.fetchPhotoAssets(assetCollection: assetCollection) { (photoAssets, photoAsset) in + self.assets = photoAssets + self.collectionView.reloadData() + self.scrollToAppropriatePlace(photoAsset: photoAsset) + if self.showLoading { + HXPHProgressHUD.hideHUD(forView: self.view, animated: true) + self.showLoading = false + }else { + HXPHProgressHUD.hideHUD(forView: self.navigationController?.view, animated: false) + } + } + } + func scrollToAppropriatePlace(photoAsset: HXPHAsset?) { + if assets.isEmpty { + return + } + if !hx_pickerController()!.config.reverseOrder { + var item = assets.count - 1 + if photoAsset != nil { + item = assets.firstIndex(of: photoAsset!) ?? item + } + collectionView.scrollToItem(at: IndexPath(item: item, section: 0), at: UICollectionView.ScrollPosition.bottom, animated: false) + } + } + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return assets.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell: HXPHPickerViewCell + let photoAsset = assets[indexPath.item] + if hx_pickerController()?.config.selectMode == HXPHAssetSelectMode.single || (photoAsset.mediaType == HXPHAssetMediaType.video && videoLoadSingleCell) { + cell = collectionView.dequeueReusableCell(withReuseIdentifier: NSStringFromClass(HXPHPickerViewCell.classForCoder()), for: indexPath) as! HXPHPickerViewCell + }else { + cell = collectionView.dequeueReusableCell(withReuseIdentifier: NSStringFromClass(HXPHPickerMultiSelectViewCell.classForCoder()), for: indexPath) as! HXPHPickerMultiSelectViewCell + } + cell.delegate = self + cell.config = config.cell + cell.photoAsset = photoAsset + return cell + } + + func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { + let myCell: HXPHPickerViewCell = cell as! HXPHPickerViewCell + + myCell.cancelRequest() + } + + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + collectionView.deselectItem(at: indexPath, animated: false) + pushPreviewViewController(previewAssets: assets, currentPreviewIndex: indexPath.item) + } + + func pushPreviewViewController(previewAssets: [HXPHAsset], currentPreviewIndex: Int) { + let vc = HXPHPreviewViewController.init() + vc.previewAssets = previewAssets + vc.currentPreviewIndex = currentPreviewIndex + vc.delegate = self + navigationController?.pushViewController(vc, animated: true) + } + + // MARK: HXPHPickerViewCellDelegate + + func cellDidSelectControlClick(_ cell: HXPHPickerMultiSelectViewCell, isSelected: Bool) { + if isSelected { + // 取消选中 + _ = hx_pickerController()?.removePhotoAsset(photoAsset: cell.photoAsset!) + cell.updateSelectedState(isSelected: false, animated: true) + if config.cell.selectBox.type == HXPHPickerCellSelectBoxType.number { + updateCellSelectedTitle() + } + }else { + // 选中 + if hx_pickerController()!.addedPhotoAsset(photoAsset: cell.photoAsset!) { + cell.updateSelectedState(isSelected: true, animated: true) + } + } + bottomView.updateFinishButtonTitle() + } + + func updateCellSelectedTitle() { + for visibleCell in collectionView.visibleCells { + if visibleCell is HXPHPickerMultiSelectViewCell { + let cell = visibleCell as! HXPHPickerMultiSelectViewCell + if cell.photoAsset!.selected { + if Int(cell.selectControl.text) != (cell.photoAsset!.selectIndex + 1) { + cell.updateSelectedState(isSelected: true, animated: false) + cell.selectControl.setNeedsDisplay() + } + } + } + } + } + + // MARK: HXPHPickerBottomViewDelegate + func bottomViewDidPreviewButtonClick(view: HXPHPickerBottomView) { + pushPreviewViewController(previewAssets: hx_pickerController()!.selectedAssetArray, currentPreviewIndex: 0) + } + func bottomViewDidFinishButtonClick(view: HXPHPickerBottomView) { + hx_pickerController()?.finishCallback() + dismiss(animated: true, completion: nil) + } + func bottomViewDidOriginalButtonClick(view: HXPHPickerBottomView, with isOriginal: Bool) { } + + // MARK: HXPHPreviewViewControllerDelegate + func previewViewControllerDidClickOriginal(_ previewViewController: HXPHPreviewViewController, with isOriginal: Bool) { + if isMultipleSelect { + bottomView.boxControl.isSelected = isOriginal + } + } + func previewViewControllerDidClickSelectBox(_ previewViewController: HXPHPreviewViewController, with isSelected: Bool) { + collectionView.reloadData() + bottomView.updateFinishButtonTitle() + } + + init() { + super.init(nibName: nil, bundle: nil) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + let margin: CGFloat = UIDevice.hx_leftMargin() + collectionView.frame = CGRect(x: margin, y: 0, width: view.hx_width - 2 * margin, height: view.hx_height) + var collectionTop: CGFloat + if navigationController?.modalPresentationStyle == UIModalPresentationStyle.fullScreen { + collectionTop = UIDevice.hx_navigationBarHeight() + }else { + collectionTop = navigationController!.navigationBar.hx_height + } + if isMultipleSelect { + bottomView.frame = CGRect(x: 0, y: view.hx_height - 50 - UIDevice.hx_bottomMargin(), width: view.hx_width, height: 50 + UIDevice.hx_bottomMargin()) + collectionView.contentInset = UIEdgeInsets(top: collectionTop, left: 0, bottom: bottomView.hx_height + 0.5, right: 0) + }else { + collectionView.contentInset = UIEdgeInsets(top: collectionTop, left: 0, bottom: UIDevice.hx_bottomMargin(), right: 0) + } + let space = config.spacing + let count : CGFloat + if UIDevice.hx_isPortrait() == true { + count = CGFloat(config.rowNumber) + }else { + count = CGFloat(config.landscapeRowNumber) + } + let itemWidth = (collectionView.hx_width - space * (count - CGFloat(1))) / count + collectionViewLayout.itemSize = CGSize.init(width: itemWidth, height: itemWidth) + collectionView.setCollectionViewLayout(collectionViewLayout, animated: true) + if orientationDidChange { + collectionView.scrollToItem(at: beforeOrientationIndexPath ?? IndexPath(item: 0, section: 0), at: UICollectionView.ScrollPosition.top, animated: false) + orientationDidChange = false + } + } + deinit { + NotificationCenter.default.removeObserver(self) + } +} + +protocol HXPHPickerBottomViewDelegate: NSObjectProtocol { + func bottomViewDidPreviewButtonClick(view: HXPHPickerBottomView) + func bottomViewDidFinishButtonClick(view: HXPHPickerBottomView) + func bottomViewDidOriginalButtonClick(view: HXPHPickerBottomView, with isOriginal: Bool) +} + +class HXPHPickerBottomView: UIToolbar { + weak var hx_delegate: HXPHPickerBottomViewDelegate? + + var config: HXPHPickerBottomViewConfiguration? + + lazy var previewBtn: UIButton = { + let previewBtn = UIButton.init(type: UIButton.ButtonType.custom) + previewBtn.setTitle("预览".hx_localized(), for: UIControl.State.normal) + previewBtn.setTitleColor(config?.previewButtonTitleColor, for: UIControl.State.normal) + if config?.previewButtonDisableTitleColor != nil { + previewBtn.setTitleColor(config?.previewButtonDisableTitleColor, for: UIControl.State.disabled) + }else { + previewBtn.setTitleColor(config?.previewButtonTitleColor.withAlphaComponent(0.6), for: UIControl.State.disabled) + } + previewBtn.titleLabel?.font = UIFont.systemFont(ofSize: 17) + previewBtn.isEnabled = false + previewBtn.addTarget(self, action: #selector(didPreviewButtonClick(button:)), for: UIControl.Event.touchUpInside) + previewBtn.isHidden = config!.previewButtonHidden + return previewBtn + }() + + @objc func didPreviewButtonClick(button: UIButton) { + hx_delegate?.bottomViewDidPreviewButtonClick(view: self) + } + + lazy var originalBtn: UIView = { + let originalBtn = UIView.init() + originalBtn.addSubview(originalTitleLb) + originalBtn.addSubview(boxControl) + let tap = UITapGestureRecognizer.init(target: self, action: #selector(didOriginalButtonClick)) + originalBtn.addGestureRecognizer(tap) + originalBtn.isHidden = config!.originalButtonHidden + return originalBtn + }() + + @objc func didOriginalButtonClick() { + if boxControl.isSelected { + // 取消 + + }else { + // 选中 + + } + boxControl.isSelected = !boxControl.isSelected + hx_viewController()?.hx_pickerController()?.isOriginal = boxControl.isSelected + hx_delegate?.bottomViewDidOriginalButtonClick(view: self, with: boxControl.isSelected) + boxControl.layer.removeAnimation(forKey: "SelectControlAnimation") + let keyAnimation = CAKeyframeAnimation.init(keyPath: "transform.scale") + keyAnimation.duration = 0.3 + keyAnimation.values = [1.2, 0.8, 1.1, 0.9, 1.0] + boxControl.layer.add(keyAnimation, forKey: "SelectControlAnimation") + } + + lazy var originalTitleLb: UILabel = { + let originalTitleLb = UILabel.init() + originalTitleLb.text = "原图".hx_localized() + originalTitleLb.textColor = config?.originalButtonTitleColor + originalTitleLb.font = UIFont.systemFont(ofSize: 17) + originalTitleLb.frame = CGRect(x: 0, y: 0, width: originalTitleLb.text!.hx_stringWidth(ofFont: originalTitleLb.font, maxHeight: 50), height: 50) + return originalTitleLb + }() + + lazy var boxControl: HXPHPickerCellSelectBoxControl = { + let boxControl = HXPHPickerCellSelectBoxControl.init(frame: CGRect(x: originalTitleLb.hx_width + 2, y: 0, width: 16, height: 16)) + boxControl.config = config!.originalSelectBox + boxControl.hx_centerY = originalTitleLb.hx_height * 0.5 + boxControl.backgroundColor = UIColor.clear + return boxControl + }() + + lazy var finishBtn: UIButton = { + let finishBtn = UIButton.init(type: UIButton.ButtonType.custom) + finishBtn.setTitle("完成".hx_localized(), for: UIControl.State.normal) + finishBtn.setTitleColor(config?.finishButtonTitleColor, for: UIControl.State.normal) + finishBtn.setTitleColor(config?.finishButtonDisableTitleColor, for: UIControl.State.disabled) + finishBtn.setBackgroundImage(UIImage.hx_image(for: config!.finishButtonBackgroudColor, havingSize: CGSize.zero), for: UIControl.State.normal) + finishBtn.setBackgroundImage(UIImage.hx_image(for: config!.finishButtonDisableBackgroudColor, havingSize: CGSize.zero), for: UIControl.State.disabled) + finishBtn.titleLabel?.font = UIFont.hx_mediumPingFang(size: 16) + finishBtn.layer.cornerRadius = 3 + finishBtn.layer.masksToBounds = true + finishBtn.isEnabled = false + finishBtn.addTarget(self, action: #selector(didFinishButtonClick(button:)), for: UIControl.Event.touchUpInside) + return finishBtn + }() + @objc func didFinishButtonClick(button: UIButton) { + hx_delegate?.bottomViewDidFinishButtonClick(view: self) + } + + init(config: HXPHPickerBottomViewConfiguration) { + super.init(frame: CGRect.zero) + self.config = config + addSubview(previewBtn) + addSubview(originalBtn) + addSubview(finishBtn) + backgroundColor = config.backgroundColor + barTintColor = config.barTintColor + barStyle = config.barStyle + isTranslucent = config.isTranslucent + } + + func updateFinishButtonTitle() { + let selectCount = hx_viewController()?.hx_pickerController()?.selectedAssetArray.count ?? 0 + if selectCount > 0 { + finishBtn.isEnabled = true + previewBtn.isEnabled = true + finishBtn.setTitle("完成".hx_localized() + " (" + String(format: "%d", arguments: [selectCount]) + ")", for: UIControl.State.normal) + }else { + finishBtn.isEnabled = !config!.disableFinishButtonWhenNotSelected + previewBtn.isEnabled = false + finishBtn.setTitle("完成".hx_localized(), for: UIControl.State.normal) + } + updateFinishButtonFrame() + } + + func updateFinishButtonFrame() { + originalBtn.hx_centerX = hx_width / 2 + var finishWidth : CGFloat = finishBtn.currentTitle!.hx_localized().hx_stringWidth(ofFont: finishBtn.titleLabel!.font, maxHeight: 50) + 20 + if finishWidth < 60 { + finishWidth = 60 + } + finishBtn.frame = CGRect(x: hx_width - UIDevice.hx_rightMargin() - finishWidth - 12, y: 0, width: finishWidth, height: 33) + finishBtn.hx_centerY = 25 + } + + override func layoutSubviews() { + super.layoutSubviews() + let previewWidth : CGFloat = previewBtn.currentTitle!.hx_localized().hx_stringWidth(ofFont: previewBtn.titleLabel!.font, maxHeight: 50) + previewBtn.frame = CGRect(x: 12 + UIDevice.hx_leftMargin(), y: 0, width: previewWidth, height: 50) + originalBtn.frame = CGRect(x: 0, y: 0, width: boxControl.frame.maxX, height: 50) + updateFinishButtonFrame() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} diff --git a/HXPHPicker/HXPHPreviewViewCell.swift b/HXPHPicker/HXPHPreviewViewCell.swift new file mode 100644 index 00000000..205d06a0 --- /dev/null +++ b/HXPHPicker/HXPHPreviewViewCell.swift @@ -0,0 +1,303 @@ +// +// HXPHPreviewViewCell.swift +// HXPHPickerExample +// +// Created by 洪欣 on 2020/11/13. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit +import Photos +import PhotosUI + +protocol HXPHPreviewViewCellDelegate: NSObjectProtocol { + func singleTap() +} + +class HXPHPreviewViewCell: UICollectionViewCell, UIScrollViewDelegate { + + weak var delegate: HXPHPreviewViewCellDelegate? + + var scrollContentView: HXPHPreviewContentView? + lazy var scrollView : UIScrollView = { + let scrollView = UIScrollView.init() + scrollView.delegate = self; + scrollView.showsHorizontalScrollIndicator = false + scrollView.showsVerticalScrollIndicator = false + scrollView.bouncesZoom = true + scrollView.minimumZoomScale = 1 + scrollView.isMultipleTouchEnabled = true + scrollView.scrollsToTop = false + scrollView.delaysContentTouches = false + scrollView.canCancelContentTouches = true + scrollView.alwaysBounceVertical = false + scrollView.autoresizingMask = UIView.AutoresizingMask.init(arrayLiteral: UIView.AutoresizingMask.flexibleWidth, UIView.AutoresizingMask.flexibleHeight) + if #available(iOS 11.0, *) { + scrollView.contentInsetAdjustmentBehavior = UIScrollView.ContentInsetAdjustmentBehavior.never + } + let singleTap = UITapGestureRecognizer.init(target: self, action: #selector(singleTap(tap:))) + scrollView.addGestureRecognizer(singleTap) + let doubleTap = UITapGestureRecognizer.init(target: self, action: #selector(doubleTap(tap:))) + doubleTap.numberOfTapsRequired = 2 + doubleTap.numberOfTouchesRequired = 1 + singleTap.require(toFail: doubleTap) + scrollView.addGestureRecognizer(doubleTap) + scrollView.addSubview(scrollContentView!) + return scrollView + }() + + var photoAsset: HXPHAsset? { + didSet { + setupScrollViewContenSize() + scrollContentView!.photoAsset = photoAsset + } + } + + override init(frame: CGRect) { + super.init(frame: frame) + } + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + func initView() { + contentView.addSubview(scrollView) + } + func setupScrollViewContenSize() { + if UIDevice.hx_isPortrait() { + let aspectRatio = hx_width / photoAsset!.imageSize.width + let contentWidth = hx_width + let contentHeight = photoAsset!.imageSize.height * aspectRatio + if contentWidth < contentHeight { + scrollView.maximumZoomScale = hx_width * 2.5 / contentWidth + }else { + scrollView.maximumZoomScale = hx_height * 2.5 / contentHeight + } + scrollContentView!.frame = CGRect(x: 0, y: 0, width: contentWidth, height: contentHeight) + if contentHeight < hx_height { + scrollView.contentSize = hx_size + scrollContentView!.center = CGPoint(x: hx_width * 0.5, y: hx_height * 0.5) + }else { + scrollView.contentSize = CGSize(width: contentWidth, height: contentHeight) + } + }else { + let aspectRatio = hx_height / photoAsset!.imageSize.height + let contentWidth = photoAsset!.imageSize.width * aspectRatio + let contentHeight = hx_height + scrollView.maximumZoomScale = hx_width / contentWidth + 0.5 + + scrollContentView!.frame = CGRect(x: 0, y: 0, width: contentWidth, height: contentHeight) + scrollContentView!.center = CGPoint(x: hx_width * 0.5, y: hx_height * 0.5) + scrollView.contentSize = hx_size + } + } + func requestPreviewAsset() { + scrollContentView!.requestPreviewAsset() + } + func cancelRequest() { + scrollContentView!.cancelRequest() + } + @objc func singleTap(tap: UITapGestureRecognizer) { + delegate?.singleTap() + } + @objc func doubleTap(tap: UITapGestureRecognizer) { + if scrollView.zoomScale > 1 { + scrollView.setZoomScale(1, animated: true) + }else { + let touchPoint = tap.location(in: scrollContentView!) + let maximumZoomScale = scrollView.maximumZoomScale + let width = hx_width / maximumZoomScale + let height = hx_height / maximumZoomScale + scrollView.zoom(to: CGRect(x: touchPoint.x - width / 2, y: touchPoint.y - height / 2, width: width, height: height), animated: true) + } + } + func viewForZooming(in scrollView: UIScrollView) -> UIView? { + return scrollContentView! + } + func scrollViewDidZoom(_ scrollView: UIScrollView) { + let offsetX = (scrollView.frame.size.width > scrollView.contentSize.width) ? (scrollView.frame.size.width - scrollView.contentSize.width) * 0.5 : 0.0; + let offsetY = (scrollView.frame.size.height > scrollView.contentSize.height) ? (scrollView.frame.size.height - scrollView.contentSize.height) * 0.5 : 0.0; + scrollContentView!.center = CGPoint(x: scrollView.contentSize.width * 0.5 + offsetX, y: scrollView.contentSize.height * 0.5 + offsetY); + } + + override func layoutSubviews() { + super.layoutSubviews() + if scrollView.frame.equalTo(bounds) == false { + scrollView.frame = bounds + } + } +} +class HXPHPreviewPhotoViewCell: HXPHPreviewViewCell { + + override init(frame: CGRect) { + super.init(frame: frame) + scrollContentView = HXPHPreviewContentView.init(type: HXPHPreviewContentViewType.photo) + initView() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +class HXPHPreviewLivePhotoViewCell: HXPHPreviewViewCell { + + override init(frame: CGRect) { + super.init(frame: frame) + scrollContentView = HXPHPreviewContentView.init(type: HXPHPreviewContentViewType.livePhoto) + initView() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + +} + +enum HXPHPreviewContentViewType: Int { + case photo + case livePhoto + case video +} +class HXPHPreviewContentView: UIView, PHLivePhotoViewDelegate { + + lazy var imageView: UIImageView = { + let imageView = UIImageView.init() + return imageView + }() + @available(iOS 9.1, *) + lazy var livePhotoView: PHLivePhotoView = { + let livePhotoView = PHLivePhotoView.init() + livePhotoView.delegate = self + return livePhotoView + }() + var type: HXPHPreviewContentViewType = HXPHPreviewContentViewType.photo + var requestID: PHImageRequestID? + var requestCompletion: Bool = false + + var photoAsset: HXPHAsset? { + didSet { + if type == HXPHPreviewContentViewType.livePhoto { + if #available(iOS 9.1, *) { + livePhotoView.livePhoto = nil + } + } + requestID = photoAsset?.requestThumbnailImage(completion: { (image, asset, info) in + if asset == self.photoAsset && image != nil { + self.imageView.image = image + } + }) + } + } + + init(type: HXPHPreviewContentViewType) { + super.init(frame: CGRect.zero) + self.type = type + addSubview(imageView) + if type == HXPHPreviewContentViewType.livePhoto { + if #available(iOS 9.1, *) { + addSubview(livePhotoView) + } + }else if type == HXPHPreviewContentViewType.video { + + } + } + + func requestPreviewAsset() { + if requestCompletion { + return + } + cancelRequest() + if type == HXPHPreviewContentViewType.photo { + requestOriginalImage() + }else if type == HXPHPreviewContentViewType.livePhoto { + if #available(iOS 9.1, *) { + requestLivePhoto() + } + }else if type == HXPHPreviewContentViewType.video { + + } + } + + func requestOriginalImage() { + requestID = photoAsset?.requestImageData(iCloudHandler: { (asset, iCloudRequestID) in + if asset == self.photoAsset { + self.requestID = iCloudRequestID + } + }, progressHandler: { (asset, progress) in + if asset == self.photoAsset { + + } + }, success: { (asset, imageData, imageOrientation, info) in + DispatchQueue.global().async { + var image = UIImage.init(data: imageData) + image = image?.hx_scaleSuitableSize() + DispatchQueue.main.async { + if asset == self.photoAsset { + self.imageView.image = image + self.requestID = nil + self.requestCompletion = true + } + } + } + }, failure: { (asset, info) in + if asset == self.photoAsset { + + } + }) + } + @available(iOS 9.1, *) + func requestLivePhoto() { + let targetSize : CGSize = hx_size + requestID = photoAsset?.requestLivePhoto(targetSize: targetSize, iCloudHandler: { (asset, requestID) in + if asset == self.photoAsset { + self.requestID = requestID + } + }, progressHandler: { (asset, progress) in + if asset == self.photoAsset { + + } + }, success: { (asset, livePhoto, info) in + if asset == self.photoAsset { + self.livePhotoView.livePhoto = livePhoto + self.livePhotoView.startPlayback(with: PHLivePhotoViewPlaybackStyle.full) + self.requestID = nil + self.requestCompletion = true + } + }, failure: { (asset, info) in + if asset == self.photoAsset { + + } + }) + } + func cancelRequest() { + if requestID != nil { + PHImageManager.default().cancelImageRequest(requestID!) + requestID = nil + } + if type == HXPHPreviewContentViewType.livePhoto { + if #available(iOS 9.1, *) { + livePhotoView.stopPlayback() + } + }else if type == HXPHPreviewContentViewType.video { + + } + requestCompletion = false + } + + override func layoutSubviews() { + super.layoutSubviews() + imageView.frame = bounds + if type == HXPHPreviewContentViewType.livePhoto { + if #available(iOS 9.1, *) { + livePhotoView.frame = bounds + } + }else if type == HXPHPreviewContentViewType.video { + + } + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} diff --git a/HXPHPicker/HXPHPreviewViewController.swift b/HXPHPicker/HXPHPreviewViewController.swift new file mode 100644 index 00000000..fa3d3b1d --- /dev/null +++ b/HXPHPicker/HXPHPreviewViewController.swift @@ -0,0 +1,286 @@ +// +// HXPHPreviewViewController.swift +// HXPHPickerExample +// +// Created by 洪欣 on 2020/11/13. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +protocol HXPHPreviewViewControllerDelegate: NSObjectProtocol { + func previewViewControllerDidClickOriginal(_ previewViewController:HXPHPreviewViewController, with isOriginal: Bool) + func previewViewControllerDidClickSelectBox(_ previewViewController:HXPHPreviewViewController, with isSelected: Bool) +} + +class HXPHPreviewViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, HXPHPreviewViewCellDelegate, HXPHPickerBottomViewDelegate { + + weak var delegate: HXPHPreviewViewControllerDelegate? + var config : HXPHPreviewViewConfiguration! + var currentPreviewIndex : Int = 0 + var orientationDidChange : Bool = false + var statusBarShouldBeHidden : Bool = false + var previewAssets : [HXPHAsset] = [] + + lazy var selectBoxControl: HXPHPickerCellSelectBoxControl = { + let boxControl = HXPHPickerCellSelectBoxControl.init(frame: CGRect(x: 0, y: 0, width: config.selectBox.size.width, height: config.selectBox.size.height)) + boxControl.backgroundColor = UIColor.clear + boxControl.config = config.selectBox + boxControl.addTarget(self, action: #selector(didSelectBoxControlClick), for: UIControl.Event.touchUpInside) + return boxControl + }() + @objc func didSelectBoxControlClick() { + let isSelected = !selectBoxControl.isSelected + let photoAsset = previewAssets[currentPreviewIndex] + var canUpdate = false + if isSelected { + // 选中 + if hx_pickerController()!.addedPhotoAsset(photoAsset: photoAsset) { + canUpdate = true + } + }else { + // 取消选中 + _ = hx_pickerController()?.removePhotoAsset(photoAsset: photoAsset) + canUpdate = true + } + if canUpdate { + updateSelectBox(isSelected, photoAsset: photoAsset) + selectBoxControl.isSelected = isSelected + bottomView.updateFinishButtonTitle() + delegate?.previewViewControllerDidClickSelectBox(self, with: isSelected) + selectBoxControl.layer.removeAnimation(forKey: "SelectControlAnimation") + let keyAnimation = CAKeyframeAnimation.init(keyPath: "transform.scale") + keyAnimation.duration = 0.3 + keyAnimation.values = [1.2, 0.8, 1.1, 0.9, 1.0] + selectBoxControl.layer.add(keyAnimation, forKey: "SelectControlAnimation") + } + } + + func updateSelectBox(_ isSelected: Bool, photoAsset: HXPHAsset) { + let boxWidth = config!.selectBox.size.width + let boxHeight = config!.selectBox.size.height + if isSelected { + if config.selectBox.type == HXPHPickerCellSelectBoxType.number { + let text = String(format: "%d", arguments: [photoAsset.selectIndex + 1]) + let font = UIFont.systemFont(ofSize: config!.selectBox.titleFontSize) + let textHeight = text.hx_stringHeight(ofFont: font, maxWidth: boxWidth) + var textWidth = text.hx_stringWidth(ofFont: font, maxHeight: textHeight) + selectBoxControl.textSize = CGSize(width: textWidth, height: textHeight) + textWidth += boxHeight * 0.5 + if textWidth < boxWidth { + textWidth = boxWidth + } + selectBoxControl.text = text + selectBoxControl.hx_size = CGSize(width: textWidth, height: boxHeight) + }else { + selectBoxControl.hx_size = CGSize(width: boxWidth, height: boxHeight) + } + }else { + selectBoxControl.hx_size = CGSize(width: boxWidth, height: boxHeight) + } + } + + lazy var collectionViewLayout : UICollectionViewFlowLayout = { + let layout = UICollectionViewFlowLayout.init() + layout.scrollDirection = UICollectionView.ScrollDirection.horizontal + layout.minimumLineSpacing = 0 + layout.minimumInteritemSpacing = 0 + layout.sectionInset = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10) + return layout + }() + + lazy var collectionView : UICollectionView = { + let collectionView = UICollectionView.init(frame: view.bounds, collectionViewLayout: collectionViewLayout) + collectionView.backgroundColor = config.backgroundColor + collectionView.dataSource = self + collectionView.delegate = self + collectionView.isPagingEnabled = true + collectionView.showsVerticalScrollIndicator = false + collectionView.showsHorizontalScrollIndicator = false + if #available(iOS 11.0, *) { + collectionView.contentInsetAdjustmentBehavior = UIScrollView.ContentInsetAdjustmentBehavior.never + } else { + // Fallback on earlier versions + self.automaticallyAdjustsScrollViewInsets = false + } + collectionView.register(HXPHPreviewPhotoViewCell.self, forCellWithReuseIdentifier: NSStringFromClass(HXPHPreviewPhotoViewCell.self)) + collectionView.register(HXPHPreviewLivePhotoViewCell.self, forCellWithReuseIdentifier: NSStringFromClass(HXPHPreviewLivePhotoViewCell.self)) + return collectionView + }() + + lazy var bottomView : HXPHPickerBottomView = { + let bottomView = HXPHPickerBottomView.init(config: config.bottomView) + bottomView.hx_delegate = self + bottomView.boxControl.isSelected = hx_pickerController()!.isOriginal + return bottomView + }() + // MARK: HXPHPickerBottomViewDelegate + func bottomViewDidPreviewButtonClick(view: HXPHPickerBottomView) {} + func bottomViewDidFinishButtonClick(view: HXPHPickerBottomView) { + hx_pickerController()?.finishCallback() + dismiss(animated: true, completion: nil) + } + func bottomViewDidOriginalButtonClick(view: HXPHPickerBottomView, with isOriginal: Bool) { + delegate?.previewViewControllerDidClickOriginal(self, with: isOriginal) + } + init() { + super.init(nibName: nil, bundle: nil) + } + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + let margin : CGFloat = 20 + let itemWidth = view.hx_width + margin; + collectionViewLayout.minimumLineSpacing = margin + collectionViewLayout.itemSize = view.hx_size + let contentWidth = (view.hx_width + itemWidth) * CGFloat(previewAssets.count) + collectionView.frame = CGRect(x: -(margin * 0.5), y: 0, width: itemWidth, height: view.hx_height) + collectionView.contentSize = CGSize(width: contentWidth, height: view.hx_height) + collectionView.setContentOffset(CGPoint(x: CGFloat(currentPreviewIndex) * itemWidth, y: 0), animated: false) + DispatchQueue.main.async { + if self.orientationDidChange { + let cell = self.getCell(for: self.currentPreviewIndex) + cell?.setupScrollViewContenSize() + self.orientationDidChange = false + } + } + bottomView.frame = CGRect(x: 0, y: view.hx_height - UIDevice.hx_bottomMargin() - 50, width: view.hx_width, height: 50 + UIDevice.hx_bottomMargin()) + } + + override func viewDidLoad() { + super.viewDidLoad() + extendedLayoutIncludesOpaqueBars = true; + edgesForExtendedLayout = UIRectEdge.all; + view.clipsToBounds = true + config = hx_pickerController()!.config.previewView + NotificationCenter.default.addObserver(self, selector: #selector(deviceOrientationChanged(notify:)), name: UIApplication.didChangeStatusBarOrientationNotification, object: nil) + view.backgroundColor = config.backgroundColor + initView() + } + + func initView() { + view.addSubview(collectionView) + view.addSubview(bottomView) + bottomView.updateFinishButtonTitle() + if hx_pickerController()!.config.selectMode == HXPHAssetSelectMode.multiple { + navigationItem.rightBarButtonItem = UIBarButtonItem.init(customView: selectBoxControl) + if currentPreviewIndex == 0 && !previewAssets.isEmpty { + let photoAsset = previewAssets.first! + updateSelectBox(photoAsset.selected, photoAsset: photoAsset) + selectBoxControl.isSelected = photoAsset.selected + } + } + } + + func getCell(for item: Int) -> HXPHPreviewViewCell? { + if previewAssets.isEmpty { + return nil + } + let cell = self.collectionView.cellForItem(at: IndexPath.init(item: item, section: 0)) as! HXPHPreviewViewCell + return cell + } + + @objc func deviceOrientationChanged(notify: Notification) { + orientationDidChange = true + let cell = getCell(for: currentPreviewIndex) + if cell?.photoAsset?.mediaSubType == HXPHAssetMediaSubType.livePhoto { + if #available(iOS 9.1, *) { + cell?.scrollContentView?.livePhotoView.stopPlayback() + } + } + } + + func singleTap() { + if navigationController == nil { + return + } + let isHidden = navigationController!.navigationBar.isHidden + statusBarShouldBeHidden = !isHidden + if self.modalPresentationStyle == UIModalPresentationStyle.fullScreen { + UIApplication.shared.setStatusBarHidden(statusBarShouldBeHidden, with: UIStatusBarAnimation.fade) + navigationController?.setNeedsStatusBarAppearanceUpdate() + } + navigationController!.setNavigationBarHidden(statusBarShouldBeHidden, animated: true) + if !statusBarShouldBeHidden { + self.bottomView.isHidden = false + } + UIView.animate(withDuration: 0.25) { + self.bottomView.alpha = self.statusBarShouldBeHidden ? 0 : 1 + } completion: { (finish) in + self.bottomView.isHidden = self.statusBarShouldBeHidden + } + + } + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return previewAssets.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let photoAsset = previewAssets[indexPath.item] + let cell :HXPHPreviewViewCell + if photoAsset.mediaSubType == HXPHAssetMediaSubType.livePhoto { + cell = collectionView.dequeueReusableCell(withReuseIdentifier: NSStringFromClass(HXPHPreviewLivePhotoViewCell.self), for: indexPath) as! HXPHPreviewLivePhotoViewCell + }else { + cell = collectionView.dequeueReusableCell(withReuseIdentifier: NSStringFromClass(HXPHPreviewPhotoViewCell.self), for: indexPath) as! HXPHPreviewPhotoViewCell + } + cell.photoAsset = photoAsset + cell.delegate = self + return cell + } + + func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { + let myCell = cell as! HXPHPreviewViewCell + myCell.cancelRequest() + } + + func scrollViewDidScroll(_ scrollView: UIScrollView) { + if scrollView != collectionView || orientationDidChange { + return + } + let offsetX = scrollView.contentOffset.x + (view.hx_width + 20) * 0.5 + let width = view.hx_width + 20 + var currentIndex = Int(offsetX / width) + if currentIndex > previewAssets.count - 1 { + currentIndex = previewAssets.count - 1 + } + if currentIndex < 0 { + currentIndex = 0 + } + if !previewAssets.isEmpty { + let photoAsset = previewAssets[currentIndex] + updateSelectBox(photoAsset.selected, photoAsset: photoAsset) + if selectBoxControl.isSelected == photoAsset.selected { + selectBoxControl.setNeedsDisplay() + }else { + selectBoxControl.isSelected = photoAsset.selected + } + } + self.currentPreviewIndex = currentIndex + } + + func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { + if scrollView != collectionView || orientationDidChange { + return + } + let cell = getCell(for: currentPreviewIndex) + cell?.requestPreviewAsset() + } + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + let cell = getCell(for: currentPreviewIndex) + cell?.requestPreviewAsset() + } + override var prefersStatusBarHidden: Bool { + return statusBarShouldBeHidden + } + + override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation { + return UIStatusBarAnimation.fade + } + + deinit { + NotificationCenter.default.removeObserver(self) + } +} diff --git a/HXPHPicker/HXPHTools.swift b/HXPHPicker/HXPHTools.swift new file mode 100644 index 00000000..8eab1225 --- /dev/null +++ b/HXPHPicker/HXPHTools.swift @@ -0,0 +1,130 @@ +// +// HXPHTools.swift +// 照片选择器-Swift +// +// Created by 洪欣 on 2019/6/29. +// Copyright © 2019年 洪欣. All rights reserved. +// + +import UIKit +import Photos + +typealias statusHandler = (PHAuthorizationStatus) -> () + +class HXPHTools: NSObject { + + + /// 显示没有权限的弹窗 + /// - Parameters: + /// - viewController: 需要弹窗的viewController + /// - status: 权限类型 + class func showNotAuthorizedAlert(viewController : UIViewController? , status : PHAuthorizationStatus) { + if viewController == nil { + return + } + if status == PHAuthorizationStatus.denied || + status == PHAuthorizationStatus.restricted { + showAlert(viewController: viewController, title: "无法访问相册", message: "请在设置-隐私-相册中允许访问相册", leftActionTitle: "取消", leftHandler: {_ in }, rightActionTitle: "设置") { (alertAction) in + openSettingsURL() + } + } + } + + class func openSettingsURL() { + if #available(iOS 10, *) { + UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!, options: [:], completionHandler: nil) + } else { + UIApplication.shared.openURL(URL(string: UIApplication.openSettingsURLString)!) + } + } + + class func showAlert(viewController: UIViewController? , title: String? , message: String? , leftActionTitle: String , leftHandler: @escaping (UIAlertAction)->(), rightActionTitle: String , rightHandler: @escaping (UIAlertAction)->()) { + let alertController = UIAlertController.init(title: title, message: message, preferredStyle: UIAlertController.Style.alert) + let leftAction = UIAlertAction.init(title: leftActionTitle, style: UIAlertAction.Style.cancel, handler: leftHandler) + let rightAction = UIAlertAction.init(title: rightActionTitle, style: UIAlertAction.Style.default, handler: rightHandler) + alertController.addAction(leftAction) + alertController.addAction(rightAction) + } + + class func transformVideoDurationToString(duration: TimeInterval) -> String { + let time = Int(round(Double(duration))) + if time < 10 { + return String.init(format: "00:0%d", arguments: [time]) + }else if time < 60 { + return String.init(format: "00:%d", arguments: [time]) + }else { + let min = Int(time / 60) + let sec = time - (min * 60) + if sec < 10 { + return String.init(format: "%d:0%d", arguments: [min,sec]) + }else { + return String.init(format: "%d:%d", arguments: [min,sec]) + } + } + } + + class func transformAlbumName(for collection: PHAssetCollection) -> String? { + if collection.assetCollectionType == PHAssetCollectionType.album { + return collection.localizedTitle + } + var albumName : String? + let type = HXPHManager.shared.languageType + if type == HXPHLanguageType.system { + albumName = collection.localizedTitle + }else { + if collection.localizedTitle == "最近项目" || + collection.localizedTitle == "最近添加" { + albumName = "HXAlbumRecents".hx_localized() + }else if collection.localizedTitle == "Camera Roll" || + collection.localizedTitle == "相机胶卷" { + albumName = "HXAlbumCameraRoll".hx_localized() + }else { + switch collection.assetCollectionSubtype { + case PHAssetCollectionSubtype.smartAlbumUserLibrary: + albumName = "HXAlbumCameraRoll".hx_localized() + break + case PHAssetCollectionSubtype.smartAlbumVideos: + albumName = "HXAlbumVideos".hx_localized() + break + case PHAssetCollectionSubtype.smartAlbumPanoramas: + albumName = "HXAlbumPanoramas".hx_localized() + break + case PHAssetCollectionSubtype.smartAlbumFavorites: + albumName = "HXAlbumFavorites".hx_localized() + break + case PHAssetCollectionSubtype.smartAlbumTimelapses: + albumName = "HXAlbumTimelapses".hx_localized() + break + case PHAssetCollectionSubtype.smartAlbumRecentlyAdded: + albumName = "HXAlbumRecentlyAdded".hx_localized() + break + case PHAssetCollectionSubtype.smartAlbumBursts: + albumName = "HXAlbumBursts".hx_localized() + break + case PHAssetCollectionSubtype.smartAlbumSlomoVideos: + albumName = "HXAlbumSlomoVideos".hx_localized() + break + case PHAssetCollectionSubtype.smartAlbumSelfPortraits: + albumName = "HXAlbumSelfPortraits".hx_localized() + break + case PHAssetCollectionSubtype.smartAlbumScreenshots: + albumName = "HXAlbumScreenshots".hx_localized() + break + case PHAssetCollectionSubtype.smartAlbumDepthEffect: + albumName = "HXAlbumDepthEffect".hx_localized() + break + case PHAssetCollectionSubtype.smartAlbumLivePhotos: + albumName = "HXAlbumLivePhotos".hx_localized() + break + case PHAssetCollectionSubtype.smartAlbumAnimated: + albumName = "HXAlbumAnimated".hx_localized() + break + default: + albumName = collection.localizedTitle + break + } + } + } + return albumName + } +} diff --git a/HXPHPicker/HXPHTypes.swift b/HXPHPicker/HXPHTypes.swift new file mode 100644 index 00000000..bb10fbb8 --- /dev/null +++ b/HXPHPicker/HXPHTypes.swift @@ -0,0 +1,54 @@ +// +// HXPHTypes.swift +// 照片选择器-Swift +// +// Created by 洪欣 on 2020/11/9. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +enum HXPHSelectType: Int { + case photo = 0 //!< 只显示图片 + case video = 1 //!< 只显示视频 + case any = 2 //!< 任何类型 +} + +enum HXPHAssetSelectMode: Int { + case single = 0 //!< 单选模式 + case multiple = 1 //!< 多选模式 +} + +enum HXAlbumShowMode: Int { + case normal = 0 //!< 正常展示 + case popup = 1 //!< 弹出展示 +} + +enum HXPHAssetMediaType: Int { + case photo = 0 //!< 照片 + case video = 1 //!< 视频 +} + +enum HXPHAssetMediaSubType: Int { + case image = 0 //!< 静态图 + case imageAnimated = 1 //!< 动图 + case livePhoto = 2 //!< LivePhoto + case localPhoto = 3 //!< 本地图片 + case video = 4 //!< 视频 + case localVideo = 5 //!< 本地视频 + case camera = 99 //!< 相机 +} + +enum HXPHLanguageType: Int { + case system //!< 跟随系统语言 + case simplifiedChinese //!< 中文简体 + case traditionalChinese //!< 中文繁体 + case japanese //!< 日文 + case korean //!< 韩文 + case english //!< 英文 +} + +enum HXPHPickerCellSelectBoxType: Int { + case number //!< 数字 + case tick //!< √ +} diff --git a/HXPHPicker/String+HXPHPicker.swift b/HXPHPicker/String+HXPHPicker.swift new file mode 100644 index 00000000..4eec4109 --- /dev/null +++ b/HXPHPicker/String+HXPHPicker.swift @@ -0,0 +1,40 @@ +// +// String+HXPHPicker.swift +// HXPHPickerExample +// +// Created by 洪欣 on 2020/11/13. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +extension String { + + func hx_localized() -> String { + return Bundle.hx_localizedString(for: self) + } + + func hx_stringWidth(ofFont font: UIFont, maxHeight: CGFloat) -> CGFloat { + let constraintRect = CGSize(width: CGFloat(MAXFLOAT), height: maxHeight) + let boundingBox = self.boundingRect(with: constraintRect, options: NSStringDrawingOptions.usesLineFragmentOrigin, attributes: [NSAttributedString.Key.font: font], context: nil) + return boundingBox.size.width + } + + func hx_stringWidth(ofSize size: CGFloat, maxHeight: CGFloat) -> CGFloat { + let constraintRect = CGSize(width: CGFloat(MAXFLOAT), height: maxHeight) + let boundingBox = self.boundingRect(with: constraintRect, options: NSStringDrawingOptions.usesLineFragmentOrigin, attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: size)], context: nil) + return boundingBox.size.width + } + + func hx_stringHeight(ofFont font: UIFont, maxWidth: CGFloat) -> CGFloat { + let constraintRect = CGSize(width: maxWidth, height: CGFloat(MAXFLOAT)) + let boundingBox = self.boundingRect(with: constraintRect, options: NSStringDrawingOptions.usesLineFragmentOrigin, attributes: [NSAttributedString.Key.font: font], context: nil) + return boundingBox.size.height + } + + func hx_stringHeight(ofSize size: CGFloat, maxWidth: CGFloat) -> CGFloat { + let constraintRect = CGSize(width: maxWidth, height: CGFloat(MAXFLOAT)) + let boundingBox = self.boundingRect(with: constraintRect, options: NSStringDrawingOptions.usesLineFragmentOrigin, attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: size)], context: nil) + return boundingBox.size.height + } +} diff --git a/HXPHPicker/UIColor+HXPHPicker.swift b/HXPHPicker/UIColor+HXPHPicker.swift new file mode 100644 index 00000000..80e61a07 --- /dev/null +++ b/HXPHPicker/UIColor+HXPHPicker.swift @@ -0,0 +1,31 @@ +// +// UIColor+HXPHPicker.swift +// HXPHPickerExample +// +// Created by 洪欣 on 2020/11/13. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +extension UIColor { + + convenience init(hx_hexString: String) { + let hexString = hx_hexString.trimmingCharacters(in: .whitespacesAndNewlines) + let scanner = Scanner(string: hexString) + if hexString.hasPrefix("#") { + scanner.scanLocation = 1 + } + var color: UInt32 = 0 + scanner.scanHexInt32(&color) + let mask = 0x000000FF + let r = Int(color >> 16) & mask + let g = Int(color >> 8) & mask + let b = Int(color) & mask + let red = CGFloat(r) / 255.0 + let green = CGFloat(g) / 255.0 + let blue = CGFloat(b) / 255.0 + self.init(red: red, green: green, blue: blue, alpha: 1) + } + +} diff --git a/HXPHPicker/UIDevice+HXPHPicker.swift b/HXPHPicker/UIDevice+HXPHPicker.swift new file mode 100644 index 00000000..121e42bb --- /dev/null +++ b/HXPHPicker/UIDevice+HXPHPicker.swift @@ -0,0 +1,126 @@ +// +// UIDevice+HXPHPicker.swift +// HXPHPickerExample +// +// Created by 洪欣 on 2020/11/13. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +extension UIDevice { + class func hx_isPortrait() -> Bool { + let orientation = UIApplication.shared.statusBarOrientation + if orientation == UIInterfaceOrientation.landscapeLeft || + orientation == UIInterfaceOrientation.landscapeRight { + return false + } + return true + } + class func hx_navigationBarHeight() -> CGFloat { + return hx_statusBarHeight() + 44 + } + class func hx_statusBarHeight() -> CGFloat { + let statusBarHeight : CGFloat; + let window = UIApplication.shared.windows.first + if #available(iOS 13.0, *) { + statusBarHeight = (window?.windowScene?.statusBarManager?.statusBarFrame.size.height)! + } else { + // Fallback on earlier versions + statusBarHeight = UIApplication.shared.statusBarFrame.size.height + } + return statusBarHeight + } + class func hx_topMargin() -> CGFloat { + if hx_isAllIPhoneX() { + return hx_statusBarHeight() + } + return 0 + } + class func hx_leftMargin() -> CGFloat { + if hx_isAllIPhoneX() { + if !hx_isPortrait() { + return 44 + } + } + return 0 + } + class func hx_rightMargin() -> CGFloat { + if hx_isAllIPhoneX() { + if !hx_isPortrait() { + return 44 + } + } + return 0 + } + class func hx_bottomMargin() -> CGFloat { + if hx_isAllIPhoneX() { + if hx_isPortrait() { + return 34 + }else { + return 21 + } + } + return 0 + } + class func hx_isPad() -> Bool { + return UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.pad + } + class func hx_isAllIPhoneX() -> Bool { + return (hx_isIPhoneX() || hx_isIPhoneXR() || hx_isIPhoneXsMax() || hx_isIPhoneXsMax() || hx_isIPhoneTwelveMini() || hx_isIPhoneTwelve() || hx_isIPhoneTwelveProMax()) + } + class func hx_isIPhoneX() -> Bool { + if UIScreen.instancesRespond(to: Selector(("currentMode"))) == true && + hx_isPad() == false { + if __CGSizeEqualToSize(CGSize(width: 1125, height: 2436), UIScreen.main.currentMode!.size) { + return true + } + } + return false + } + class func hx_isIPhoneXR() -> Bool { + if UIScreen.instancesRespond(to: Selector(("currentMode"))) == true && + hx_isPad() == false { + if __CGSizeEqualToSize(CGSize(width: 828, height: 1792), UIScreen.main.currentMode!.size) { + return true + } + } + return false + } + class func hx_isIPhoneXsMax() -> Bool { + if UIScreen.instancesRespond(to: Selector(("currentMode"))) == true && + hx_isPad() == false { + if __CGSizeEqualToSize(CGSize(width: 1242, height: 2688), UIScreen.main.currentMode!.size) { + return true + } + } + return false + } + class func hx_isIPhoneTwelveMini() -> Bool { + if UIScreen.instancesRespond(to: Selector(("currentMode"))) == true && + hx_isPad() == false { + if __CGSizeEqualToSize(CGSize(width: 1080, height: 2340), UIScreen.main.currentMode!.size) { + return true + } + } + return false + } + class func hx_isIPhoneTwelve() -> Bool { + if UIScreen.instancesRespond(to: Selector(("currentMode"))) == true && + hx_isPad() == false { + if __CGSizeEqualToSize(CGSize(width: 1170, height: 2532), UIScreen.main.currentMode!.size) { + return true + } + } + return false + } + class func hx_isIPhoneTwelveProMax() -> Bool { + if UIScreen.instancesRespond(to: Selector(("currentMode"))) == true && + hx_isPad() == false { + if __CGSizeEqualToSize(CGSize(width: 1284, height: 2778), UIScreen.main.currentMode!.size) { + return true + } + } + return false + } +} diff --git a/HXPHPicker/UIFont+HXPHPicker.swift b/HXPHPicker/UIFont+HXPHPicker.swift new file mode 100644 index 00000000..e726e35b --- /dev/null +++ b/HXPHPicker/UIFont+HXPHPicker.swift @@ -0,0 +1,28 @@ +// +// UIFont+HXPHPicker.swift +// HXPHPickerExample +// +// Created by 洪欣 on 2020/11/13. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +extension UIFont { + + class func hx_regularPingFang(size: CGFloat) -> UIFont { + let font = UIFont.init(name: "PingFangSC-Regular", size: size) + return font ?? UIFont.systemFont(ofSize: size) + } + + class func hx_mediumPingFang(size: CGFloat) -> UIFont { + let font = UIFont.init(name: "PingFangSC-Medium", size: size) + return font ?? UIFont.systemFont(ofSize: size) + } + + class func hx_semiboldPingFang(size: CGFloat) -> UIFont { + let font = UIFont.init(name: "PingFangSC-Semibold", size: size) + return font ?? UIFont.systemFont(ofSize: size) + } + +} diff --git a/HXPHPicker/UIImage+HXPHPicker.swift b/HXPHPicker/UIImage+HXPHPicker.swift new file mode 100644 index 00000000..e10115ec --- /dev/null +++ b/HXPHPicker/UIImage+HXPHPicker.swift @@ -0,0 +1,64 @@ +// +// UIImage+HXPHPicker.swift +// HXPHPickerExample +// +// Created by 洪欣 on 2020/11/15. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +extension UIImage { + + class func hx_named(named: String) -> UIImage? { + let bundle = HXPHManager.shared.bundle + var image : UIImage? + if bundle != nil { + let path = bundle?.path(forResource: "images/" + named, ofType: nil) + if path != nil { + image = self.init(named: path!) + } + } + if image == nil { + image = self.init(named: named) + } + return image + } + + func hx_scaleSuitableSize() -> UIImage? { + var imageSize = self.size + while (imageSize.width * imageSize.height > 3 * 1000 * 1000) { + imageSize.width *= 0.5 + imageSize.height *= 0.5 + } + return self.hx_scaleToFillSize(size: imageSize) + } + func hx_scaleToFillSize(size: CGSize) -> UIImage? { + if __CGSizeEqualToSize(self.size, size) { + return self + } + UIGraphicsBeginImageContextWithOptions(size, false, self.scale) + self.draw(in: CGRect(x: 0, y: 0, width: size.width, height: size.height)) + let image = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + return image + } + + class func hx_image(for color: UIColor, havingSize: CGSize) -> UIImage? { + let rect: CGRect + if havingSize.equalTo(CGSize.zero) { + rect = CGRect(x: 0, y: 0, width: 1, height: 1) + }else { + rect = CGRect(x: 0, y: 0, width: havingSize.width, height: havingSize.height) + } + UIGraphicsBeginImageContext(rect.size) + let context = UIGraphicsGetCurrentContext() + context?.setFillColor(color.cgColor) + context?.fill(rect) + + let image = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + return image + } + +} diff --git a/HXPHPicker/UIView+HXPHPicker.swift b/HXPHPicker/UIView+HXPHPicker.swift new file mode 100644 index 00000000..81451d6d --- /dev/null +++ b/HXPHPicker/UIView+HXPHPicker.swift @@ -0,0 +1,383 @@ +// +// UIView+HXPHPicker.swift +// HXPhotoPickerSwift +// +// Created by 洪欣 on 2020/11/12. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +extension UIView { + var hx_x : CGFloat { + get { + return frame.origin.x + } + set { + var rect = frame + rect.origin.x = newValue + frame = rect + } + } + var hx_y : CGFloat { + get { + return frame.origin.y + } + set { + var rect = frame + rect.origin.y = newValue + frame = rect + } + } + var hx_width : CGFloat { + get { + return frame.size.width + } + set { + var rect = frame + rect.size.width = newValue + frame = rect + } + } + var hx_height : CGFloat { + get { + return frame.size.height + } + set { + var rect = frame + rect.size.height = newValue + frame = rect + } + } + var hx_size : CGSize { + get { + return frame.size + } + set { + var rect = frame + rect.size = newValue + frame = rect + } + } + var hx_centerX : CGFloat { + get { + return center.x + } + set { + var point = center + point.x = newValue + center = point + } + } + var hx_centerY : CGFloat { + get { + return center.y + } + set { + var point = center + point.y = newValue + center = point + } + } + + func hx_viewController() -> UIViewController? { + var next = superview + while (next != nil) { + let nextResponder = next?.next + if nextResponder is UINavigationController || + nextResponder is UIViewController { + return nextResponder as? UIViewController + } + next = next?.superview + } + return nil + } +} + +enum HXPHProgressHUDMode : Int { + case indicator + case image +} + +class HXPHProgressHUD: UIView { + var mode : HXPHProgressHUDMode! + + lazy var backgroundView: UIView = { + let backgroundView = UIView.init() + backgroundView.layer.cornerRadius = 5 + backgroundView.layer.masksToBounds = true + backgroundView.alpha = 0 + backgroundView.addSubview(blurEffectView) + return backgroundView + }() + + lazy var blurEffectView: UIVisualEffectView = { + let effect = UIBlurEffect.init(style: UIBlurEffect.Style.dark) + let blurEffectView = UIVisualEffectView.init(effect: effect) + return blurEffectView + }() + + lazy var indicatorView : UIActivityIndicatorView = { + let indicatorView = UIActivityIndicatorView.init(style: UIActivityIndicatorView.Style.whiteLarge) + indicatorView.hidesWhenStopped = true + return indicatorView + }() + + lazy var textLb: UILabel = { + let textLb = UILabel.init() + textLb.textColor = UIColor.white + textLb.textAlignment = NSTextAlignment.center + textLb.font = UIFont.hx_mediumPingFang(size: 16) + textLb.numberOfLines = 0; + return textLb + }() + + lazy var imageView: HXPHProgressImageView = { + let imageView = HXPHProgressImageView.init(frame: CGRect(x: 0, y: 0, width: 60, height: 60)) + return imageView + }() + + var text : String? + var finished : Bool = false + var showDelayTimer : Timer? + var hideDelayTimer : Timer? + + init(addedTo view: UIView, mode: HXPHProgressHUDMode) { + super.init(frame: view.bounds) + self.mode = mode + initView() + } + + func initView() { + addSubview(backgroundView) + backgroundView.addSubview(textLb) + if mode == HXPHProgressHUDMode.indicator { + backgroundView.addSubview(indicatorView) + }else if mode == HXPHProgressHUDMode.image { + backgroundView.addSubview(imageView) + } + } + + private func showHUD(text: String?, animated: Bool, afterDelay: TimeInterval) { + self.text = text + textLb.text = text + updateFrame() + if afterDelay > 0 { + let timer = Timer.init(timeInterval: afterDelay, target: self, selector: #selector(handleShowTimer(timer:)), userInfo: animated, repeats: false) + RunLoop.current.add(timer, forMode: RunLoop.Mode.common) + self.showDelayTimer = timer + }else { + showViews(animated: animated) + } + } + @objc func handleShowTimer(timer: Timer) { + showViews(animated: (timer.userInfo != nil)) + } + private func showViews(animated: Bool) { + if finished { + return + } + if animated { + UIView.animate(withDuration: 0.25) { + self.backgroundView.alpha = 1 + } + }else { + self.backgroundView.alpha = 1 + } + } + private func hideHUD(withAnimated animated: Bool, afterDelay: TimeInterval) { + finished = true + self.showDelayTimer?.invalidate() + if afterDelay > 0 { + let timer = Timer.init(timeInterval: afterDelay, target: self, selector: #selector(handleHideTimer(timer:)), userInfo: animated, repeats: false) + RunLoop.current.add(timer, forMode: RunLoop.Mode.common) + self.hideDelayTimer = timer + }else { + hideViews(animated: animated) + } + } + @objc func handleHideTimer(timer: Timer) { + hideViews(animated: (timer.userInfo != nil)) + } + private func hideViews(animated: Bool) { + if animated { + UIView.animate(withDuration: 0.25) { + self.backgroundView.alpha = 0 + } completion: { (finished) in + self.removeFromSuperview() + } + }else { + self.backgroundView.alpha = 0 + removeFromSuperview() + } + } + private func updateFrame() { + if text != nil { + var width = text!.hx_stringWidth(ofFont: textLb.font, maxHeight: 15) + if width < 60 { + width = 60 + } + if width > hx_width - 100 { + width = hx_width - 100 + } + let height = text!.hx_stringHeight(ofFont: textLb.font, maxWidth: width) + textLb.hx_size = CGSize(width: width, height: height) + } + var width = textLb.hx_width + 60 + if width < 100 { + width = 100 + } + + let centenrX = width / 2 + textLb.hx_centerX = centenrX + if mode == HXPHProgressHUDMode.indicator { + indicatorView.startAnimating() + indicatorView.hx_centerX = centenrX + if text != nil { + indicatorView.hx_y = 20 + textLb.hx_y = indicatorView.frame.maxY + 10 + }else { + indicatorView.hx_centerY = 100 / 2 + } + }else if mode == HXPHProgressHUDMode.image { + imageView.hx_centerX = centenrX + if text != nil { + imageView.hx_y = 20 + textLb.hx_y = imageView.frame.maxY + 15 + }else { + imageView.hx_centerY = 100 / 2 + } + } + + backgroundView.hx_width = width + if textLb.frame.maxY + 20 < 120 { + backgroundView.hx_height = 100 + }else { + backgroundView.hx_height = textLb.frame.maxY + 20 + } + backgroundView.center = CGPoint(x: hx_width / 2, y: hx_height / 2) + blurEffectView.frame = backgroundView.bounds + } + + class func showLoadingHUD(addedTo view: UIView?, animated: Bool) { + showLoadingHUD(addedTo: view, text: nil, animated: animated) + } + class func showLoadingHUD(addedTo view: UIView?, afterDelay: TimeInterval, animated: Bool) { + showLoadingHUD(addedTo: view, text: nil, afterDelay: afterDelay, animated: animated) + } + + class func showLoadingHUD(addedTo view: UIView?, text: String?, animated: Bool) { + showLoadingHUD(addedTo: view, text: text, afterDelay: 0, animated: animated) + } + + class func showLoadingHUD(addedTo view: UIView?, text: String?, afterDelay: TimeInterval , animated: Bool) { + if view == nil { + return + } + let progressView = HXPHProgressHUD.init(addedTo: view!, mode: HXPHProgressHUDMode.indicator) + progressView.showHUD(text: text, animated: animated, afterDelay: afterDelay) + view!.addSubview(progressView) + } + + class func showWarningHUD(addedTo view: UIView?, text: String?, afterDelay: TimeInterval , animated: Bool) { + if view == nil { + return + } + let progressView = HXPHProgressHUD.init(addedTo: view!, mode: HXPHProgressHUDMode.image) + progressView.showHUD(text: text, animated: animated, afterDelay: afterDelay) + view!.addSubview(progressView) + } + + class func hideHUD(forView view:UIView? ,animated: Bool) { + hideHUD(forView: view, animated: animated, afterDelay: 0) + } + + class func hideHUD(forView view:UIView? ,animated: Bool ,afterDelay: TimeInterval) { + if view == nil { + return + } + for subView in view!.subviews { + if subView is HXPHProgressHUD { + (subView as! HXPHProgressHUD).hideHUD(withAnimated: animated, afterDelay: afterDelay) + } + } + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} +class HXPHProgressImageView: UIView { + + lazy var circleLayer: CAShapeLayer = { + let circleLayer = CAShapeLayer.init() + return circleLayer + }() + + lazy var lineLayer: CAShapeLayer = { + let lineLayer = CAShapeLayer.init() + return lineLayer + }() + + lazy var pointLayer: CAShapeLayer = { + let pointLayer = CAShapeLayer.init() + return pointLayer + }() + + override init(frame: CGRect) { + super.init(frame: frame) + layer.addSublayer(circleLayer) + layer.addSublayer(lineLayer) + layer.addSublayer(pointLayer) + drawCircle() + drawExclamationPoint() + } + func startAnimation() { + } + func drawCircle() { + let circlePath = UIBezierPath.init() + circlePath.addArc(withCenter: CGPoint(x: hx_width * 0.5, y: hx_height * 0.5), radius: hx_width * 0.5, startAngle: 0, endAngle: 2 * .pi, clockwise: true) + circleLayer.path = circlePath.cgPath + circleLayer.lineWidth = 1.5 + circleLayer.strokeColor = UIColor.white.cgColor + circleLayer.fillColor = UIColor.clear.cgColor + +// let circleAimation = CABasicAnimation.init(keyPath: "strokeEnd") +// circleAimation.fromValue = 0 +// circleAimation.toValue = 1 +// circleAimation.duration = 0.5 +// circleLayer.add(circleAimation, forKey: "") + } + + func drawExclamationPoint() { + let linePath = UIBezierPath.init() + linePath.move(to: CGPoint(x: hx_width * 0.5, y: 15)) + linePath.addLine(to: CGPoint(x: hx_width * 0.5, y: hx_height - 22)) + lineLayer.path = linePath.cgPath + lineLayer.lineWidth = 2 + lineLayer.strokeColor = UIColor.white.cgColor + lineLayer.fillColor = UIColor.white.cgColor + +// let lineAimation = CABasicAnimation.init(keyPath: "strokeEnd") +// lineAimation.fromValue = 0 +// lineAimation.toValue = 1 +// lineAimation.duration = 0.3 +// lineLayer.add(lineAimation, forKey: "") + + let pointPath = UIBezierPath.init() + pointPath.addArc(withCenter: CGPoint(x: hx_width * 0.5, y: hx_height - 15), radius: 1, startAngle: 0, endAngle: 2 * .pi, clockwise: true) + pointLayer.path = pointPath.cgPath + pointLayer.lineWidth = 1 + pointLayer.strokeColor = UIColor.white.cgColor + pointLayer.fillColor = UIColor.white.cgColor + +// let pointAimation = CAKeyframeAnimation.init(keyPath: "transform.scale") +// pointAimation.values = [0, 1.2, 0.8, 1.1, 0.9 , 1] +// pointAimation.duration = 0.5 +// pointLayer.add(pointAimation, forKey: "") + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} diff --git a/HXPHPicker/UIViewController+HXPHPicker.swift b/HXPHPicker/UIViewController+HXPHPicker.swift new file mode 100644 index 00000000..c3f79542 --- /dev/null +++ b/HXPHPicker/UIViewController+HXPHPicker.swift @@ -0,0 +1,20 @@ +// +// UIViewController+HXPHPicker.swift +// 照片选择器-Swift +// +// Created by 洪欣 on 2020/11/11. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +extension UIViewController { + + func hx_pickerController() -> HXPHPickerController? { + if self.navigationController is HXPHPickerController { + return self.navigationController as? HXPHPickerController + } + return nil + } + +} diff --git a/HXPhotoPicker-DemoUITests/HXPhotoPicker_DemoUITests.m b/HXPhotoPicker-DemoUITests/HXPhotoPicker_DemoUITests.m deleted file mode 100644 index c4d69e0a..00000000 --- a/HXPhotoPicker-DemoUITests/HXPhotoPicker_DemoUITests.m +++ /dev/null @@ -1,48 +0,0 @@ -// -// HXPhotoPicker_DemoUITests.m -// HXPhotoPicker-DemoUITests -// -// Created by 洪欣 on 2020/8/29. -// Copyright © 2020 洪欣. All rights reserved. -// - -#import - -@interface HXPhotoPicker_DemoUITests : XCTestCase - -@end - -@implementation HXPhotoPicker_DemoUITests - -- (void)setUp { - // Put setup code here. This method is called before the invocation of each test method in the class. - // - // In UI tests it is usually best to stop immediately when a failure occurs. - self.continueAfterFailure = NO; - - // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. -} - -- (void)tearDown { - // Put teardown code here. This method is called after the invocation of each test method in the class. -} - -- (void)testExample { - // UI tests must launch the application that they test. - XCUIApplication *app = [[XCUIApplication alloc] init]; - [app launch]; - - // Use recording to get started writing UI tests. - // Use XCTAssert and related functions to verify your tests produce the correct results. -} - -- (void)testLaunchPerformance { - if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { - // This measures how long it takes to launch your application. - [self measureWithMetrics:@[XCTOSSignpostMetric.applicationLaunchMetric] block:^{ - [[[XCUIApplication alloc] init] launch]; - }]; - } -} - -@end diff --git a/HXPhotoPicker-DemoUITests/Info.plist b/HXPhotoPicker-DemoUITests/Info.plist deleted file mode 100644 index 64d65ca4..00000000 --- a/HXPhotoPicker-DemoUITests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/HXPhotoPicker/Category/NSArray+HXExtension.h b/HXPhotoPicker/Category/NSArray+HXExtension.h index 90531e93..c4885a11 100644 --- a/HXPhotoPicker/Category/NSArray+HXExtension.h +++ b/HXPhotoPicker/Category/NSArray+HXExtension.h @@ -1,6 +1,6 @@ // // NSArray+HXExtension.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/1/7. // Copyright © 2019年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/NSArray+HXExtension.m b/HXPhotoPicker/Category/NSArray+HXExtension.m index e1ff047f..069aa622 100644 --- a/HXPhotoPicker/Category/NSArray+HXExtension.m +++ b/HXPhotoPicker/Category/NSArray+HXExtension.m @@ -1,6 +1,6 @@ // // NSArray+HXExtension.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/1/7. // Copyright © 2019年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/NSBundle+HXPhotoPicker.h b/HXPhotoPicker/Category/NSBundle+HXPhotoPicker.h index 623c0571..2f78856f 100644 --- a/HXPhotoPicker/Category/NSBundle+HXPhotoPicker.h +++ b/HXPhotoPicker/Category/NSBundle+HXPhotoPicker.h @@ -1,6 +1,6 @@ // // NSBundle+HXPhotoPicker.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/7/25. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/NSBundle+HXPhotoPicker.m b/HXPhotoPicker/Category/NSBundle+HXPhotoPicker.m index 920cd980..453420d1 100644 --- a/HXPhotoPicker/Category/NSBundle+HXPhotoPicker.m +++ b/HXPhotoPicker/Category/NSBundle+HXPhotoPicker.m @@ -1,6 +1,6 @@ // // NSBundle+HXPhotopicker.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/7/25. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/NSDate+HXExtension.h b/HXPhotoPicker/Category/NSDate+HXExtension.h index 13727f6e..8e55c835 100644 --- a/HXPhotoPicker/Category/NSDate+HXExtension.h +++ b/HXPhotoPicker/Category/NSDate+HXExtension.h @@ -1,6 +1,6 @@ // // NSDate+HXExtension.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/14. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/NSDate+HXExtension.m b/HXPhotoPicker/Category/NSDate+HXExtension.m index 68cf504d..70ea90c8 100644 --- a/HXPhotoPicker/Category/NSDate+HXExtension.m +++ b/HXPhotoPicker/Category/NSDate+HXExtension.m @@ -1,6 +1,6 @@ // // NSDate+HXExtension.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/14. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/NSString+HXExtension.h b/HXPhotoPicker/Category/NSString+HXExtension.h index 2175d45b..3b3c2d1f 100644 --- a/HXPhotoPicker/Category/NSString+HXExtension.h +++ b/HXPhotoPicker/Category/NSString+HXExtension.h @@ -1,6 +1,6 @@ // // NSString+HXExtension.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/1/10. // Copyright © 2019年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/NSString+HXExtension.m b/HXPhotoPicker/Category/NSString+HXExtension.m index 915b55a5..a7a27dd3 100644 --- a/HXPhotoPicker/Category/NSString+HXExtension.m +++ b/HXPhotoPicker/Category/NSString+HXExtension.m @@ -1,6 +1,6 @@ // // NSString+HXExtension.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/1/10. // Copyright © 2019年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/NSTimer+HXExtension.h b/HXPhotoPicker/Category/NSTimer+HXExtension.h index 89fec9e6..e5521d23 100644 --- a/HXPhotoPicker/Category/NSTimer+HXExtension.h +++ b/HXPhotoPicker/Category/NSTimer+HXExtension.h @@ -1,6 +1,6 @@ // // NSTimer+HXExtension.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/1/3. // Copyright © 2019年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/NSTimer+HXExtension.m b/HXPhotoPicker/Category/NSTimer+HXExtension.m index 8776e088..1d581c3f 100644 --- a/HXPhotoPicker/Category/NSTimer+HXExtension.m +++ b/HXPhotoPicker/Category/NSTimer+HXExtension.m @@ -1,6 +1,6 @@ // // NSTimer+HXExtension.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/1/3. // Copyright © 2019年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIButton+HXExtension.h b/HXPhotoPicker/Category/UIButton+HXExtension.h index 5ca5cc50..7aa79a1f 100644 --- a/HXPhotoPicker/Category/UIButton+HXExtension.h +++ b/HXPhotoPicker/Category/UIButton+HXExtension.h @@ -1,6 +1,6 @@ // // UIButton+HXExtension.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/16. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIButton+HXExtension.m b/HXPhotoPicker/Category/UIButton+HXExtension.m index 1a575aab..56019b49 100644 --- a/HXPhotoPicker/Category/UIButton+HXExtension.m +++ b/HXPhotoPicker/Category/UIButton+HXExtension.m @@ -1,6 +1,6 @@ // // UIButton+HXExtension.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/16. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIColor+HXExtension.h b/HXPhotoPicker/Category/UIColor+HXExtension.h index a6a5449d..a16021a9 100644 --- a/HXPhotoPicker/Category/UIColor+HXExtension.h +++ b/HXPhotoPicker/Category/UIColor+HXExtension.h @@ -1,6 +1,6 @@ // // UIColor+HXExtension.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/12/3. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIColor+HXExtension.m b/HXPhotoPicker/Category/UIColor+HXExtension.m index 382dd4d6..322a8cc9 100644 --- a/HXPhotoPicker/Category/UIColor+HXExtension.m +++ b/HXPhotoPicker/Category/UIColor+HXExtension.m @@ -1,6 +1,6 @@ // // UIColor+HXExtension.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/12/3. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIFont+HXExtension.h b/HXPhotoPicker/Category/UIFont+HXExtension.h index 911afcb8..00645b19 100644 --- a/HXPhotoPicker/Category/UIFont+HXExtension.h +++ b/HXPhotoPicker/Category/UIFont+HXExtension.h @@ -1,6 +1,6 @@ // // UIFont+HXExtension.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/14. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIFont+HXExtension.m b/HXPhotoPicker/Category/UIFont+HXExtension.m index 4cdf7a94..b49efc23 100644 --- a/HXPhotoPicker/Category/UIFont+HXExtension.m +++ b/HXPhotoPicker/Category/UIFont+HXExtension.m @@ -1,6 +1,6 @@ // // UIFont+HXExtension.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/14. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIImage+HXExtension.h b/HXPhotoPicker/Category/UIImage+HXExtension.h index 9ce2e68d..85bbaeb1 100644 --- a/HXPhotoPicker/Category/UIImage+HXExtension.h +++ b/HXPhotoPicker/Category/UIImage+HXExtension.h @@ -1,6 +1,6 @@ // // UIImage+HXExtension.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/15. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIImage+HXExtension.m b/HXPhotoPicker/Category/UIImage+HXExtension.m index 8bb94735..d5a95e0a 100644 --- a/HXPhotoPicker/Category/UIImage+HXExtension.m +++ b/HXPhotoPicker/Category/UIImage+HXExtension.m @@ -1,6 +1,6 @@ // // UIImage+HXExtension.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/15. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIImageView+HXExtension.h b/HXPhotoPicker/Category/UIImageView+HXExtension.h index d86b2dd9..5dcfc179 100644 --- a/HXPhotoPicker/Category/UIImageView+HXExtension.h +++ b/HXPhotoPicker/Category/UIImageView+HXExtension.h @@ -1,6 +1,6 @@ // // UIImageView+HXExtension.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/2/14. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIImageView+HXExtension.m b/HXPhotoPicker/Category/UIImageView+HXExtension.m index 54c482ce..3d1c0750 100644 --- a/HXPhotoPicker/Category/UIImageView+HXExtension.m +++ b/HXPhotoPicker/Category/UIImageView+HXExtension.m @@ -1,6 +1,6 @@ // // UIImageView+HXExtension.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/2/14. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UILabel+HXExtension.h b/HXPhotoPicker/Category/UILabel+HXExtension.h index 43bceb68..f0f63f6e 100644 --- a/HXPhotoPicker/Category/UILabel+HXExtension.h +++ b/HXPhotoPicker/Category/UILabel+HXExtension.h @@ -1,6 +1,6 @@ // // UILabel+HXExtension.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/12/28. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UILabel+HXExtension.m b/HXPhotoPicker/Category/UILabel+HXExtension.m index c4d9a632..e9e519d2 100644 --- a/HXPhotoPicker/Category/UILabel+HXExtension.m +++ b/HXPhotoPicker/Category/UILabel+HXExtension.m @@ -1,6 +1,6 @@ // // UILabel+HXExtension.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/12/28. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIView+HXExtension.h b/HXPhotoPicker/Category/UIView+HXExtension.h index 3a17a087..50d0832d 100644 --- a/HXPhotoPicker/Category/UIView+HXExtension.h +++ b/HXPhotoPicker/Category/UIView+HXExtension.h @@ -1,6 +1,6 @@ // // UIView+HXExtension.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/16. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIView+HXExtension.m b/HXPhotoPicker/Category/UIView+HXExtension.m index d19752ba..21773ffd 100644 --- a/HXPhotoPicker/Category/UIView+HXExtension.m +++ b/HXPhotoPicker/Category/UIView+HXExtension.m @@ -1,6 +1,6 @@ // // UIView+HXExtension.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/16. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIViewController+HXExtension.h b/HXPhotoPicker/Category/UIViewController+HXExtension.h index 8cba88fb..933ce5d2 100644 --- a/HXPhotoPicker/Category/UIViewController+HXExtension.h +++ b/HXPhotoPicker/Category/UIViewController+HXExtension.h @@ -1,6 +1,6 @@ // // UIViewController+HXExtension.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/11/24. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Category/UIViewController+HXExtension.m b/HXPhotoPicker/Category/UIViewController+HXExtension.m index e1d337f2..4dd5f997 100644 --- a/HXPhotoPicker/Category/UIViewController+HXExtension.m +++ b/HXPhotoPicker/Category/UIViewController+HXExtension.m @@ -1,6 +1,6 @@ // // UIViewController+HXExtension.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/11/24. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXAlbumListViewController.h b/HXPhotoPicker/Controller/HXAlbumListViewController.h index 2aae6cad..e1e0438c 100644 --- a/HXPhotoPicker/Controller/HXAlbumListViewController.h +++ b/HXPhotoPicker/Controller/HXAlbumListViewController.h @@ -1,6 +1,6 @@ // // HXDateAlbumViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/14. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXAlbumListViewController.m b/HXPhotoPicker/Controller/HXAlbumListViewController.m index 2add8855..bd6ab9ea 100644 --- a/HXPhotoPicker/Controller/HXAlbumListViewController.m +++ b/HXPhotoPicker/Controller/HXAlbumListViewController.m @@ -1,6 +1,6 @@ // // HXDateAlbumViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/14. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXCustomCameraController.h b/HXPhotoPicker/Controller/HXCustomCameraController.h index e274033a..794299f1 100644 --- a/HXPhotoPicker/Controller/HXCustomCameraController.h +++ b/HXPhotoPicker/Controller/HXCustomCameraController.h @@ -1,6 +1,6 @@ // // HXCustomCameraController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/31. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXCustomCameraController.m b/HXPhotoPicker/Controller/HXCustomCameraController.m index 37d37f02..01599c1b 100644 --- a/HXPhotoPicker/Controller/HXCustomCameraController.m +++ b/HXPhotoPicker/Controller/HXCustomCameraController.m @@ -1,6 +1,6 @@ // // HXCustomCameraController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/31. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXCustomCameraViewController.h b/HXPhotoPicker/Controller/HXCustomCameraViewController.h index f3b85926..2ec1288b 100644 --- a/HXPhotoPicker/Controller/HXCustomCameraViewController.h +++ b/HXPhotoPicker/Controller/HXCustomCameraViewController.h @@ -1,6 +1,6 @@ // // HXCustomCameraViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/9/30. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXCustomCameraViewController.m b/HXPhotoPicker/Controller/HXCustomCameraViewController.m index 5c7806bd..9edcc8db 100644 --- a/HXPhotoPicker/Controller/HXCustomCameraViewController.m +++ b/HXPhotoPicker/Controller/HXCustomCameraViewController.m @@ -1,6 +1,6 @@ // // HXCustomCameraViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/9/30. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXCustomNavigationController.h b/HXPhotoPicker/Controller/HXCustomNavigationController.h index f0fdfff3..ab88ad46 100644 --- a/HXPhotoPicker/Controller/HXCustomNavigationController.h +++ b/HXPhotoPicker/Controller/HXCustomNavigationController.h @@ -1,6 +1,6 @@ // // HXCustomNavigationController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/31. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXCustomNavigationController.m b/HXPhotoPicker/Controller/HXCustomNavigationController.m index 9a0f8e4e..cd6ac8a9 100644 --- a/HXPhotoPicker/Controller/HXCustomNavigationController.m +++ b/HXPhotoPicker/Controller/HXCustomNavigationController.m @@ -1,6 +1,6 @@ // // HXCustomNavigationController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/31. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXPhoto3DTouchViewController.h b/HXPhotoPicker/Controller/HXPhoto3DTouchViewController.h index 8b3bd614..10d2bb64 100644 --- a/HXPhotoPicker/Controller/HXPhoto3DTouchViewController.h +++ b/HXPhotoPicker/Controller/HXPhoto3DTouchViewController.h @@ -1,6 +1,6 @@ // // HXPhoto3DTouchViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/9/25. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXPhoto3DTouchViewController.m b/HXPhotoPicker/Controller/HXPhoto3DTouchViewController.m index fb3b334a..57b5e1b4 100644 --- a/HXPhotoPicker/Controller/HXPhoto3DTouchViewController.m +++ b/HXPhotoPicker/Controller/HXPhoto3DTouchViewController.m @@ -1,6 +1,6 @@ // // HXPhoto3DTouchViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/9/25. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXPhotoEditViewController.h b/HXPhotoPicker/Controller/HXPhotoEditViewController.h index 074574ac..dac86b8a 100644 --- a/HXPhotoPicker/Controller/HXPhotoEditViewController.h +++ b/HXPhotoPicker/Controller/HXPhotoEditViewController.h @@ -1,6 +1,6 @@ // // HXPhotoEditViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/27. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXPhotoEditViewController.m b/HXPhotoPicker/Controller/HXPhotoEditViewController.m index ace6a9e3..a861ff4d 100644 --- a/HXPhotoPicker/Controller/HXPhotoEditViewController.m +++ b/HXPhotoPicker/Controller/HXPhotoEditViewController.m @@ -1,6 +1,6 @@ // // HXPhotoEditViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/27. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXPhotoPreviewViewController.h b/HXPhotoPicker/Controller/HXPhotoPreviewViewController.h index da83450f..5e148910 100644 --- a/HXPhotoPicker/Controller/HXPhotoPreviewViewController.h +++ b/HXPhotoPicker/Controller/HXPhotoPreviewViewController.h @@ -1,6 +1,6 @@ // // HXPhotoPreviewViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/14. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXPhotoPreviewViewController.m b/HXPhotoPicker/Controller/HXPhotoPreviewViewController.m index f972ee59..791b00a4 100644 --- a/HXPhotoPicker/Controller/HXPhotoPreviewViewController.m +++ b/HXPhotoPicker/Controller/HXPhotoPreviewViewController.m @@ -1,6 +1,6 @@ // // HXPhotoPreviewViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/14. // Copyright © 2017年 洪欣. All rights reserved. @@ -723,7 +723,7 @@ - (HXPhotoPreviewViewCell *)currentPreviewCell:(HXPhotoModel *)model { } - (void)changeStatusBarWithHidden:(BOOL)hidden { self.statusBarShouldBeHidden = hidden; - [self preferredStatusBarUpdateAnimation]; +// [self preferredStatusBarUpdateAnimation]; } - (void)setSubviewAlphaAnimate:(BOOL)animete duration:(NSTimeInterval)duration { if (self.exteriorPreviewStyle == HXPhotoViewPreViewShowStyleDark) { diff --git a/HXPhotoPicker/Controller/HXPhotoViewController.h b/HXPhotoPicker/Controller/HXPhotoViewController.h index 120efd4f..9c702f54 100644 --- a/HXPhotoPicker/Controller/HXPhotoViewController.h +++ b/HXPhotoPicker/Controller/HXPhotoViewController.h @@ -1,6 +1,6 @@ // // HXPhotoViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/14. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXPhotoViewController.m b/HXPhotoPicker/Controller/HXPhotoViewController.m index 7342df17..6e2d7e5d 100644 --- a/HXPhotoPicker/Controller/HXPhotoViewController.m +++ b/HXPhotoPicker/Controller/HXPhotoViewController.m @@ -1,6 +1,6 @@ // // HXPhotoViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/14. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXVideoEditViewController.h b/HXPhotoPicker/Controller/HXVideoEditViewController.h index 319e4649..d867f7ba 100644 --- a/HXPhotoPicker/Controller/HXVideoEditViewController.h +++ b/HXPhotoPicker/Controller/HXVideoEditViewController.h @@ -1,6 +1,6 @@ // // HXVideoEditViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/12/31. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Controller/HXVideoEditViewController.m b/HXPhotoPicker/Controller/HXVideoEditViewController.m index 77617a03..c44ea365 100644 --- a/HXPhotoPicker/Controller/HXVideoEditViewController.m +++ b/HXPhotoPicker/Controller/HXVideoEditViewController.m @@ -1,6 +1,6 @@ // // HXVideoEditViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/12/31. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/HXAssetManager.h b/HXPhotoPicker/HXAssetManager.h index 41099375..16e91934 100644 --- a/HXPhotoPicker/HXAssetManager.h +++ b/HXPhotoPicker/HXAssetManager.h @@ -1,6 +1,6 @@ // // HXAssetManager.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/11/5. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker/HXAssetManager.m b/HXPhotoPicker/HXAssetManager.m index caec03cb..852da24d 100644 --- a/HXPhotoPicker/HXAssetManager.m +++ b/HXPhotoPicker/HXAssetManager.m @@ -1,6 +1,6 @@ // // HXAssetManager.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/11/5. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker/HXPhotoCommon.h b/HXPhotoPicker/HXPhotoCommon.h index 6e7c2b87..4e7f5225 100644 --- a/HXPhotoPicker/HXPhotoCommon.h +++ b/HXPhotoPicker/HXPhotoCommon.h @@ -1,6 +1,6 @@ // // HXPhotoCommon.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/1/8. // Copyright © 2019年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/HXPhotoCommon.m b/HXPhotoPicker/HXPhotoCommon.m index 25e63d43..aac20524 100644 --- a/HXPhotoPicker/HXPhotoCommon.m +++ b/HXPhotoPicker/HXPhotoCommon.m @@ -1,6 +1,6 @@ // // HXPhotoCommon.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/1/8. // Copyright © 2019年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/HXPhotoConfiguration.h b/HXPhotoPicker/HXPhotoConfiguration.h index 42a197a8..48d8d37b 100644 --- a/HXPhotoPicker/HXPhotoConfiguration.h +++ b/HXPhotoPicker/HXPhotoConfiguration.h @@ -1,6 +1,6 @@ // // HXPhotoConfiguration.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/11/21. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/HXPhotoConfiguration.m b/HXPhotoPicker/HXPhotoConfiguration.m index da5bb395..4644eea1 100644 --- a/HXPhotoPicker/HXPhotoConfiguration.m +++ b/HXPhotoPicker/HXPhotoConfiguration.m @@ -1,6 +1,6 @@ // // HXPhotoConfiguration.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/11/21. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/HXPhotoDefine.h b/HXPhotoPicker/HXPhotoDefine.h index dc49e5ea..58402b42 100644 --- a/HXPhotoPicker/HXPhotoDefine.h +++ b/HXPhotoPicker/HXPhotoDefine.h @@ -1,6 +1,6 @@ // // HXPhotoDefine.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/11/24. // Copyright © 2017年 洪欣. All rights reserved. @@ -110,12 +110,15 @@ #define HX_IS_IPhoneX_All (HX_Is_iPhoneX || HX_Is_iPhoneXR || HX_Is_iPhoneXS || HX_Is_iPhoneXS_MAX || HX_IS_IPHONEX || HX_Is_iPhoneTwelveMini || HX_Is_iPhoneTwelvePro || HX_Is_iPhoneTwelveProMax) // 导航栏 + 状态栏 的高度 -#define hxNavigationBarHeight (HX_IS_IPhoneX_All ? 88 : 64) +#define hxNavigationBarHeight (44 + HXStatusBarHeight) #define hxTopMargin (HX_IS_IPhoneX_All ? 44 : 0) #define hxBottomMargin (HX_IS_IPhoneX_All ? 34 : 0) +#define HXStatusBarHeight [HXPhotoTools getStatusBarHeight] #define HX_IOS14_Later ([UIDevice currentDevice].systemVersion.floatValue >= 14.0f) +#define HX_IOS13_Later ([UIDevice currentDevice].systemVersion.floatValue >= 13.0f) + #define HX_IOS11_Later ([UIDevice currentDevice].systemVersion.floatValue >= 11.0f) #define HX_IOS11_Earlier ([UIDevice currentDevice].systemVersion.floatValue < 11.0f) diff --git a/HXPhotoPicker/HXPhotoEdit/View/HXPhotoEditGraffitiColorSizeView.h b/HXPhotoPicker/HXPhotoEdit/View/HXPhotoEditGraffitiColorSizeView.h index c0995a24..9d77b50b 100644 --- a/HXPhotoPicker/HXPhotoEdit/View/HXPhotoEditGraffitiColorSizeView.h +++ b/HXPhotoPicker/HXPhotoEdit/View/HXPhotoEditGraffitiColorSizeView.h @@ -1,6 +1,6 @@ // // HXPhotoEditGraffitiColorSizeView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/8/14. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker/HXPhotoEdit/View/HXPhotoEditGraffitiColorSizeView.m b/HXPhotoPicker/HXPhotoEdit/View/HXPhotoEditGraffitiColorSizeView.m index 59d20232..02c985b7 100644 --- a/HXPhotoPicker/HXPhotoEdit/View/HXPhotoEditGraffitiColorSizeView.m +++ b/HXPhotoPicker/HXPhotoEdit/View/HXPhotoEditGraffitiColorSizeView.m @@ -1,6 +1,6 @@ // // HXPhotoEditGraffitiColorSizeView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/8/14. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker/HXPhotoEdit/View/HXPhotoEditTextView.m b/HXPhotoPicker/HXPhotoEdit/View/HXPhotoEditTextView.m index bc735ae9..f1bdb1f0 100644 --- a/HXPhotoPicker/HXPhotoEdit/View/HXPhotoEditTextView.m +++ b/HXPhotoPicker/HXPhotoEdit/View/HXPhotoEditTextView.m @@ -15,6 +15,7 @@ #import "HXPhotoEditConfiguration.h" #import "NSBundle+HXPhotoPicker.h" #import "UIFont+HXExtension.h" +#import "HXPhotoTools.h" #define HXEditTextBlankWidth 22 #define HXEditTextRadius 8.f diff --git a/HXPhotoPicker/HXPhotoManager.h b/HXPhotoPicker/HXPhotoManager.h index ddc7e31d..8898784b 100644 --- a/HXPhotoPicker/HXPhotoManager.h +++ b/HXPhotoPicker/HXPhotoManager.h @@ -1,6 +1,6 @@ // // HX_PhotoManager.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/HXPhotoManager.m b/HXPhotoPicker/HXPhotoManager.m index 750ee5c1..1fcb9d92 100644 --- a/HXPhotoPicker/HXPhotoManager.m +++ b/HXPhotoPicker/HXPhotoManager.m @@ -1,6 +1,6 @@ // // HX_PhotoManager.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/HXPhotoPicker.h b/HXPhotoPicker/HXPhotoPicker.h index 2e06f132..0e4eed0b 100644 --- a/HXPhotoPicker/HXPhotoPicker.h +++ b/HXPhotoPicker/HXPhotoPicker.h @@ -1,6 +1,6 @@ // // HXPhotoPicker.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/11/24. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/HXPhotoTools.h b/HXPhotoPicker/HXPhotoTools.h index 7cc2fe60..c0253e6f 100644 --- a/HXPhotoPicker/HXPhotoTools.h +++ b/HXPhotoPicker/HXPhotoTools.h @@ -1,6 +1,6 @@ // // HXPhotoTools.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. @@ -142,4 +142,6 @@ /// 删除下载的网络视频缓存文件 + (void)deleteNetWorkVideoFile; + ++ (CGFloat)getStatusBarHeight; @end diff --git a/HXPhotoPicker/HXPhotoTools.m b/HXPhotoPicker/HXPhotoTools.m index 0ece417c..d9f01db6 100644 --- a/HXPhotoPicker/HXPhotoTools.m +++ b/HXPhotoPicker/HXPhotoTools.m @@ -1,6 +1,6 @@ // // HXPhotoTools.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. @@ -1015,4 +1015,17 @@ + (void)deleteLivePhotoCachesFile { + (void)deleteNetWorkVideoFile { [[NSFileManager defaultManager] removeItemAtPath:HXPhotoPickerCachesDownloadPath error:nil]; } + + ++ (CGFloat)getStatusBarHeight { + CGFloat statusBarHeight = 0; + if (@available(iOS 13.0, *)) { + UIStatusBarManager *statusBarManager = [UIApplication sharedApplication].windows.firstObject.windowScene.statusBarManager; + statusBarHeight = statusBarManager.statusBarFrame.size.height; + } + else { + statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height; + } + return statusBarHeight; +} @end diff --git a/HXPhotoPicker/HXPhotoTypes.h b/HXPhotoPicker/HXPhotoTypes.h index 69797c8f..a7d04228 100644 --- a/HXPhotoPicker/HXPhotoTypes.h +++ b/HXPhotoPicker/HXPhotoTypes.h @@ -1,6 +1,6 @@ // // HXPhotoTypes.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/8/3. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Model/HXAlbumModel.h b/HXPhotoPicker/Model/HXAlbumModel.h index 81e2ebed..fc9b01ba 100644 --- a/HXPhotoPicker/Model/HXAlbumModel.h +++ b/HXPhotoPicker/Model/HXAlbumModel.h @@ -1,6 +1,6 @@ // // HXAlbumModel.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Model/HXAlbumModel.m b/HXPhotoPicker/Model/HXAlbumModel.m index cb5f4df4..d54fcfa7 100644 --- a/HXPhotoPicker/Model/HXAlbumModel.m +++ b/HXPhotoPicker/Model/HXAlbumModel.m @@ -1,6 +1,6 @@ // // HXAlbumModel.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Model/HXCustomAssetModel.h b/HXPhotoPicker/Model/HXCustomAssetModel.h index 9e73d1e0..c574edc1 100644 --- a/HXPhotoPicker/Model/HXCustomAssetModel.h +++ b/HXPhotoPicker/Model/HXCustomAssetModel.h @@ -1,6 +1,6 @@ // // HXCustomAssetModel.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/7/25. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Model/HXCustomAssetModel.m b/HXPhotoPicker/Model/HXCustomAssetModel.m index 9fbd265f..0f631156 100644 --- a/HXPhotoPicker/Model/HXCustomAssetModel.m +++ b/HXPhotoPicker/Model/HXCustomAssetModel.m @@ -1,6 +1,6 @@ // // HXCustomAssetModel.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/7/25. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Model/HXPhotoModel.h b/HXPhotoPicker/Model/HXPhotoModel.h index b6e07c0d..4351c727 100644 --- a/HXPhotoPicker/Model/HXPhotoModel.h +++ b/HXPhotoPicker/Model/HXPhotoModel.h @@ -1,6 +1,6 @@ // // HXPhotoModel.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Model/HXPhotoModel.m b/HXPhotoPicker/Model/HXPhotoModel.m index 8bca371f..274912be 100644 --- a/HXPhotoPicker/Model/HXPhotoModel.m +++ b/HXPhotoPicker/Model/HXPhotoModel.m @@ -1,6 +1,6 @@ // // HXPhotoModel.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Model/HXPhotoViewCellCustomProtocol.h b/HXPhotoPicker/Model/HXPhotoViewCellCustomProtocol.h index 48388515..859accb7 100644 --- a/HXPhotoPicker/Model/HXPhotoViewCellCustomProtocol.h +++ b/HXPhotoPicker/Model/HXPhotoViewCellCustomProtocol.h @@ -1,6 +1,6 @@ // // HXPhotoViewCellCustomProtocol.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/7/21. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker/Model/HXPhotoViewProtocol.h b/HXPhotoPicker/Model/HXPhotoViewProtocol.h index b46ead07..4d41e6a3 100644 --- a/HXPhotoPicker/Model/HXPhotoViewProtocol.h +++ b/HXPhotoPicker/Model/HXPhotoViewProtocol.h @@ -1,6 +1,6 @@ // // HXPhotoViewProtocol.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/8/1. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker/TransitionAnimation/HXPhotoEditTransition.h b/HXPhotoPicker/TransitionAnimation/HXPhotoEditTransition.h index d9350072..aaa49a63 100644 --- a/HXPhotoPicker/TransitionAnimation/HXPhotoEditTransition.h +++ b/HXPhotoPicker/TransitionAnimation/HXPhotoEditTransition.h @@ -1,6 +1,6 @@ // // HXPhotoEditTransition.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/1/20. // Copyright © 2019年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/TransitionAnimation/HXPhotoEditTransition.m b/HXPhotoPicker/TransitionAnimation/HXPhotoEditTransition.m index b9d3c33c..f1033d35 100644 --- a/HXPhotoPicker/TransitionAnimation/HXPhotoEditTransition.m +++ b/HXPhotoPicker/TransitionAnimation/HXPhotoEditTransition.m @@ -1,6 +1,6 @@ // // HXPhotoEditTransition.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/1/20. // Copyright © 2019年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/TransitionAnimation/HXPhotoInteractiveTransition.h b/HXPhotoPicker/TransitionAnimation/HXPhotoInteractiveTransition.h index 693f5b33..f4d24844 100644 --- a/HXPhotoPicker/TransitionAnimation/HXPhotoInteractiveTransition.h +++ b/HXPhotoPicker/TransitionAnimation/HXPhotoInteractiveTransition.h @@ -1,6 +1,6 @@ // // HXPhotoInteractiveTransition.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/28. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/TransitionAnimation/HXPhotoInteractiveTransition.m b/HXPhotoPicker/TransitionAnimation/HXPhotoInteractiveTransition.m index 16d6f018..710fab88 100644 --- a/HXPhotoPicker/TransitionAnimation/HXPhotoInteractiveTransition.m +++ b/HXPhotoPicker/TransitionAnimation/HXPhotoInteractiveTransition.m @@ -1,6 +1,6 @@ // // HXPhotoInteractiveTransition.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/28. // Copyright © 2017年 洪欣. All rights reserved. @@ -178,9 +178,6 @@ - (void)beginInterPercent { HXPhotoPreviewViewCell *fromCell = [fromVC currentPreviewCell:model]; HXPhotoViewCell *toCell = [toVC currentPreviewCell:model]; self.fromCell = fromCell; - if (fromCell.previewContentView.frame.origin.x != 0) { - NSSLog(@"11111"); - } self.scrollViewZoomScale = [self.fromCell getScrollViewZoomScale]; self.scrollViewContentSize = [self.fromCell getScrollViewContentSize]; self.scrollViewContentOffset = [self.fromCell getScrollViewContentOffset]; @@ -190,10 +187,6 @@ - (void)beginInterPercent { self.contentView = fromCell.previewContentView; self.imageInitialFrame = fromCell.previewContentView.frame; tempImageViewFrame = [fromCell.previewContentView convertRect:fromCell.previewContentView.bounds toView:containerView]; - if (tempImageViewFrame.origin.x != 0) { - NSSLog(@"11111"); - } - NSSLog(@"%@", NSStringFromCGRect(tempImageViewFrame)); if (!toCell) { [toVC scrollToModel:model]; toCell = [toVC currentPreviewCell:model]; diff --git a/HXPhotoPicker/TransitionAnimation/HXPhotoPersentInteractiveTransition.h b/HXPhotoPicker/TransitionAnimation/HXPhotoPersentInteractiveTransition.h index 705b8325..cf0c3d01 100644 --- a/HXPhotoPicker/TransitionAnimation/HXPhotoPersentInteractiveTransition.h +++ b/HXPhotoPicker/TransitionAnimation/HXPhotoPersentInteractiveTransition.h @@ -1,6 +1,6 @@ // // HXPhotoPersentInteractiveTransition.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/9/8. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/TransitionAnimation/HXPhotoPersentInteractiveTransition.m b/HXPhotoPicker/TransitionAnimation/HXPhotoPersentInteractiveTransition.m index bf51e6d0..3fad84fe 100644 --- a/HXPhotoPicker/TransitionAnimation/HXPhotoPersentInteractiveTransition.m +++ b/HXPhotoPicker/TransitionAnimation/HXPhotoPersentInteractiveTransition.m @@ -1,6 +1,6 @@ // // HXPhotoPersentInteractiveTransition.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/9/8. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/TransitionAnimation/HXPhotoViewPresentTransition.h b/HXPhotoPicker/TransitionAnimation/HXPhotoViewPresentTransition.h index 1e48deb5..c5b003a5 100644 --- a/HXPhotoPicker/TransitionAnimation/HXPhotoViewPresentTransition.h +++ b/HXPhotoPicker/TransitionAnimation/HXPhotoViewPresentTransition.h @@ -1,6 +1,6 @@ // // HXPhotoViewPresentTransition.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/28. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/TransitionAnimation/HXPhotoViewPresentTransition.m b/HXPhotoPicker/TransitionAnimation/HXPhotoViewPresentTransition.m index 99e11447..d39ed54b 100644 --- a/HXPhotoPicker/TransitionAnimation/HXPhotoViewPresentTransition.m +++ b/HXPhotoPicker/TransitionAnimation/HXPhotoViewPresentTransition.m @@ -1,6 +1,6 @@ // // HXPhotoViewPresentTransition.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/28. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/TransitionAnimation/HXPhotoViewTransition.h b/HXPhotoPicker/TransitionAnimation/HXPhotoViewTransition.h index 167a0f2c..3b7c29a4 100644 --- a/HXPhotoPicker/TransitionAnimation/HXPhotoViewTransition.h +++ b/HXPhotoPicker/TransitionAnimation/HXPhotoViewTransition.h @@ -1,6 +1,6 @@ // // HXPhotoViewTransition.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/27. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/TransitionAnimation/HXPhotoViewTransition.m b/HXPhotoPicker/TransitionAnimation/HXPhotoViewTransition.m index b62e8266..18144509 100644 --- a/HXPhotoPicker/TransitionAnimation/HXPhotoViewTransition.m +++ b/HXPhotoPicker/TransitionAnimation/HXPhotoViewTransition.m @@ -1,6 +1,6 @@ // // HXPhotoViewTransition.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/27. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXAlbumlistView.h b/HXPhotoPicker/View/HXAlbumlistView.h index 9abb2038..753bfa9a 100644 --- a/HXPhotoPicker/View/HXAlbumlistView.h +++ b/HXPhotoPicker/View/HXAlbumlistView.h @@ -1,6 +1,6 @@ // // HXAlbumlistView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/9/26. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXAlbumlistView.m b/HXPhotoPicker/View/HXAlbumlistView.m index fd10ac91..bb00dafb 100644 --- a/HXPhotoPicker/View/HXAlbumlistView.m +++ b/HXPhotoPicker/View/HXAlbumlistView.m @@ -1,6 +1,6 @@ // // HXAlbumlistView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/9/26. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXCameraBottomView.h b/HXPhotoPicker/View/HXCameraBottomView.h index 2ad94f0c..cdbe30da 100644 --- a/HXPhotoPicker/View/HXCameraBottomView.h +++ b/HXPhotoPicker/View/HXCameraBottomView.h @@ -1,6 +1,6 @@ // // HXCameraBottomView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/7/17. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXCameraBottomView.m b/HXPhotoPicker/View/HXCameraBottomView.m index d97e5a0d..8ef5de16 100644 --- a/HXPhotoPicker/View/HXCameraBottomView.m +++ b/HXPhotoPicker/View/HXCameraBottomView.m @@ -1,6 +1,6 @@ // // HXCameraBottomView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/7/17. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXCircleProgressView.h b/HXPhotoPicker/View/HXCircleProgressView.h index 111aa8dc..93d98149 100644 --- a/HXPhotoPicker/View/HXCircleProgressView.h +++ b/HXPhotoPicker/View/HXCircleProgressView.h @@ -1,6 +1,6 @@ // // HXCircleProgressView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/5/18. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXCircleProgressView.m b/HXPhotoPicker/View/HXCircleProgressView.m index e2bb9bc0..433c06d8 100644 --- a/HXPhotoPicker/View/HXCircleProgressView.m +++ b/HXPhotoPicker/View/HXCircleProgressView.m @@ -1,6 +1,6 @@ // // HXCircleProgressView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/5/18. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXCollectionView.h b/HXPhotoPicker/View/HXCollectionView.h index 2043624f..52a85275 100644 --- a/HXPhotoPicker/View/HXCollectionView.h +++ b/HXPhotoPicker/View/HXCollectionView.h @@ -1,6 +1,6 @@ // // HXCollectionView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/17. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXCollectionView.m b/HXPhotoPicker/View/HXCollectionView.m index 47d6c4f6..002aec83 100644 --- a/HXPhotoPicker/View/HXCollectionView.m +++ b/HXPhotoPicker/View/HXCollectionView.m @@ -1,6 +1,6 @@ // // HXCollectionView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/17. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXCustomCollectionReusableView.h b/HXPhotoPicker/View/HXCustomCollectionReusableView.h index d33ab319..52741a40 100644 --- a/HXPhotoPicker/View/HXCustomCollectionReusableView.h +++ b/HXPhotoPicker/View/HXCustomCollectionReusableView.h @@ -1,6 +1,6 @@ // // HXCustomCollectionReusableView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/11/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXCustomCollectionReusableView.m b/HXPhotoPicker/View/HXCustomCollectionReusableView.m index 948089b6..e6fb6beb 100644 --- a/HXPhotoPicker/View/HXCustomCollectionReusableView.m +++ b/HXPhotoPicker/View/HXCustomCollectionReusableView.m @@ -1,6 +1,6 @@ // // HXCustomCollectionReusableView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/11/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXCustomPreviewView.h b/HXPhotoPicker/View/HXCustomPreviewView.h index 4a7ac267..184ed671 100644 --- a/HXPhotoPicker/View/HXCustomPreviewView.h +++ b/HXPhotoPicker/View/HXCustomPreviewView.h @@ -1,6 +1,6 @@ // // HXCustomPreviewView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/31. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXCustomPreviewView.m b/HXPhotoPicker/View/HXCustomPreviewView.m index 3cc6b314..1943af4d 100644 --- a/HXPhotoPicker/View/HXCustomPreviewView.m +++ b/HXPhotoPicker/View/HXCustomPreviewView.m @@ -1,6 +1,6 @@ // // HXCustomPreviewView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/31. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXFullScreenCameraPlayView.h b/HXPhotoPicker/View/HXFullScreenCameraPlayView.h index d189705e..24cf1a3e 100644 --- a/HXPhotoPicker/View/HXFullScreenCameraPlayView.h +++ b/HXPhotoPicker/View/HXFullScreenCameraPlayView.h @@ -1,6 +1,6 @@ // // HXFullScreenCameraPlayView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/5/23. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXFullScreenCameraPlayView.m b/HXPhotoPicker/View/HXFullScreenCameraPlayView.m index fead5317..34a016b7 100644 --- a/HXPhotoPicker/View/HXFullScreenCameraPlayView.m +++ b/HXPhotoPicker/View/HXFullScreenCameraPlayView.m @@ -1,6 +1,6 @@ // // HXFullScreenCameraPlayView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/5/23. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoBottomSelectView.h b/HXPhotoPicker/View/HXPhotoBottomSelectView.h index e99a2c20..b0bf59fa 100644 --- a/HXPhotoPicker/View/HXPhotoBottomSelectView.h +++ b/HXPhotoPicker/View/HXPhotoBottomSelectView.h @@ -1,6 +1,6 @@ // // HXPhotoBottomSelectView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/9/30. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoBottomSelectView.m b/HXPhotoPicker/View/HXPhotoBottomSelectView.m index bed48c39..15627a12 100644 --- a/HXPhotoPicker/View/HXPhotoBottomSelectView.m +++ b/HXPhotoPicker/View/HXPhotoBottomSelectView.m @@ -1,6 +1,6 @@ // // HXPhotoBottomSelectView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/9/30. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoCustomNavigationBar.h b/HXPhotoPicker/View/HXPhotoCustomNavigationBar.h index de90838e..e887e4b6 100644 --- a/HXPhotoPicker/View/HXPhotoCustomNavigationBar.h +++ b/HXPhotoPicker/View/HXPhotoCustomNavigationBar.h @@ -1,6 +1,6 @@ // // HXPhotoCustomNavigationBar.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/9/22. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoCustomNavigationBar.m b/HXPhotoPicker/View/HXPhotoCustomNavigationBar.m index 10426b2c..129a8405 100644 --- a/HXPhotoPicker/View/HXPhotoCustomNavigationBar.m +++ b/HXPhotoPicker/View/HXPhotoCustomNavigationBar.m @@ -1,6 +1,6 @@ // // HXPhotoCustomNavigationBar.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/9/22. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoPreviewBottomView.h b/HXPhotoPicker/View/HXPhotoPreviewBottomView.h index ed6a8208..7b3d5e12 100644 --- a/HXPhotoPicker/View/HXPhotoPreviewBottomView.h +++ b/HXPhotoPicker/View/HXPhotoPreviewBottomView.h @@ -1,6 +1,6 @@ // // HXPhotoPreviewBottomView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/16. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoPreviewBottomView.m b/HXPhotoPicker/View/HXPhotoPreviewBottomView.m index 37b6dc96..df59205d 100644 --- a/HXPhotoPicker/View/HXPhotoPreviewBottomView.m +++ b/HXPhotoPicker/View/HXPhotoPreviewBottomView.m @@ -1,6 +1,6 @@ // // HXPhotoPreviewBottomView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/10/16. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoPreviewImageViewCell.h b/HXPhotoPicker/View/HXPhotoPreviewImageViewCell.h index 5b0d3dda..071a33ba 100644 --- a/HXPhotoPicker/View/HXPhotoPreviewImageViewCell.h +++ b/HXPhotoPicker/View/HXPhotoPreviewImageViewCell.h @@ -1,6 +1,6 @@ // // HXPhotoPreviewImageViewCell.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/12/5. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoPreviewImageViewCell.m b/HXPhotoPicker/View/HXPhotoPreviewImageViewCell.m index 4690ea09..ef12d741 100644 --- a/HXPhotoPicker/View/HXPhotoPreviewImageViewCell.m +++ b/HXPhotoPicker/View/HXPhotoPreviewImageViewCell.m @@ -1,6 +1,6 @@ // // HXPhotoPreviewImageViewCell.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/12/5. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoPreviewLivePhotoCell.h b/HXPhotoPicker/View/HXPhotoPreviewLivePhotoCell.h index 11beafc1..3ab1b334 100644 --- a/HXPhotoPicker/View/HXPhotoPreviewLivePhotoCell.h +++ b/HXPhotoPicker/View/HXPhotoPreviewLivePhotoCell.h @@ -1,6 +1,6 @@ // // HXPhotoPreviewLivePhotoCell.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/12/14. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoPreviewLivePhotoCell.m b/HXPhotoPicker/View/HXPhotoPreviewLivePhotoCell.m index 314e79da..7045a663 100644 --- a/HXPhotoPicker/View/HXPhotoPreviewLivePhotoCell.m +++ b/HXPhotoPicker/View/HXPhotoPreviewLivePhotoCell.m @@ -1,6 +1,6 @@ // // HXPhotoPreviewLivePhotoCell.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/12/14. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoPreviewVideoViewCell.h b/HXPhotoPicker/View/HXPhotoPreviewVideoViewCell.h index f391c45d..a51cf572 100644 --- a/HXPhotoPicker/View/HXPhotoPreviewVideoViewCell.h +++ b/HXPhotoPicker/View/HXPhotoPreviewVideoViewCell.h @@ -1,6 +1,6 @@ // // HXPhotoPreviewVideoViewCell.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/12/5. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoPreviewVideoViewCell.m b/HXPhotoPicker/View/HXPhotoPreviewVideoViewCell.m index 666ffa84..1b77884a 100644 --- a/HXPhotoPicker/View/HXPhotoPreviewVideoViewCell.m +++ b/HXPhotoPicker/View/HXPhotoPreviewVideoViewCell.m @@ -1,6 +1,6 @@ // // HXPhotoPreviewVideoViewCell.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/12/5. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoPreviewViewCell.h b/HXPhotoPicker/View/HXPhotoPreviewViewCell.h index 02366583..4bd5c839 100644 --- a/HXPhotoPicker/View/HXPhotoPreviewViewCell.h +++ b/HXPhotoPicker/View/HXPhotoPreviewViewCell.h @@ -1,6 +1,6 @@ // // HXPhotoPreviewViewCell.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/12/5. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoPreviewViewCell.m b/HXPhotoPicker/View/HXPhotoPreviewViewCell.m index 7e071b10..e74edc95 100644 --- a/HXPhotoPicker/View/HXPhotoPreviewViewCell.m +++ b/HXPhotoPicker/View/HXPhotoPreviewViewCell.m @@ -1,6 +1,6 @@ // // HXPhotoPreviewViewCell.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/12/5. // Copyright © 2019 洪欣. All rights reserved. @@ -216,8 +216,6 @@ - (void)layoutSubviews { - (UIScrollView *)scrollView { if (!_scrollView) { _scrollView = [[UIScrollView alloc] init]; - _scrollView.showsHorizontalScrollIndicator = NO; - _scrollView.showsVerticalScrollIndicator = NO; _scrollView.bouncesZoom = YES; _scrollView.minimumZoomScale = 1; _scrollView.multipleTouchEnabled = YES; diff --git a/HXPhotoPicker/View/HXPhotoSubViewCell.h b/HXPhotoPicker/View/HXPhotoSubViewCell.h index 44e06058..2e13ab24 100644 --- a/HXPhotoPicker/View/HXPhotoSubViewCell.h +++ b/HXPhotoPicker/View/HXPhotoSubViewCell.h @@ -1,6 +1,6 @@ // // HXPhotoSubViewCell.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/17. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoSubViewCell.m b/HXPhotoPicker/View/HXPhotoSubViewCell.m index 6ff9b4db..13ff1e36 100644 --- a/HXPhotoPicker/View/HXPhotoSubViewCell.m +++ b/HXPhotoPicker/View/HXPhotoSubViewCell.m @@ -1,6 +1,6 @@ // // HXPhotoSubViewCell.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/17. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoView.h b/HXPhotoPicker/View/HXPhotoView.h index bbf76195..d016260c 100644 --- a/HXPhotoPicker/View/HXPhotoView.h +++ b/HXPhotoPicker/View/HXPhotoView.h @@ -1,6 +1,6 @@ // // HXPhotoView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/17. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoView.m b/HXPhotoPicker/View/HXPhotoView.m index b57287cb..5d1747ae 100644 --- a/HXPhotoPicker/View/HXPhotoView.m +++ b/HXPhotoPicker/View/HXPhotoView.m @@ -1,6 +1,6 @@ // // HXPhotoView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/17. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoViewFlowLayout.h b/HXPhotoPicker/View/HXPhotoViewFlowLayout.h index 743b1ebc..6d14b235 100644 --- a/HXPhotoPicker/View/HXPhotoViewFlowLayout.h +++ b/HXPhotoPicker/View/HXPhotoViewFlowLayout.h @@ -1,6 +1,6 @@ // // HXPhotoViewFlowLayout.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/11/15. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPhotoViewFlowLayout.m b/HXPhotoPicker/View/HXPhotoViewFlowLayout.m index 2fd08d7c..4be923cb 100644 --- a/HXPhotoPicker/View/HXPhotoViewFlowLayout.m +++ b/HXPhotoPicker/View/HXPhotoViewFlowLayout.m @@ -1,6 +1,6 @@ // // HXPhotoViewFlowLayout.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/11/15. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPreviewContentView.h b/HXPhotoPicker/View/HXPreviewContentView.h index 45509030..e2fba390 100644 --- a/HXPhotoPicker/View/HXPreviewContentView.h +++ b/HXPhotoPicker/View/HXPreviewContentView.h @@ -1,6 +1,6 @@ // // HXPreviewContentView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/11/19. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPreviewContentView.m b/HXPhotoPicker/View/HXPreviewContentView.m index 4403ea05..fd0f5407 100644 --- a/HXPhotoPicker/View/HXPreviewContentView.m +++ b/HXPhotoPicker/View/HXPreviewContentView.m @@ -1,6 +1,6 @@ // // HXPreviewContentView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/11/19. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPreviewImageView.h b/HXPhotoPicker/View/HXPreviewImageView.h index 8f31c785..680b44bb 100644 --- a/HXPhotoPicker/View/HXPreviewImageView.h +++ b/HXPhotoPicker/View/HXPreviewImageView.h @@ -1,6 +1,6 @@ // // HXPreviewImageView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/11/15. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPreviewImageView.m b/HXPhotoPicker/View/HXPreviewImageView.m index f428b777..f9abd16f 100644 --- a/HXPhotoPicker/View/HXPreviewImageView.m +++ b/HXPhotoPicker/View/HXPreviewImageView.m @@ -1,6 +1,6 @@ // // HXPreviewImageView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/11/15. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPreviewLivePhotoView.h b/HXPhotoPicker/View/HXPreviewLivePhotoView.h index c45ff9be..b2bf22d3 100644 --- a/HXPhotoPicker/View/HXPreviewLivePhotoView.h +++ b/HXPhotoPicker/View/HXPreviewLivePhotoView.h @@ -1,6 +1,6 @@ // // HXPreviewLivePhotoView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/11/15. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPreviewLivePhotoView.m b/HXPhotoPicker/View/HXPreviewLivePhotoView.m index 6cb2f6bb..e8db6ebb 100644 --- a/HXPhotoPicker/View/HXPreviewLivePhotoView.m +++ b/HXPhotoPicker/View/HXPreviewLivePhotoView.m @@ -1,6 +1,6 @@ // // HXPreviewLivePhotoView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/11/15. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPreviewVideoView.h b/HXPhotoPicker/View/HXPreviewVideoView.h index a52c8166..85d15b02 100644 --- a/HXPhotoPicker/View/HXPreviewVideoView.h +++ b/HXPhotoPicker/View/HXPreviewVideoView.h @@ -1,6 +1,6 @@ // // HXPreviewVideoView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/11/15. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker/View/HXPreviewVideoView.m b/HXPhotoPicker/View/HXPreviewVideoView.m index e4863cf6..40d7c229 100644 --- a/HXPhotoPicker/View/HXPreviewVideoView.m +++ b/HXPhotoPicker/View/HXPreviewVideoView.m @@ -1,6 +1,6 @@ // // HXPreviewVideoView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/11/15. // Copyright © 2019 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo.xcodeproj/project.pbxproj b/HXPhotoPickerExample.xcodeproj/project.pbxproj similarity index 89% rename from HXPhotoPicker-Demo.xcodeproj/project.pbxproj rename to HXPhotoPickerExample.xcodeproj/project.pbxproj index 229c0020..3a9eea02 100644 --- a/HXPhotoPicker-Demo.xcodeproj/project.pbxproj +++ b/HXPhotoPickerExample.xcodeproj/project.pbxproj @@ -7,8 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 62FC75381C5F62172A3FF354 /* libPods-HXPhotoPicker-Demo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD350B5542739D4914344B4 /* libPods-HXPhotoPicker-Demo.a */; }; - 7B0856B924FA00FD00E93091 /* HXPhotoPicker_DemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B0856B824FA00FD00E93091 /* HXPhotoPicker_DemoUITests.m */; }; + 438A0ED618CD3AF385950318 /* libPods-HXPhotoPickerExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E6254BB2C20603515D5A76A4 /* libPods-HXPhotoPickerExample.a */; }; 7B08595324FA58DE00E93091 /* WxMomentPublishViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7B08590D24FA58DE00E93091 /* WxMomentPublishViewController.xib */; }; 7B08595424FA58DE00E93091 /* YYWeakProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B08590E24FA58DE00E93091 /* YYWeakProxy.m */; }; 7B08595524FA58DF00E93091 /* Demo15ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B08591024FA58DE00E93091 /* Demo15ViewController.m */; }; @@ -49,7 +48,32 @@ 7B08597A24FA58DF00E93091 /* Demo10ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B08594E24FA58DE00E93091 /* Demo10ViewController.m */; }; 7B08597B24FA58DF00E93091 /* SettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B08595024FA58DE00E93091 /* SettingViewController.m */; }; 7B08597C24FA58DF00E93091 /* WxMomentViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7B08595124FA58DE00E93091 /* WxMomentViewCell.xib */; }; + 7B0B2A88255E1AE300ACF619 /* HXPHPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A7A255E1AE300ACF619 /* HXPHPickerViewController.swift */; }; + 7B0B2A89255E1AE300ACF619 /* HXPHConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A7B255E1AE300ACF619 /* HXPHConfiguration.swift */; }; + 7B0B2A8A255E1AE300ACF619 /* HXPHTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A7C255E1AE300ACF619 /* HXPHTypes.swift */; }; + 7B0B2A8B255E1AE300ACF619 /* HXPHPickerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A7D255E1AE300ACF619 /* HXPHPickerController.swift */; }; + 7B0B2A8C255E1AE300ACF619 /* HXPHTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A7E255E1AE300ACF619 /* HXPHTools.swift */; }; + 7B0B2A8D255E1AE300ACF619 /* HXAlbumViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A7F255E1AE300ACF619 /* HXAlbumViewController.swift */; }; + 7B0B2A8E255E1AE300ACF619 /* HXPHAsset.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A80255E1AE300ACF619 /* HXPHAsset.swift */; }; + 7B0B2A8F255E1AE300ACF619 /* HXPHAssetCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A81255E1AE300ACF619 /* HXPHAssetCollection.swift */; }; + 7B0B2A90255E1AE300ACF619 /* HXAlbumViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A82255E1AE300ACF619 /* HXAlbumViewCell.swift */; }; + 7B0B2A91255E1AE300ACF619 /* HXPHManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A83255E1AE300ACF619 /* HXPHManager.swift */; }; + 7B0B2A92255E1AE300ACF619 /* HXPHAssetManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A84255E1AE300ACF619 /* HXPHAssetManager.swift */; }; + 7B0B2A93255E1AE300ACF619 /* HXPHPickerViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A85255E1AE300ACF619 /* HXPHPickerViewCell.swift */; }; + 7B0B2A94255E1AE300ACF619 /* UIView+HXPHPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A86255E1AE300ACF619 /* UIView+HXPHPicker.swift */; }; + 7B0B2A95255E1AE300ACF619 /* UIViewController+HXPHPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2A87255E1AE300ACF619 /* UIViewController+HXPHPicker.swift */; }; + 7B0B2AAA255E384100ACF619 /* UIFont+HXPHPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2AA9255E384100ACF619 /* UIFont+HXPHPicker.swift */; }; + 7B0B2AAF255E3B7B00ACF619 /* UIColor+HXPHPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2AAE255E3B7B00ACF619 /* UIColor+HXPHPicker.swift */; }; + 7B0B2AB4255E5A1800ACF619 /* HXPHPreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2AB3255E5A1800ACF619 /* HXPHPreviewViewController.swift */; }; + 7B0B2AB9255E5F6F00ACF619 /* HXPHPreviewViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2AB8255E5F6F00ACF619 /* HXPHPreviewViewCell.swift */; }; + 7B0B2AD1255E82F200ACF619 /* UIDevice+HXPHPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B0B2AD0255E82F200ACF619 /* UIDevice+HXPHPicker.swift */; }; 7B2824192514A7CD00DEE5A0 /* HXPhotoPicker.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 7B2824182514A7CD00DEE5A0 /* HXPhotoPicker.bundle */; }; + 7B3327F7255EE4F300784BC0 /* String+HXPHPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B3327F6255EE4F300784BC0 /* String+HXPHPicker.swift */; }; + 7B3EDEC1255E185900937B4A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B3EDEC0255E185900937B4A /* AppDelegate.swift */; }; + 7B3EDEC5255E185900937B4A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B3EDEC4255E185900937B4A /* ViewController.swift */; }; + 7B3EDEC8255E185900937B4A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7B3EDEC6255E185900937B4A /* Main.storyboard */; }; + 7B3EDECA255E185B00937B4A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7B3EDEC9255E185B00937B4A /* Assets.xcassets */; }; + 7B3EDECD255E185B00937B4A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7B3EDECB255E185B00937B4A /* LaunchScreen.storyboard */; }; 7B3FAFE02558EFAE0092FCE0 /* HXPhotoPicker.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 7B2824182514A7CD00DEE5A0 /* HXPhotoPicker.bundle */; }; 7B4D4C3E24B858C600B03846 /* HXPhotoEditConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B4D4BE624B858C600B03846 /* HXPhotoEditConfiguration.m */; }; 7B4D4C4624B858C600B03846 /* HX_PhotoEditViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B4D4BF924B858C600B03846 /* HX_PhotoEditViewController.m */; }; @@ -140,6 +164,7 @@ 7B64186124F76C67003A5723 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 7B64186024F76C67003A5723 /* README.md */; }; 7B752DE82372ADF000580F35 /* Photos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B752DE72372ADF000580F35 /* Photos.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 7B752DEA2372ADF300580F35 /* PhotosUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B752DE92372ADF300580F35 /* PhotosUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + 7B7BE3F22563D34A0008C391 /* HXAlbumView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B7BE3F12563D34A0008C391 /* HXAlbumView.swift */; }; 7B7E3E7B1E4AACD1002234EE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B7E3E7A1E4AACD1002234EE /* main.m */; }; 7B7E3E7E1E4AACD1002234EE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B7E3E7D1E4AACD1002234EE /* AppDelegate.m */; }; 7B7E3E861E4AACD1002234EE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7B7E3E851E4AACD1002234EE /* Assets.xcassets */; }; @@ -150,6 +175,9 @@ 7B8629AA237D0F8D00F8A584 /* EventKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B8629A9237D0F8C00F8A584 /* EventKit.framework */; }; 7B8629AC237D0F9400F8A584 /* Contacts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B8629AB237D0F9400F8A584 /* Contacts.framework */; }; 7B8629AE237D0FAA00F8A584 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B8629AD237D0FAA00F8A584 /* AddressBook.framework */; }; + 7BA6878B25610CF00014C3E3 /* UIImage+HXPHPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BA6878A25610CF00014C3E3 /* UIImage+HXPHPicker.swift */; }; + 7BA68790256144EA0014C3E3 /* HXPHPicker.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 7BA6878F256144EA0014C3E3 /* HXPHPicker.bundle */; }; + 7BA68798256149790014C3E3 /* Bundle+HXPhotoPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BA68797256149790014C3E3 /* Bundle+HXPhotoPicker.swift */; }; 7BAF876124C14D5C00ACAF85 /* HXCameraBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BAF876024C14D5C00ACAF85 /* HXCameraBottomView.m */; }; 7BC371522505D25000E2D05C /* HXPhotoEditGraffitiColorSizeView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7BC3713A2505D24E00E2D05C /* HXPhotoEditGraffitiColorSizeView.xib */; }; 7BC371532505D25000E2D05C /* HXPhotoEditStickerTrashView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7BC3713B2505D24E00E2D05C /* HXPhotoEditStickerTrashView.xib */; }; @@ -342,21 +370,9 @@ 7BD52F7D24FE258200AE3D7C /* HXPhotoTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B4E65D92487AD5B00077EE1 /* HXPhotoTools.m */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 7B0856BB24FA00FE00E93091 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 7B7E3E6E1E4AACD1002234EE /* Project object */; - proxyType = 1; - remoteGlobalIDString = 7B7E3E751E4AACD1002234EE; - remoteInfo = "HXPhotoPicker-Demo"; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXFileReference section */ - 1AD350B5542739D4914344B4 /* libPods-HXPhotoPicker-Demo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HXPhotoPicker-Demo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 7B0856B624FA00FD00E93091 /* HXPhotoPicker-DemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "HXPhotoPicker-DemoUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - 7B0856B824FA00FD00E93091 /* HXPhotoPicker_DemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HXPhotoPicker_DemoUITests.m; sourceTree = ""; }; - 7B0856BA24FA00FD00E93091 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 16A9631049F51EB2C9886F18 /* Pods-HXPhotoPickerExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HXPhotoPickerExample.debug.xcconfig"; path = "Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample.debug.xcconfig"; sourceTree = ""; }; + 3582D2EABCA69E96E4C95300 /* Pods-HXPhotoPickerExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HXPhotoPickerExample.release.xcconfig"; path = "Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample.release.xcconfig"; sourceTree = ""; }; 7B08590C24FA58DE00E93091 /* WxMomentPublishViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WxMomentPublishViewController.h; sourceTree = ""; }; 7B08590D24FA58DE00E93091 /* WxMomentPublishViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WxMomentPublishViewController.xib; sourceTree = ""; }; 7B08590E24FA58DE00E93091 /* YYWeakProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YYWeakProxy.m; sourceTree = ""; }; @@ -423,7 +439,34 @@ 7B08595024FA58DE00E93091 /* SettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingViewController.m; sourceTree = ""; }; 7B08595124FA58DE00E93091 /* WxMomentViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WxMomentViewCell.xib; sourceTree = ""; }; 7B08595224FA58DE00E93091 /* Demo6SubViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Demo6SubViewController.h; sourceTree = ""; }; + 7B0B2A7A255E1AE300ACF619 /* HXPHPickerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXPHPickerViewController.swift; sourceTree = ""; }; + 7B0B2A7B255E1AE300ACF619 /* HXPHConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXPHConfiguration.swift; sourceTree = ""; }; + 7B0B2A7C255E1AE300ACF619 /* HXPHTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXPHTypes.swift; sourceTree = ""; }; + 7B0B2A7D255E1AE300ACF619 /* HXPHPickerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXPHPickerController.swift; sourceTree = ""; }; + 7B0B2A7E255E1AE300ACF619 /* HXPHTools.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXPHTools.swift; sourceTree = ""; }; + 7B0B2A7F255E1AE300ACF619 /* HXAlbumViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXAlbumViewController.swift; sourceTree = ""; }; + 7B0B2A80255E1AE300ACF619 /* HXPHAsset.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXPHAsset.swift; sourceTree = ""; }; + 7B0B2A81255E1AE300ACF619 /* HXPHAssetCollection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXPHAssetCollection.swift; sourceTree = ""; }; + 7B0B2A82255E1AE300ACF619 /* HXAlbumViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXAlbumViewCell.swift; sourceTree = ""; }; + 7B0B2A83255E1AE300ACF619 /* HXPHManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXPHManager.swift; sourceTree = ""; }; + 7B0B2A84255E1AE300ACF619 /* HXPHAssetManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXPHAssetManager.swift; sourceTree = ""; }; + 7B0B2A85255E1AE300ACF619 /* HXPHPickerViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HXPHPickerViewCell.swift; sourceTree = ""; }; + 7B0B2A86255E1AE300ACF619 /* UIView+HXPHPicker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+HXPHPicker.swift"; sourceTree = ""; }; + 7B0B2A87255E1AE300ACF619 /* UIViewController+HXPHPicker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+HXPHPicker.swift"; sourceTree = ""; }; + 7B0B2AA9255E384100ACF619 /* UIFont+HXPHPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+HXPHPicker.swift"; sourceTree = ""; }; + 7B0B2AAE255E3B7B00ACF619 /* UIColor+HXPHPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+HXPHPicker.swift"; sourceTree = ""; }; + 7B0B2AB3255E5A1800ACF619 /* HXPHPreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HXPHPreviewViewController.swift; sourceTree = ""; }; + 7B0B2AB8255E5F6F00ACF619 /* HXPHPreviewViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HXPHPreviewViewCell.swift; sourceTree = ""; }; + 7B0B2AD0255E82F200ACF619 /* UIDevice+HXPHPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIDevice+HXPHPicker.swift"; sourceTree = ""; }; 7B2824182514A7CD00DEE5A0 /* HXPhotoPicker.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = HXPhotoPicker.bundle; sourceTree = ""; }; + 7B3327F6255EE4F300784BC0 /* String+HXPHPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+HXPHPicker.swift"; sourceTree = ""; }; + 7B3EDEBE255E185900937B4A /* HXPHPickerExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HXPHPickerExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7B3EDEC0255E185900937B4A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7B3EDEC4255E185900937B4A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 7B3EDEC7255E185900937B4A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 7B3EDEC9255E185B00937B4A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 7B3EDECC255E185B00937B4A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 7B3EDECE255E185B00937B4A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 7B4D4BE624B858C600B03846 /* HXPhotoEditConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HXPhotoEditConfiguration.m; sourceTree = ""; }; 7B4D4BF424B858C600B03846 /* HXPhotoEdit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HXPhotoEdit.h; sourceTree = ""; }; 7B4D4BF824B858C600B03846 /* HX_PhotoEditViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HX_PhotoEditViewController.h; sourceTree = ""; }; @@ -601,7 +644,8 @@ 7B64186024F76C67003A5723 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 7B752DE72372ADF000580F35 /* Photos.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Photos.framework; path = System/Library/Frameworks/Photos.framework; sourceTree = SDKROOT; }; 7B752DE92372ADF300580F35 /* PhotosUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PhotosUI.framework; path = System/Library/Frameworks/PhotosUI.framework; sourceTree = SDKROOT; }; - 7B7E3E761E4AACD1002234EE /* HXPhotoPicker-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HXPhotoPicker-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 7B7BE3F12563D34A0008C391 /* HXAlbumView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HXAlbumView.swift; sourceTree = ""; }; + 7B7E3E761E4AACD1002234EE /* HXPhotoPickerExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HXPhotoPickerExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 7B7E3E7A1E4AACD1002234EE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 7B7E3E7C1E4AACD1002234EE /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 7B7E3E7D1E4AACD1002234EE /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; @@ -615,6 +659,9 @@ 7B8629AB237D0F9400F8A584 /* Contacts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Contacts.framework; path = System/Library/Frameworks/Contacts.framework; sourceTree = SDKROOT; }; 7B8629AD237D0FAA00F8A584 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; 7B8EED1A24D7C2C600957B3C /* HXPhotoTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HXPhotoTypes.h; sourceTree = ""; }; + 7BA6878A25610CF00014C3E3 /* UIImage+HXPHPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+HXPHPicker.swift"; sourceTree = ""; }; + 7BA6878F256144EA0014C3E3 /* HXPHPicker.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = HXPHPicker.bundle; sourceTree = ""; }; + 7BA68797256149790014C3E3 /* Bundle+HXPhotoPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+HXPhotoPicker.swift"; sourceTree = ""; }; 7BAF875F24C14D5C00ACAF85 /* HXCameraBottomView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HXCameraBottomView.h; sourceTree = ""; }; 7BAF876024C14D5C00ACAF85 /* HXCameraBottomView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HXCameraBottomView.m; sourceTree = ""; }; 7BB9FDFB24D500DB00C9A6F1 /* HXPhotoViewProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HXPhotoViewProtocol.h; sourceTree = ""; }; @@ -633,12 +680,11 @@ 7BD52EC024FE250E00AE3D7C /* HXPhotoPicker.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HXPhotoPicker.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7BD52EC324FE250E00AE3D7C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 7BE8DFD624C68B2800306042 /* HXPhotoViewCellCustomProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HXPhotoViewCellCustomProtocol.h; sourceTree = ""; }; - AD6E46F470F33649CB1826B8 /* Pods-HXPhotoPicker-Demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HXPhotoPicker-Demo.debug.xcconfig"; path = "Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo.debug.xcconfig"; sourceTree = ""; }; - B50B4B451C32F6F526B3EFDA /* Pods-HXPhotoPicker-Demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HXPhotoPicker-Demo.release.xcconfig"; path = "Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo.release.xcconfig"; sourceTree = ""; }; + E6254BB2C20603515D5A76A4 /* libPods-HXPhotoPickerExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HXPhotoPickerExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 7B0856B324FA00FD00E93091 /* Frameworks */ = { + 7B3EDEBB255E185900937B4A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( @@ -658,7 +704,7 @@ 7B8629A2237D0F6500F8A584 /* QuickLook.framework in Frameworks */, 7B752DEA2372ADF300580F35 /* PhotosUI.framework in Frameworks */, 7B752DE82372ADF000580F35 /* Photos.framework in Frameworks */, - 62FC75381C5F62172A3FF354 /* libPods-HXPhotoPicker-Demo.a in Frameworks */, + 438A0ED618CD3AF385950318 /* libPods-HXPhotoPickerExample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -675,8 +721,8 @@ 4577D5A9522A169F69B55034 /* Pods */ = { isa = PBXGroup; children = ( - AD6E46F470F33649CB1826B8 /* Pods-HXPhotoPicker-Demo.debug.xcconfig */, - B50B4B451C32F6F526B3EFDA /* Pods-HXPhotoPicker-Demo.release.xcconfig */, + 16A9631049F51EB2C9886F18 /* Pods-HXPhotoPickerExample.debug.xcconfig */, + 3582D2EABCA69E96E4C95300 /* Pods-HXPhotoPickerExample.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -689,15 +735,6 @@ path = Resources; sourceTree = ""; }; - 7B0856B724FA00FD00E93091 /* HXPhotoPicker-DemoUITests */ = { - isa = PBXGroup; - children = ( - 7B0856B824FA00FD00E93091 /* HXPhotoPicker_DemoUITests.m */, - 7B0856BA24FA00FD00E93091 /* Info.plist */, - ); - path = "HXPhotoPicker-DemoUITests"; - sourceTree = ""; - }; 7B08590B24FA58DE00E93091 /* Classes */ = { isa = PBXGroup; children = ( @@ -791,6 +828,51 @@ path = assets; sourceTree = ""; }; + 7B0B2A79255E1AE300ACF619 /* HXPHPicker */ = { + isa = PBXGroup; + children = ( + 7BA6878F256144EA0014C3E3 /* HXPHPicker.bundle */, + 7B0B2A7B255E1AE300ACF619 /* HXPHConfiguration.swift */, + 7B0B2A83255E1AE300ACF619 /* HXPHManager.swift */, + 7B0B2A84255E1AE300ACF619 /* HXPHAssetManager.swift */, + 7B0B2A81255E1AE300ACF619 /* HXPHAssetCollection.swift */, + 7B0B2A80255E1AE300ACF619 /* HXPHAsset.swift */, + 7B0B2A7D255E1AE300ACF619 /* HXPHPickerController.swift */, + 7B0B2A7F255E1AE300ACF619 /* HXAlbumViewController.swift */, + 7B7BE3F12563D34A0008C391 /* HXAlbumView.swift */, + 7B0B2A82255E1AE300ACF619 /* HXAlbumViewCell.swift */, + 7B0B2A7A255E1AE300ACF619 /* HXPHPickerViewController.swift */, + 7B0B2A85255E1AE300ACF619 /* HXPHPickerViewCell.swift */, + 7B0B2AB3255E5A1800ACF619 /* HXPHPreviewViewController.swift */, + 7B0B2AB8255E5F6F00ACF619 /* HXPHPreviewViewCell.swift */, + 7B0B2A7E255E1AE300ACF619 /* HXPHTools.swift */, + 7B0B2A7C255E1AE300ACF619 /* HXPHTypes.swift */, + 7B0B2AD0255E82F200ACF619 /* UIDevice+HXPHPicker.swift */, + 7B0B2A86255E1AE300ACF619 /* UIView+HXPHPicker.swift */, + 7B0B2A87255E1AE300ACF619 /* UIViewController+HXPHPicker.swift */, + 7B0B2AA9255E384100ACF619 /* UIFont+HXPHPicker.swift */, + 7B0B2AAE255E3B7B00ACF619 /* UIColor+HXPHPicker.swift */, + 7B3327F6255EE4F300784BC0 /* String+HXPHPicker.swift */, + 7BA6878A25610CF00014C3E3 /* UIImage+HXPHPicker.swift */, + 7BA68797256149790014C3E3 /* Bundle+HXPhotoPicker.swift */, + ); + path = HXPHPicker; + sourceTree = SOURCE_ROOT; + }; + 7B3EDEBF255E185900937B4A /* Swift */ = { + isa = PBXGroup; + children = ( + 7B0B2A79255E1AE300ACF619 /* HXPHPicker */, + 7B3EDEC0255E185900937B4A /* AppDelegate.swift */, + 7B3EDEC4255E185900937B4A /* ViewController.swift */, + 7B3EDEC6255E185900937B4A /* Main.storyboard */, + 7B3EDEC9255E185B00937B4A /* Assets.xcassets */, + 7B3EDECB255E185B00937B4A /* LaunchScreen.storyboard */, + 7B3EDECE255E185B00937B4A /* Info.plist */, + ); + path = Swift; + sourceTree = ""; + }; 7B4D4BE524B858C600B03846 /* HXPhotoEdit */ = { isa = PBXGroup; children = ( @@ -1062,7 +1144,7 @@ 7B8629A1237D0F6500F8A584 /* QuickLook.framework */, 7B752DE92372ADF300580F35 /* PhotosUI.framework */, 7B752DE72372ADF000580F35 /* Photos.framework */, - 1AD350B5542739D4914344B4 /* libPods-HXPhotoPicker-Demo.a */, + E6254BB2C20603515D5A76A4 /* libPods-HXPhotoPickerExample.a */, ); name = Frameworks; sourceTree = ""; @@ -1071,8 +1153,8 @@ isa = PBXGroup; children = ( 7B64186024F76C67003A5723 /* README.md */, - 7B7E3E781E4AACD1002234EE /* HXPhotoPicker-Demo */, - 7B0856B724FA00FD00E93091 /* HXPhotoPicker-DemoUITests */, + 7B7E3E781E4AACD1002234EE /* Objective-C */, + 7B3EDEBF255E185900937B4A /* Swift */, 7BD52EC124FE250E00AE3D7C /* HXPhotoPickerFramework */, 7B7E3E771E4AACD1002234EE /* Products */, 7B752DE62372ADEF00580F35 /* Frameworks */, @@ -1083,14 +1165,14 @@ 7B7E3E771E4AACD1002234EE /* Products */ = { isa = PBXGroup; children = ( - 7B7E3E761E4AACD1002234EE /* HXPhotoPicker-Demo.app */, - 7B0856B624FA00FD00E93091 /* HXPhotoPicker-DemoUITests.xctest */, + 7B7E3E761E4AACD1002234EE /* HXPhotoPickerExample.app */, 7BD52EC024FE250E00AE3D7C /* HXPhotoPicker.framework */, + 7B3EDEBE255E185900937B4A /* HXPHPickerExample.app */, ); name = Products; sourceTree = ""; }; - 7B7E3E781E4AACD1002234EE /* HXPhotoPicker-Demo */ = { + 7B7E3E781E4AACD1002234EE /* Objective-C */ = { isa = PBXGroup; children = ( 7B4E65AE2487AD5B00077EE1 /* HXPhotoPicker */, @@ -1101,7 +1183,7 @@ 7B7E3E8A1E4AACD1002234EE /* Info.plist */, 7B7E3E791E4AACD1002234EE /* Supporting Files */, ); - path = "HXPhotoPicker-Demo"; + path = "Objective-C"; sourceTree = ""; }; 7B7E3E791E4AACD1002234EE /* Supporting Files */ = { @@ -1224,27 +1306,26 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 7B0856B524FA00FD00E93091 /* HXPhotoPicker-DemoUITests */ = { + 7B3EDEBD255E185900937B4A /* HXPHPickerExample */ = { isa = PBXNativeTarget; - buildConfigurationList = 7B0856BD24FA00FE00E93091 /* Build configuration list for PBXNativeTarget "HXPhotoPicker-DemoUITests" */; + buildConfigurationList = 7B3EDECF255E185B00937B4A /* Build configuration list for PBXNativeTarget "HXPHPickerExample" */; buildPhases = ( - 7B0856B224FA00FD00E93091 /* Sources */, - 7B0856B324FA00FD00E93091 /* Frameworks */, - 7B0856B424FA00FD00E93091 /* Resources */, + 7B3EDEBA255E185900937B4A /* Sources */, + 7B3EDEBB255E185900937B4A /* Frameworks */, + 7B3EDEBC255E185900937B4A /* Resources */, ); buildRules = ( ); dependencies = ( - 7B0856BC24FA00FE00E93091 /* PBXTargetDependency */, ); - name = "HXPhotoPicker-DemoUITests"; - productName = "HXPhotoPicker-DemoUITests"; - productReference = 7B0856B624FA00FD00E93091 /* HXPhotoPicker-DemoUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; + name = HXPHPickerExample; + productName = HXPHPickerExample; + productReference = 7B3EDEBE255E185900937B4A /* HXPHPickerExample.app */; + productType = "com.apple.product-type.application"; }; - 7B7E3E751E4AACD1002234EE /* HXPhotoPicker-Demo */ = { + 7B7E3E751E4AACD1002234EE /* HXPhotoPickerExample */ = { isa = PBXNativeTarget; - buildConfigurationList = 7B7E3E8D1E4AACD1002234EE /* Build configuration list for PBXNativeTarget "HXPhotoPicker-Demo" */; + buildConfigurationList = 7B7E3E8D1E4AACD1002234EE /* Build configuration list for PBXNativeTarget "HXPhotoPickerExample" */; buildPhases = ( 434547430CF3E6D5B728C923 /* [CP] Check Pods Manifest.lock */, 7B7E3E721E4AACD1002234EE /* Sources */, @@ -1255,9 +1336,9 @@ ); dependencies = ( ); - name = "HXPhotoPicker-Demo"; + name = HXPhotoPickerExample; productName = "照片选择"; - productReference = 7B7E3E761E4AACD1002234EE /* HXPhotoPicker-Demo.app */; + productReference = 7B7E3E761E4AACD1002234EE /* HXPhotoPickerExample.app */; productType = "com.apple.product-type.application"; }; 7BD52EBF24FE250E00AE3D7C /* HXPhotoPickerFramework */ = { @@ -1285,14 +1366,14 @@ isa = PBXProject; attributes = { DefaultBuildSystemTypeForWorkspace = Latest; + LastSwiftUpdateCheck = 1220; LastUpgradeCheck = 1200; ORGANIZATIONNAME = "洪欣"; TargetAttributes = { - 7B0856B524FA00FD00E93091 = { - CreatedOnToolsVersion = 11.5; - DevelopmentTeam = BMBPTRQ2Q4; + 7B3EDEBD255E185900937B4A = { + CreatedOnToolsVersion = 12.2; + DevelopmentTeam = 36YN45CVLK; ProvisioningStyle = Automatic; - TestTargetID = 7B7E3E751E4AACD1002234EE; }; 7B7E3E751E4AACD1002234EE = { CreatedOnToolsVersion = 8.2.1; @@ -1306,7 +1387,7 @@ }; }; }; - buildConfigurationList = 7B7E3E711E4AACD1002234EE /* Build configuration list for PBXProject "HXPhotoPicker-Demo" */; + buildConfigurationList = 7B7E3E711E4AACD1002234EE /* Build configuration list for PBXProject "HXPhotoPickerExample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = en; hasScannedForEncodings = 0; @@ -1319,18 +1400,22 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 7B7E3E751E4AACD1002234EE /* HXPhotoPicker-Demo */, - 7B0856B524FA00FD00E93091 /* HXPhotoPicker-DemoUITests */, + 7B7E3E751E4AACD1002234EE /* HXPhotoPickerExample */, + 7B3EDEBD255E185900937B4A /* HXPHPickerExample */, 7BD52EBF24FE250E00AE3D7C /* HXPhotoPickerFramework */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 7B0856B424FA00FD00E93091 /* Resources */ = { + 7B3EDEBC255E185900937B4A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 7B3EDECD255E185B00937B4A /* LaunchScreen.storyboard in Resources */, + 7B3EDECA255E185B00937B4A /* Assets.xcassets in Resources */, + 7B3EDEC8255E185900937B4A /* Main.storyboard in Resources */, + 7BA68790256144EA0014C3E3 /* HXPHPicker.bundle in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1396,7 +1481,7 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-HXPhotoPicker-Demo-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-HXPhotoPickerExample-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -1406,11 +1491,35 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 7B0856B224FA00FD00E93091 /* Sources */ = { + 7B3EDEBA255E185900937B4A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 7B0856B924FA00FD00E93091 /* HXPhotoPicker_DemoUITests.m in Sources */, + 7B3327F7255EE4F300784BC0 /* String+HXPHPicker.swift in Sources */, + 7B0B2AAA255E384100ACF619 /* UIFont+HXPHPicker.swift in Sources */, + 7B0B2A8A255E1AE300ACF619 /* HXPHTypes.swift in Sources */, + 7B0B2A92255E1AE300ACF619 /* HXPHAssetManager.swift in Sources */, + 7B0B2A8C255E1AE300ACF619 /* HXPHTools.swift in Sources */, + 7B0B2A94255E1AE300ACF619 /* UIView+HXPHPicker.swift in Sources */, + 7B0B2A8F255E1AE300ACF619 /* HXPHAssetCollection.swift in Sources */, + 7B3EDEC5255E185900937B4A /* ViewController.swift in Sources */, + 7B0B2AAF255E3B7B00ACF619 /* UIColor+HXPHPicker.swift in Sources */, + 7BA68798256149790014C3E3 /* Bundle+HXPhotoPicker.swift in Sources */, + 7B0B2AB4255E5A1800ACF619 /* HXPHPreviewViewController.swift in Sources */, + 7B0B2A88255E1AE300ACF619 /* HXPHPickerViewController.swift in Sources */, + 7B0B2A8E255E1AE300ACF619 /* HXPHAsset.swift in Sources */, + 7B0B2A89255E1AE300ACF619 /* HXPHConfiguration.swift in Sources */, + 7BA6878B25610CF00014C3E3 /* UIImage+HXPHPicker.swift in Sources */, + 7B3EDEC1255E185900937B4A /* AppDelegate.swift in Sources */, + 7B0B2AB9255E5F6F00ACF619 /* HXPHPreviewViewCell.swift in Sources */, + 7B0B2A8D255E1AE300ACF619 /* HXAlbumViewController.swift in Sources */, + 7B0B2A90255E1AE300ACF619 /* HXAlbumViewCell.swift in Sources */, + 7B0B2AD1255E82F200ACF619 /* UIDevice+HXPHPicker.swift in Sources */, + 7B0B2A8B255E1AE300ACF619 /* HXPHPickerController.swift in Sources */, + 7B7BE3F22563D34A0008C391 /* HXAlbumView.swift in Sources */, + 7B0B2A93255E1AE300ACF619 /* HXPHPickerViewCell.swift in Sources */, + 7B0B2A95255E1AE300ACF619 /* UIViewController+HXPHPicker.swift in Sources */, + 7B0B2A91255E1AE300ACF619 /* HXPHManager.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1631,55 +1740,77 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 7B0856BC24FA00FE00E93091 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 7B7E3E751E4AACD1002234EE /* HXPhotoPicker-Demo */; - targetProxy = 7B0856BB24FA00FE00E93091 /* PBXContainerItemProxy */; +/* Begin PBXVariantGroup section */ + 7B3EDEC6255E185900937B4A /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 7B3EDEC7255E185900937B4A /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 7B3EDECB255E185B00937B4A /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 7B3EDECC255E185B00937B4A /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; }; -/* End PBXTargetDependency section */ +/* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 7B0856BE24FA00FE00E93091 /* Debug */ = { + 7B3EDED0255E185B00937B4A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = BMBPTRQ2Q4; + DEVELOPMENT_TEAM = 36YN45CVLK; GCC_C_LANGUAGE_STANDARD = gnu11; - INFOPLIST_FILE = "HXPhotoPicker-DemoUITests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 13.5; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = Swift/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.silence.HXPhotoPicker-DemoUITests"; + PRODUCT_BUNDLE_IDENTIFIER = com.silence.HXPHPickerExample; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = "HXPhotoPicker-Demo"; }; name = Debug; }; - 7B0856BF24FA00FE00E93091 /* Release */ = { + 7B3EDED1255E185B00937B4A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = BMBPTRQ2Q4; + DEVELOPMENT_TEAM = 36YN45CVLK; GCC_C_LANGUAGE_STANDARD = gnu11; - INFOPLIST_FILE = "HXPhotoPicker-DemoUITests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 13.5; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + INFOPLIST_FILE = Swift/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.silence.HXPhotoPicker-DemoUITests"; + PRODUCT_BUNDLE_IDENTIFIER = com.silence.HXPHPickerExample; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = "HXPhotoPicker-Demo"; }; name = Release; }; @@ -1795,7 +1926,7 @@ }; 7B7E3E8E1E4AACD1002234EE /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AD6E46F470F33649CB1826B8 /* Pods-HXPhotoPicker-Demo.debug.xcconfig */; + baseConfigurationReference = 16A9631049F51EB2C9886F18 /* Pods-HXPhotoPickerExample.debug.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -1810,12 +1941,12 @@ "COCOAPODS=1", DEBUG, ); - INFOPLIST_FILE = "HXPhotoPicker-Demo/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Objective-C/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 3.1.5; ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "com.silence.HXPhotoPicker-4"; + PRODUCT_BUNDLE_IDENTIFIER = "com.silence.HXPhotoPicker-5"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1825,7 +1956,7 @@ }; 7B7E3E8F1E4AACD1002234EE /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B50B4B451C32F6F526B3EFDA /* Pods-HXPhotoPicker-Demo.release.xcconfig */; + baseConfigurationReference = 3582D2EABCA69E96E4C95300 /* Pods-HXPhotoPickerExample.release.xcconfig */; buildSettings = { ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -1834,11 +1965,11 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 36YN45CVLK; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = "HXPhotoPicker-Demo/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Objective-C/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 3.1.5; - PRODUCT_BUNDLE_IDENTIFIER = "com.silence.HXPhotoPicker-4"; + PRODUCT_BUNDLE_IDENTIFIER = "com.silence.HXPhotoPicker-5"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1918,16 +2049,16 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 7B0856BD24FA00FE00E93091 /* Build configuration list for PBXNativeTarget "HXPhotoPicker-DemoUITests" */ = { + 7B3EDECF255E185B00937B4A /* Build configuration list for PBXNativeTarget "HXPHPickerExample" */ = { isa = XCConfigurationList; buildConfigurations = ( - 7B0856BE24FA00FE00E93091 /* Debug */, - 7B0856BF24FA00FE00E93091 /* Release */, + 7B3EDED0255E185B00937B4A /* Debug */, + 7B3EDED1255E185B00937B4A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 7B7E3E711E4AACD1002234EE /* Build configuration list for PBXProject "HXPhotoPicker-Demo" */ = { + 7B7E3E711E4AACD1002234EE /* Build configuration list for PBXProject "HXPhotoPickerExample" */ = { isa = XCConfigurationList; buildConfigurations = ( 7B7E3E8B1E4AACD1002234EE /* Debug */, @@ -1936,7 +2067,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 7B7E3E8D1E4AACD1002234EE /* Build configuration list for PBXNativeTarget "HXPhotoPicker-Demo" */ = { + 7B7E3E8D1E4AACD1002234EE /* Build configuration list for PBXNativeTarget "HXPhotoPickerExample" */ = { isa = XCConfigurationList; buildConfigurations = ( 7B7E3E8E1E4AACD1002234EE /* Debug */, diff --git a/HXPhotoPicker-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/HXPhotoPickerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from HXPhotoPicker-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to HXPhotoPickerExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/HXPhotoPicker-Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/HXPhotoPickerExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from HXPhotoPicker-Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to HXPhotoPickerExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/HXPhotoPicker-Demo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/HXPhotoPickerExample.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from HXPhotoPicker-Demo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to HXPhotoPickerExample.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/HXPhotoPicker-Demo.xcodeproj/xcshareddata/xcschemes/HXPhotoPicker.xcscheme b/HXPhotoPickerExample.xcodeproj/xcshareddata/xcschemes/HXPHPickerExample.xcscheme similarity index 62% rename from HXPhotoPicker-Demo.xcodeproj/xcshareddata/xcschemes/HXPhotoPicker.xcscheme rename to HXPhotoPickerExample.xcodeproj/xcshareddata/xcschemes/HXPHPickerExample.xcscheme index 3ec137ae..794fb069 100644 --- a/HXPhotoPicker-Demo.xcodeproj/xcshareddata/xcschemes/HXPhotoPicker.xcscheme +++ b/HXPhotoPickerExample.xcodeproj/xcshareddata/xcschemes/HXPHPickerExample.xcscheme @@ -14,10 +14,10 @@ buildForAnalyzing = "YES"> + BlueprintIdentifier = "7B3EDEBD255E185900937B4A" + BuildableName = "HXPHPickerExample.app" + BlueprintName = "HXPHPickerExample" + ReferencedContainer = "container:HXPhotoPickerExample.xcodeproj"> @@ -26,19 +26,8 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES" - codeCoverageEnabled = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES"> - - - - + BlueprintIdentifier = "7B3EDEBD255E185900937B4A" + BuildableName = "HXPHPickerExample.app" + BlueprintName = "HXPHPickerExample" + ReferencedContainer = "container:HXPhotoPickerExample.xcodeproj"> @@ -72,10 +61,10 @@ runnableDebuggingMode = "0"> + BlueprintIdentifier = "7B3EDEBD255E185900937B4A" + BuildableName = "HXPHPickerExample.app" + BlueprintName = "HXPHPickerExample" + ReferencedContainer = "container:HXPhotoPickerExample.xcodeproj"> diff --git a/HXPhotoPicker-Demo.xcodeproj/xcshareddata/xcschemes/HXPhotoPicker-DemoUITests.xcscheme b/HXPhotoPickerExample.xcodeproj/xcshareddata/xcschemes/HXPhotoPickerExample.xcscheme similarity index 60% rename from HXPhotoPicker-Demo.xcodeproj/xcshareddata/xcschemes/HXPhotoPicker-DemoUITests.xcscheme rename to HXPhotoPickerExample.xcodeproj/xcshareddata/xcschemes/HXPhotoPickerExample.xcscheme index e40e91f6..351686fc 100644 --- a/HXPhotoPicker-Demo.xcodeproj/xcshareddata/xcschemes/HXPhotoPicker-DemoUITests.xcscheme +++ b/HXPhotoPickerExample.xcodeproj/xcshareddata/xcschemes/HXPhotoPickerExample.xcscheme @@ -5,6 +5,22 @@ + + + + + + - - - - + + + + + ReferencedContainer = "container:HXPhotoPickerExample.xcodeproj"> @@ -47,15 +47,6 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> - - - - diff --git a/HXPhotoPicker-Demo.xcworkspace/contents.xcworkspacedata b/HXPhotoPickerExample.xcworkspace/contents.xcworkspacedata similarity index 76% rename from HXPhotoPicker-Demo.xcworkspace/contents.xcworkspacedata rename to HXPhotoPickerExample.xcworkspace/contents.xcworkspacedata index 4c6ec2b3..0b3a51f2 100644 --- a/HXPhotoPicker-Demo.xcworkspace/contents.xcworkspacedata +++ b/HXPhotoPickerExample.xcworkspace/contents.xcworkspacedata @@ -2,7 +2,7 @@ + location = "group:HXPhotoPickerExample.xcodeproj"> diff --git a/HXPhotoPicker-Demo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/HXPhotoPickerExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from HXPhotoPicker-Demo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to HXPhotoPickerExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/HXPhotoPicker-Demo.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/HXPhotoPickerExample.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from HXPhotoPicker-Demo.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to HXPhotoPickerExample.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/HXPhotoPicker-Demo/AppDelegate.h b/Objective-C/AppDelegate.h similarity index 91% rename from HXPhotoPicker-Demo/AppDelegate.h rename to Objective-C/AppDelegate.h index e0966cc7..16c5f885 100644 --- a/HXPhotoPicker-Demo/AppDelegate.h +++ b/Objective-C/AppDelegate.h @@ -1,6 +1,6 @@ // // AppDelegate.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/AppDelegate.m b/Objective-C/AppDelegate.m similarity index 99% rename from HXPhotoPicker-Demo/AppDelegate.m rename to Objective-C/AppDelegate.m index b27fa0d5..404a7a55 100644 --- a/HXPhotoPicker-Demo/AppDelegate.m +++ b/Objective-C/AppDelegate.m @@ -1,6 +1,6 @@ // // AppDelegate.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Assets.xcassets/0.imageset/Contents.json b/Objective-C/Assets.xcassets/0.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/0.imageset/Contents.json rename to Objective-C/Assets.xcassets/0.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/0.imageset/ab6ee730c94871de3382e22c5ffdacf1.jpg b/Objective-C/Assets.xcassets/0.imageset/ab6ee730c94871de3382e22c5ffdacf1.jpg similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/0.imageset/ab6ee730c94871de3382e22c5ffdacf1.jpg rename to Objective-C/Assets.xcassets/0.imageset/ab6ee730c94871de3382e22c5ffdacf1.jpg diff --git a/HXPhotoPicker-Demo/Assets.xcassets/1.imageset/22ea5c0b716b2548069b91464012eeac.jpg b/Objective-C/Assets.xcassets/1.imageset/22ea5c0b716b2548069b91464012eeac.jpg similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/1.imageset/22ea5c0b716b2548069b91464012eeac.jpg rename to Objective-C/Assets.xcassets/1.imageset/22ea5c0b716b2548069b91464012eeac.jpg diff --git a/HXPhotoPicker-Demo/Assets.xcassets/1.imageset/Contents.json b/Objective-C/Assets.xcassets/1.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/1.imageset/Contents.json rename to Objective-C/Assets.xcassets/1.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/2.imageset/0954d7ffbe081e75cdcf5bdcbc500f50.jpg b/Objective-C/Assets.xcassets/2.imageset/0954d7ffbe081e75cdcf5bdcbc500f50.jpg similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/2.imageset/0954d7ffbe081e75cdcf5bdcbc500f50.jpg rename to Objective-C/Assets.xcassets/2.imageset/0954d7ffbe081e75cdcf5bdcbc500f50.jpg diff --git a/HXPhotoPicker-Demo/Assets.xcassets/2.imageset/Contents.json b/Objective-C/Assets.xcassets/2.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/2.imageset/Contents.json rename to Objective-C/Assets.xcassets/2.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/3.imageset/5576ce269d16bd4422b66c5e75cfbe43 (1).jpg b/Objective-C/Assets.xcassets/3.imageset/5576ce269d16bd4422b66c5e75cfbe43 (1).jpg similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/3.imageset/5576ce269d16bd4422b66c5e75cfbe43 (1).jpg rename to Objective-C/Assets.xcassets/3.imageset/5576ce269d16bd4422b66c5e75cfbe43 (1).jpg diff --git a/HXPhotoPicker-Demo/Assets.xcassets/3.imageset/Contents.json b/Objective-C/Assets.xcassets/3.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/3.imageset/Contents.json rename to Objective-C/Assets.xcassets/3.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/APPCityPlayer_bannerGame.imageset/APPCityPlayer_bannerGame@2x.png b/Objective-C/Assets.xcassets/APPCityPlayer_bannerGame.imageset/APPCityPlayer_bannerGame@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/APPCityPlayer_bannerGame.imageset/APPCityPlayer_bannerGame@2x.png rename to Objective-C/Assets.xcassets/APPCityPlayer_bannerGame.imageset/APPCityPlayer_bannerGame@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/APPCityPlayer_bannerGame.imageset/APPCityPlayer_bannerGame@3x.png b/Objective-C/Assets.xcassets/APPCityPlayer_bannerGame.imageset/APPCityPlayer_bannerGame@3x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/APPCityPlayer_bannerGame.imageset/APPCityPlayer_bannerGame@3x.png rename to Objective-C/Assets.xcassets/APPCityPlayer_bannerGame.imageset/APPCityPlayer_bannerGame@3x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/APPCityPlayer_bannerGame.imageset/Contents.json b/Objective-C/Assets.xcassets/APPCityPlayer_bannerGame.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/APPCityPlayer_bannerGame.imageset/Contents.json rename to Objective-C/Assets.xcassets/APPCityPlayer_bannerGame.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json b/Objective-C/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Objective-C/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/HXPhotoPicker_Icon@2x.png b/Objective-C/Assets.xcassets/AppIcon.appiconset/HXPhotoPicker_Icon@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/HXPhotoPicker_Icon@2x.png rename to Objective-C/Assets.xcassets/AppIcon.appiconset/HXPhotoPicker_Icon@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-1024.png b/Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-1024.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-1024.png rename to Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-1024.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png b/Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png rename to Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png b/Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png rename to Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-Notify@2x.png b/Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-Notify@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-Notify@2x.png rename to Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-Notify@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-Notify@3x.png b/Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-Notify@3x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-Notify@3x.png rename to Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-Notify@3x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png b/Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png rename to Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png b/Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png rename to Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png rename to Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png b/Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png rename to Objective-C/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/Contents.json b/Objective-C/Assets.xcassets/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/Contents.json rename to Objective-C/Assets.xcassets/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/camera_overturn.imageset/Contents.json b/Objective-C/Assets.xcassets/camera_overturn.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/camera_overturn.imageset/Contents.json rename to Objective-C/Assets.xcassets/camera_overturn.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/camera_overturn.imageset/camera_overturn@2x.png b/Objective-C/Assets.xcassets/camera_overturn.imageset/camera_overturn@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/camera_overturn.imageset/camera_overturn@2x.png rename to Objective-C/Assets.xcassets/camera_overturn.imageset/camera_overturn@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/camera_overturn.imageset/camera_overturn@3x.png b/Objective-C/Assets.xcassets/camera_overturn.imageset/camera_overturn@3x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/camera_overturn.imageset/camera_overturn@3x.png rename to Objective-C/Assets.xcassets/camera_overturn.imageset/camera_overturn@3x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/camera_overturn_highlighted.imageset/Contents.json b/Objective-C/Assets.xcassets/camera_overturn_highlighted.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/camera_overturn_highlighted.imageset/Contents.json rename to Objective-C/Assets.xcassets/camera_overturn_highlighted.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/camera_overturn_highlighted.imageset/camera_overturn_highlighted@2x.png b/Objective-C/Assets.xcassets/camera_overturn_highlighted.imageset/camera_overturn_highlighted@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/camera_overturn_highlighted.imageset/camera_overturn_highlighted@2x.png rename to Objective-C/Assets.xcassets/camera_overturn_highlighted.imageset/camera_overturn_highlighted@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/camera_overturn_highlighted.imageset/camera_overturn_highlighted@3x.png b/Objective-C/Assets.xcassets/camera_overturn_highlighted.imageset/camera_overturn_highlighted@3x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/camera_overturn_highlighted.imageset/camera_overturn_highlighted@3x.png rename to Objective-C/Assets.xcassets/camera_overturn_highlighted.imageset/camera_overturn_highlighted@3x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/feed_more_arrow.imageset/Contents.json b/Objective-C/Assets.xcassets/feed_more_arrow.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/feed_more_arrow.imageset/Contents.json rename to Objective-C/Assets.xcassets/feed_more_arrow.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/feed_more_arrow.imageset/feed_more_arrow@2x.png b/Objective-C/Assets.xcassets/feed_more_arrow.imageset/feed_more_arrow@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/feed_more_arrow.imageset/feed_more_arrow@2x.png rename to Objective-C/Assets.xcassets/feed_more_arrow.imageset/feed_more_arrow@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/feed_more_arrow.imageset/feed_more_arrow@3x.png b/Objective-C/Assets.xcassets/feed_more_arrow.imageset/feed_more_arrow@3x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/feed_more_arrow.imageset/feed_more_arrow@3x.png rename to Objective-C/Assets.xcassets/feed_more_arrow.imageset/feed_more_arrow@3x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/headlines_icon_arrow.imageset/Contents.json b/Objective-C/Assets.xcassets/headlines_icon_arrow.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/headlines_icon_arrow.imageset/Contents.json rename to Objective-C/Assets.xcassets/headlines_icon_arrow.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/headlines_icon_arrow.imageset/headlines_icon_arrow@2x.png b/Objective-C/Assets.xcassets/headlines_icon_arrow.imageset/headlines_icon_arrow@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/headlines_icon_arrow.imageset/headlines_icon_arrow@2x.png rename to Objective-C/Assets.xcassets/headlines_icon_arrow.imageset/headlines_icon_arrow@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/headlines_icon_arrow.imageset/headlines_icon_arrow@3x.png b/Objective-C/Assets.xcassets/headlines_icon_arrow.imageset/headlines_icon_arrow@3x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/headlines_icon_arrow.imageset/headlines_icon_arrow@3x.png rename to Objective-C/Assets.xcassets/headlines_icon_arrow.imageset/headlines_icon_arrow@3x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/hotweibo_back_icon.imageset/Contents.json b/Objective-C/Assets.xcassets/hotweibo_back_icon.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/hotweibo_back_icon.imageset/Contents.json rename to Objective-C/Assets.xcassets/hotweibo_back_icon.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/hotweibo_back_icon.imageset/hotweibo_back_icon@2x.png b/Objective-C/Assets.xcassets/hotweibo_back_icon.imageset/hotweibo_back_icon@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/hotweibo_back_icon.imageset/hotweibo_back_icon@2x.png rename to Objective-C/Assets.xcassets/hotweibo_back_icon.imageset/hotweibo_back_icon@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/hotweibo_back_icon.imageset/hotweibo_back_icon@3x.png b/Objective-C/Assets.xcassets/hotweibo_back_icon.imageset/hotweibo_back_icon@3x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/hotweibo_back_icon.imageset/hotweibo_back_icon@3x.png rename to Objective-C/Assets.xcassets/hotweibo_back_icon.imageset/hotweibo_back_icon@3x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/hx_photo_edit_trash_close.imageset/Contents.json b/Objective-C/Assets.xcassets/hx_photo_edit_trash_close.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/hx_photo_edit_trash_close.imageset/Contents.json rename to Objective-C/Assets.xcassets/hx_photo_edit_trash_close.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/hx_photo_edit_trash_close.imageset/hx_photo_edit_trash_close@2x.png b/Objective-C/Assets.xcassets/hx_photo_edit_trash_close.imageset/hx_photo_edit_trash_close@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/hx_photo_edit_trash_close.imageset/hx_photo_edit_trash_close@2x.png rename to Objective-C/Assets.xcassets/hx_photo_edit_trash_close.imageset/hx_photo_edit_trash_close@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/hx_photo_edit_trash_close.imageset/hx_photo_edit_trash_close@3x.png b/Objective-C/Assets.xcassets/hx_photo_edit_trash_close.imageset/hx_photo_edit_trash_close@3x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/hx_photo_edit_trash_close.imageset/hx_photo_edit_trash_close@3x.png rename to Objective-C/Assets.xcassets/hx_photo_edit_trash_close.imageset/hx_photo_edit_trash_close@3x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/hx_photo_edit_trash_open.imageset/Contents.json b/Objective-C/Assets.xcassets/hx_photo_edit_trash_open.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/hx_photo_edit_trash_open.imageset/Contents.json rename to Objective-C/Assets.xcassets/hx_photo_edit_trash_open.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/hx_photo_edit_trash_open.imageset/hx_photo_edit_trash_open@2x.png b/Objective-C/Assets.xcassets/hx_photo_edit_trash_open.imageset/hx_photo_edit_trash_open@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/hx_photo_edit_trash_open.imageset/hx_photo_edit_trash_open@2x.png rename to Objective-C/Assets.xcassets/hx_photo_edit_trash_open.imageset/hx_photo_edit_trash_open@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/hx_photo_edit_trash_open.imageset/hx_photo_edit_trash_open@3x.png b/Objective-C/Assets.xcassets/hx_photo_edit_trash_open.imageset/hx_photo_edit_trash_open@3x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/hx_photo_edit_trash_open.imageset/hx_photo_edit_trash_open@3x.png rename to Objective-C/Assets.xcassets/hx_photo_edit_trash_open.imageset/hx_photo_edit_trash_open@3x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/news_2_merchant_back.imageset/Contents.json b/Objective-C/Assets.xcassets/news_2_merchant_back.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/news_2_merchant_back.imageset/Contents.json rename to Objective-C/Assets.xcassets/news_2_merchant_back.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/news_2_merchant_back.imageset/news_2_merchant_back@2x.png b/Objective-C/Assets.xcassets/news_2_merchant_back.imageset/news_2_merchant_back@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/news_2_merchant_back.imageset/news_2_merchant_back@2x.png rename to Objective-C/Assets.xcassets/news_2_merchant_back.imageset/news_2_merchant_back@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/wx_bg_image.imageset/Contents.json b/Objective-C/Assets.xcassets/wx_bg_image.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/wx_bg_image.imageset/Contents.json rename to Objective-C/Assets.xcassets/wx_bg_image.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/wx_bg_image.imageset/wx_bg_image@2x.png b/Objective-C/Assets.xcassets/wx_bg_image.imageset/wx_bg_image@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/wx_bg_image.imageset/wx_bg_image@2x.png rename to Objective-C/Assets.xcassets/wx_bg_image.imageset/wx_bg_image@2x.png diff --git a/HXPhotoPicker-Demo/Assets.xcassets/wx_head_icon.imageset/Contents.json b/Objective-C/Assets.xcassets/wx_head_icon.imageset/Contents.json similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/wx_head_icon.imageset/Contents.json rename to Objective-C/Assets.xcassets/wx_head_icon.imageset/Contents.json diff --git a/HXPhotoPicker-Demo/Assets.xcassets/wx_head_icon.imageset/wx_head_icon@2x.png b/Objective-C/Assets.xcassets/wx_head_icon.imageset/wx_head_icon@2x.png similarity index 100% rename from HXPhotoPicker-Demo/Assets.xcassets/wx_head_icon.imageset/wx_head_icon@2x.png rename to Objective-C/Assets.xcassets/wx_head_icon.imageset/wx_head_icon@2x.png diff --git a/HXPhotoPicker-Demo/Classes/Demo10ViewController.h b/Objective-C/Classes/Demo10ViewController.h similarity index 89% rename from HXPhotoPicker-Demo/Classes/Demo10ViewController.h rename to Objective-C/Classes/Demo10ViewController.h index 94ca3c0e..324f912e 100644 --- a/HXPhotoPicker-Demo/Classes/Demo10ViewController.h +++ b/Objective-C/Classes/Demo10ViewController.h @@ -1,6 +1,6 @@ // // Demo10ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/7/21. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo10ViewController.m b/Objective-C/Classes/Demo10ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo10ViewController.m rename to Objective-C/Classes/Demo10ViewController.m index ccf0c761..5ad3e3c1 100644 --- a/HXPhotoPicker-Demo/Classes/Demo10ViewController.m +++ b/Objective-C/Classes/Demo10ViewController.m @@ -1,6 +1,6 @@ // // Demo10ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/7/21. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo11ViewController.h b/Objective-C/Classes/Demo11ViewController.h similarity index 89% rename from HXPhotoPicker-Demo/Classes/Demo11ViewController.h rename to Objective-C/Classes/Demo11ViewController.h index 766c326e..d88b6528 100644 --- a/HXPhotoPicker-Demo/Classes/Demo11ViewController.h +++ b/Objective-C/Classes/Demo11ViewController.h @@ -1,6 +1,6 @@ // // Demo11ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/7/21. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo11ViewController.m b/Objective-C/Classes/Demo11ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo11ViewController.m rename to Objective-C/Classes/Demo11ViewController.m index 996d4676..8ee43dec 100644 --- a/HXPhotoPicker-Demo/Classes/Demo11ViewController.m +++ b/Objective-C/Classes/Demo11ViewController.m @@ -1,6 +1,6 @@ // // Demo11ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/7/21. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo11ViewController.xib b/Objective-C/Classes/Demo11ViewController.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/Demo11ViewController.xib rename to Objective-C/Classes/Demo11ViewController.xib diff --git a/HXPhotoPicker-Demo/Classes/Demo12ViewController.h b/Objective-C/Classes/Demo12ViewController.h similarity index 89% rename from HXPhotoPicker-Demo/Classes/Demo12ViewController.h rename to Objective-C/Classes/Demo12ViewController.h index ee11656b..716a214b 100644 --- a/HXPhotoPicker-Demo/Classes/Demo12ViewController.h +++ b/Objective-C/Classes/Demo12ViewController.h @@ -1,6 +1,6 @@ // // Demo12ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/7/24. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo12ViewController.m b/Objective-C/Classes/Demo12ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo12ViewController.m rename to Objective-C/Classes/Demo12ViewController.m index dcfbed94..c21f6b8b 100644 --- a/HXPhotoPicker-Demo/Classes/Demo12ViewController.m +++ b/Objective-C/Classes/Demo12ViewController.m @@ -1,6 +1,6 @@ // // Demo12ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/7/24. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo14ViewController.h b/Objective-C/Classes/Demo14ViewController.h similarity index 91% rename from HXPhotoPicker-Demo/Classes/Demo14ViewController.h rename to Objective-C/Classes/Demo14ViewController.h index af295129..65f4962c 100644 --- a/HXPhotoPicker-Demo/Classes/Demo14ViewController.h +++ b/Objective-C/Classes/Demo14ViewController.h @@ -1,6 +1,6 @@ // // Demo14ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/5/22. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo14ViewController.m b/Objective-C/Classes/Demo14ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo14ViewController.m rename to Objective-C/Classes/Demo14ViewController.m index 34abc8ab..b9c31cbe 100644 --- a/HXPhotoPicker-Demo/Classes/Demo14ViewController.m +++ b/Objective-C/Classes/Demo14ViewController.m @@ -1,6 +1,6 @@ // // Demo14ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/5/22. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo15ViewController.h b/Objective-C/Classes/Demo15ViewController.h similarity index 91% rename from HXPhotoPicker-Demo/Classes/Demo15ViewController.h rename to Objective-C/Classes/Demo15ViewController.h index f8b7b7af..600e05ea 100644 --- a/HXPhotoPicker-Demo/Classes/Demo15ViewController.h +++ b/Objective-C/Classes/Demo15ViewController.h @@ -1,6 +1,6 @@ // // Demo15ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/5/27. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo15ViewController.m b/Objective-C/Classes/Demo15ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo15ViewController.m rename to Objective-C/Classes/Demo15ViewController.m index 060c674b..24fc8627 100644 --- a/HXPhotoPicker-Demo/Classes/Demo15ViewController.m +++ b/Objective-C/Classes/Demo15ViewController.m @@ -1,6 +1,6 @@ // // Demo15ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/5/27. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo1ViewController.h b/Objective-C/Classes/Demo1ViewController.h similarity index 89% rename from HXPhotoPicker-Demo/Classes/Demo1ViewController.h rename to Objective-C/Classes/Demo1ViewController.h index cdca52df..b57915e9 100644 --- a/HXPhotoPicker-Demo/Classes/Demo1ViewController.h +++ b/Objective-C/Classes/Demo1ViewController.h @@ -1,6 +1,6 @@ // // Demo1ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/17. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo1ViewController.m b/Objective-C/Classes/Demo1ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo1ViewController.m rename to Objective-C/Classes/Demo1ViewController.m index 5ec99b53..104603ec 100644 --- a/HXPhotoPicker-Demo/Classes/Demo1ViewController.m +++ b/Objective-C/Classes/Demo1ViewController.m @@ -1,6 +1,6 @@ // // Demo1ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/17. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo1ViewController.xib b/Objective-C/Classes/Demo1ViewController.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/Demo1ViewController.xib rename to Objective-C/Classes/Demo1ViewController.xib diff --git a/HXPhotoPicker-Demo/Classes/Demo2ViewController.h b/Objective-C/Classes/Demo2ViewController.h similarity index 89% rename from HXPhotoPicker-Demo/Classes/Demo2ViewController.h rename to Objective-C/Classes/Demo2ViewController.h index a5cbb6aa..65bc097d 100644 --- a/HXPhotoPicker-Demo/Classes/Demo2ViewController.h +++ b/Objective-C/Classes/Demo2ViewController.h @@ -1,6 +1,6 @@ // // Demo2ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/17. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo2ViewController.m b/Objective-C/Classes/Demo2ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo2ViewController.m rename to Objective-C/Classes/Demo2ViewController.m index 0aaa363b..c1977bce 100644 --- a/HXPhotoPicker-Demo/Classes/Demo2ViewController.m +++ b/Objective-C/Classes/Demo2ViewController.m @@ -1,6 +1,6 @@ // // Demo2ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/17. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo3ViewController.h b/Objective-C/Classes/Demo3ViewController.h similarity index 89% rename from HXPhotoPicker-Demo/Classes/Demo3ViewController.h rename to Objective-C/Classes/Demo3ViewController.h index 4fcc0bf5..42835809 100644 --- a/HXPhotoPicker-Demo/Classes/Demo3ViewController.h +++ b/Objective-C/Classes/Demo3ViewController.h @@ -1,6 +1,6 @@ // // Demo3ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/17. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo3ViewController.m b/Objective-C/Classes/Demo3ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo3ViewController.m rename to Objective-C/Classes/Demo3ViewController.m index ea8bb568..662d7676 100644 --- a/HXPhotoPicker-Demo/Classes/Demo3ViewController.m +++ b/Objective-C/Classes/Demo3ViewController.m @@ -1,6 +1,6 @@ // // Demo3ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/17. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo4ViewController.h b/Objective-C/Classes/Demo4ViewController.h similarity index 89% rename from HXPhotoPicker-Demo/Classes/Demo4ViewController.h rename to Objective-C/Classes/Demo4ViewController.h index c5ae1f05..a350a9a2 100644 --- a/HXPhotoPicker-Demo/Classes/Demo4ViewController.h +++ b/Objective-C/Classes/Demo4ViewController.h @@ -1,6 +1,6 @@ // // Demo4ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/7/1. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo4ViewController.m b/Objective-C/Classes/Demo4ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo4ViewController.m rename to Objective-C/Classes/Demo4ViewController.m index ff37d318..f6fce29c 100644 --- a/HXPhotoPicker-Demo/Classes/Demo4ViewController.m +++ b/Objective-C/Classes/Demo4ViewController.m @@ -1,6 +1,6 @@ // // Demo4ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/7/1. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo4ViewController.xib b/Objective-C/Classes/Demo4ViewController.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/Demo4ViewController.xib rename to Objective-C/Classes/Demo4ViewController.xib diff --git a/HXPhotoPicker-Demo/Classes/Demo5ViewController.h b/Objective-C/Classes/Demo5ViewController.h similarity index 89% rename from HXPhotoPicker-Demo/Classes/Demo5ViewController.h rename to Objective-C/Classes/Demo5ViewController.h index 54fe4c33..07937414 100644 --- a/HXPhotoPicker-Demo/Classes/Demo5ViewController.h +++ b/Objective-C/Classes/Demo5ViewController.h @@ -1,6 +1,6 @@ // // Demo5ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/7/5. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo5ViewController.m b/Objective-C/Classes/Demo5ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo5ViewController.m rename to Objective-C/Classes/Demo5ViewController.m index 3132f468..a36b053d 100644 --- a/HXPhotoPicker-Demo/Classes/Demo5ViewController.m +++ b/Objective-C/Classes/Demo5ViewController.m @@ -1,6 +1,6 @@ // // Demo5ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/7/5. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo6SubViewController.h b/Objective-C/Classes/Demo6SubViewController.h similarity index 92% rename from HXPhotoPicker-Demo/Classes/Demo6SubViewController.h rename to Objective-C/Classes/Demo6SubViewController.h index 4a1a8682..0e085b31 100644 --- a/HXPhotoPicker-Demo/Classes/Demo6SubViewController.h +++ b/Objective-C/Classes/Demo6SubViewController.h @@ -1,6 +1,6 @@ // // Demo6SubViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/7/26. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo6SubViewController.m b/Objective-C/Classes/Demo6SubViewController.m similarity index 93% rename from HXPhotoPicker-Demo/Classes/Demo6SubViewController.m rename to Objective-C/Classes/Demo6SubViewController.m index 3eff1979..f1a2c0e4 100644 --- a/HXPhotoPicker-Demo/Classes/Demo6SubViewController.m +++ b/Objective-C/Classes/Demo6SubViewController.m @@ -1,6 +1,6 @@ // // Demo6SubViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/7/26. // Copyright © 2017年 洪欣. All rights reserved. @@ -81,6 +81,9 @@ - (void)viewDidLoad { self.scrollView = scrollView; CGFloat width = scrollView.frame.size.width; + self.manager.configuration.photoEditConfigur.onlyCliping = NO; + self.manager.configuration.photoEditConfigur.aspectRatio = HXPhotoEditAspectRatioType_None; + self.manager.configuration.photoEditConfigur.isRoundCliping = NO; HXPhotoView *photoView = [[HXPhotoView alloc] initWithFrame:CGRectMake(kPhotoViewMargin, kPhotoViewMargin, width - kPhotoViewMargin * 2, 0) manager:self.manager]; photoView.delegate = self; photoView.outerCamera = YES; diff --git a/HXPhotoPicker-Demo/Classes/Demo6ViewController.h b/Objective-C/Classes/Demo6ViewController.h similarity index 89% rename from HXPhotoPicker-Demo/Classes/Demo6ViewController.h rename to Objective-C/Classes/Demo6ViewController.h index ce9c8dae..0e77977c 100644 --- a/HXPhotoPicker-Demo/Classes/Demo6ViewController.h +++ b/Objective-C/Classes/Demo6ViewController.h @@ -1,6 +1,6 @@ // // Demo6ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/7/26. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo6ViewController.m b/Objective-C/Classes/Demo6ViewController.m similarity index 96% rename from HXPhotoPicker-Demo/Classes/Demo6ViewController.m rename to Objective-C/Classes/Demo6ViewController.m index c94959f9..8dbff758 100644 --- a/HXPhotoPicker-Demo/Classes/Demo6ViewController.m +++ b/Objective-C/Classes/Demo6ViewController.m @@ -1,6 +1,6 @@ // // Demo6ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/7/26. // Copyright © 2017年 洪欣. All rights reserved. @@ -57,6 +57,9 @@ - (HXPhotoManager *)manager { if (!_manager) { _manager = [[HXPhotoManager alloc] initWithType:HXPhotoManagerSelectedTypePhotoAndVideo]; _manager.configuration.type = HXConfigurationTypeWXMoment; + _manager.configuration.photoEditConfigur.onlyCliping = YES; + _manager.configuration.photoEditConfigur.aspectRatio = HXPhotoEditAspectRatioType_1x1; + _manager.configuration.photoEditConfigur.isRoundCliping = YES; } return _manager; } diff --git a/HXPhotoPicker-Demo/Classes/Demo7ViewController.h b/Objective-C/Classes/Demo7ViewController.h similarity index 89% rename from HXPhotoPicker-Demo/Classes/Demo7ViewController.h rename to Objective-C/Classes/Demo7ViewController.h index b9124574..b1490393 100644 --- a/HXPhotoPicker-Demo/Classes/Demo7ViewController.h +++ b/Objective-C/Classes/Demo7ViewController.h @@ -1,6 +1,6 @@ // // Demo7ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/9/2. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo7ViewController.m b/Objective-C/Classes/Demo7ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo7ViewController.m rename to Objective-C/Classes/Demo7ViewController.m index 094186d5..c454398d 100644 --- a/HXPhotoPicker-Demo/Classes/Demo7ViewController.m +++ b/Objective-C/Classes/Demo7ViewController.m @@ -1,6 +1,6 @@ // // Demo7ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/9/2. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo8ViewController.h b/Objective-C/Classes/Demo8ViewController.h similarity index 89% rename from HXPhotoPicker-Demo/Classes/Demo8ViewController.h rename to Objective-C/Classes/Demo8ViewController.h index 2326a296..062c8c2a 100644 --- a/HXPhotoPicker-Demo/Classes/Demo8ViewController.h +++ b/Objective-C/Classes/Demo8ViewController.h @@ -1,6 +1,6 @@ // // Demo8ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/9/14. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo8ViewController.m b/Objective-C/Classes/Demo8ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo8ViewController.m rename to Objective-C/Classes/Demo8ViewController.m index 99a94a45..12a8a27b 100644 --- a/HXPhotoPicker-Demo/Classes/Demo8ViewController.m +++ b/Objective-C/Classes/Demo8ViewController.m @@ -1,6 +1,6 @@ // // Demo8ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2017/9/14. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo9Model.h b/Objective-C/Classes/Demo9Model.h similarity index 98% rename from HXPhotoPicker-Demo/Classes/Demo9Model.h rename to Objective-C/Classes/Demo9Model.h index ced83e6f..48d41101 100644 --- a/HXPhotoPicker-Demo/Classes/Demo9Model.h +++ b/Objective-C/Classes/Demo9Model.h @@ -1,6 +1,6 @@ // // Demo9Model.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/2/14. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo9Model.m b/Objective-C/Classes/Demo9Model.m similarity index 98% rename from HXPhotoPicker-Demo/Classes/Demo9Model.m rename to Objective-C/Classes/Demo9Model.m index 61864979..c34a074c 100644 --- a/HXPhotoPicker-Demo/Classes/Demo9Model.m +++ b/Objective-C/Classes/Demo9Model.m @@ -1,6 +1,6 @@ // // Demo9Model.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/2/14. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo9ViewCell.h b/Objective-C/Classes/Demo9ViewCell.h similarity index 94% rename from HXPhotoPicker-Demo/Classes/Demo9ViewCell.h rename to Objective-C/Classes/Demo9ViewCell.h index a0d0dd59..925089a4 100644 --- a/HXPhotoPicker-Demo/Classes/Demo9ViewCell.h +++ b/Objective-C/Classes/Demo9ViewCell.h @@ -1,6 +1,6 @@ // // Demo9ViewCell.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/2/14. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo9ViewCell.m b/Objective-C/Classes/Demo9ViewCell.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo9ViewCell.m rename to Objective-C/Classes/Demo9ViewCell.m index 6bb395e8..d39d6961 100644 --- a/HXPhotoPicker-Demo/Classes/Demo9ViewCell.m +++ b/Objective-C/Classes/Demo9ViewCell.m @@ -1,6 +1,6 @@ // // Demo9ViewCell.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/2/14. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo9ViewController.h b/Objective-C/Classes/Demo9ViewController.h similarity index 89% rename from HXPhotoPicker-Demo/Classes/Demo9ViewController.h rename to Objective-C/Classes/Demo9ViewController.h index 7411b412..ded2f52d 100644 --- a/HXPhotoPicker-Demo/Classes/Demo9ViewController.h +++ b/Objective-C/Classes/Demo9ViewController.h @@ -1,6 +1,6 @@ // // Demo9ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/2/14. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/Demo9ViewController.m b/Objective-C/Classes/Demo9ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/Demo9ViewController.m rename to Objective-C/Classes/Demo9ViewController.m index 7cc47d76..ba48da35 100644 --- a/HXPhotoPicker-Demo/Classes/Demo9ViewController.m +++ b/Objective-C/Classes/Demo9ViewController.m @@ -1,6 +1,6 @@ // // Demo9ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2018/2/14. // Copyright © 2018年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/SettingViewController.h b/Objective-C/Classes/SettingViewController.h similarity index 94% rename from HXPhotoPicker-Demo/Classes/SettingViewController.h rename to Objective-C/Classes/SettingViewController.h index 735b4541..8d825af3 100644 --- a/HXPhotoPicker-Demo/Classes/SettingViewController.h +++ b/Objective-C/Classes/SettingViewController.h @@ -1,6 +1,6 @@ // // SettingViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/2/2. // Copyright © 2019年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/SettingViewController.m b/Objective-C/Classes/SettingViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/SettingViewController.m rename to Objective-C/Classes/SettingViewController.m index 1de71bea..e10766c8 100644 --- a/HXPhotoPicker-Demo/Classes/SettingViewController.m +++ b/Objective-C/Classes/SettingViewController.m @@ -1,6 +1,6 @@ // // SettingViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2019/2/2. // Copyright © 2019年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/SettingViewController.xib b/Objective-C/Classes/SettingViewController.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/SettingViewController.xib rename to Objective-C/Classes/SettingViewController.xib diff --git a/HXPhotoPicker-Demo/Classes/UITextView+Placeholder.h b/Objective-C/Classes/UITextView+Placeholder.h similarity index 100% rename from HXPhotoPicker-Demo/Classes/UITextView+Placeholder.h rename to Objective-C/Classes/UITextView+Placeholder.h diff --git a/HXPhotoPicker-Demo/Classes/UITextView+Placeholder.m b/Objective-C/Classes/UITextView+Placeholder.m similarity index 100% rename from HXPhotoPicker-Demo/Classes/UITextView+Placeholder.m rename to Objective-C/Classes/UITextView+Placeholder.m diff --git a/HXPhotoPicker-Demo/Classes/ViewController.h b/Objective-C/Classes/ViewController.h similarity index 88% rename from HXPhotoPicker-Demo/Classes/ViewController.h rename to Objective-C/Classes/ViewController.h index b155952f..466bc5b4 100644 --- a/HXPhotoPicker-Demo/Classes/ViewController.h +++ b/Objective-C/Classes/ViewController.h @@ -1,6 +1,6 @@ // // ViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/ViewController.m b/Objective-C/Classes/ViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/ViewController.m rename to Objective-C/Classes/ViewController.m index eab4a65a..1ef739eb 100644 --- a/HXPhotoPicker-Demo/Classes/ViewController.m +++ b/Objective-C/Classes/ViewController.m @@ -1,6 +1,6 @@ // // ViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/WxMomentHeaderView.h b/Objective-C/Classes/WxMomentHeaderView.h similarity index 93% rename from HXPhotoPicker-Demo/Classes/WxMomentHeaderView.h rename to Objective-C/Classes/WxMomentHeaderView.h index 1fee3695..97e524b0 100644 --- a/HXPhotoPicker-Demo/Classes/WxMomentHeaderView.h +++ b/Objective-C/Classes/WxMomentHeaderView.h @@ -1,6 +1,6 @@ // // WxMomentHeaderView.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/8/4. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/WxMomentHeaderView.m b/Objective-C/Classes/WxMomentHeaderView.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/WxMomentHeaderView.m rename to Objective-C/Classes/WxMomentHeaderView.m index b07deda3..459941a4 100644 --- a/HXPhotoPicker-Demo/Classes/WxMomentHeaderView.m +++ b/Objective-C/Classes/WxMomentHeaderView.m @@ -1,6 +1,6 @@ // // WxMomentHeaderView.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/8/4. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/WxMomentHeaderView.xib b/Objective-C/Classes/WxMomentHeaderView.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/WxMomentHeaderView.xib rename to Objective-C/Classes/WxMomentHeaderView.xib diff --git a/HXPhotoPicker-Demo/Classes/WxMomentPublishViewController.h b/Objective-C/Classes/WxMomentPublishViewController.h similarity index 93% rename from HXPhotoPicker-Demo/Classes/WxMomentPublishViewController.h rename to Objective-C/Classes/WxMomentPublishViewController.h index e813799b..78d0b481 100644 --- a/HXPhotoPicker-Demo/Classes/WxMomentPublishViewController.h +++ b/Objective-C/Classes/WxMomentPublishViewController.h @@ -1,6 +1,6 @@ // // WxMomentPublishViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/8/4. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/WxMomentPublishViewController.m b/Objective-C/Classes/WxMomentPublishViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/WxMomentPublishViewController.m rename to Objective-C/Classes/WxMomentPublishViewController.m index a1f4a398..2ea2af4d 100644 --- a/HXPhotoPicker-Demo/Classes/WxMomentPublishViewController.m +++ b/Objective-C/Classes/WxMomentPublishViewController.m @@ -1,6 +1,6 @@ // // WxMomentPublishViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/8/4. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/WxMomentPublishViewController.xib b/Objective-C/Classes/WxMomentPublishViewController.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/WxMomentPublishViewController.xib rename to Objective-C/Classes/WxMomentPublishViewController.xib diff --git a/HXPhotoPicker-Demo/Classes/WxMomentViewCell.h b/Objective-C/Classes/WxMomentViewCell.h similarity index 90% rename from HXPhotoPicker-Demo/Classes/WxMomentViewCell.h rename to Objective-C/Classes/WxMomentViewCell.h index 5d4ffe6e..e66b6d7b 100644 --- a/HXPhotoPicker-Demo/Classes/WxMomentViewCell.h +++ b/Objective-C/Classes/WxMomentViewCell.h @@ -1,6 +1,6 @@ // // WxMomentViewCell.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/8/4. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/WxMomentViewCell.m b/Objective-C/Classes/WxMomentViewCell.m similarity index 94% rename from HXPhotoPicker-Demo/Classes/WxMomentViewCell.m rename to Objective-C/Classes/WxMomentViewCell.m index b962e40c..2105a138 100644 --- a/HXPhotoPicker-Demo/Classes/WxMomentViewCell.m +++ b/Objective-C/Classes/WxMomentViewCell.m @@ -1,6 +1,6 @@ // // WxMomentViewCell.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/8/4. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/WxMomentViewCell.xib b/Objective-C/Classes/WxMomentViewCell.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/WxMomentViewCell.xib rename to Objective-C/Classes/WxMomentViewCell.xib diff --git a/HXPhotoPicker-Demo/Classes/WxMomentViewController.h b/Objective-C/Classes/WxMomentViewController.h similarity index 91% rename from HXPhotoPicker-Demo/Classes/WxMomentViewController.h rename to Objective-C/Classes/WxMomentViewController.h index 2769cbef..ca1e11a8 100644 --- a/HXPhotoPicker-Demo/Classes/WxMomentViewController.h +++ b/Objective-C/Classes/WxMomentViewController.h @@ -1,6 +1,6 @@ // // WxMomentViewController.h -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/8/4. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/WxMomentViewController.m b/Objective-C/Classes/WxMomentViewController.m similarity index 99% rename from HXPhotoPicker-Demo/Classes/WxMomentViewController.m rename to Objective-C/Classes/WxMomentViewController.m index 0f5afe4c..80bcebeb 100644 --- a/HXPhotoPicker-Demo/Classes/WxMomentViewController.m +++ b/Objective-C/Classes/WxMomentViewController.m @@ -1,6 +1,6 @@ // // WxMomentViewController.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 2020/8/4. // Copyright © 2020 洪欣. All rights reserved. diff --git a/HXPhotoPicker-Demo/Classes/WxMomentViewController.xib b/Objective-C/Classes/WxMomentViewController.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/WxMomentViewController.xib rename to Objective-C/Classes/WxMomentViewController.xib diff --git a/HXPhotoPicker-Demo/Classes/YYFPSLabel.h b/Objective-C/Classes/YYFPSLabel.h similarity index 100% rename from HXPhotoPicker-Demo/Classes/YYFPSLabel.h rename to Objective-C/Classes/YYFPSLabel.h diff --git a/HXPhotoPicker-Demo/Classes/YYFPSLabel.m b/Objective-C/Classes/YYFPSLabel.m similarity index 100% rename from HXPhotoPicker-Demo/Classes/YYFPSLabel.m rename to Objective-C/Classes/YYFPSLabel.m diff --git a/HXPhotoPicker-Demo/Classes/YYWeakProxy.h b/Objective-C/Classes/YYWeakProxy.h similarity index 100% rename from HXPhotoPicker-Demo/Classes/YYWeakProxy.h rename to Objective-C/Classes/YYWeakProxy.h diff --git a/HXPhotoPicker-Demo/Classes/YYWeakProxy.m b/Objective-C/Classes/YYWeakProxy.m similarity index 100% rename from HXPhotoPicker-Demo/Classes/YYWeakProxy.m rename to Objective-C/Classes/YYWeakProxy.m diff --git a/HXPhotoPicker-Demo/Classes/assets/0AA996F1-6566-4CA3-845F-5698DD9726A0.jpg b/Objective-C/Classes/assets/0AA996F1-6566-4CA3-845F-5698DD9726A0.jpg similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/0AA996F1-6566-4CA3-845F-5698DD9726A0.jpg rename to Objective-C/Classes/assets/0AA996F1-6566-4CA3-845F-5698DD9726A0.jpg diff --git a/HXPhotoPicker-Demo/Classes/assets/9f2f070828381f30ed5bacf8ab014c086e06f024.jpg b/Objective-C/Classes/assets/9f2f070828381f30ed5bacf8ab014c086e06f024.jpg similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/9f2f070828381f30ed5bacf8ab014c086e06f024.jpg rename to Objective-C/Classes/assets/9f2f070828381f30ed5bacf8ab014c086e06f024.jpg diff --git a/HXPhotoPicker-Demo/Classes/assets/HXCameraBottomView.xib b/Objective-C/Classes/assets/HXCameraBottomView.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/HXCameraBottomView.xib rename to Objective-C/Classes/assets/HXCameraBottomView.xib diff --git a/HXPhotoPicker-Demo/Classes/assets/HXPhotoEditChartletContentViewCell.xib b/Objective-C/Classes/assets/HXPhotoEditChartletContentViewCell.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/HXPhotoEditChartletContentViewCell.xib rename to Objective-C/Classes/assets/HXPhotoEditChartletContentViewCell.xib diff --git a/HXPhotoPicker-Demo/Classes/assets/HXPhotoEditChartletListView.xib b/Objective-C/Classes/assets/HXPhotoEditChartletListView.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/HXPhotoEditChartletListView.xib rename to Objective-C/Classes/assets/HXPhotoEditChartletListView.xib diff --git a/HXPhotoPicker-Demo/Classes/assets/HXPhotoEditChartletPreviewView.xib b/Objective-C/Classes/assets/HXPhotoEditChartletPreviewView.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/HXPhotoEditChartletPreviewView.xib rename to Objective-C/Classes/assets/HXPhotoEditChartletPreviewView.xib diff --git a/HXPhotoPicker-Demo/Classes/assets/HXPhotoEditClippingToolBar.xib b/Objective-C/Classes/assets/HXPhotoEditClippingToolBar.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/HXPhotoEditClippingToolBar.xib rename to Objective-C/Classes/assets/HXPhotoEditClippingToolBar.xib diff --git a/HXPhotoPicker-Demo/Classes/assets/HXPhotoEditGraffitiColorSizeView.xib b/Objective-C/Classes/assets/HXPhotoEditGraffitiColorSizeView.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/HXPhotoEditGraffitiColorSizeView.xib rename to Objective-C/Classes/assets/HXPhotoEditGraffitiColorSizeView.xib diff --git a/HXPhotoPicker-Demo/Classes/assets/HXPhotoEditGraffitiColorView.xib b/Objective-C/Classes/assets/HXPhotoEditGraffitiColorView.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/HXPhotoEditGraffitiColorView.xib rename to Objective-C/Classes/assets/HXPhotoEditGraffitiColorView.xib diff --git a/HXPhotoPicker-Demo/Classes/assets/HXPhotoEditGraffitiColorViewCell.xib b/Objective-C/Classes/assets/HXPhotoEditGraffitiColorViewCell.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/HXPhotoEditGraffitiColorViewCell.xib rename to Objective-C/Classes/assets/HXPhotoEditGraffitiColorViewCell.xib diff --git a/HXPhotoPicker-Demo/Classes/assets/HXPhotoEditMosaicView.xib b/Objective-C/Classes/assets/HXPhotoEditMosaicView.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/HXPhotoEditMosaicView.xib rename to Objective-C/Classes/assets/HXPhotoEditMosaicView.xib diff --git a/HXPhotoPicker-Demo/Classes/assets/HXPhotoEditStickerTrashView.xib b/Objective-C/Classes/assets/HXPhotoEditStickerTrashView.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/HXPhotoEditStickerTrashView.xib rename to Objective-C/Classes/assets/HXPhotoEditStickerTrashView.xib diff --git a/HXPhotoPicker-Demo/Classes/assets/HXPhotoEditTextView.xib b/Objective-C/Classes/assets/HXPhotoEditTextView.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/HXPhotoEditTextView.xib rename to Objective-C/Classes/assets/HXPhotoEditTextView.xib diff --git a/HXPhotoPicker-Demo/Classes/assets/HX_PhotoEditBottomView.xib b/Objective-C/Classes/assets/HX_PhotoEditBottomView.xib similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/HX_PhotoEditBottomView.xib rename to Objective-C/Classes/assets/HX_PhotoEditBottomView.xib diff --git a/HXPhotoPicker-Demo/Classes/assets/IMG_0168.GIF b/Objective-C/Classes/assets/IMG_0168.GIF similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/IMG_0168.GIF rename to Objective-C/Classes/assets/IMG_0168.GIF diff --git a/HXPhotoPicker-Demo/Classes/assets/LocalSampleVideo.mp4 b/Objective-C/Classes/assets/LocalSampleVideo.mp4 similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/LocalSampleVideo.mp4 rename to Objective-C/Classes/assets/LocalSampleVideo.mp4 diff --git a/HXPhotoPicker-Demo/Classes/assets/c81.mp4 b/Objective-C/Classes/assets/c81.mp4 similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/c81.mp4 rename to Objective-C/Classes/assets/c81.mp4 diff --git a/HXPhotoPicker-Demo/Classes/assets/d87.jpeg b/Objective-C/Classes/assets/d87.jpeg similarity index 100% rename from HXPhotoPicker-Demo/Classes/assets/d87.jpeg rename to Objective-C/Classes/assets/d87.jpeg diff --git a/HXPhotoPicker-Demo/Info.plist b/Objective-C/Info.plist similarity index 100% rename from HXPhotoPicker-Demo/Info.plist rename to Objective-C/Info.plist diff --git a/HXPhotoPicker-Demo/main.m b/Objective-C/main.m similarity index 92% rename from HXPhotoPicker-Demo/main.m rename to Objective-C/main.m index 63d4858f..a3099f3b 100644 --- a/HXPhotoPicker-Demo/main.m +++ b/Objective-C/main.m @@ -1,6 +1,6 @@ // // main.m -// HXPhotoPicker-Demo +// HXPhotoPickerExample // // Created by 洪欣 on 17/2/8. // Copyright © 2017年 洪欣. All rights reserved. diff --git a/Podfile b/Podfile index 85d2c661..21e1eb4c 100644 --- a/Podfile +++ b/Podfile @@ -1,6 +1,6 @@ source 'https://github.com/CocoaPods/Specs.git' platform:ios,'8.0' -target "HXPhotoPicker-Demo" do +target "HXPhotoPickerExample" do #ios14下出现显示空白需要将SDWebImage升级到最新版,YYWebImage由于没人维护所以需要替换成SDWebImage pod 'SDWebImage' pod 'AFNetworking' diff --git a/Podfile.lock b/Podfile.lock index 0d5fc1a2..57292b70 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -35,6 +35,6 @@ SPEC CHECKSUMS: Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 SDWebImage: 0b42b8719ab0c5257177d5894306e8a336b21cbb -PODFILE CHECKSUM: 617e1a56912251549edd513d7d9a7e4fd384a9b4 +PODFILE CHECKSUM: f52e65093523abc9a79ffc212d4bb37e27096887 COCOAPODS: 1.9.1 diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 0d5fc1a2..57292b70 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -35,6 +35,6 @@ SPEC CHECKSUMS: Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 SDWebImage: 0b42b8719ab0c5257177d5894306e8a336b21cbb -PODFILE CHECKSUM: 617e1a56912251549edd513d7d9a7e4fd384a9b4 +PODFILE CHECKSUM: f52e65093523abc9a79ffc212d4bb37e27096887 COCOAPODS: 1.9.1 diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index 16e6240b..df2c85cc 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -109,8 +109,8 @@ 757EBD77D300E8FAF251BF89058A0063 /* SDWebImageOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 6537BFFC56F7E8F7BE89C49BF733AFCF /* SDWebImageOperation.h */; settings = {ATTRIBUTES = (Project, ); }; }; 759335CEF832A5F72222213C7AC7FFEA /* SDAsyncBlockOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = B05699FCB7BABF634770691B55AE5168 /* SDAsyncBlockOperation.h */; settings = {ATTRIBUTES = (Project, ); }; }; 787AE202E71EF711783ABDEAA6D52204 /* SDImageAPNGCoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E3814F1103F47907F878ED48B197CC /* SDImageAPNGCoder.m */; }; + 78F72C32BF287269D91D2ABA8267DF5A /* Pods-HXPhotoPickerExample-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5742B6BAE980582B8893E0BC9AF5ED94 /* Pods-HXPhotoPickerExample-dummy.m */; }; 7CF2AC7A3B3ED03B30C1E4ED662B0551 /* MASLayoutConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C4D1BD07088BD50F491ACEC77FBB0D /* MASLayoutConstraint.h */; settings = {ATTRIBUTES = (Project, ); }; }; - 7F432AB8243A5C1341631177297DB205 /* Pods-HXPhotoPicker-Demo-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = D2FC40E69BF17726FF80D4F13855910F /* Pods-HXPhotoPicker-Demo-dummy.m */; }; 80B7FBA8291E76D74A651249A0E211FC /* SDMemoryCache.m in Sources */ = {isa = PBXBuildFile; fileRef = DE2D9AAF7FE0EFFABA65D763F2DF541D /* SDMemoryCache.m */; }; 81F811A56B6724F7E8E2D25364E595E3 /* NSArray+MASShorthandAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 53C603440637E006422B6A09F7FA0EBC /* NSArray+MASShorthandAdditions.h */; settings = {ATTRIBUTES = (Project, ); }; }; 8231FDD98A7D1659F4FA5788AFEEE6DF /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 02C99D6C6F46E7599C5CEF0125324CF7 /* AFHTTPSessionManager.m */; }; @@ -215,32 +215,33 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1E506C1B1B6D1516D7A7482C37CC275A /* PBXContainerItemProxy */ = { + 2EBEB7B6FFBEDBFEEB76187D419FD20E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; remoteGlobalIDString = 55AF53E6C77A10ED4985E04D74A8878E; remoteInfo = Masonry; }; - 2E5750E566F44C1FE96B1BCD04202316 /* PBXContainerItemProxy */ = { + 982DBCE866CCF7676D2910524B381F51 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; - remoteGlobalIDString = 0130B3724283586C0E9D2A112D4F2AA1; - remoteInfo = AFNetworking; + remoteGlobalIDString = 3847153A6E5EEFB86565BA840768F429; + remoteInfo = SDWebImage; }; - 69E4F936D18AB2AC264CED14AABF0B56 /* PBXContainerItemProxy */ = { + B6C3D58D800432AC1FF2BA72A41A2657 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; - remoteGlobalIDString = 3847153A6E5EEFB86565BA840768F429; - remoteInfo = SDWebImage; + remoteGlobalIDString = 0130B3724283586C0E9D2A112D4F2AA1; + remoteInfo = AFNetworking; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 00197B51ECC6BD3BFC5D448DCB16DB24 /* AFNetworking-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AFNetworking-prefix.pch"; sourceTree = ""; }; 0133C557D78312856E2ABFD3AC598C92 /* AFCompatibilityMacros.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFCompatibilityMacros.h; path = AFNetworking/AFCompatibilityMacros.h; sourceTree = ""; }; + 01A31513A870508886C637E7445D78F5 /* Pods-HXPhotoPickerExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HXPhotoPickerExample.release.xcconfig"; sourceTree = ""; }; 02C99D6C6F46E7599C5CEF0125324CF7 /* AFHTTPSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFHTTPSessionManager.m; path = AFNetworking/AFHTTPSessionManager.m; sourceTree = ""; }; 043A7FA41B5FED4B8EADC046BDB71277 /* SDImageLoadersManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDImageLoadersManager.m; path = SDWebImage/Core/SDImageLoadersManager.m; sourceTree = ""; }; 049D153784628198BFD163BAC151B2B4 /* UIImage+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+AFNetworking.h"; path = "UIKit+AFNetworking/UIImage+AFNetworking.h"; sourceTree = ""; }; @@ -256,6 +257,7 @@ 102832D20950596140FD90E604592489 /* SDWebImageDownloaderResponseModifier.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDownloaderResponseModifier.h; path = SDWebImage/Core/SDWebImageDownloaderResponseModifier.h; sourceTree = ""; }; 11F6693B0B8148D439064AB4A6003AA0 /* SDImageCoderHelper.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDImageCoderHelper.m; path = SDWebImage/Core/SDImageCoderHelper.m; sourceTree = ""; }; 13A1F45002BCDD56FAB0CC103D0992D3 /* AFURLSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFURLSessionManager.m; path = AFNetworking/AFURLSessionManager.m; sourceTree = ""; }; + 1487CBC234378493AED9BADE98D51AE4 /* Pods-HXPhotoPickerExample-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-HXPhotoPickerExample-acknowledgements.plist"; sourceTree = ""; }; 17C2B2B69743FACFBBA502AAB7754EA3 /* SDImageAWebPCoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDImageAWebPCoder.h; path = SDWebImage/Core/SDImageAWebPCoder.h; sourceTree = ""; }; 17EFABD07C2702A0ACF7E2C207D23714 /* UIImage+GIF.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+GIF.h"; path = "SDWebImage/Core/UIImage+GIF.h"; sourceTree = ""; }; 1977D50F229D29DE5CE1F4C214737000 /* SDWebImageDownloader.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDownloader.m; path = SDWebImage/Core/SDWebImageDownloader.m; sourceTree = ""; }; @@ -312,6 +314,7 @@ 53C603440637E006422B6A09F7FA0EBC /* NSArray+MASShorthandAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSArray+MASShorthandAdditions.h"; path = "Masonry/NSArray+MASShorthandAdditions.h"; sourceTree = ""; }; 53E3C6E2967FC31148C5F3D3128E5D89 /* SDDisplayLink.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDDisplayLink.h; path = SDWebImage/Private/SDDisplayLink.h; sourceTree = ""; }; 564B2A071E42DB2C3926BBB7AC5D2751 /* NSImage+Compatibility.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSImage+Compatibility.h"; path = "SDWebImage/Core/NSImage+Compatibility.h"; sourceTree = ""; }; + 5742B6BAE980582B8893E0BC9AF5ED94 /* Pods-HXPhotoPickerExample-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-HXPhotoPickerExample-dummy.m"; sourceTree = ""; }; 57ECBB99AC8DEB24DB96FEE7E28C8383 /* SDWebImageDownloaderOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageDownloaderOperation.h; path = SDWebImage/Core/SDWebImageDownloaderOperation.h; sourceTree = ""; }; 59FF948DEA5D99637271067396EE10FA /* SDWebImageDownloaderRequestModifier.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDownloaderRequestModifier.m; path = SDWebImage/Core/SDWebImageDownloaderRequestModifier.m; sourceTree = ""; }; 5B93239215164F796A0F447EAE75992D /* UIProgressView+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIProgressView+AFNetworking.h"; path = "UIKit+AFNetworking/UIProgressView+AFNetworking.h"; sourceTree = ""; }; @@ -341,6 +344,7 @@ 756D245450F443CCECE6F3B44C25DF44 /* AFURLRequestSerialization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AFURLRequestSerialization.h; path = AFNetworking/AFURLRequestSerialization.h; sourceTree = ""; }; 76207F760D33180302EE9BC0126D0E4F /* SDFileAttributeHelper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDFileAttributeHelper.h; path = SDWebImage/Private/SDFileAttributeHelper.h; sourceTree = ""; }; 7752B1A4A1D5BA41B88BB71837E40A9D /* NSLayoutConstraint+MASDebugAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSLayoutConstraint+MASDebugAdditions.h"; path = "Masonry/NSLayoutConstraint+MASDebugAdditions.h"; sourceTree = ""; }; + 77DE95D52455539E87518B28C811417B /* Pods-HXPhotoPickerExample-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-HXPhotoPickerExample-acknowledgements.markdown"; sourceTree = ""; }; 78FBCE16EFAA14631A0A8EBDA7B34CA5 /* Masonry.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Masonry.release.xcconfig; sourceTree = ""; }; 7A034B1D388D38BC67150D0528937C2D /* SDAnimatedImagePlayer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDAnimatedImagePlayer.h; path = SDWebImage/Core/SDAnimatedImagePlayer.h; sourceTree = ""; }; 7AC6CBDDF60CE8432F2D42A404EFD010 /* UIView+WebCache.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+WebCache.h"; path = "SDWebImage/Core/UIView+WebCache.h"; sourceTree = ""; }; @@ -380,7 +384,6 @@ 9F7C2B08065EA79ADC99DC562ACD4BE7 /* SDWebImageManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageManager.m; path = SDWebImage/Core/SDWebImageManager.m; sourceTree = ""; }; 9F9194C11CB993049C624881E3FAC198 /* SDImageAssetManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDImageAssetManager.m; path = SDWebImage/Private/SDImageAssetManager.m; sourceTree = ""; }; A207E5AB19D940ACE41F06A3BBC84B78 /* SDWebImageOptionsProcessor.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageOptionsProcessor.m; path = SDWebImage/Core/SDWebImageOptionsProcessor.m; sourceTree = ""; }; - A287B06C6AC26719CF1CEC851E493254 /* Pods-HXPhotoPicker-Demo-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-HXPhotoPicker-Demo-acknowledgements.markdown"; sourceTree = ""; }; A2DF4F8CE438C27F6E90D3C4F1122A22 /* NSBezierPath+SDRoundedCorners.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSBezierPath+SDRoundedCorners.h"; path = "SDWebImage/Private/NSBezierPath+SDRoundedCorners.h"; sourceTree = ""; }; A3777E8227AAF1DC3B488F70DC3F1412 /* SDImageCachesManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDImageCachesManager.m; path = SDWebImage/Core/SDImageCachesManager.m; sourceTree = ""; }; A4FA15D44DF6BAC7550EDEED10862AA3 /* libAFNetworking.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libAFNetworking.a; path = libAFNetworking.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -395,7 +398,6 @@ AA5F48E28F6527629331ED946A87D04A /* SDWebImage.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SDWebImage.release.xcconfig; sourceTree = ""; }; AAF4EDBB614164B0B9F34225878F2699 /* AFNetworking.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = AFNetworking.release.xcconfig; sourceTree = ""; }; AC7493D7A06747B038AA6BBAC2D2A5A0 /* SDImageFrame.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDImageFrame.h; path = SDWebImage/Core/SDImageFrame.h; sourceTree = ""; }; - AC8C6280DA088CC7CE34E0F42C6FA063 /* Pods-HXPhotoPicker-Demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HXPhotoPicker-Demo.release.xcconfig"; sourceTree = ""; }; AD604124C0E87585D5D97F8C3C3FA951 /* SDImageHEICCoder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDImageHEICCoder.m; path = SDWebImage/Core/SDImageHEICCoder.m; sourceTree = ""; }; AE56C455295218924F5847EDE515F01B /* UIColor+SDHexString.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIColor+SDHexString.m"; path = "SDWebImage/Private/UIColor+SDHexString.m"; sourceTree = ""; }; AFC1EBA76CF0A548DAF4BD2312A634F7 /* SDWebImageCompat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDWebImageCompat.h; path = SDWebImage/Core/SDWebImageCompat.h; sourceTree = ""; }; @@ -432,22 +434,20 @@ D137BA31966EABC1C7EA30006FB3F810 /* UIRefreshControl+AFNetworking.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIRefreshControl+AFNetworking.h"; path = "UIKit+AFNetworking/UIRefreshControl+AFNetworking.h"; sourceTree = ""; }; D1C5B724A2DC66F711BF280B3F9C1BA9 /* SDDeviceHelper.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDDeviceHelper.h; path = SDWebImage/Private/SDDeviceHelper.h; sourceTree = ""; }; D2F7723854F89DC9E59BA2BF72789A72 /* Masonry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Masonry.h; path = Masonry/Masonry.h; sourceTree = ""; }; - D2FC40E69BF17726FF80D4F13855910F /* Pods-HXPhotoPicker-Demo-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-HXPhotoPicker-Demo-dummy.m"; sourceTree = ""; }; - D37B78F337C88A2DD8B6B9A32616CC3C /* Pods-HXPhotoPicker-Demo-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-HXPhotoPicker-Demo-acknowledgements.plist"; sourceTree = ""; }; D632D60F66BC939F66241337EB5B87BF /* SDAnimatedImage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDAnimatedImage.m; path = SDWebImage/Core/SDAnimatedImage.m; sourceTree = ""; }; D656972EC843F56441EDB1B63DD23872 /* AFNetworkReachabilityManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AFNetworkReachabilityManager.m; path = AFNetworking/AFNetworkReachabilityManager.m; sourceTree = ""; }; D762969CAC59B2B644E87D69FD5CF72D /* SDImageLoader.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDImageLoader.h; path = SDWebImage/Core/SDImageLoader.h; sourceTree = ""; }; D967EAB1ED49111A501C638B72D22F86 /* SDAnimatedImageRep.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDAnimatedImageRep.m; path = SDWebImage/Core/SDAnimatedImageRep.m; sourceTree = ""; }; - DB5763CD05F5B33A7D7610E2E867DD09 /* Pods-HXPhotoPicker-Demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HXPhotoPicker-Demo.debug.xcconfig"; sourceTree = ""; }; DC70E6F53AF3C07E3DDA1B895836939D /* UIView+WebCacheOperation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+WebCacheOperation.h"; path = "SDWebImage/Core/UIView+WebCacheOperation.h"; sourceTree = ""; }; DE2D9AAF7FE0EFFABA65D763F2DF541D /* SDMemoryCache.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDMemoryCache.m; path = SDWebImage/Core/SDMemoryCache.m; sourceTree = ""; }; DED5F8BF61C617E1ADAB9A87AEB9AF55 /* SDAnimatedImagePlayer.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDAnimatedImagePlayer.m; path = SDWebImage/Core/SDAnimatedImagePlayer.m; sourceTree = ""; }; E014B3A843686358A04FF9B7FFC78E33 /* Masonry-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Masonry-prefix.pch"; sourceTree = ""; }; - E2C39974F069A7FD86D5479EAD0683E6 /* libPods-HXPhotoPicker-Demo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-HXPhotoPicker-Demo.a"; path = "libPods-HXPhotoPicker-Demo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E4F13D24941EF85C46C15EC5F11B8359 /* UIImage+ExtendedCacheData.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+ExtendedCacheData.h"; path = "SDWebImage/Core/UIImage+ExtendedCacheData.h"; sourceTree = ""; }; E554C3BE1B41878706C506399BEF7A0D /* SDFileAttributeHelper.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDFileAttributeHelper.m; path = SDWebImage/Private/SDFileAttributeHelper.m; sourceTree = ""; }; E5A2D0C75EC74552142D6C094D7EB26C /* SDAssociatedObject.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDAssociatedObject.m; path = SDWebImage/Private/SDAssociatedObject.m; sourceTree = ""; }; E744994421BFF3340E21DD3B563CEC43 /* SDImageIOCoder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SDImageIOCoder.h; path = SDWebImage/Core/SDImageIOCoder.h; sourceTree = ""; }; + E7FACF0656056AFACF2C82D01BD89750 /* libPods-HXPhotoPickerExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-HXPhotoPickerExample.a"; path = "libPods-HXPhotoPickerExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + E8C65A000081A804C15BCA84FA8CD24B /* Pods-HXPhotoPickerExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HXPhotoPickerExample.debug.xcconfig"; sourceTree = ""; }; E929681DE99DB055B7F4086852E1D6D7 /* SDWebImageDefine.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDWebImageDefine.m; path = SDWebImage/Core/SDWebImageDefine.m; sourceTree = ""; }; ED446BC7D3E898662F1A68EB63EC80CD /* SDAsyncBlockOperation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SDAsyncBlockOperation.m; path = SDWebImage/Private/SDAsyncBlockOperation.m; sourceTree = ""; }; EDB7472A985AEB59B97AD3F428E81C06 /* MASConstraint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASConstraint.h; path = Masonry/MASConstraint.h; sourceTree = ""; }; @@ -486,7 +486,7 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9DF87687B85E728D106522F393A38E82 /* Frameworks */ = { + F83098D7261392EF91C21D3A2F787B10 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( @@ -594,30 +594,6 @@ path = Masonry; sourceTree = ""; }; - 6C0F69FA6D106E806802E5AA7173F009 /* Products */ = { - isa = PBXGroup; - children = ( - A4FA15D44DF6BAC7550EDEED10862AA3 /* libAFNetworking.a */, - 1FFED36A657123030ABB700256D73F15 /* libMasonry.a */, - E2C39974F069A7FD86D5479EAD0683E6 /* libPods-HXPhotoPicker-Demo.a */, - B0B214D775196BA7CA8E17E53048A493 /* libSDWebImage.a */, - ); - name = Products; - sourceTree = ""; - }; - 72C8489C305D88796BB630308BD29824 /* Pods-HXPhotoPicker-Demo */ = { - isa = PBXGroup; - children = ( - A287B06C6AC26719CF1CEC851E493254 /* Pods-HXPhotoPicker-Demo-acknowledgements.markdown */, - D37B78F337C88A2DD8B6B9A32616CC3C /* Pods-HXPhotoPicker-Demo-acknowledgements.plist */, - D2FC40E69BF17726FF80D4F13855910F /* Pods-HXPhotoPicker-Demo-dummy.m */, - DB5763CD05F5B33A7D7610E2E867DD09 /* Pods-HXPhotoPicker-Demo.debug.xcconfig */, - AC8C6280DA088CC7CE34E0F42C6FA063 /* Pods-HXPhotoPicker-Demo.release.xcconfig */, - ); - name = "Pods-HXPhotoPicker-Demo"; - path = "Target Support Files/Pods-HXPhotoPicker-Demo"; - sourceTree = ""; - }; 73B169F258778839382110D7F828AA0C /* NSURLSession */ = { isa = PBXGroup; children = ( @@ -800,6 +776,17 @@ name = Core; sourceTree = ""; }; + 97CD5420F829B86686CDBC3410FA96AB /* Products */ = { + isa = PBXGroup; + children = ( + A4FA15D44DF6BAC7550EDEED10862AA3 /* libAFNetworking.a */, + 1FFED36A657123030ABB700256D73F15 /* libMasonry.a */, + E7FACF0656056AFACF2C82D01BD89750 /* libPods-HXPhotoPickerExample.a */, + B0B214D775196BA7CA8E17E53048A493 /* libSDWebImage.a */, + ); + name = Products; + sourceTree = ""; + }; B638CB34C0259FCF4209A16CE09BD15D /* AFNetworking */ = { isa = PBXGroup; children = ( @@ -815,6 +802,19 @@ path = AFNetworking; sourceTree = ""; }; + BB0B8DA68B76354FAF16080A6F447254 /* Pods-HXPhotoPickerExample */ = { + isa = PBXGroup; + children = ( + 77DE95D52455539E87518B28C811417B /* Pods-HXPhotoPickerExample-acknowledgements.markdown */, + 1487CBC234378493AED9BADE98D51AE4 /* Pods-HXPhotoPickerExample-acknowledgements.plist */, + 5742B6BAE980582B8893E0BC9AF5ED94 /* Pods-HXPhotoPickerExample-dummy.m */, + E8C65A000081A804C15BCA84FA8CD24B /* Pods-HXPhotoPickerExample.debug.xcconfig */, + 01A31513A870508886C637E7445D78F5 /* Pods-HXPhotoPickerExample.release.xcconfig */, + ); + name = "Pods-HXPhotoPickerExample"; + path = "Target Support Files/Pods-HXPhotoPickerExample"; + sourceTree = ""; + }; C722FFB2FB407D34720D57727B27D482 /* UIKit */ = { isa = PBXGroup; children = ( @@ -842,22 +842,14 @@ name = UIKit; sourceTree = ""; }; - C80585B7C333BA8AFB97A6B18BADA3C0 /* Targets Support Files */ = { - isa = PBXGroup; - children = ( - 72C8489C305D88796BB630308BD29824 /* Pods-HXPhotoPicker-Demo */, - ); - name = "Targets Support Files"; - sourceTree = ""; - }; CF1408CF629C7361332E53B88F7BD30C = { isa = PBXGroup; children = ( 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, D89477F20FB1DE18A04690586D7808C4 /* Frameworks */, 2CC129490CFDD30B5D0B061225724B69 /* Pods */, - 6C0F69FA6D106E806802E5AA7173F009 /* Products */, - C80585B7C333BA8AFB97A6B18BADA3C0 /* Targets Support Files */, + 97CD5420F829B86686CDBC3410FA96AB /* Products */, + E06EA0D780F64CD5D3804ECAA548AF66 /* Targets Support Files */, ); sourceTree = ""; }; @@ -868,16 +860,17 @@ name = Frameworks; sourceTree = ""; }; + E06EA0D780F64CD5D3804ECAA548AF66 /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + BB0B8DA68B76354FAF16080A6F447254 /* Pods-HXPhotoPickerExample */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 004BED2D6B7D99043321CFE4114C82ED /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 1719BD8C8C5FB63E8E3A195F3CF29331 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -1006,6 +999,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C2407B9A6B0A9AA66B1B4F3FDF2228AD /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -1026,26 +1026,6 @@ productReference = A4FA15D44DF6BAC7550EDEED10862AA3 /* libAFNetworking.a */; productType = "com.apple.product-type.library.static"; }; - 32727823F487C847FB252A5FB158A11A /* Pods-HXPhotoPicker-Demo */ = { - isa = PBXNativeTarget; - buildConfigurationList = BCEBF67888B33C35C64AA37A89D66873 /* Build configuration list for PBXNativeTarget "Pods-HXPhotoPicker-Demo" */; - buildPhases = ( - 004BED2D6B7D99043321CFE4114C82ED /* Headers */, - FE33DB94D22B8508D37EA7E76745F6D5 /* Sources */, - 9DF87687B85E728D106522F393A38E82 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 9D063B6B12DA561B8849DBCA85565275 /* PBXTargetDependency */, - 013B38358F6A2AD9D06828AC2DBF08BE /* PBXTargetDependency */, - E21BC8DB83082400FF8FCDC4AC9DCB88 /* PBXTargetDependency */, - ); - name = "Pods-HXPhotoPicker-Demo"; - productName = "Pods-HXPhotoPicker-Demo"; - productReference = E2C39974F069A7FD86D5479EAD0683E6 /* libPods-HXPhotoPicker-Demo.a */; - productType = "com.apple.product-type.library.static"; - }; 3847153A6E5EEFB86565BA840768F429 /* SDWebImage */ = { isa = PBXNativeTarget; buildConfigurationList = B1FA491365904802AD9D5BF4683066A6 /* Build configuration list for PBXNativeTarget "SDWebImage" */; @@ -1080,6 +1060,26 @@ productReference = 1FFED36A657123030ABB700256D73F15 /* libMasonry.a */; productType = "com.apple.product-type.library.static"; }; + D1D724522871333DBFA94E79471AC4FE /* Pods-HXPhotoPickerExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1F52B3F70DC9935ADF4A76C908EAD3E2 /* Build configuration list for PBXNativeTarget "Pods-HXPhotoPickerExample" */; + buildPhases = ( + C2407B9A6B0A9AA66B1B4F3FDF2228AD /* Headers */, + 40011648948ADBC3C1DE5FC8FD5B2645 /* Sources */, + F83098D7261392EF91C21D3A2F787B10 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 29B374E55CB4F5209B90D691C544F999 /* PBXTargetDependency */, + 151B15FC7071A8407DAA0680A8307AD0 /* PBXTargetDependency */, + DFB9E324F1E27F00CF31BC1CFF9BE64F /* PBXTargetDependency */, + ); + name = "Pods-HXPhotoPickerExample"; + productName = "Pods-HXPhotoPickerExample"; + productReference = E7FACF0656056AFACF2C82D01BD89750 /* libPods-HXPhotoPickerExample.a */; + productType = "com.apple.product-type.library.static"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -1098,13 +1098,13 @@ Base, ); mainGroup = CF1408CF629C7361332E53B88F7BD30C; - productRefGroup = 6C0F69FA6D106E806802E5AA7173F009 /* Products */; + productRefGroup = 97CD5420F829B86686CDBC3410FA96AB /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 0130B3724283586C0E9D2A112D4F2AA1 /* AFNetworking */, 55AF53E6C77A10ED4985E04D74A8878E /* Masonry */, - 32727823F487C847FB252A5FB158A11A /* Pods-HXPhotoPicker-Demo */, + D1D724522871333DBFA94E79471AC4FE /* Pods-HXPhotoPickerExample */, 3847153A6E5EEFB86565BA840768F429 /* SDWebImage */, ); }; @@ -1134,6 +1134,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 40011648948ADBC3C1DE5FC8FD5B2645 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 78F72C32BF287269D91D2ABA8267DF5A /* Pods-HXPhotoPickerExample-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 811E255F9DA765E3FED6313B480D487A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1229,34 +1237,26 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - FE33DB94D22B8508D37EA7E76745F6D5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7F432AB8243A5C1341631177297DB205 /* Pods-HXPhotoPicker-Demo-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 013B38358F6A2AD9D06828AC2DBF08BE /* PBXTargetDependency */ = { + 151B15FC7071A8407DAA0680A8307AD0 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = Masonry; target = 55AF53E6C77A10ED4985E04D74A8878E /* Masonry */; - targetProxy = 1E506C1B1B6D1516D7A7482C37CC275A /* PBXContainerItemProxy */; + targetProxy = 2EBEB7B6FFBEDBFEEB76187D419FD20E /* PBXContainerItemProxy */; }; - 9D063B6B12DA561B8849DBCA85565275 /* PBXTargetDependency */ = { + 29B374E55CB4F5209B90D691C544F999 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = AFNetworking; target = 0130B3724283586C0E9D2A112D4F2AA1 /* AFNetworking */; - targetProxy = 2E5750E566F44C1FE96B1BCD04202316 /* PBXContainerItemProxy */; + targetProxy = B6C3D58D800432AC1FF2BA72A41A2657 /* PBXContainerItemProxy */; }; - E21BC8DB83082400FF8FCDC4AC9DCB88 /* PBXTargetDependency */ = { + DFB9E324F1E27F00CF31BC1CFF9BE64F /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = SDWebImage; target = 3847153A6E5EEFB86565BA840768F429 /* SDWebImage */; - targetProxy = 69E4F936D18AB2AC264CED14AABF0B56 /* PBXContainerItemProxy */; + targetProxy = 982DBCE866CCF7676D2910524B381F51 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -1285,6 +1285,51 @@ }; name = Debug; }; + 13DA88666CF53B09B2AFB8BEEB333A26 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E8C65A000081A804C15BCA84FA8CD24B /* Pods-HXPhotoPickerExample.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + ARCHS = "$(ARCHS_STANDARD)"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACH_O_TYPE = staticlib; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 2A6BE2EFB24163F8760F7FDFBD9E8D96 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 01A31513A870508886C637E7445D78F5 /* Pods-HXPhotoPickerExample.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + ARCHS = "$(ARCHS_STANDARD)"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACH_O_TYPE = staticlib; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; 4BE66A09A74FD25164AAB3C2645B9B93 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1369,29 +1414,6 @@ }; name = Debug; }; - 5AF5911D6BFDD7C66EF6A9AADA29A97C /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AC8C6280DA088CC7CE34E0F42C6FA063 /* Pods-HXPhotoPicker-Demo.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - ARCHS = "$(ARCHS_STANDARD)"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACH_O_TYPE = staticlib; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; 7353D52D6880D22B810A9AFFE8474018 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = BEA01A425AB4602985E07E2B38874079 /* AFNetworking.debug.xcconfig */; @@ -1480,28 +1502,6 @@ }; name = Debug; }; - 97715D95FA379355B65C9CD8DD3BEC6E /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = DB5763CD05F5B33A7D7610E2E867DD09 /* Pods-HXPhotoPicker-Demo.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - ARCHS = "$(ARCHS_STANDARD)"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACH_O_TYPE = staticlib; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; BBC96101FAB84DBB4D79AD0C0B4D5576 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 78FBCE16EFAA14631A0A8EBDA7B34CA5 /* Masonry.release.xcconfig */; @@ -1589,29 +1589,29 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { + 1F52B3F70DC9935ADF4A76C908EAD3E2 /* Build configuration list for PBXNativeTarget "Pods-HXPhotoPickerExample" */ = { isa = XCConfigurationList; buildConfigurations = ( - 7EF7227D9B20A1D549000096ACCB23D7 /* Debug */, - 4BE66A09A74FD25164AAB3C2645B9B93 /* Release */, + 13DA88666CF53B09B2AFB8BEEB333A26 /* Debug */, + 2A6BE2EFB24163F8760F7FDFBD9E8D96 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - B1FA491365904802AD9D5BF4683066A6 /* Build configuration list for PBXNativeTarget "SDWebImage" */ = { + 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - 4FF00C2A785B420048917CEE6BA6F10A /* Debug */, - D87A66F163EC214EE369973C052B5D94 /* Release */, + 7EF7227D9B20A1D549000096ACCB23D7 /* Debug */, + 4BE66A09A74FD25164AAB3C2645B9B93 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - BCEBF67888B33C35C64AA37A89D66873 /* Build configuration list for PBXNativeTarget "Pods-HXPhotoPicker-Demo" */ = { + B1FA491365904802AD9D5BF4683066A6 /* Build configuration list for PBXNativeTarget "SDWebImage" */ = { isa = XCConfigurationList; buildConfigurations = ( - 97715D95FA379355B65C9CD8DD3BEC6E /* Debug */, - 5AF5911D6BFDD7C66EF6A9AADA29A97C /* Release */, + 4FF00C2A785B420048917CEE6BA6F10A /* Debug */, + D87A66F163EC214EE369973C052B5D94 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Pods/Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo-dummy.m b/Pods/Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo-dummy.m deleted file mode 100644 index c0daf640..00000000 --- a/Pods/Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_HXPhotoPicker_Demo : NSObject -@end -@implementation PodsDummy_Pods_HXPhotoPicker_Demo -@end diff --git a/Pods/Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo-acknowledgements.markdown b/Pods/Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample-acknowledgements.markdown similarity index 100% rename from Pods/Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo-acknowledgements.markdown rename to Pods/Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample-acknowledgements.markdown diff --git a/Pods/Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo-acknowledgements.plist b/Pods/Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample-acknowledgements.plist similarity index 100% rename from Pods/Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo-acknowledgements.plist rename to Pods/Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample-acknowledgements.plist diff --git a/Pods/Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample-dummy.m b/Pods/Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample-dummy.m new file mode 100644 index 00000000..7f54018e --- /dev/null +++ b/Pods/Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_HXPhotoPickerExample : NSObject +@end +@implementation PodsDummy_Pods_HXPhotoPickerExample +@end diff --git a/Pods/Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo.debug.xcconfig b/Pods/Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample.debug.xcconfig similarity index 100% rename from Pods/Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo.debug.xcconfig rename to Pods/Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample.debug.xcconfig diff --git a/Pods/Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo.release.xcconfig b/Pods/Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample.release.xcconfig similarity index 100% rename from Pods/Target Support Files/Pods-HXPhotoPicker-Demo/Pods-HXPhotoPicker-Demo.release.xcconfig rename to Pods/Target Support Files/Pods-HXPhotoPickerExample/Pods-HXPhotoPickerExample.release.xcconfig diff --git a/Swift/AppDelegate.swift b/Swift/AppDelegate.swift new file mode 100644 index 00000000..7764f769 --- /dev/null +++ b/Swift/AppDelegate.swift @@ -0,0 +1,29 @@ +// +// AppDelegate.swift +// HXPhotoPickerSwift +// +// Created by 洪欣 on 2020/11/12. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + window = UIWindow.init(frame: UIScreen.main.bounds) + + let vc = ViewController.init() + let nav = UINavigationController.init(rootViewController: vc) + + window?.rootViewController = nav + window?.makeKeyAndVisible() + return true + } + +} + diff --git a/Swift/Assets.xcassets/AccentColor.colorset/Contents.json b/Swift/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/Swift/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Swift/Assets.xcassets/AppIcon.appiconset/Contents.json b/Swift/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..3ac36510 --- /dev/null +++ b/Swift/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,123 @@ +{ + "images" : [ + { + "filename" : "Icon-Notify@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "Icon-Notify@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "Icon-Small@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "Icon-Small@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "Icon-Small-40@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "Icon-Small-40@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "1x", + "size" : "57x57" + }, + { + "filename" : "HXPhotoPicker_Icon@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "57x57" + }, + { + "filename" : "Icon-60@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "Icon-60@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "Icon-1024.png", + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Swift/Assets.xcassets/AppIcon.appiconset/HXPhotoPicker_Icon@2x.png b/Swift/Assets.xcassets/AppIcon.appiconset/HXPhotoPicker_Icon@2x.png new file mode 100644 index 00000000..6362a2c9 Binary files /dev/null and b/Swift/Assets.xcassets/AppIcon.appiconset/HXPhotoPicker_Icon@2x.png differ diff --git a/Swift/Assets.xcassets/AppIcon.appiconset/Icon-1024.png b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-1024.png new file mode 100644 index 00000000..a2f715da Binary files /dev/null and b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-1024.png differ diff --git a/Swift/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png new file mode 100644 index 00000000..05387531 Binary files /dev/null and b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png differ diff --git a/Swift/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png new file mode 100644 index 00000000..a5c0d715 Binary files /dev/null and b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png differ diff --git a/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Notify@2x.png b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Notify@2x.png new file mode 100644 index 00000000..9175f36b Binary files /dev/null and b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Notify@2x.png differ diff --git a/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Notify@3x.png b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Notify@3x.png new file mode 100644 index 00000000..8c6b5177 Binary files /dev/null and b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Notify@3x.png differ diff --git a/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png new file mode 100644 index 00000000..c431ff04 Binary files /dev/null and b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png differ diff --git a/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png new file mode 100644 index 00000000..05387531 Binary files /dev/null and b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png differ diff --git a/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png new file mode 100644 index 00000000..b7d481fc Binary files /dev/null and b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png differ diff --git a/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png new file mode 100644 index 00000000..361f6b7f Binary files /dev/null and b/Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png differ diff --git a/Swift/Assets.xcassets/Contents.json b/Swift/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Swift/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Swift/Assets.xcassets/wx_head_icon.imageset/Contents.json b/Swift/Assets.xcassets/wx_head_icon.imageset/Contents.json new file mode 100644 index 00000000..6053ae17 --- /dev/null +++ b/Swift/Assets.xcassets/wx_head_icon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "wx_head_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Swift/Assets.xcassets/wx_head_icon.imageset/wx_head_icon@2x.png b/Swift/Assets.xcassets/wx_head_icon.imageset/wx_head_icon@2x.png new file mode 100644 index 00000000..b2615329 Binary files /dev/null and b/Swift/Assets.xcassets/wx_head_icon.imageset/wx_head_icon@2x.png differ diff --git a/Swift/Base.lproj/LaunchScreen.storyboard b/Swift/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/Swift/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Swift/Base.lproj/Main.storyboard b/Swift/Base.lproj/Main.storyboard new file mode 100644 index 00000000..25a76385 --- /dev/null +++ b/Swift/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Swift/Info.plist b/Swift/Info.plist new file mode 100644 index 00000000..e93aad4b --- /dev/null +++ b/Swift/Info.plist @@ -0,0 +1,69 @@ + + + + + UIViewControllerBasedStatusBarAppearance + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + PHPhotoLibraryPreventAutomaticLimitedAccessAlert + + NSPhotoLibraryUsageDescription + 是否允许此App访问你的媒体资料库 + NSMicrophoneUsageDescription + 是否允许此App使用你的麦克风 + NSLocationWhenInUseUsageDescription + 是否允许此App获取定位信息 + NSLocationAlwaysUsageDescription + 是否允许此App后台获取定位信息 + NSCameraUsageDescription + 是否允许此App使用你的相机 + CFBundleDevelopmentRegion + zh_CN + CFBundleDisplayName + 照片(Swift) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortraitUpsideDown + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Swift/ViewController.swift b/Swift/ViewController.swift new file mode 100644 index 00000000..733fc5bc --- /dev/null +++ b/Swift/ViewController.swift @@ -0,0 +1,61 @@ +// +// ViewController.swift +// HXPhotoPickerSwift +// +// Created by 洪欣 on 2020/11/12. +// Copyright © 2020 洪欣. All rights reserved. +// + +import UIKit +import Photos + +class ViewController: UIViewController , UITableViewDataSource, UITableViewDelegate, HXPHPickerControllerDelegate { + + var tableView : UITableView? + + var selectedAssets: [HXPHAsset] = [] + var isOriginal: Bool = false + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + title = "swift" + view.backgroundColor = UIColor.white + + tableView = UITableView.init(frame: CGRect.init(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height), style: UITableView.Style.plain) + tableView?.dataSource = self + tableView?.delegate = self + + tableView?.register(UITableViewCell.classForCoder(), forCellReuseIdentifier: "cellId") + + view.addSubview(tableView!) + +// UINavigationBar.appearance().isTranslucent = false + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return 10 + } + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "cellId") + cell?.textLabel?.text = "\( indexPath.row)" + return cell! + } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + tableView.deselectRow(at: indexPath, animated: true) + let config = HXPHConfiguration.init() +// config.selectType = HXPHSelectType.video + let nav = HXPHPickerController.init(config: config) + nav.pickerContollerDelegate = self + nav.selectedAssetArray = selectedAssets + nav.isOriginal = isOriginal +// nav.modalPresentationStyle = UIModalPresentationStyle.fullScreen + present(nav, animated: true, completion: nil) + } + func pickerContollerDidFinish(_ pickerController: HXPHPickerController, with selectedAssetArray: [HXPHAsset], isOriginal: Bool) { + self.selectedAssets = selectedAssetArray + self.isOriginal = isOriginal + } + +} +