//
|
// ShareView.swift
|
// XQMuse
|
//
|
// Created by 无故事王国 on 2024/8/14.
|
//
|
|
import UIKit
|
import JQTools
|
|
class ShareView: UIView,JQNibView{
|
|
@IBOutlet weak var view_content: UIView!
|
@IBOutlet weak var cons_bottom: NSLayoutConstraint!
|
|
override func awakeFromNib() {
|
super.awakeFromNib()
|
|
alpha = 0
|
cons_bottom.constant = -JQ_ScreenW
|
layoutIfNeeded()
|
}
|
|
static func show(){
|
let shareView = ShareView.jq_loadNibView()
|
sceneDelegate?.window?.addSubview(shareView)
|
shareView.frame = sceneDelegate?.window?.frame ?? .zero
|
shareView.cons_bottom.constant = 0
|
|
UIView.animate(withDuration: 0.4) {
|
shareView.layoutIfNeeded()
|
shareView.alpha = 1
|
}
|
}
|
|
@IBAction func cancelAction(_ sender: UIButton) {
|
self.cons_bottom.constant = -JQ_ScreenW
|
UIView.animate(withDuration: 0.4) {
|
self.layoutIfNeeded()
|
self.alpha = 0
|
} completion: { _ in
|
self.removeFromSuperview()
|
}
|
}
|
}
|