|
@@ -7,7 +7,9 @@
|
|
// 发布进度のView
|
|
// 发布进度のView
|
|
|
|
|
|
import UIKit
|
|
import UIKit
|
|
|
|
+import FWPopupView
|
|
import RxSwift
|
|
import RxSwift
|
|
|
|
+import RxCocoa
|
|
|
|
|
|
/// 跳转方式
|
|
/// 跳转方式
|
|
///
|
|
///
|
|
@@ -19,7 +21,7 @@ enum UploadStatus{
|
|
case failure
|
|
case failure
|
|
}
|
|
}
|
|
|
|
|
|
-class PublishUploadProgressView: BaseView {
|
|
|
|
|
|
+class PublishUploadProgressView: FWPopupView {
|
|
|
|
|
|
typealias CloseViewClosure = () -> Void
|
|
typealias CloseViewClosure = () -> Void
|
|
var closeViewClosure : CloseViewClosure?
|
|
var closeViewClosure : CloseViewClosure?
|
|
@@ -36,8 +38,20 @@ class PublishUploadProgressView: BaseView {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ let disposeBag = DisposeBag()
|
|
|
|
|
|
- override func setupViews() {
|
|
|
|
|
|
+ override init(frame: CGRect) {
|
|
|
|
+ super.init(frame: frame)
|
|
|
|
+ setupViews()
|
|
|
|
+ setupLayouts()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ required init?(coder aDecoder: NSCoder) {
|
|
|
|
+ fatalError("init(coder:) has not been implemented")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ func setupViews() {
|
|
self.backgroundColor = kffffffColor
|
|
self.backgroundColor = kffffffColor
|
|
addSubview(imageView)
|
|
addSubview(imageView)
|
|
addSubview(progressLabel)
|
|
addSubview(progressLabel)
|
|
@@ -46,7 +60,7 @@ class PublishUploadProgressView: BaseView {
|
|
addSubview(failedCloseButton)
|
|
addSubview(failedCloseButton)
|
|
}
|
|
}
|
|
|
|
|
|
- override func setupLayouts() {
|
|
|
|
|
|
+ func setupLayouts() {
|
|
imageView.snp.makeConstraints { (make) in
|
|
imageView.snp.makeConstraints { (make) in
|
|
make.left.equalTo(14)
|
|
make.left.equalTo(14)
|
|
make.centerY.equalToSuperview()
|
|
make.centerY.equalToSuperview()
|
|
@@ -121,6 +135,22 @@ class PublishUploadProgressView: BaseView {
|
|
return failedCloseButton
|
|
return failedCloseButton
|
|
}()
|
|
}()
|
|
|
|
|
|
|
|
+ class func publishUploadProgressView(attachedView:UIView) -> PublishUploadProgressView {
|
|
|
|
+ let view = PublishUploadProgressView(frame: CGRect(x: 0, y: kNavBarHeight, width: kScreenWidth, height: 62))
|
|
|
|
+ view.attachedView = attachedView
|
|
|
|
+ let vProperty = FWPopupViewProperty()
|
|
|
|
+ vProperty.popupCustomAlignment = .topCenter
|
|
|
|
+ vProperty.popupViewEdgeInsets = UIEdgeInsets(top: kNavBarHeight + 48, left: 0, bottom: 0, right: 0 )
|
|
|
|
+ vProperty.popupAnimationType = .frame
|
|
|
|
+ vProperty.maskViewColor = UIColor(white: 0, alpha: 0.5)
|
|
|
|
+ vProperty.touchWildToHide = "0"
|
|
|
|
+ vProperty.maskViewColor = UIColor.clear
|
|
|
|
+
|
|
|
|
+ view.vProperty = vProperty
|
|
|
|
+ view.show()
|
|
|
|
+ return view
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
extension PublishUploadProgressView {
|
|
extension PublishUploadProgressView {
|