1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- //
- // TSGennertatorSelectStyleVC.swift
- // AIEmoji
- //
- // Created by 100Years on 2025/4/27.
- //
- class TSGennertatorSelectStyleVC: TSBaseVC {
- var viewModel: TSGennertatorSelectStyleViewModel = .init()
- lazy var bottomView: UIView = {
- let bottomView = UIView()
- bottomView.backgroundColor = .popupColor
- return bottomView
- }()
- lazy var xBtn: TSUIExpandedTouchButton = {
- let xBtn = TSUIExpandedTouchButton()
- xBtn.setUpButton(image: UIImage(named: "close_gray")) { [weak self] in
- guard let self = self else { return }
- self.dismiss(animated: true)
- }
- return xBtn
- }()
- var selectedValueBlock: ((IndexPath, TSGenerateOnlineStyleModel) -> Void)?
- lazy var styleCollectionVc: TSGennertatorSelectStyleListVc = {
- let vc = TSGennertatorSelectStyleListVc()
- vc.viewModel.currentIndexPath = viewModel.currentIndexPath
- vc.viewModel.layout = viewModel.layout
- vc.viewModel.datas = viewModel.initData
- vc.viewModel.isBigLoading = false
- vc.selectedValueBlock = selectedValueBlock
- vc.view.backgroundColor = .clear
- return vc
- }()
- override func createView() {
- view.backgroundColor = .clear
- contentView.backgroundColor = .clear
- setNavBarViewHidden(true)
- contentView.addSubview(bottomView)
- bottomView.snp.makeConstraints { make in
- make.bottom.leading.trailing.bottom.equalTo(0)
- make.top.equalTo(104 + k_Nav_Height)
- }
-
- let topView = UIView()
- contentView.addSubview(topView)
- topView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clickTopView)))
- topView.snp.makeConstraints { make in
- make.top.leading.trailing.equalTo(0)
- make.bottom.equalTo(bottomView.snp.top)
- }
-
-
- setContentView()
- kDelayMainShort {
- self.bottomView.cornersRound(radius: 20, corner: [.topLeft, .topRight])
- }
- }
- func setContentView() {
- let titleLabel = UILabel.createLabel(text: "Select Style".localized, font: .font(size: 16, weight: .medium), textColor: .white)
- bottomView.addSubview(titleLabel)
- titleLabel.snp.makeConstraints { make in
- make.leading.equalTo(16)
- make.top.equalTo(24)
- }
- bottomView.addSubview(xBtn)
- xBtn.snp.makeConstraints { make in
- make.top.equalTo(8)
- make.trailing.equalTo(-8)
- make.width.height.equalTo(24)
- }
- bottomView.addSubview(styleCollectionVc.view)
- styleCollectionVc.view.snp.makeConstraints { make in
- make.top.equalTo(56)
- make.leading.trailing.equalTo(0)
- make.bottom.equalTo(0)
- }
- addChild(styleCollectionVc)
- styleCollectionVc.didMove(toParent: self)
- }
- override func dealThings() {
- addPullDownClosePage()
- }
-
- @objc func clickTopView(){
- self.dismiss()
- }
- }
|