无故事王国
2023-09-18 b395e5ea758b24803743535f86bf443765237551
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
//  GamesIntruduceView.swift
//  WanPai
//
//  Created by 无故事王国 on 2023/9/15.
//
 
import UIKit
import JQTools
 
class GamesIntruduceView: UIView,JQNibView{
 
    @IBOutlet weak var img_profile: UIImageView!
    @IBOutlet weak var label_content: UILabel!
    @IBOutlet weak var view_container: UIView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        view_container.transform = CGAffineTransform(scaleX: 0.1, y: 0.1)
        alpha = 0
        layoutIfNeeded()
    }
 
    static func show(){
        let intruduceView = GamesIntruduceView.jq_loadNibView()
        intruduceView.frame = sceneDelegate?.window?.frame ?? .zero
        sceneDelegate?.window?.addSubview(intruduceView)
 
        UIView.animate(withDuration: 0.5) {
            intruduceView.alpha = 1
            intruduceView.view_container.transform = CGAffineTransform(scaleX: 1.0, y: 1.0)
        } completion: { _ in
 
        }
    }
 
 
    @IBAction func closeAction(_ sender: UIButton) {
        UIView.animate(withDuration: 0.5) {
            self.alpha = 0
            self.view_container.transform = CGAffineTransform(scaleX: 0.1, y: 0.1)
        } completion: { _ in
            self.removeFromSuperview()
        }
    }
    
}