11//
22// PopupController.swift
3- // HTComponents
3+ // FXViewKit
44//
55// Created by mac on 2021/6/10.
66//
77
88import UIKit
9- import SnapKit
109
11- @objc ( HTPopupViewProtocol )
10+ @objc ( FXPopupViewProtocol )
1211public protocol PopupViewProtocol : NSObjectProtocol {
1312 weak var popupControllerDelegate : PopupControllerProtocol ? { set get }
1413}
1514
16- @objc ( HTPopupControllerProtocol )
15+ @objc ( FXPopupControllerProtocol )
1716public protocol PopupControllerProtocol : NSObjectProtocol {
1817 func dismiss( )
1918}
2019
21- @objc ( HTPopupController )
20+ @objc ( FXPopupController )
2221@objcMembers
2322open class PopupController : UIViewController , PopupControllerProtocol {
2423
@@ -40,12 +39,15 @@ open class PopupController: UIViewController, PopupControllerProtocol {
4039 super. viewDidLoad ( )
4140
4241 view. backgroundColor = UIColor . black. withAlphaComponent ( 0.3 )
42+ self . customView. translatesAutoresizingMaskIntoConstraints = false
4343
4444 view. addSubview ( self . customView)
45- self . customView. snp. makeConstraints { make in
46- make. center. equalToSuperview ( )
47- make. width. height. lessThanOrEqualToSuperview ( )
48- }
45+ NSLayoutConstraint . activate ( [
46+ customView. centerYAnchor. constraint ( equalTo: view. centerYAnchor) ,
47+ customView. centerXAnchor. constraint ( equalTo: view. centerXAnchor) ,
48+ customView. widthAnchor. constraint ( lessThanOrEqualTo: view. widthAnchor) ,
49+ customView. heightAnchor. constraint ( lessThanOrEqualTo: view. heightAnchor) ,
50+ ] )
4951
5052 }
5153
0 commit comments