-num lines-num-new"> 830
</resources>
</document>
@@ -14,7 +14,7 @@ final class PhotoDetailCoordinator: Coordinator {
|
||
| 14 | 14 |
let photoDetailViewController: PhotoDetailViewController |
| 15 | 15 |
let shareListViewModel: PhotoDetailListViewModel |
| 16 | 16 |
|
| 17 |
- fileprivate var coordinators = [String: Coordinator]() |
|
| 17 |
+ fileprivate var coordinators = [CoordinatorKey: Coordinator]() |
|
| 18 | 18 |
|
| 19 | 19 |
init(_ photoDetailVC: PhotoDetailViewController, |
| 20 | 20 |
nav: UINavigationController, |
@@ -42,7 +42,7 @@ extension PhotoDetailCoordinator: PhotoDetailViewModelDelegate {
|
||
| 42 | 42 |
vc.viewModel = GroupViewModel(groupItem: item) |
| 43 | 43 |
let coordinator = GroupCoordinator(vc, |
| 44 | 44 |
navigationController: navigationController) |
| 45 |
- coordinators["group"] = coordinator |
|
| 45 |
+ coordinators[.group] = coordinator |
|
| 46 | 46 |
|
| 47 | 47 |
navigationController.pushViewController(vc) |
| 48 | 48 |
} |
@@ -44,6 +44,7 @@ final class PhotoDetailViewController: UIViewController {
|
||
| 44 | 44 |
@IBOutlet weak var waterMarkImage: UIImageView! |
| 45 | 45 |
@IBOutlet weak var waterMarkLabel: UILabel! |
| 46 | 46 |
|
| 47 |
+ @IBOutlet var keyboardGestureRcognizer: UITapGestureRecognizer! |
|
| 47 | 48 |
@IBOutlet weak var thumbupViewHeightConstraint: NSLayoutConstraint! |
| 48 | 49 |
@IBOutlet weak var commentEditYConstraint: NSLayoutConstraint! |
| 49 | 50 |
|
@@ -56,6 +57,7 @@ final class PhotoDetailViewController: UIViewController {
|
||
| 56 | 57 |
// MARK: view function |
| 57 | 58 |
override func viewDidLoad() {
|
| 58 | 59 |
super.viewDidLoad() |
| 60 |
+ title = "详情" |
|
| 59 | 61 |
binding() |
| 60 | 62 |
setup() |
| 61 | 63 |
} |
@@ -80,19 +82,13 @@ final class PhotoDetailViewController: UIViewController {
|
||
| 80 | 82 |
} |
| 81 | 83 |
} |
| 82 | 84 |
|
| 83 |
-//MARK textField delegate |
|
| 84 |
-extension PhotoDetailViewController: UIGestureRecognizerDelegate {
|
|
| 85 |
- // MARK: textField |
|
| 86 |
- |
|
| 87 |
- func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
|
|
| 88 |
- return commentTextField.isFirstResponder |
|
| 89 |
- } |
|
| 90 |
- |
|
| 91 |
-} |
|
| 92 |
- |
|
| 93 |
- |
|
| 94 | 85 |
/// bind storyboard gesture action |
| 95 | 86 |
extension PhotoDetailViewController {
|
| 87 |
+ |
|
| 88 |
+ @IBAction func recyclingKeyboard(_ sender: UITapGestureRecognizer) {
|
|
| 89 |
+ commentTextField.resignFirstResponder() |
|
| 90 |
+ } |
|
| 91 |
+ |
|
| 96 | 92 |
@IBAction func purchase(_ sender: UITapGestureRecognizer) {
|
| 97 | 93 |
|
| 98 | 94 |
} |
@@ -105,7 +101,7 @@ extension PhotoDetailViewController {
|
||
| 105 | 101 |
/// bind storyboard button action |
| 106 | 102 |
extension PhotoDetailViewController {
|
| 107 | 103 |
@IBAction func share() {
|
| 108 |
- let ctl = UIStoryboard.photoDetail.instantiateController(ShareController.self) |
|
| 104 |
+ let ctl = UIStoryboard.photoDetail.instantiateController(ShareViewController.self) |
|
| 109 | 105 |
ctl.shareContent = "我使用拍爱分享了一张美图,你也快来试试吧" |
| 110 | 106 |
// ctl.shareImgUrlThumb = datas[currentPhotoIndex].photo_thumbnail_url |
| 111 | 107 |
// ctl.shareUrl = datas[currentPhotoIndex].photo_share_url |
@@ -283,6 +279,9 @@ extension PhotoDetailViewController {
|
||
| 283 | 279 |
.notification(UIResponder.keyboardWillShowNotification) |
| 284 | 280 |
.takeUntil(self.rx.deallocated) |
| 285 | 281 |
.subscribe { [unowned self] notification in
|
| 282 |
+ |
|
| 283 |
+ self.keyboardGestureRcognizer.isEnabled = true |
|
| 284 |
+ |
|
| 286 | 285 |
guard let userInfo = notification.element?.userInfo, |
| 287 | 286 |
let keyboardFrame = userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect, |
| 288 | 287 |
let timeInterval = userInfo[UIResponder.keyboardAnimationDurationUserInfoKey] as? TimeInterval, |
@@ -301,6 +300,8 @@ extension PhotoDetailViewController {
|
||
| 301 | 300 |
.notification(UIResponder.keyboardWillHideNotification) |
| 302 | 301 |
.takeUntil(self.rx.deallocated) |
| 303 | 302 |
.subscribe { [unowned self] notification in
|
| 303 |
+ self.keyboardGestureRcognizer.isEnabled = false |
|
| 304 |
+ |
|
| 304 | 305 |
guard let userInfo = notification.element?.userInfo, |
| 305 | 306 |
let timeInterval = userInfo[UIResponder.keyboardAnimationDurationUserInfoKey] as? TimeInterval, |
| 306 | 307 |
let curve = userInfo[UIResponder.keyboardAnimationCurveUserInfoKey] as? Int |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 |
// |
| 2 |
-// ShareController.swift |
|
| 2 |
+// ShareViewController.swift |
|
| 3 | 3 |
// PaiAi |
| 4 | 4 |
// |
| 5 | 5 |
// Created by zhengjianfei on 16/4/7. |
@@ -10,24 +10,24 @@ import UIKit |
||
| 10 | 10 |
import PaiaiDataKit |
| 11 | 11 |
import PaiaiUIKit |
| 12 | 12 |
|
| 13 |
-final class ShareController: UIViewController {
|
|
| 13 |
+final class ShareViewController: AlertViewController {
|
|
| 14 | 14 |
|
| 15 |
- // MARK: Storyboard property |
|
| 16 | 15 |
@IBOutlet weak var shareView: UIView! |
| 17 |
- |
|
| 16 |
+ |
|
| 17 |
+ override var animationView: UIView? {
|
|
| 18 |
+ return shareView |
|
| 19 |
+ } |
|
| 20 |
+ |
|
| 21 |
+ override var style: AlertViewController.Style {
|
|
| 22 |
+ return .actionSheet |
|
| 23 |
+ } |
|
| 24 |
+ |
|
| 18 | 25 |
// MARK: parameter property |
| 19 | 26 |
var shareContent: String = "" |
| 20 | 27 |
var shareImg: UIImage? |
| 21 | 28 |
lazy var shareImgUrlThumb: String = "" |
| 22 | 29 |
lazy var shareUrl: String = "" |
| 23 |
-// let transitioning = FFTransitioning(alertStyle: .actionSheet) |
|
| 24 |
- |
|
| 25 |
- required init?(coder aDecoder: NSCoder) {
|
|
| 26 |
- super.init(coder: aDecoder) |
|
| 27 |
-// transitioningDelegate = transitioning |
|
| 28 |
- } |
|
| 29 |
- |
|
| 30 |
- // MARK: view function |
|
| 30 |
+ |
|
| 31 | 31 |
override func viewDidLoad() {
|
| 32 | 32 |
super.viewDidLoad() |
| 33 | 33 |
let imageView = UIImageView() |
@@ -1,29 +0,0 @@ |
||
| 1 |
-// |
|
| 2 |
-// ShareView.swift |
|
| 3 |
-// Paiai_iOS |
|
| 4 |
-// |
|
| 5 |
-// Created by ffib on 2019/3/21. |
|
| 6 |
-// Copyright © 2019 yb. All rights reserved. |
|
| 7 |
-// |
|
| 8 |
- |
|
| 9 |
-import UIKit |
|
| 10 |
- |
|
| 11 |
-class ShareView: UIView {
|
|
| 12 |
- |
|
| 13 |
-} |
|
| 14 |
- |
|
| 15 |
- |
|
| 16 |
- |
|
| 17 |
-extension ShareView {
|
|
| 18 |
- |
|
| 19 |
- func activateConstraints() {
|
|
| 20 |
- |
|
| 21 |
- } |
|
| 22 |
- |
|
| 23 |
- func activateConstraintsShareView() {
|
|
| 24 |
- guard let superView = superview else { return }
|
|
| 25 |
- |
|
| 26 |
- self.translatesAutoresizingMaskIntoConstraints = false |
|
| 27 |
- |
|
| 28 |
- } |
|
| 29 |
-} |