Commit 26f2aa74 authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  解决复杂UI布局下 滑动返回失效问题
  // add tag 0.2.10-4
  // UI走查
  //  UI走查
parents 68c5fd19 732c5044
......@@ -220,6 +220,7 @@
045EEF232B9F171A0022A143 /* YHItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EEE762B9F171A0022A143 /* YHItemView.swift */; };
045EEF242B9F171A0022A143 /* YHStepView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EEE772B9F171A0022A143 /* YHStepView.swift */; };
045EEF252B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045EEE782B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift */; };
04684A7F2BD6520A007D95B8 /* UIScrollView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04684A7E2BD6520A007D95B8 /* UIScrollView+Extension.swift */; };
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */; };
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; };
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */; };
......@@ -670,6 +671,7 @@
045EEE762B9F171A0022A143 /* YHItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHItemView.swift; sourceTree = "<group>"; };
045EEE772B9F171A0022A143 /* YHStepView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHStepView.swift; sourceTree = "<group>"; };
045EEE782B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHMainInformationCardTableViewCell.swift; sourceTree = "<group>"; };
04684A7E2BD6520A007D95B8 /* UIScrollView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIScrollView+Extension.swift"; sourceTree = "<group>"; };
0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVerificationCodeLoginController.swift; sourceTree = "<group>"; };
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; };
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeResultViewController.swift; sourceTree = "<group>"; };
......@@ -2031,6 +2033,7 @@
A5ACE9032B4564F7002C94D2 /* UILable+Extension.swift */,
A5ACE9042B4564F7002C94D2 /* Array+Extension.swift */,
04754A942B96FF3D00F8ADCA /* UITextField+Extension.swift */,
04684A7E2BD6520A007D95B8 /* UIScrollView+Extension.swift */,
);
path = Extention;
sourceTree = "<group>";
......@@ -2519,6 +2522,7 @@
A5173D682BC399B9007D4E74 /* YHHomePageViewController.swift in Sources */,
045EEF0E2B9F171A0022A143 /* YHBasicInfoFillView.swift in Sources */,
045EEEA12B9F171A0022A143 /* YHWorkExperienceDetailModel.swift in Sources */,
04684A7F2BD6520A007D95B8 /* UIScrollView+Extension.swift in Sources */,
A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */,
A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */,
045EEF252B9F171A0022A143 /* YHMainInformationCardTableViewCell.swift in Sources */,
......@@ -2983,7 +2987,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -3189,7 +3193,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -3237,7 +3241,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......
......@@ -28,8 +28,7 @@ class YHBaseViewController: UIViewController {
#if DEBUG
IQKeyboardManager.shared.enable = true
#endif
navigationController?.interactivePopGestureRecognizer?.delegate = self
}
override var prefersStatusBarHidden: Bool {
......@@ -45,4 +44,36 @@ class YHBaseViewController: UIViewController {
printLog(#function)
#endif
}
func popGestureClose() {
if let ges = self.navigationController?.interactivePopGestureRecognizer?.view?.gestureRecognizers {
for item in ges {
item.isEnabled = false
}
}
}
func popGestureOpen() {
if let ges = self.navigationController?.interactivePopGestureRecognizer?.view?.gestureRecognizers {
for item in ges {
item.isEnabled = false
}
}
}
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
if children.count == 1 {
return false
}else{
return true
}
}
}
extension YHBaseViewController: UIGestureRecognizerDelegate {
// 这个方法是在手势将要激活前调用
// 返回YES允许右滑手势的激活,返回NO不允许右滑手势的激活
func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}
......@@ -10,6 +10,13 @@ import UIKit
class YHNavigationController: UINavigationController {
override func viewDidLoad() {
super.viewDidLoad()
guard let targets = interactivePopGestureRecognizer?.value(forKey: "_targets") as? [NSObject] else {return}
let targetObjc = targets[0]
let target = targetObjc.value(forKey: "target")
let action = Selector(("handleNavigationTransition:"))
let panges = UIPanGestureRecognizer(target: target, action: action)
view.addGestureRecognizer(panges)
}
override func pushViewController(_ viewController: UIViewController, animated: Bool) {
......
......@@ -46,6 +46,7 @@ class YHServiceListViewController: YHBaseViewController {
super.viewWillAppear(animated)
loadData()
}
}
extension YHServiceListViewController {
......
......@@ -11,13 +11,6 @@ import JXSegmentedView
class YHServiceViewController: YHBaseViewController {
var canScroll : Bool = false {
didSet {
for vc in arrItemVCs {
}
}
}
var defaltIndex: Int = 0
let arrItemTitles = ["香港身份","香港生活"]
......@@ -83,7 +76,6 @@ class YHServiceViewController: YHBaseViewController {
//segmentedViewDataSource一定要通过属性强持有!!!!!!!!!
segmentedView.dataSource = segmentedDataSource
segmentedView.delegate = self
segmentedView.collectionView.backgroundColor = .white
view.addSubview(segmentedView)
......@@ -134,26 +126,16 @@ class YHServiceViewController: YHBaseViewController {
listContainerView.frame = CGRect(x: 0, y: k_Height_safeAreaInsetsTop() + 48, width: view.bounds.size.width, height: view.bounds.size.height - 48 - k_Height_safeAreaInsetsTop())
}
}
extension YHServiceViewController {
func jumpToItemIndex(itemIndex : Int) {
self.segmentedView.selectItemAt(index: itemIndex)
}
}
extension YHServiceViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
// NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil)
navigationController?.interactivePopGestureRecognizer?.isEnabled = (segmentedView.selectedIndex == 0)
}
}
/// 正在滚动中的回调
///
/// - Parameters:
/// - segmentedView: JXSegmentedView
/// - leftIndex: 正在滚动中,相对位置处于左边的index
/// - rightIndex: 正在滚动中,相对位置处于右边的index
/// - percent: 从左往右计算的百分比
func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
// NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewWillBeginDragging"), object: nil)
extension YHServiceViewController {
func jumpToItemIndex(itemIndex : Int) {
self.segmentedView.selectItemAt(index: itemIndex)
}
}
......
......@@ -76,8 +76,9 @@ class YHMessageDetailListVC: YHBaseViewController {
label.text = "暂无消息".local
view.addSubview(label)
let topMargin = (KScreenHeight-k_Height_NavigationtBarAndStatuBar-124.0)/2.0
imgView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(204)
make.top.equalToSuperview().offset(topMargin)
make.width.height.equalTo(92)
make.centerX.equalTo(view)
}
......
......@@ -74,8 +74,9 @@ class YHMessageListVC: YHBaseViewController {
label.text = "暂无消息".local
view.addSubview(label)
let topMargin = (KScreenHeight-k_Height_NavigationtBarAndStatuBar-k_Height_TabBar-124.0)/2.0
imgView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(204)
make.top.equalToSuperview().offset(topMargin)
make.width.height.equalTo(92)
make.centerX.equalTo(view)
}
......@@ -307,7 +308,7 @@ extension YHMessageListVC: UITableViewDelegate, UITableViewDataSource {
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
if !isNotifyEnabled {
return 42.0
return 52.0
}
return 1.0
}
......@@ -326,16 +327,21 @@ extension YHMessageListVC: UITableViewDelegate, UITableViewDataSource {
if isNotifyEnabled {
return UIView()
}
let view = UIView()
view.backgroundColor = UIColor(hex: 0x3570DC, alpha: 0.06)
let contentview = UIView()
contentview.backgroundColor = UIColor(hex: 0x3570DC, alpha: 0.06)
view.addSubview(contentview)
contentview.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.bottom.equalToSuperview().offset(-10)
}
let label = UILabel()
label.textColor = UIColor(hex: 0x121A26)
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:13)
label.text = "开启通知,及时掌握最新消息".local
view.addSubview(label)
contentview.addSubview(label)
let enableBtn = UIButton()
enableBtn.setTitle("开启".local, for: .normal)
......@@ -343,7 +349,7 @@ extension YHMessageListVC: UITableViewDelegate, UITableViewDataSource {
enableBtn.titleLabel?.font = .PFSC_R(ofSize: 13)
enableBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 12, left: 20, bottom: 12, right: 20)
enableBtn.addTarget(self, action: #selector(didEnableNotifyBtnClicked), for: .touchUpInside)
view.addSubview(enableBtn)
contentview.addSubview(enableBtn)
label.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
......
......@@ -114,6 +114,8 @@ class YHDetailMessageCell: UITableViewCell {
detailLabel = UILabel()
detailLabel.textAlignment = .left
detailLabel.numberOfLines = 0
detailLabel.font = UIFont.PFSC_R(ofSize:14)
titleLabel.textColor = UIColor(hex: 0x121A26, alpha: 0.7)
whiteView.addSubview(detailLabel)
lineView = UIView()
......
......@@ -136,7 +136,7 @@ class YHMessageSessionCell: UITableViewCell {
contentView.addSubview(timeLabel)
bottomLineView = UIView()
bottomLineView.backgroundColor = UIColor(hex: 0xF0F3F7)
bottomLineView.backgroundColor = UIColor(hex:0x121A26,transparency: 0.05)
contentView.addSubview(bottomLineView)
iconContentView.snp.makeConstraints { make in
......@@ -179,7 +179,7 @@ class YHMessageSessionCell: UITableViewCell {
bottomLineView.snp.makeConstraints { make in
make.left.right.equalTo(detailLabel)
make.height.equalTo(1)
make.height.equalTo(0.5)
make.bottom.equalToSuperview()
}
}
......
//
// YHViewController.swift
// galaxy
//
// Created by EDY on 2024/4/22.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
extension UIScrollView {
// 解决有UIScrollView时不能在屏幕左边侧滑返回
open override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
// 过滤UITextView(因为UITextView继承自UIScrollView),否则会引起崩溃
if (gestureRecognizer.view?.isMember(of: UITextView.self))! {
return true
}
let velocity = (gestureRecognizer as! UIPanGestureRecognizer).velocity(in: self)
let location = gestureRecognizer.location(in: self)
if (velocity.x > 0.0 && Int(location.x) % Int(UIScreen.main.bounds.size.width) < 60) {
return false
}
return true
}
}
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