Commit 8bbad709 authored by David黄金龙's avatar David黄金龙

全局 tips 展示

parent 57f618ab
...@@ -186,6 +186,7 @@ ...@@ -186,6 +186,7 @@
A58556C02B6C82AF003746B2 /* YHScoreResultBaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58556BF2B6C82AF003746B2 /* YHScoreResultBaseModel.swift */; }; A58556C02B6C82AF003746B2 /* YHScoreResultBaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58556BF2B6C82AF003746B2 /* YHScoreResultBaseModel.swift */; };
A58556C22B6C8412003746B2 /* YHScoreResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58556C12B6C8412003746B2 /* YHScoreResultModel.swift */; }; A58556C22B6C8412003746B2 /* YHScoreResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58556C12B6C8412003746B2 /* YHScoreResultModel.swift */; };
A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A58951C42B398D1000225C19 /* Launch Screen.storyboard */; }; A58951C52B398D1000225C19 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A58951C42B398D1000225C19 /* Launch Screen.storyboard */; };
A592BFEF2B9AB720004C04A9 /* YHWholeScreenTipsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A592BFEE2B9AB720004C04A9 /* YHWholeScreenTipsView.swift */; };
A596C39F2B84D9100067BBB8 /* YHOtherResidenceFillView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596C3992B84D9100067BBB8 /* YHOtherResidenceFillView.swift */; }; A596C39F2B84D9100067BBB8 /* YHOtherResidenceFillView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596C3992B84D9100067BBB8 /* YHOtherResidenceFillView.swift */; };
A596C3A02B84D9100067BBB8 /* YHOtherInfoFillCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596C39A2B84D9100067BBB8 /* YHOtherInfoFillCell.swift */; }; A596C3A02B84D9100067BBB8 /* YHOtherInfoFillCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596C39A2B84D9100067BBB8 /* YHOtherInfoFillCell.swift */; };
A596C3A12B84D9100067BBB8 /* YHOtherTextViewItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596C39B2B84D9100067BBB8 /* YHOtherTextViewItemView.swift */; }; A596C3A12B84D9100067BBB8 /* YHOtherTextViewItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596C39B2B84D9100067BBB8 /* YHOtherTextViewItemView.swift */; };
...@@ -510,6 +511,7 @@ ...@@ -510,6 +511,7 @@
A58556BF2B6C82AF003746B2 /* YHScoreResultBaseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreResultBaseModel.swift; sourceTree = "<group>"; }; A58556BF2B6C82AF003746B2 /* YHScoreResultBaseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreResultBaseModel.swift; sourceTree = "<group>"; };
A58556C12B6C8412003746B2 /* YHScoreResultModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreResultModel.swift; sourceTree = "<group>"; }; A58556C12B6C8412003746B2 /* YHScoreResultModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHScoreResultModel.swift; sourceTree = "<group>"; };
A58951C42B398D1000225C19 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; }; A58951C42B398D1000225C19 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
A592BFEE2B9AB720004C04A9 /* YHWholeScreenTipsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWholeScreenTipsView.swift; sourceTree = "<group>"; };
A596C3992B84D9100067BBB8 /* YHOtherResidenceFillView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHOtherResidenceFillView.swift; sourceTree = "<group>"; }; A596C3992B84D9100067BBB8 /* YHOtherResidenceFillView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHOtherResidenceFillView.swift; sourceTree = "<group>"; };
A596C39A2B84D9100067BBB8 /* YHOtherInfoFillCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHOtherInfoFillCell.swift; sourceTree = "<group>"; }; A596C39A2B84D9100067BBB8 /* YHOtherInfoFillCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHOtherInfoFillCell.swift; sourceTree = "<group>"; };
A596C39B2B84D9100067BBB8 /* YHOtherTextViewItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHOtherTextViewItemView.swift; sourceTree = "<group>"; }; A596C39B2B84D9100067BBB8 /* YHOtherTextViewItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHOtherTextViewItemView.swift; sourceTree = "<group>"; };
...@@ -1440,6 +1442,7 @@ ...@@ -1440,6 +1442,7 @@
A5ACE9112B4564F7002C94D2 /* YhOverlayView.swift */, A5ACE9112B4564F7002C94D2 /* YhOverlayView.swift */,
A5ACE9122B4564F7002C94D2 /* YhCacheTool.swift */, A5ACE9122B4564F7002C94D2 /* YhCacheTool.swift */,
A5ACE9132B4564F7002C94D2 /* YhConstant.swift */, A5ACE9132B4564F7002C94D2 /* YhConstant.swift */,
A592BFEE2B9AB720004C04A9 /* YHWholeScreenTipsView.swift */,
); );
path = Helper; path = Helper;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2048,6 +2051,7 @@ ...@@ -2048,6 +2051,7 @@
044CC6252B873F330083FF76 /* YHCollegeSearchViewController.swift in Sources */, 044CC6252B873F330083FF76 /* YHCollegeSearchViewController.swift in Sources */,
0468D42B2B55019900CFB916 /* YHAnalytics.swift in Sources */, 0468D42B2B55019900CFB916 /* YHAnalytics.swift in Sources */,
A5ACE93C2B4564F7002C94D2 /* UIColor+Extension.swift in Sources */, A5ACE93C2B4564F7002C94D2 /* UIColor+Extension.swift in Sources */,
A592BFEF2B9AB720004C04A9 /* YHWholeScreenTipsView.swift in Sources */,
04E86E4F2B8479B700A35F4B /* YHWorkIntroductionItemView.swift in Sources */, 04E86E4F2B8479B700A35F4B /* YHWorkIntroductionItemView.swift in Sources */,
040ED4612B9173DE005CA3F8 /* YHHKIDCardModel.swift in Sources */, 040ED4612B9173DE005CA3F8 /* YHHKIDCardModel.swift in Sources */,
044CC62D2B876C980083FF76 /* YHSheetPickerViewType.swift in Sources */, 044CC62D2B876C980083FF76 /* YHSheetPickerViewType.swift in Sources */,
......
...@@ -109,6 +109,12 @@ class YHOtherInfoSessionView: UIView { ...@@ -109,6 +109,12 @@ class YHOtherInfoSessionView: UIView {
make.height.width.equalTo(16) make.height.width.equalTo(16)
} }
let tap : UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(tapButton(gestureRecognizer:)))
iconImageV.isUserInteractionEnabled = true
iconImageV.addGestureRecognizer(tap)
iconImageV.backgroundColor = .red//for test hjl
//delButton //delButton
addSubview(delButton) addSubview(delButton)
...@@ -120,6 +126,10 @@ class YHOtherInfoSessionView: UIView { ...@@ -120,6 +126,10 @@ class YHOtherInfoSessionView: UIView {
} }
delButton.addTarget(self, action: #selector(clickDeleteBtn), for: .touchUpInside) delButton.addTarget(self, action: #selector(clickDeleteBtn), for: .touchUpInside)
} }
@objc func tapButton(gestureRecognizer:UITapGestureRecognizer) {
YHWholeScreenTipsView.show(type: .residenceInfo, targetView: iconImageV)
}
} }
extension YHOtherInfoSessionView { extension YHOtherInfoSessionView {
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
// //
import UIKit import UIKit
//import SnapKit
import DeviceKit import DeviceKit
class YHLoginViewController: YHBaseViewController { class YHLoginViewController: YHBaseViewController {
......
...@@ -103,9 +103,40 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -103,9 +103,40 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
return img return img
}() }()
let bigView : UIView = UIView()
let smallButton : UIButton = UIButton(type: .custom)
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
initView() initView()
view.addSubview(bigView)
bigView.backgroundColor = .green
bigView.snp.makeConstraints { make in
make.top.equalTo(200)
make.width.equalTo(200)
make.height.equalTo(200)
make.left.equalTo(200)
}
smallButton.addTarget(self, action: #selector(clickBtn), for: .touchUpInside)
smallButton.backgroundColor = .red
bigView.addSubview(smallButton)
smallButton.snp.makeConstraints { make in
make.top.equalTo(100)
make.left.equalTo(100)
make.width.equalTo(100)
make.height.equalTo(100)
}
view.layoutIfNeeded()
let crect = smallButton.convert(smallButton.frame, to: UIApplication.shared.yhKeyWindow())
return
}
@objc func clickBtn() {
} }
func checkLogin()->Bool { func checkLogin()->Bool {
......
//
// YHWholeScreenTipsView.swift
// galaxy
//
// Created by davidhuangA on 2024/3/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
enum YHWholeScreenTipsViewType : Int {
case unKnow //默认情况
case residenceInfo //居住信息
}
class YHWholeScreenTipsView: UIView {
lazy var blackMaskView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0x000000, alpha: 0.1)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismiss))
view.addGestureRecognizer(tap)
return view
}()
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(hex: 0x222222, alpha: 0.9)
view.layer.cornerRadius = kCornerRadius6
view.clipsToBounds = true
return view
}()
lazy var contentLable : UILabel = {
let lable = UILabel()
lable.text = "依日期顺序列出你自出生后曾居住12个月或更长时间的所有国家或地区,包括你的现居国家或地区"
lable.font = UIFont.PFSC_R(ofSize: 14)
lable.textColor = .white
lable.numberOfLines = 0
return lable
}()
init(type: YHWholeScreenTipsViewType, targetView : UIView) {
super.init(frame: UIScreen.main.bounds)
contentLable.text = getTitleBy(type: type)
self.createUI(targetView : targetView)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func getTitleBy(type : YHWholeScreenTipsViewType)-> String {
switch type {
case .residenceInfo:
return "依日期顺序列出你自出生后曾居住12个月或更长时间的所有国家或地区,包括你的现居国家或地区"
default:
return "--"
}
}
func show() {
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
static func show(type:YHWholeScreenTipsViewType, targetView : UIView) {
let view = YHWholeScreenTipsView(type: type,targetView : targetView)
view.show()
}
@objc func dismiss() {
self.removeFromSuperview()
}
func createUI(targetView : UIView) {
addSubview(blackMaskView)
addSubview(whiteContentView)
whiteContentView.addSubview(contentLable)
blackMaskView.snp.makeConstraints { make in
make.edges.equalTo(0)
}
let rrrrr = targetView.convert(targetView.bounds, to: UIApplication.shared.yhKeyWindow())
let left = rrrrr.origin.x
let top = rrrrr.origin.y + targetView.height + 5
whiteContentView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(left)
make.top.equalToSuperview().offset(top)
make.width.equalTo(214)
}
contentLable.snp.makeConstraints { make in
make.top.left.equalTo(12)
make.right.bottom.equalTo(-12)
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment