|
@@ -0,0 +1,139 @@
|
|
|
+//
|
|
|
+// PublishNewAuthorizationView.swift
|
|
|
+// RainbowPlanet
|
|
|
+//
|
|
|
+// Created by 南鑫林 on 2019/9/9.
|
|
|
+// Copyright © 2019 RainbowPlanet. All rights reserved.
|
|
|
+//
|
|
|
+
|
|
|
+import UIKit
|
|
|
+
|
|
|
+class PublishNewAuthorizationView: BaseView {
|
|
|
+
|
|
|
+ deinit {
|
|
|
+ NXLLog("deinit")
|
|
|
+ }
|
|
|
+
|
|
|
+ override func setupViews() {
|
|
|
+ self.backgroundColor = UIColor.black
|
|
|
+ addSubview(backButton)
|
|
|
+ addSubview(titleLabel)
|
|
|
+ addSubview(cameraButton)
|
|
|
+ addSubview(microphoneButton)
|
|
|
+ addSubview(albumButton)
|
|
|
+ }
|
|
|
+
|
|
|
+ override func setupLayouts() {
|
|
|
+ backButton.snp.makeConstraints { (make) in
|
|
|
+ make.top.equalTo(kSafeStatusBarHeight)
|
|
|
+ make.height.equalTo(44)
|
|
|
+ make.left.equalTo(14)
|
|
|
+ }
|
|
|
+ titleLabel.snp.makeConstraints { (make) in
|
|
|
+ make.top.equalTo(backButton.snp.bottom).offset(164)
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
+
|
|
|
+ }
|
|
|
+ cameraButton.snp.makeConstraints { (make) in
|
|
|
+ make.top.equalTo(titleLabel.snp.bottom).offset(40)
|
|
|
+ make.width.equalTo(200)
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
+ make.height.equalTo(40)
|
|
|
+ }
|
|
|
+ microphoneButton.snp.makeConstraints { (make) in
|
|
|
+ make.top.equalTo(cameraButton.snp.bottom).offset(20)
|
|
|
+ make.width.equalTo(200)
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
+ make.height.equalTo(40)
|
|
|
+ }
|
|
|
+ albumButton.snp.makeConstraints { (make) in
|
|
|
+ make.top.equalTo(microphoneButton.snp.bottom).offset(20)
|
|
|
+ make.width.equalTo(200)
|
|
|
+ make.centerX.equalToSuperview()
|
|
|
+ make.height.equalTo(40)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ override func setupData() {
|
|
|
+
|
|
|
+ let vc = UIViewController.topMost
|
|
|
+ vc?.statusBarStyle = .lightContent
|
|
|
+ //返回
|
|
|
+ backButton.rx.tap.subscribe(onNext: { [weak vc] _ in
|
|
|
+ vc?.dismiss(animated: true, completion: nil)
|
|
|
+ }).disposed(by: disposeBag)
|
|
|
+ //跳转到相机权限
|
|
|
+ cameraButton.rx.tap.subscribe(onNext: { [weak vc] _ in
|
|
|
+ LBXPermissions.jumpToSystemPrivacySetting()
|
|
|
+ vc?.dismiss(animated: true, completion: nil)
|
|
|
+ }).disposed(by: disposeBag)
|
|
|
+ // 跳转到麦克风权限
|
|
|
+ microphoneButton.rx.tap.subscribe(onNext: { [weak vc] _ in
|
|
|
+ LBXPermissions.jumpToSystemPrivacySetting()
|
|
|
+ vc?.dismiss(animated: true, completion: nil)
|
|
|
+ }).disposed(by: disposeBag)
|
|
|
+ // 跳转到相册权限
|
|
|
+ albumButton.rx.tap.subscribe(onNext: { [weak vc] _ in
|
|
|
+ LBXPermissions.jumpToSystemPrivacySetting()
|
|
|
+ vc?.dismiss(animated: true, completion: nil)
|
|
|
+ }).disposed(by: disposeBag)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// 返回
|
|
|
+ lazy var backButton: UIButton = {
|
|
|
+ let backButton = UIButton(type: UIButton.ButtonType.custom)
|
|
|
+ backButton.setImage(kImage(name: "navbar_back_white"), for: UIControl.State.normal)
|
|
|
+ return backButton
|
|
|
+ }()
|
|
|
+
|
|
|
+
|
|
|
+ /// 标题
|
|
|
+ lazy var titleLabel: UILabel = {
|
|
|
+ let titleLabel = UILabel()
|
|
|
+ titleLabel.text = "允许启用权限即可进入视频发布"
|
|
|
+ titleLabel.textColor = UIColor.white
|
|
|
+ titleLabel.font = kMediumFont20
|
|
|
+ return titleLabel
|
|
|
+ }()
|
|
|
+
|
|
|
+ /// 相机权限
|
|
|
+ lazy var cameraButton: UIButton = {
|
|
|
+ let cameraButton = UIButton(type: .custom)
|
|
|
+ cameraButton.setTitle("启用相机访问权限", for: UIControl.State.normal)
|
|
|
+ cameraButton.setTitleColor(kThemeColor, for: UIControl.State.normal)
|
|
|
+ cameraButton.titleLabel?.font = kRegularFont15
|
|
|
+ cameraButton.layer.borderColor = kThemeColor.cgColor
|
|
|
+ cameraButton.layer.borderWidth = 0.5
|
|
|
+ cameraButton.cornerRadius = 20
|
|
|
+ cameraButton.masksToBounds = true
|
|
|
+ return cameraButton
|
|
|
+ }()
|
|
|
+
|
|
|
+ /// 麦克风权限
|
|
|
+ lazy var microphoneButton: UIButton = {
|
|
|
+ let microphoneButton = UIButton(type: .custom)
|
|
|
+ microphoneButton.setTitle("启用麦克风访问权限", for: UIControl.State.normal)
|
|
|
+ microphoneButton.setTitleColor(kThemeColor, for: UIControl.State.normal)
|
|
|
+ microphoneButton.titleLabel?.font = kRegularFont15
|
|
|
+ microphoneButton.layer.borderColor = kThemeColor.cgColor
|
|
|
+ microphoneButton.layer.borderWidth = 0.5
|
|
|
+ microphoneButton.cornerRadius = 20
|
|
|
+ microphoneButton.masksToBounds = true
|
|
|
+ return microphoneButton
|
|
|
+ }()
|
|
|
+
|
|
|
+ /// 相册权限权限
|
|
|
+ lazy var albumButton: UIButton = {
|
|
|
+ let albumButton = UIButton(type: .custom)
|
|
|
+ albumButton.setTitle("启用相册访问权限", for: UIControl.State.normal)
|
|
|
+ albumButton.setTitleColor(kThemeColor, for: UIControl.State.normal)
|
|
|
+ albumButton.titleLabel?.font = kRegularFont15
|
|
|
+ albumButton.layer.borderColor = kThemeColor.cgColor
|
|
|
+ albumButton.layer.borderWidth = 0.5
|
|
|
+ albumButton.cornerRadius = 20
|
|
|
+ albumButton.masksToBounds = true
|
|
|
+ return albumButton
|
|
|
+ }()
|
|
|
+
|
|
|
+}
|