//
|
// AuthRecordView.swift
|
// OKProject
|
//
|
// Created by 杨锴 on 2023/6/12.
|
// Copyright © 2023 yangwang. All rights reserved.
|
//
|
|
import UIKit
|
|
class AuthRecordView: UIView,LDNibView{
|
|
@IBOutlet weak var view_container: UIView!
|
@IBOutlet weak var label_content: UILabel!
|
|
private var clouse:(()->Void)!
|
|
override func awakeFromNib() {
|
super.awakeFromNib()
|
view_container.transform = .init(scaleX: 0.1, y: 0.1)
|
alpha = 0
|
layoutIfNeeded()
|
}
|
|
static func show(_ clouse:@escaping ()->Void){
|
let authRecordView = AuthRecordView.ld_loadNibView()
|
authRecordView.clouse = clouse
|
authRecordView.frame = app.window?.frame ?? .zero
|
app.window?.addSubview(authRecordView)
|
|
UIView.animate(withDuration: 0.4) {
|
authRecordView.view_container.transform = .init(scaleX: 1.0, y: 1.0)
|
authRecordView.alpha = 1
|
}
|
}
|
|
@IBAction func settingAction(_ sender: UIButton) {
|
UIView.animate(withDuration: 0.4) {
|
self.view_container.transform = .init(scaleX: 0.1, y: 0.1)
|
self.alpha = 0
|
} completion: { _ in
|
self.removeFromSuperview()
|
self.clouse()
|
}
|
}
|
|
@IBAction func closeAction(_ sender: UIButton) {
|
UIView.animate(withDuration: 0.4) {
|
self.view_container.transform = .init(scaleX: 0.1, y: 0.1)
|
self.alpha = 0
|
} completion: { _ in
|
self.removeFromSuperview()
|
}
|
}
|
}
|