Commit ca8a7ef1 authored by CZ1004's avatar CZ1004

1、添加TensorFlowLiteSwift库

2、添加设置页面
parent be2f74aa
......@@ -97,6 +97,7 @@
EB388E582D8A61A800629B0D /* Frameworks */,
EB388E592D8A61A800629B0D /* Resources */,
B06228D82143041809F900CE /* [CP] Embed Pods Frameworks */,
31462A82044E900B1963FE3A /* [CP] Copy Pods Resources */,
);
buildRules = (
);
......@@ -156,6 +157,23 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
31462A82044E900B1963FE3A /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PhoneManager/Pods-PhoneManager-resources.sh\"\n";
showEnvVarsInLog = 0;
};
594FD43819933850E07C4C9C /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "button_switch_off.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "button_switch_off@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "button_switch_off@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "button_switch_on.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "button_switch_on@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "button_switch_on@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_about_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_about_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_about_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_delete_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_delete_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_delete_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_email_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_email_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_email_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_faq_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_faq_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_faq_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_hints_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_hints_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_hints_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_ins_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_ins_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_ins_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_list_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_list_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_list_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_more_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_more_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_more_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_out_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_out_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_out_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_pin_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_pin_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_pin_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_privacy_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_privacy_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_privacy_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_rate_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_rate_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_rate_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_restore_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_restore_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_restore_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_share_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_share_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_share_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_vibration_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_vibration_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_vibration_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_widgets_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_widgets_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_widgets_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "icon_left_setting_grey.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon_left_setting_grey@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon_left_setting_grey@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "img_light_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "img_light_setting@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_light_setting@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "img_return_pop.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "img_return_pop@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "img_return_pop@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "logo_phone_manager.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "logo_phone_manager@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "logo_phone_manager@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -79,8 +79,10 @@ class HomeNavView:UIView {
}
@objc private func settingBtnClick() {
let homeNavViewModel = HomeNavViewModel()
let settingViewController = SettingViewController()
homeNavViewModel.pushToDetailController(currentView: self, destnationController: settingViewController)
}
func setFileAndCount(count:Int,fileSize:Double) {
......
//
// HomeNavViewModel.swift
// PhoneManager
//
// Created by edy on 2025/3/28.
//
import Foundation
class HomeNavViewModel{
func pushToDetailController(currentView : UIView, destnationController: BaseViewController) {
let navigationController = currentView.responderViewController()?.navigationController
navigationController?.pushViewController(destnationController, animated: true)
}
}
//
// SettingModel.swift
// PhoneManager
//
// Created by edy on 2025/3/31.
//
import Foundation
struct SettingModel {
var sectionTitle: String
var rowInfo : [RowInfoModel]
init(sectionTitle: String, rowInfo: [RowInfoModel]) {
self.sectionTitle = sectionTitle
self.rowInfo = rowInfo
}
}
struct RowInfoModel{
var imageName : String
var title: String
init(imageName: String, title: String) {
self.imageName = imageName
self.title = title
}
}
func getSettingViewInfo() -> [SettingModel] {
return [
SettingModel(sectionTitle: "",rowInfo: [RowInfoModel(imageName: "",title: "")]),
SettingModel(sectionTitle: "FROM DEVELOPER",rowInfo:
[RowInfoModel(imageName: "ic_more_setting",title: "More Apps From Us")]),
SettingModel(sectionTitle: "EMAIL",rowInfo:
[RowInfoModel(imageName: "ic_out_setting",title: "Sign Out")]),
SettingModel(sectionTitle: "UTILITIES",rowInfo:
[RowInfoModel(imageName: "ic_widgets_setting",title: "Widgets")]),
SettingModel(sectionTitle: "SECRET SPACE",rowInfo: [
RowInfoModel(imageName: "ic_pin_setting",title: "Use PIN"),
RowInfoModel(imageName: "ic_delete_setting",title: "Remove After lmport")]),
SettingModel(sectionTitle: "OTHERS",rowInfo:
[RowInfoModel(imageName: "ic_vibration_setting",title: "Vibration"),
RowInfoModel(imageName: "ic_list_setting",title: "Keep List"),
RowInfoModel(imageName: "ic_hints_setting",title: "Hints")]),
SettingModel(sectionTitle: "SUPPORT",rowInfo:
[RowInfoModel(imageName: "ic_faq_setting",title: "FAQ"),
RowInfoModel(imageName: "ic_email_setting",title: "Email Support"),
RowInfoModel(imageName: "ic_restore_setting",title: "Restore Purchase"),
RowInfoModel(imageName: "ic_about_setting",title: "About Us"),
RowInfoModel(imageName: "ic_privacy_setting",title: "Privacy Policy")]),
SettingModel(sectionTitle: "STAY IN TOUCH",rowInfo:
[RowInfoModel(imageName: "ic_rate_setting",title: "Rate App"),
RowInfoModel(imageName: "ic_share_setting",title: "Share App"),
RowInfoModel(imageName: "ic_ins_setting",title: "Follow on Instagram")])]
}
//
// SettingNormalCell.swift
// PhoneManager
//
// Created by edy on 2025/3/31.
//
import Foundation
class SettingNormalCell : UITableViewCell {
override var frame: CGRect{
didSet{
var newFrame = frame
newFrame.origin.x += 15
newFrame.size.width -= 30
super.frame = newFrame
}
}
lazy var lineView : UIView = {
let lineView = UIView()
lineView.backgroundColor = .white
return lineView
}()
lazy var logoView : UIImageView = {
let logoView = UIImageView()
logoView.backgroundColor = .clear
return logoView
}()
lazy var fLabel : UILabel = {
let label = UILabel();
label.text = "ceshi"
label.font = UIFont(name: "PingFang SC-Bold", size: 14)
label.textColor = UIColor(red: 0.2, green: 0.2, blue: 0.2, alpha: 1)
label.textAlignment = .left
return label
}()
lazy var moreImageView : UIImageView = {
let sview:UIImageView = UIImageView()
sview.backgroundColor = .clear
sview.image = UIImage(named: "icon_left_setting_grey")
return sview
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.selectionStyle = .none
self.contentView.backgroundColor = UIColor(red: 0.95, green: 0.96, blue: 0.99, alpha: 1)
self.contentView.addSubview(self.logoView)
self.contentView.addSubview(self.fLabel)
self.contentView.addSubview(self.moreImageView)
self.contentView.addSubview(self.lineView)
self.logoView.snp.makeConstraints { make in
make.width.height.equalTo(28)
make.left.equalToSuperview().offset(16)
make.centerY.equalToSuperview()
}
self.fLabel.snp.makeConstraints { make in
make.left.equalTo(self.logoView.snp.right).offset(4)
make.centerY.equalToSuperview();
make.height.equalTo(20)
make.width.equalTo(206)
}
self.moreImageView.snp.makeConstraints { make in
make.width.height.equalTo(20)
make.right.equalToSuperview().offset(-16)
make.centerY.equalToSuperview()
}
self.lineView.snp.makeConstraints { make in
make.height.equalTo(1)
make.left.equalToSuperview().offset(15)
make.right.equalToSuperview().offset(-15)
make.bottom.equalToSuperview().offset(-1)
}
}
required init?(coder: NSCoder) {
super .init(coder: coder)
fatalError("init(coder:) has not been implemented")
}
override func layoutSubviews() {
super.layoutSubviews()
}
}
//
// SettingSwitchCell.swift
// PhoneManager
//
// Created by edy on 2025/3/31.
//
import Foundation
class SettingSwitchCell : UITableViewCell {
override var frame: CGRect{
didSet{
var newFrame = frame
newFrame.origin.x += 15
newFrame.size.width -= 30
super.frame = newFrame
}
}
lazy var lineView : UIView = {
let lineView = UIView()
lineView.backgroundColor = .white
return lineView
}()
lazy var logoView : UIImageView = {
let logoView = UIImageView()
logoView.backgroundColor = .clear
return logoView
}()
lazy var fLabel : UILabel = {
let label = UILabel();
label.text = "ceshi"
label.font = UIFont(name: "PingFang SC-Bold", size: 14)
label.textColor = UIColor(red: 0.2, green: 0.2, blue: 0.2, alpha: 1)
label.textAlignment = .left
return label
}()
lazy var openImageView : UIImageView = {
let sview:UIImageView = UIImageView()
sview.backgroundColor = .clear
sview.image = UIImage(named: "button_switch_off")
return sview
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.selectionStyle = .none
self.contentView.backgroundColor = UIColor(red: 0.95, green: 0.96, blue: 0.99, alpha: 1)
self.contentView.addSubview(self.logoView)
self.contentView.addSubview(self.fLabel)
self.contentView.addSubview(self.openImageView)
self.contentView.addSubview(self.lineView)
self.logoView.snp.makeConstraints { make in
make.width.height.equalTo(28)
make.left.equalToSuperview().offset(16)
make.centerY.equalToSuperview()
}
self.fLabel.snp.makeConstraints { make in
make.left.equalTo(self.logoView.snp.right).offset(4)
make.centerY.equalToSuperview();
make.height.equalTo(20)
make.width.equalTo(206)
}
self.openImageView.snp.makeConstraints { make in
make.height.equalTo(28)
make.width.equalTo(36)
make.right.equalToSuperview().offset(-16)
make.centerY.equalToSuperview()
}
self.lineView.snp.makeConstraints { make in
make.height.equalTo(1)
make.left.equalToSuperview().offset(15)
make.right.equalToSuperview().offset(-15)
make.bottom.equalToSuperview().offset(-1)
}
}
required init?(coder: NSCoder) {
super .init(coder: coder)
fatalError("init(coder:) has not been implemented")
}
override func layoutSubviews() {
super.layoutSubviews()
}
}
//
// SettingViewHeaderCell.swift
// PhoneManager
//
// Created by edy on 2025/3/28.
//
import Foundation
class SettingViewHeaderCell : UITableViewCell {
lazy var logoView : UIImageView = {
let logoView = UIImageView()
logoView.layer.cornerRadius = 22.5
logoView.contentMode = .scaleAspectFit
logoView.translatesAutoresizingMaskIntoConstraints = false
logoView.image = UIImage(named: "logo_phone_manager")
return logoView
}()
lazy var fLabel : UILabel = {
let label = UILabel();
label.text = "Unlock Unlimited Access"
label.font = UIFont(name: "PingFang SC-Bold", size: 18)
label.textColor = UIColor(red: 0.2, green: 0.2, blue: 0.2, alpha: 1)
label.textAlignment = .center
return label
}()
lazy var sLabel : UILabel = {
let label = UILabel();
label.text = "Enjoy unlimited access with all Cleanup features"
label.font = UIFont(name: "PingFang SC-Regular", size: 14)
label.textColor = UIColor(red: 0.4, green: 0.4, blue: 0.4, alpha: 1)
label.textAlignment = .center
return label
}()
lazy var preButtonImageView : UIImageView = {
let preButtonImageView = UIImageView()
preButtonImageView.image = UIImage(named: "img_light_setting")
preButtonImageView.backgroundColor = .clear
let tap = UITapGestureRecognizer()
tap.addTarget(SettingNormalCell.self, action: #selector(leanMoreBtnClick))
preButtonImageView.isUserInteractionEnabled = true
preButtonImageView.addGestureRecognizer(tap)
return preButtonImageView
}()
lazy var moreButton : UIButton = {
let sview:UIButton = UIButton()
sview.backgroundColor = UIColor.colorWithHex(hexStr: mColor)
sview.setTitle("Learn More", for: .normal)
sview.setTitleColor(UIColor.white, for: .normal)
sview.titleLabel?.font = .systemFont(ofSize: 16, weight: .bold)
sview.layer.cornerRadius = 23
sview.layer.masksToBounds = true
sview.addTarget(SettingViewHeaderCell.self, action: #selector(leanMoreBtnClick), for: .touchUpInside)
return sview
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.selectionStyle = .none
self.contentView.addSubview(self.logoView)
self.contentView.addSubview(self.fLabel)
self.contentView.addSubview(self.sLabel)
self.contentView.addSubview(self.moreButton)
self.moreButton.addSubview(self.preButtonImageView)
self.logoView.snp.makeConstraints { make in
make.width.height.equalTo(150)
make.centerX.equalToSuperview()
make.top.equalToSuperview().offset(48)
}
self.fLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(15)
make.right.equalToSuperview().offset(-15)
make.top.equalTo(self.logoView.snp.bottom).offset(40)
make.height.equalTo(25)
}
self.sLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(15)
make.right.equalToSuperview().offset(-15)
make.top.equalTo(fLabel.snp.bottom).offset(4)
make.height.equalTo(20)
}
self.preButtonImageView.snp.makeConstraints { make in
make.width.height.equalTo(46)
make.left.equalToSuperview().offset(6)
make.top.equalToSuperview()
}
self.moreButton.snp.makeConstraints { make in
make.width.equalTo(245)
make.height.equalTo(46)
make.centerX.equalToSuperview()
make.top.equalTo(self.sLabel.snp.bottom).offset(20)
}
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@objc func leanMoreBtnClick() {
Print("点击了---Learn More")
}
}
//
// SignOutTipView.swift
// PhoneManager
//
// Created by edy on 2025/3/31.
//
import Foundation
class SignOutTipView : UIView {
override init(frame: CGRect) {
super.init(frame: frame)
self.addSubview(backView)
self.backView.addSubview(self.contentView)
self.contentView.addSubview(self.logoView)
self.contentView.addSubview(self.fLabel)
self.contentView.addSubview(self.yesButton)
self.contentView.addSubview(self.cancelButton)
self.contentView.snp.makeConstraints { make in
make.width.equalTo(295)
make.height.equalTo(370)
make.center.equalToSuperview()
}
self.logoView.snp.makeConstraints { make in
make.width.equalTo(192)
make.height.equalTo(158)
make.top.equalToSuperview().offset(28)
make.centerX.equalToSuperview()
}
self.fLabel.snp.makeConstraints { make in
make.top.equalTo(self.logoView.snp.bottom).offset(0)
make.left.equalToSuperview().offset(24)
make.right.equalToSuperview().offset(-24)
make.height.equalTo(56)
}
self.yesButton.snp.makeConstraints { make in
make.top.equalTo(self.fLabel.snp.bottom).offset(16)
make.left.equalToSuperview().offset(24)
make.right.equalToSuperview().offset(-24)
make.height.equalTo(46)
}
self.cancelButton.snp.makeConstraints { make in
make.top.equalTo(self.yesButton.snp.bottom).offset(4)
make.left.equalToSuperview().offset(24)
make.right.equalToSuperview().offset(-24)
make.height.equalTo(46)
}
}
lazy var backView : UIView = {
let maskView = UIView(frame: self.bounds)
maskView.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5000)
return maskView
}()
lazy var contentView : UIView = {
let contentView = UIView(frame: self.bounds)
contentView.backgroundColor = .white
contentView.layer.cornerRadius = 20
contentView.layer.masksToBounds = true
return contentView
}()
lazy var logoView : UIImageView = {
let logoView = UIImageView()
logoView.image = UIImage(named: "img_return_pop")
logoView.backgroundColor = .clear
return logoView
}()
lazy var fLabel : UILabel = {
let label = UILabel();
label.text = "Are you sure you want to sign out?"
label.font = UIFont(name: "PingFang SC-Bold", size: 20)
label.textColor = UIColor(red: 0.1, green: 0.1, blue: 0.1, alpha: 1)
label.textAlignment = .center
label.numberOfLines = 0
return label
}()
lazy var yesButton : UIButton = {
let sview:UIButton = UIButton()
sview.backgroundColor = UIColor.colorWithHex(hexStr: mColor)
sview.setTitle("Yes", for: .normal)
sview.setTitleColor(UIColor.white, for: .normal)
sview.titleLabel?.font = .systemFont(ofSize: 16, weight: .bold)
sview.layer.cornerRadius = 23
sview.layer.masksToBounds = true
return sview
}()
lazy var cancelButton : UIButton = {
let sview:UIButton = UIButton()
sview.backgroundColor = .white
sview.setTitle("Cancel", for: .normal)
sview.setTitleColor(UIColor(red: 0.4, green: 0.4, blue: 0.4, alpha: 1), for: .normal)
sview.titleLabel?.font = UIFont(name: "PingFang SC-Bold", size: 16)
sview.layer.cornerRadius = 23
sview.layer.masksToBounds = true
sview.addTarget(self, action: #selector(clickCancelAction), for: UIControl.Event.touchUpInside)
return sview
}()
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@objc func clickCancelAction() {
self.removeFromSuperview()
}
}
//
// SettingVieController.swift
// PhoneManager
//
// Created by edy on 2025/3/28.
//
import Foundation
class SettingViewController : BaseViewController , UITableViewDelegate, UITableViewDataSource{
var modelData: [SettingModel]?
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
modelData = getSettingViewInfo()
self.tableView.reloadData()
}
lazy var tableView : UITableView = {
let cY = titleView.height + titleView.y
let tableView:UITableView = UITableView.init(frame: CGRect(x: 0, y: cY, width: view.width, height: view.height - cY) , style: UITableView.Style.grouped)
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.showsVerticalScrollIndicator = false
tableView.delegate = self
tableView.dataSource = self
tableView.register(SettingViewHeaderCell.classForCoder(), forCellReuseIdentifier: "SettingViewHeaderCell")
tableView.register(SettingNormalCell.classForCoder(), forCellReuseIdentifier: "SettingNormalCell")
tableView.register(SettingSwitchCell.classForCoder(), forCellReuseIdentifier: "SettingSwitchCell")
tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
if #available(iOS 15.0, *) {
tableView.sectionHeaderTopPadding = 0
}
return tableView
}()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
self.titleView.titleLabel.text = "Settings"
self.titleView.titleLabel.textAlignment = .left
self.titleView.titleLabel.font = UIFont(name: "PingFang SC-Bold", size: 20)
self.titleView.titleLabel.textColor = UIColor(red: 0.2, green: 0.2, blue: 0.2, alpha: 1)
modelData = getSettingViewInfo()
self.view.addSubview(tableView)
self.tableView.reloadData()
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
let model : SettingModel = modelData![section]
return model.rowInfo.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
let cell : SettingViewHeaderCell = tableView.dequeueReusableCell(withIdentifier: "SettingViewHeaderCell",for: indexPath) as! SettingViewHeaderCell
return cell
}else{
let model : SettingModel = modelData![indexPath.section]
let detailModel : RowInfoModel = model.rowInfo[indexPath.row]
if indexPath.section == 4 || (indexPath.section == 5 && indexPath.row == 0){
let cell : SettingSwitchCell = tableView.dequeueReusableCell(withIdentifier: "SettingSwitchCell",for: indexPath) as! SettingSwitchCell
cell.fLabel.text = detailModel.title
cell.logoView.image = UIImage(named: detailModel.imageName)
let rowNum = tableView.numberOfRows(inSection: indexPath.section)
cell.layer.mask = nil
cell.lineView.isHidden = false
if rowNum == 1 {
cell.cornerCut(radius: 12, corner: UIRectCorner(rawValue: (UIRectCorner.bottomLeft.rawValue)|(UIRectCorner.bottomRight.rawValue)|(UIRectCorner.topLeft.rawValue)|(UIRectCorner.topRight.rawValue)))
cell.lineView.isHidden = true
}else{
if indexPath.row == 0 {
cell.cornerCut(radius: 12, corner: UIRectCorner(rawValue: (UIRectCorner.topLeft.rawValue)|(UIRectCorner.topRight.rawValue)))
}
if (indexPath.row == rowNum - 1){
cell.lineView.isHidden = true
cell.cornerCut(radius: 12,corner: UIRectCorner(rawValue: (UIRectCorner.bottomLeft.rawValue)|(UIRectCorner.bottomRight.rawValue)))
}
}
return cell
}else{
let cell : SettingNormalCell = tableView.dequeueReusableCell(withIdentifier: "SettingNormalCell",for: indexPath) as! SettingNormalCell
cell.fLabel.text = detailModel.title
cell.logoView.image = UIImage(named: detailModel.imageName)
let rowNum = tableView.numberOfRows(inSection: indexPath.section)
cell.layer.mask = nil
cell.lineView.isHidden = false
if rowNum == 1 {
cell.cornerCut(radius: 12, corner: UIRectCorner(rawValue: (UIRectCorner.bottomLeft.rawValue)|(UIRectCorner.bottomRight.rawValue)|(UIRectCorner.topLeft.rawValue)|(UIRectCorner.topRight.rawValue)))
cell.lineView.isHidden = true
}else{
if indexPath.row == 0 {
cell.cornerCut(radius: 12, corner: UIRectCorner(rawValue: (UIRectCorner.topLeft.rawValue)|(UIRectCorner.topRight.rawValue)))
}
if (indexPath.row == rowNum - 1){
cell.lineView.isHidden = true
cell.cornerCut(radius: 12,corner: UIRectCorner(rawValue: (UIRectCorner.bottomLeft.rawValue)|(UIRectCorner.bottomRight.rawValue)))
}
}
return cell
}
}
}
func numberOfSections(in tableView: UITableView) -> Int {
return modelData!.count
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if section == 0{
return 0
}
return 49
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
view.frame = CGRect(x: 0, y: 0, width: view.width, height: 49)
view.backgroundColor = .clear
let titleLabel = UILabel()
titleLabel.text = modelData![section].sectionTitle
titleLabel.font = UIFont(name: "PingFang SC-Bold", size: 12)
titleLabel.textColor = UIColor(red: 0.7, green: 0.7, blue: 0.7, alpha: 1)
titleLabel.frame = CGRect(x: 15, y: 20, width: 345, height: 17)
view.addSubview(titleLabel)
return view
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 0 {
return 385
}
return 60
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
Print("点了")
let signOutTipView = SignOutTipView(frame: self.view.frame)
self.view.addSubview(signOutTipView)
}
}
......@@ -9,6 +9,8 @@ target 'PhoneManager' do
pod 'Alamofire'
pod 'lottie-ios'
pod 'SnapKit'
pod 'OpenCV', '~> 4.0.0'
pod 'OpenCV'
pod 'TensorFlowLiteSwift'
end
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