|
@@ -27,8 +27,13 @@ class PublishConfirmPhotoController: BaseViewController {
|
|
setupLayouts()
|
|
setupLayouts()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ override var shouldAutorotate: Bool {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+
|
|
override func setupViews() {
|
|
override func setupViews() {
|
|
navigationBar.isHidden = true
|
|
navigationBar.isHidden = true
|
|
|
|
+ self.view.backgroundColor = UIColor.black
|
|
|
|
|
|
view.addSubview(photoImageView)
|
|
view.addSubview(photoImageView)
|
|
view.addSubview(retakeBtn)
|
|
view.addSubview(retakeBtn)
|
|
@@ -55,6 +60,7 @@ class PublishConfirmPhotoController: BaseViewController {
|
|
|
|
|
|
private lazy var photoImageView: UIImageView = {
|
|
private lazy var photoImageView: UIImageView = {
|
|
let photoImageView = UIImageView()
|
|
let photoImageView = UIImageView()
|
|
|
|
+ photoImageView.contentMode = .scaleAspectFit
|
|
return photoImageView
|
|
return photoImageView
|
|
}()
|
|
}()
|
|
|
|
|
|
@@ -75,24 +81,24 @@ class PublishConfirmPhotoController: BaseViewController {
|
|
usePhotoBtn.setTitleColor(kffffffColor, for: .normal)
|
|
usePhotoBtn.setTitleColor(kffffffColor, for: .normal)
|
|
usePhotoBtn.titleLabel?.font = kMediumFont15
|
|
usePhotoBtn.titleLabel?.font = kMediumFont15
|
|
usePhotoBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
|
|
usePhotoBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
|
|
- PHPhotoLibrary.shared().performChanges({
|
|
|
|
-
|
|
|
|
- }, completionHandler: { (success, error) in
|
|
|
|
- // 写入相册成功后,回到主线程进行流程
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
- if success != true{
|
|
|
|
- SwiftProgressHUD.shared().showText("保存失败")
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 保存成功,跳转至发布
|
|
|
|
- self?.dismiss(animated: false, completion: nil)
|
|
|
|
- let imageArr: Array<UIImage> = [self!.photoImg!]
|
|
|
|
- if let pubImgClosure = self?.pubImgClosure {
|
|
|
|
- pubImgClosure(imageArr)
|
|
|
|
|
|
+ PHPhotoLibrary.shared().performChanges({
|
|
|
|
+
|
|
|
|
+ }, completionHandler: { [weak self] (success, error) in
|
|
|
|
+ // 写入相册成功后,回到主线程进行流程
|
|
|
|
+ DispatchQueue.main.async {
|
|
|
|
+ [weak self] in
|
|
|
|
+ if success != true{
|
|
|
|
+ SwiftProgressHUD.shared().showText("保存失败")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 保存成功,跳转至发布
|
|
|
|
+ self?.dismiss(animated: false, completion: nil)
|
|
|
|
+ let imageArr: Array<UIImage> = [(self?.photoImg)!]
|
|
|
|
+ if let pubImgClosure = self?.pubImgClosure {
|
|
|
|
+ pubImgClosure(imageArr)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ })
|
|
|
|
|
|
}).disposed(by: disposeBag)
|
|
}).disposed(by: disposeBag)
|
|
return usePhotoBtn
|
|
return usePhotoBtn
|