Commit 3187f91b34bac4a0758befa32aaa8b391c92cb1b
Merge branch 'master' of http://bj.gitlab.cnlive.com/ios-team/CNLiveMateCode
# Conflicts: # metaCode.xcodeproj/project.pbxproj # metaCode/Classes/Other/AppDelegate.swift # metaCode/Supporting Files/Assets.xcassets/Home/homePage_backViewImage.imageset/4671683516653_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/Home/homePage_backViewImage.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/Home/homePage_homePage_down.imageset/4491683252485_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/Home/homePage_homePage_down.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/Home/homePage_mainView_front.imageset/4621683513846_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/Home/homePage_mainView_front.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/Home/homePage_payMoneyImage.imageset/4651683514228_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/Home/homePage_payMoneyImage.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/Home/homePage_topImage.imageset/4771683609542_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/Home/homePage_topImage.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/Home/homePage_zhongguorenming_bank.imageset/4431683250159_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/Home/homePage_zhongguorenming_bank.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_backViewImage.imageset/4671683516653_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_backViewImage.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_homePage_down.imageset/4491683252485_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_homePage_down.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_mainView_front.imageset/4621683513846_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_mainView_front.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_payMoneyImage.imageset/4651683514228_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_payMoneyImage.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_topImage.imageset/4771683609542_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_topImage.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_zhongguorenming_bank.imageset/4431683250159_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/HomePage/homePage_zhongguorenming_bank.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/homePage_backViewImage.imageset/4671683516653_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/homePage_backViewImage.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/homePage_homePage_down.imageset/4491683252485_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/homePage_homePage_down.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/homePage_mainView_front.imageset/4621683513846_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/homePage_mainView_front.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/homePage_payMoneyImage.imageset/4651683514228_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/homePage_payMoneyImage.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/homePage_topImage.imageset/4771683609542_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/homePage_topImage.imageset/Contents.json # metaCode/Supporting Files/Assets.xcassets/homePage_zhongguorenming_bank.imageset/4431683250159_.pic.jpg # metaCode/Supporting Files/Assets.xcassets/homePage_zhongguorenming_bank.imageset/Contents.json
Showing
45 changed files
with
704 additions
and
82 deletions
metaCode.xcodeproj/project.pbxproj
| ... | ... | @@ -14,10 +14,14 @@ |
| 14 | 14 | 790D018B2A2D8B3300C5978D /* CNLiveLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790D018A2A2D8B3300C5978D /* CNLiveLoginViewController.swift */; }; |
| 15 | 15 | 790D01912A2DAC5E00C5978D /* CNLiveConfigFontMacro.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790D01902A2DAC5E00C5978D /* CNLiveConfigFontMacro.swift */; }; |
| 16 | 16 | 796398932A260C0100D045EB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7963988C2A260C0100D045EB /* ViewController.swift */; }; |
| 17 | + 790D01852A2D89E100C5978D /* UIColor+CNHexColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790D01842A2D89E100C5978D /* UIColor+CNHexColor.swift */; }; | |
| 18 | + 796398932A260C0100D045EB /* CNMineViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7963988C2A260C0100D045EB /* CNMineViewController.swift */; }; | |
| 17 | 19 | 796398942A260C0100D045EB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7963988D2A260C0100D045EB /* AppDelegate.swift */; }; |
| 18 | 20 | 7963989D2A260E6200D045EB /* CNLiveBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7963989C2A260E6200D045EB /* CNLiveBaseViewController.swift */; }; |
| 19 | 21 | 79A68C4A2A26E6CE00DC3B43 /* (null) in Sources */ = {isa = PBXBuildFile; }; |
| 20 | 22 | 79A68C4C2A26EA6000DC3B43 /* (null) in Sources */ = {isa = PBXBuildFile; }; |
| 23 | + 7C4931292A2D8BA8000E44B4 /* CNLiveBaseTabBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C4931282A2D8BA8000E44B4 /* CNLiveBaseTabBarViewController.swift */; }; | |
| 24 | + 7C49312D2A2DB9FA000E44B4 /* UITabBar+CNBadge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C49312C2A2DB9FA000E44B4 /* UITabBar+CNBadge.swift */; }; | |
| 21 | 25 | 7CD675292A270F6A008354C1 /* WJColorChange.m in Sources */ = {isa = PBXBuildFile; fileRef = 7CD675282A270F6A008354C1 /* WJColorChange.m */; }; |
| 22 | 26 | 7CD6753C2A2740B0008354C1 /* CNBottomPayMoneyRemindView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CD675372A2740B0008354C1 /* CNBottomPayMoneyRemindView.swift */; }; |
| 23 | 27 | 7CD6753D2A2740B0008354C1 /* CNMainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CD675382A2740B0008354C1 /* CNMainView.swift */; }; |
| ... | ... | @@ -67,9 +71,13 @@ |
| 67 | 71 | 790D018A2A2D8B3300C5978D /* CNLiveLoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveLoginViewController.swift; sourceTree = "<group>"; }; |
| 68 | 72 | 790D01902A2DAC5E00C5978D /* CNLiveConfigFontMacro.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveConfigFontMacro.swift; sourceTree = "<group>"; }; |
| 69 | 73 | 7963988C2A260C0100D045EB /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; }; |
| 74 | + 790D01842A2D89E100C5978D /* UIColor+CNHexColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIColor+CNHexColor.swift"; sourceTree = "<group>"; }; | |
| 75 | + 7963988C2A260C0100D045EB /* CNMineViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CNMineViewController.swift; sourceTree = "<group>"; }; | |
| 70 | 76 | 7963988D2A260C0100D045EB /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; |
| 71 | 77 | 7963989C2A260E6200D045EB /* CNLiveBaseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CNLiveBaseViewController.swift; sourceTree = "<group>"; }; |
| 72 | 78 | 79A68C512A26F59C00DC3B43 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = metaCode/Info.plist; sourceTree = "<group>"; }; |
| 79 | + 7C4931282A2D8BA8000E44B4 /* CNLiveBaseTabBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveBaseTabBarViewController.swift; sourceTree = "<group>"; }; | |
| 80 | + 7C49312C2A2DB9FA000E44B4 /* UITabBar+CNBadge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITabBar+CNBadge.swift"; sourceTree = "<group>"; }; | |
| 73 | 81 | 7CD675262A270F69008354C1 /* metaCode-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "metaCode-Bridging-Header.h"; sourceTree = "<group>"; }; |
| 74 | 82 | 7CD675272A270F6A008354C1 /* WJColorChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WJColorChange.h; sourceTree = "<group>"; }; |
| 75 | 83 | 7CD675282A270F6A008354C1 /* WJColorChange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WJColorChange.m; sourceTree = "<group>"; }; |
| ... | ... | @@ -143,7 +151,8 @@ |
| 143 | 151 | 790D01832A2D89E100C5978D /* Extensions */ = { |
| 144 | 152 | isa = PBXGroup; |
| 145 | 153 | children = ( |
| 146 | - 790D01842A2D89E100C5978D /* CNHexColor.swift */, | |
| 154 | + 790D01842A2D89E100C5978D /* UIColor+CNHexColor.swift */, | |
| 155 | + 7C49312C2A2DB9FA000E44B4 /* UITabBar+CNBadge.swift */, | |
| 147 | 156 | ); |
| 148 | 157 | path = Extensions; |
| 149 | 158 | sourceTree = "<group>"; |
| ... | ... | @@ -237,7 +246,6 @@ |
| 237 | 246 | 7963988B2A260C0100D045EB /* Other */ = { |
| 238 | 247 | isa = PBXGroup; |
| 239 | 248 | children = ( |
| 240 | - 7963988C2A260C0100D045EB /* ViewController.swift */, | |
| 241 | 249 | 7963988D2A260C0100D045EB /* AppDelegate.swift */, |
| 242 | 250 | ); |
| 243 | 251 | path = Other; |
| ... | ... | @@ -269,6 +277,7 @@ |
| 269 | 277 | children = ( |
| 270 | 278 | 790D018C2A2D8C9A00C5978D /* LoginPage */, |
| 271 | 279 | 790D01862A2D8A7000C5978D /* MinePage */, |
| 280 | + 7C49312E2A2DBCB4000E44B4 /* Mine */, | |
| 272 | 281 | 7CD675212A26F844008354C1 /* HomePage */, |
| 273 | 282 | ); |
| 274 | 283 | path = Main; |
| ... | ... | @@ -305,10 +314,27 @@ |
| 305 | 314 | isa = PBXGroup; |
| 306 | 315 | children = ( |
| 307 | 316 | 7963989C2A260E6200D045EB /* CNLiveBaseViewController.swift */, |
| 317 | + 7C4931282A2D8BA8000E44B4 /* CNLiveBaseTabBarViewController.swift */, | |
| 308 | 318 | ); |
| 309 | 319 | path = Base; |
| 310 | 320 | sourceTree = "<group>"; |
| 311 | 321 | }; |
| 322 | + 7C49312E2A2DBCB4000E44B4 /* Mine */ = { | |
| 323 | + isa = PBXGroup; | |
| 324 | + children = ( | |
| 325 | + 7C49312F2A2DBCC4000E44B4 /* Controller */, | |
| 326 | + ); | |
| 327 | + path = Mine; | |
| 328 | + sourceTree = "<group>"; | |
| 329 | + }; | |
| 330 | + 7C49312F2A2DBCC4000E44B4 /* Controller */ = { | |
| 331 | + isa = PBXGroup; | |
| 332 | + children = ( | |
| 333 | + 7963988C2A260C0100D045EB /* CNMineViewController.swift */, | |
| 334 | + ); | |
| 335 | + path = Controller; | |
| 336 | + sourceTree = "<group>"; | |
| 337 | + }; | |
| 312 | 338 | 7CD675212A26F844008354C1 /* HomePage */ = { |
| 313 | 339 | isa = PBXGroup; |
| 314 | 340 | children = ( |
| ... | ... | @@ -665,8 +691,13 @@ |
| 665 | 691 | 790D018B2A2D8B3300C5978D /* CNLiveLoginViewController.swift in Sources */, |
| 666 | 692 | 7CD675422A2740F8008354C1 /* CNCustomIndexView.swift in Sources */, |
| 667 | 693 | 790D01912A2DAC5E00C5978D /* CNLiveConfigFontMacro.swift in Sources */, |
| 694 | + 790D01852A2D89E100C5978D /* UIColor+CNHexColor.swift in Sources */, | |
| 695 | + 796398932A260C0100D045EB /* CNMineViewController.swift in Sources */, | |
| 696 | + 7CD675422A2740F8008354C1 /* CNCustomIndexView.swift in Sources */, | |
| 697 | + 7C4931292A2D8BA8000E44B4 /* CNLiveBaseTabBarViewController.swift in Sources */, | |
| 668 | 698 | 7CD6753F2A2740B0008354C1 /* CNTopCollectMoneyRemindView.swift in Sources */, |
| 669 | 699 | 7CD6753C2A2740B0008354C1 /* CNBottomPayMoneyRemindView.swift in Sources */, |
| 700 | + 7C49312D2A2DB9FA000E44B4 /* UITabBar+CNBadge.swift in Sources */, | |
| 670 | 701 | 79A68C4C2A26EA6000DC3B43 /* (null) in Sources */, |
| 671 | 702 | ); |
| 672 | 703 | runOnlyForDeploymentPostprocessing = 0; | ... | ... |
metaCode/Classes/Common/Base/CNLiveBaseTabBarViewController.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveBaseTabbarViewController.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by daojian on 2023/6/5. | |
| 6 | +// | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | +import UIKit | |
| 10 | + | |
| 11 | +class CNLiveBaseTabBarViewController:UITabBarController | |
| 12 | +{ | |
| 13 | + | |
| 14 | + override func viewDidLoad() { | |
| 15 | + super.viewDidLoad() | |
| 16 | + } | |
| 17 | + | |
| 18 | + override func viewWillAppear(_ animated: Bool) { | |
| 19 | + super.viewWillAppear(animated) | |
| 20 | + self.setUpTabBar() | |
| 21 | + self.setupBackgroup() | |
| 22 | + | |
| 23 | + } | |
| 24 | + override func viewDidAppear(_ animated: Bool) { | |
| 25 | + super.viewDidAppear(animated) | |
| 26 | + | |
| 27 | + } | |
| 28 | + // MARK: - 控制器的信息 | |
| 29 | + func setUpTabBar() { | |
| 30 | + | |
| 31 | + let homeVC = CNMetaCodeHomePageController() | |
| 32 | + let mineVC = CNMineViewController() | |
| 33 | + | |
| 34 | + creatTabbarView(viewController: homeVC, image: "tabbar_hoem_icon_default", selectImage: "tabbar_hoem_icon_selected", title: "首页") | |
| 35 | + | |
| 36 | + creatTabbarView(viewController: mineVC, image: "tabbar_mine_icon_default", selectImage: "tabbar_mine_icon_selected", title: "我的") | |
| 37 | + | |
| 38 | + self.tabBar.tintColor = UIColor("#0066FE") | |
| 39 | + self.tabBar.isTranslucent = false | |
| 40 | + | |
| 41 | + self.viewControllers = [ | |
| 42 | + UINavigationController(rootViewController: homeVC), | |
| 43 | + UINavigationController(rootViewController: mineVC), | |
| 44 | + ]; | |
| 45 | + | |
| 46 | + | |
| 47 | + } | |
| 48 | + | |
| 49 | + // MARK: - Tabar 背景图 | |
| 50 | + func setupBackgroup(){ | |
| 51 | + if #available(iOS 13.0, *) { | |
| 52 | + let appearance: UITabBarAppearance = UITabBarAppearance.init() | |
| 53 | + appearance.configureWithTransparentBackground() | |
| 54 | + appearance.backgroundColor = UIColor.clear | |
| 55 | + appearance.backgroundImage = UIImage(named: "tabbar_backgroup") | |
| 56 | + if #available(iOS 15.0, *) { | |
| 57 | + tabBar.scrollEdgeAppearance = appearance | |
| 58 | + } else { | |
| 59 | + // Fallback on earlier versions | |
| 60 | + tabBar.standardAppearance = appearance | |
| 61 | + } | |
| 62 | + | |
| 63 | + } else { | |
| 64 | + tabBar.backgroundColor = .clear | |
| 65 | + tabBar.backgroundImage = UIImage(named: "tabbar_backgroup") | |
| 66 | + } | |
| 67 | + } | |
| 68 | + | |
| 69 | + // MARK: - TabBar里面的文字图片 | |
| 70 | + func creatTabbarView(viewController:UIViewController, image:NSString, selectImage:NSString, title:NSString) { | |
| 71 | + // alwaysOriginal 始终绘制图片原始状态,不使用Tint Color。 | |
| 72 | + viewController.tabBarItem.image = UIImage(named: image as String)?.withRenderingMode(.alwaysOriginal) | |
| 73 | + viewController.tabBarItem.selectedImage = UIImage(named: selectImage as String)?.withRenderingMode(.alwaysOriginal) | |
| 74 | + viewController.title = title as String | |
| 75 | + } | |
| 76 | +} | |
| 77 | + | ... | ... |
metaCode/Classes/Common/Base/CNLiveBaseViewController.swift
metaCode/Classes/Constant/CNLiveConstant.swift
metaCode/Classes/Extensions/CNHexColor.swift renamed to metaCode/Classes/Extensions/UIColor+CNHexColor.swift
metaCode/Classes/Extensions/UITabBar+CNBadge.swift
0 → 100644
| 1 | +// | |
| 2 | +// UITabBar+CNBadge.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by daojian on 2023/6/5. | |
| 6 | +// | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | +import UIKit | |
| 10 | + | |
| 11 | +extension UITabBar { | |
| 12 | + /** | |
| 13 | + tabbar tag | |
| 14 | + */ | |
| 15 | + private var badgeTag:Int! { | |
| 16 | + get{ | |
| 17 | + return 1000 | |
| 18 | + } | |
| 19 | + set{ | |
| 20 | + | |
| 21 | + } | |
| 22 | + } | |
| 23 | + | |
| 24 | + /** | |
| 25 | + 运行时对应的key值 | |
| 26 | + */ | |
| 27 | + private struct AssociatedKeys { | |
| 28 | + static var kBadgeSize:String! = "kBadgeSize" | |
| 29 | + static var kBadgeColor:String! = "kBadgeColor" | |
| 30 | + static var kBadgeImage:String! = "kBadgeImage" | |
| 31 | + static var kBadgePoint:String! = "kBadgePoint" | |
| 32 | + static var kBadgeValue:String! = "kBadgeValue" | |
| 33 | + } | |
| 34 | + | |
| 35 | + | |
| 36 | + // 小红点size | |
| 37 | + public var badgeSize:CGSize! { | |
| 38 | + get{ | |
| 39 | + return objc_getAssociatedObject(self, &AssociatedKeys.kBadgeSize) as? CGSize | |
| 40 | + } | |
| 41 | + set{ | |
| 42 | + objc_setAssociatedObject(self, &AssociatedKeys.kBadgeSize, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) | |
| 43 | + } | |
| 44 | + } | |
| 45 | + | |
| 46 | + // 小红点图片 | |
| 47 | + public var badgeImage:UIImage! { | |
| 48 | + get{ | |
| 49 | + return objc_getAssociatedObject(self, &AssociatedKeys.kBadgeImage) as? UIImage | |
| 50 | + } | |
| 51 | + set{ | |
| 52 | + objc_setAssociatedObject(self, &AssociatedKeys.kBadgeImage, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) | |
| 53 | + } | |
| 54 | + } | |
| 55 | + | |
| 56 | + // 小红点颜色 | |
| 57 | + public var badgeColor:UIColor! { | |
| 58 | + get{ | |
| 59 | + return objc_getAssociatedObject(self, &AssociatedKeys.kBadgeColor) as? UIColor | |
| 60 | + } | |
| 61 | + set{ | |
| 62 | + objc_setAssociatedObject(self, &AssociatedKeys.kBadgeColor, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) | |
| 63 | + } | |
| 64 | + } | |
| 65 | + | |
| 66 | + // 小红点的x、y值 | |
| 67 | + public var badgePoint:CGPoint! { | |
| 68 | + get{ | |
| 69 | + return objc_getAssociatedObject(self, &AssociatedKeys.kBadgePoint) as? CGPoint | |
| 70 | + } | |
| 71 | + set{ | |
| 72 | + objc_setAssociatedObject(self, &AssociatedKeys.kBadgePoint, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) | |
| 73 | + } | |
| 74 | + } | |
| 75 | + | |
| 76 | + // 小红点的数字 | |
| 77 | + public var badgeValue:String! { | |
| 78 | + get{ | |
| 79 | + return objc_getAssociatedObject(self, &AssociatedKeys.kBadgeValue) as? String | |
| 80 | + } | |
| 81 | + set{ | |
| 82 | + objc_setAssociatedObject(self, &AssociatedKeys.kBadgeValue, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) | |
| 83 | + } | |
| 84 | + } | |
| 85 | + | |
| 86 | + // MARK:-显示小红点 | |
| 87 | + public func showBadgeOnItemIndex(index:Int){ | |
| 88 | + // 移除 | |
| 89 | + self.removeRedPointOnIndex(index: index, animation: false) | |
| 90 | + | |
| 91 | + // 防止是空的 | |
| 92 | + if self.badgeColor == nil { | |
| 93 | + self.badgeColor = UIColor() | |
| 94 | + self.badgeColor = UIColor.red | |
| 95 | + } | |
| 96 | + | |
| 97 | + if self.badgePoint == nil { | |
| 98 | + self.badgePoint = CGPoint() | |
| 99 | + self.badgePoint = CGPoint.zero | |
| 100 | + } | |
| 101 | + | |
| 102 | + if self.badgeSize == nil { | |
| 103 | + self.badgeSize = CGSize.zero | |
| 104 | + } | |
| 105 | + | |
| 106 | + if self.badgeImage == nil { | |
| 107 | + self.badgeImage = UIImage() | |
| 108 | + } | |
| 109 | + | |
| 110 | + if self.badgeValue == nil { | |
| 111 | + self.badgeValue = String() | |
| 112 | + } | |
| 113 | + | |
| 114 | + // 小红点背景默认值大小设置 | |
| 115 | + if __CGSizeEqualToSize(self.badgeSize, CGSize.zero) { | |
| 116 | + self.badgeSize = CGSize(width: 12, height: 12) | |
| 117 | + } | |
| 118 | + | |
| 119 | + | |
| 120 | + let badgeView = UIView() | |
| 121 | + badgeView.backgroundColor = self.badgeColor | |
| 122 | + badgeView.layer.cornerRadius = self.badgeSize.width / 2 | |
| 123 | + badgeView.tag = badgeTag + 1 | |
| 124 | + | |
| 125 | + let barButtonView = self.getBarButttonViewWithIndex(index: index) | |
| 126 | + //(图片的imageView) | |
| 127 | + var iconView = UIView() | |
| 128 | + for swappableImageView in barButtonView.subviews { | |
| 129 | + | |
| 130 | + if swappableImageView.isKind(of: UIImageView.self) { | |
| 131 | + iconView = swappableImageView | |
| 132 | + break | |
| 133 | + } | |
| 134 | + | |
| 135 | + } | |
| 136 | + | |
| 137 | + // 小红点背景默认值Point设置 | |
| 138 | + if __CGPointEqualToPoint(self.badgePoint, CGPoint.zero) { | |
| 139 | + let iconViewSize = iconView.frame.size | |
| 140 | + badgeView.frame = CGRect(x: iconViewSize.width - self.badgeSize.width / 2, y: -self.badgeSize.width / 2, width: self.badgeSize.width, height: self.badgeSize.height) | |
| 141 | + }else{ | |
| 142 | + badgeView.frame = CGRect(x: self.badgePoint.x, y: self.badgePoint.y, width: self.badgeSize.width, height: self.badgeSize.height) | |
| 143 | + } | |
| 144 | + | |
| 145 | + // 添加图片到小红点上 | |
| 146 | + let imageview = UIImageView(frame: badgeView.bounds) | |
| 147 | + imageview.image = self.badgeImage | |
| 148 | + if self.badgeImage != nil { | |
| 149 | + self.backgroundColor = UIColor.red | |
| 150 | + } | |
| 151 | + badgeView.addSubview(imageview) | |
| 152 | + | |
| 153 | + if self.badgeValue != nil { | |
| 154 | + let badgeLabel = UILabel(frame: badgeView.bounds) | |
| 155 | + badgeLabel.text = self.badgeValue | |
| 156 | + badgeLabel.textAlignment = .center | |
| 157 | + badgeLabel.font = UIFont.systemFont(ofSize: 13) | |
| 158 | + badgeLabel.textColor = UIColor.white | |
| 159 | + badgeView.addSubview(badgeLabel) | |
| 160 | + } | |
| 161 | + | |
| 162 | + iconView.addSubview(badgeView) | |
| 163 | + } | |
| 164 | + | |
| 165 | + // MARK:-隐藏小红点 | |
| 166 | + public func hiddenRedPointOnIndex(index:Int, animation:Bool){ | |
| 167 | + self.removeRedPointOnIndex(index: index, animation: animation) | |
| 168 | + } | |
| 169 | + | |
| 170 | + private func removeRedPointOnIndex(index:Int, animation:Bool) { | |
| 171 | + let barButtonView = self.getBarButttonViewWithIndex(index: index) | |
| 172 | + | |
| 173 | + for swapView in barButtonView.subviews { | |
| 174 | + | |
| 175 | + if swapView.isKind(of: UIImageView.self) { | |
| 176 | + | |
| 177 | + for view1 in swapView.subviews { | |
| 178 | + | |
| 179 | + if view1.tag == (badgeTag + 1) { | |
| 180 | + | |
| 181 | + if animation { | |
| 182 | + UIView.animate(withDuration: 0.2, animations: { | |
| 183 | + view1.transform = CGAffineTransform(translationX: 2, y: 2) | |
| 184 | + view1.alpha = 0 | |
| 185 | + }) { (finished) in | |
| 186 | + view1.removeFromSuperview() | |
| 187 | + } | |
| 188 | + }else{ | |
| 189 | + view1.removeFromSuperview() | |
| 190 | + } | |
| 191 | + | |
| 192 | + } | |
| 193 | + | |
| 194 | + } | |
| 195 | + | |
| 196 | + } | |
| 197 | + | |
| 198 | + } | |
| 199 | + | |
| 200 | + } | |
| 201 | + | |
| 202 | + // 获取barButtonView | |
| 203 | + private func getBarButttonViewWithIndex(index:Int) -> UIView { | |
| 204 | + | |
| 205 | + if let itemss = self.items { | |
| 206 | + let item = itemss[index] | |
| 207 | + let barButtonView = item.value(forKey: "view") | |
| 208 | + return barButtonView as! UIView | |
| 209 | + } | |
| 210 | + | |
| 211 | + let vw = UIView() | |
| 212 | + return vw | |
| 213 | + } | |
| 214 | + | |
| 215 | +} | ... | ... |
metaCode/Classes/Main/HomePage/Controller/CNMetaCodeHomePageController.swift
| ... | ... | @@ -12,7 +12,9 @@ import YYCategories |
| 12 | 12 | let Width: CGFloat = UIScreen.main.bounds.size.width |
| 13 | 13 | let Height: CGFloat = UIScreen.main.bounds.size.height |
| 14 | 14 | |
| 15 | -class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDelegate, NewPagedFlowViewDataSource{ | |
| 15 | +class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDelegate, NewPagedFlowViewDataSource, CNCustomIndexViewDelegate{ | |
| 16 | + | |
| 17 | + private var tabBarY:CGFloat = 0.0 | |
| 16 | 18 | |
| 17 | 19 | // MARK: - 懒加载 |
| 18 | 20 | ///数据源 |
| ... | ... | @@ -34,7 +36,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 34 | 36 | pageFlowView.isOpenAutoScroll = false; |
| 35 | 37 | |
| 36 | 38 | //左右图片的距离顶部和底部的高度 |
| 37 | - pageFlowView.topBottomMargin = 0; | |
| 39 | + pageFlowView.topBottomMargin = 100; | |
| 38 | 40 | |
| 39 | 41 | return pageFlowView |
| 40 | 42 | |
| ... | ... | @@ -44,7 +46,10 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 44 | 46 | override func viewDidLoad() { |
| 45 | 47 | super.viewDidLoad() |
| 46 | 48 | |
| 49 | + self.tabBarY = (self.tabBarController?.tabBar.top)! | |
| 47 | 50 | |
| 51 | + self.view.backgroundColor = KVCBackgroupColor | |
| 52 | + | |
| 48 | 53 | for i in (0..<2) { |
| 49 | 54 | self.dataArray.add("122") |
| 50 | 55 | } |
| ... | ... | @@ -75,6 +80,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 75 | 80 | } |
| 76 | 81 | bannerView?.superScrollView = flowView.scrollView; |
| 77 | 82 | bannerView?.associatedVCView = self.view; |
| 83 | + bannerView?.delegate = self | |
| 78 | 84 | return bannerView; |
| 79 | 85 | } |
| 80 | 86 | |
| ... | ... | @@ -82,4 +88,10 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 82 | 88 | return CGSize(width: Width-50, height: Height) |
| 83 | 89 | } |
| 84 | 90 | |
| 91 | + //MARK: - CNCustomIndexView 代理方法 | |
| 92 | + func customIndexViewDidScroll(scrollView: UIScrollView) { | |
| 93 | + let fabsOffset: CGFloat = abs(scrollView.contentOffset.y - KSreenHeight) | |
| 94 | + self.tabBarController?.tabBar.top = self.tabBarY + fabsOffset | |
| 95 | + } | |
| 96 | + | |
| 85 | 97 | } | ... | ... |
metaCode/Classes/Main/HomePage/View/CNCustomIndexView.swift
| ... | ... | @@ -7,22 +7,19 @@ |
| 7 | 7 | |
| 8 | 8 | import Foundation |
| 9 | 9 | |
| 10 | -///关联的控制器的view | |
| 11 | -//@property (nonatomic, weak)UIView *associatedVCView | |
| 12 | -// | |
| 13 | -/////父视图ScrollView | |
| 14 | -//@property (nonatomic, weak)UIScrollView *superScrollView | |
| 15 | -/////自己的底部ScrollView,用来装载 | |
| 16 | -//@property (nonatomic, strong)UIScrollView *baseScrollView | |
| 17 | -// | |
| 18 | -//@property (nonatomic, strong)CNMainView *mainView | |
| 19 | -//@property (nonatomic, strong)CNCollectMoneyCodeView *collectMoneyCodeView | |
| 20 | -//@property (nonatomic, strong)CNPayMoneyCodeView *payMoneyCodeView | |
| 10 | + | |
| 11 | +protocol CNCustomIndexViewDelegate:NSObjectProtocol{ | |
| 12 | + ///当前scrollView 发送滚动 | |
| 13 | + func customIndexViewDidScroll(scrollView :UIScrollView); | |
| 14 | +} | |
| 21 | 15 | |
| 22 | 16 | class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChangeDelegate{ |
| 23 | 17 | |
| 24 | 18 | var colorChange: WJColorChange! |
| 25 | 19 | |
| 20 | + ///代理 | |
| 21 | + weak var delegate:CNCustomIndexViewDelegate? | |
| 22 | + | |
| 26 | 23 | ///关联的控制器的view |
| 27 | 24 | weak var associatedVCView:UIView? |
| 28 | 25 | { |
| ... | ... | @@ -44,7 +41,7 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange |
| 44 | 41 | |
| 45 | 42 | ///颜色数据 |
| 46 | 43 | lazy var colorDataArr: NSMutableArray = { |
| 47 | - let colorDataArr = NSMutableArray(array: NSArray(objects: UIColor.black,UIColor.white,UIColor.red)) | |
| 44 | + let colorDataArr = NSMutableArray(array: NSArray(objects: UIColor.white,KVCBackgroupColor!,UIColor("#004FE0")!)) | |
| 48 | 45 | |
| 49 | 46 | return colorDataArr |
| 50 | 47 | }() |
| ... | ... | @@ -160,7 +157,7 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange |
| 160 | 157 | let currentOffset: CGFloat = scrollView.contentOffset.y |
| 161 | 158 | |
| 162 | 159 | /**隐藏左右view*/ |
| 163 | - let fabsOffset: CGFloat = fabs(defaultOffset - currentOffset) | |
| 160 | + let fabsOffset: CGFloat = abs(defaultOffset - currentOffset) | |
| 164 | 161 | |
| 165 | 162 | let leftView:UIView? = self.superScrollView?.viewWithTag(tag-1) |
| 166 | 163 | let rightView:UIView? = self.superScrollView?.viewWithTag(tag+1) |
| ... | ... | @@ -205,21 +202,24 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange |
| 205 | 202 | |
| 206 | 203 | |
| 207 | 204 | /**控制缩放范围在一定范围*/ |
| 208 | - let mainViewOffset:CGFloat = abs(currentOffset - self.baseScrollView.height) | |
| 209 | - if (mainViewOffset < 100) { | |
| 210 | - var scale: CGFloat = 1.0 | |
| 211 | - | |
| 212 | - if (currentOffset < self.baseScrollView.height) { | |
| 213 | - //下滑时,计算scale方法 | |
| 214 | - scale = currentOffset/self.baseScrollView.height | |
| 215 | - } | |
| 216 | - else { | |
| 217 | - //上滑时,计算scale方法 | |
| 218 | - scale = self.baseScrollView.height/currentOffset | |
| 219 | - } | |
| 220 | - | |
| 221 | - self.mainView.scaledView(scale: scale) | |
| 222 | - } | |
| 205 | +// let mainViewOffset:CGFloat = abs(currentOffset - self.baseScrollView.height) | |
| 206 | +// if (mainViewOffset < 100) { | |
| 207 | +// var scale: CGFloat = 1.0 | |
| 208 | +// | |
| 209 | +// if (currentOffset < self.baseScrollView.height) { | |
| 210 | +// //下滑时,计算scale方法 | |
| 211 | +// scale = currentOffset/self.baseScrollView.height | |
| 212 | +// } | |
| 213 | +// else { | |
| 214 | +// //上滑时,计算scale方法 | |
| 215 | +// scale = self.baseScrollView.height/currentOffset | |
| 216 | +// } | |
| 217 | +// | |
| 218 | +// self.mainView.scaledView(scale: scale) | |
| 219 | +// } | |
| 220 | + | |
| 221 | + | |
| 222 | + delegate?.customIndexViewDidScroll(scrollView: self.baseScrollView) | |
| 223 | 223 | |
| 224 | 224 | } |
| 225 | 225 | ... | ... |
metaCode/Classes/Main/HomePage/View/CNMainView.swift
| ... | ... | @@ -8,6 +8,9 @@ |
| 8 | 8 | import Foundation |
| 9 | 9 | import YYCategories |
| 10 | 10 | |
| 11 | +///旋转动画时间 | |
| 12 | +let KTransformAnimationTime:CGFloat = 0.75; | |
| 13 | +///点击事件回调 | |
| 11 | 14 | typealias closureBlock = ()->Void; |
| 12 | 15 | |
| 13 | 16 | ///正面View |
| ... | ... | @@ -43,14 +46,14 @@ class CNFrontMainView : UIView{ |
| 43 | 46 | |
| 44 | 47 | lazy var contentView : UIView = { |
| 45 | 48 | |
| 46 | - let contentView = UIView.init(frame: CGRect(x: 0, y: self.imageView.bottom - 20, width: self.width, height: self.height - self.imageView.bottom + 20)) | |
| 47 | - contentView.backgroundColor = UIColor.white | |
| 49 | + let contentView = UIView.init(frame: CGRect(x: 0, y: 0, width: self.width, height: self.height )) | |
| 50 | + contentView.backgroundColor = UIColor.red | |
| 48 | 51 | contentView.clipsToBounds = true |
| 49 | 52 | contentView.layer.cornerRadius = 20 |
| 50 | 53 | |
| 51 | - let imageView = UIImageView.init(frame: CGRect(x: 10, y: 10, width: contentView.width - 20, height: contentView.height - 20)) | |
| 52 | - imageView.image = UIImage.init(named: "homePage_mainView_front"); | |
| 53 | - contentView.addSubview(imageView) | |
| 54 | +// let imageView = UIImageView.init(frame: CGRect(x: 10, y: 10, width: contentView.width - 20, height: contentView.height - 20)) | |
| 55 | +// imageView.image = UIImage.init(named: "homePage_mainView_front"); | |
| 56 | +// contentView.addSubview(imageView) | |
| 54 | 57 | |
| 55 | 58 | return contentView |
| 56 | 59 | |
| ... | ... | @@ -58,16 +61,13 @@ class CNFrontMainView : UIView{ |
| 58 | 61 | |
| 59 | 62 | func initUI() |
| 60 | 63 | { |
| 61 | - self.addSubview(self.imageView) | |
| 64 | +// self.addSubview(self.imageView) | |
| 62 | 65 | self.addSubview(self.contentView) |
| 63 | 66 | } |
| 64 | 67 | |
| 65 | 68 | @objc func tapAction(){ |
| 66 | - if (self.tapTransformAciton != nil){ | |
| 67 | - self.tapTransformAciton | |
| 68 | - } | |
| 69 | + tapTransformAciton!() | |
| 69 | 70 | } |
| 70 | - | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | ///反面View |
| ... | ... | @@ -75,17 +75,8 @@ class CNBackMainView : UIView{ |
| 75 | 75 | ///点击反转事件 |
| 76 | 76 | var tapTransformAciton:closureBlock? |
| 77 | 77 | |
| 78 | - override init(frame: CGRect) { | |
| 79 | - super.init(frame: frame) | |
| 80 | - self.initUI() | |
| 81 | - let tap:UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(tapAction)) | |
| 82 | - self.addGestureRecognizer(tap) | |
| 83 | - } | |
| 84 | - | |
| 85 | - required init?(coder: NSCoder) { | |
| 86 | - fatalError("init(coder:) has not been implemented") | |
| 87 | - } | |
| 88 | 78 | |
| 79 | + // MARK: - 懒加载 | |
| 89 | 80 | lazy var imageView:UIImageView = { |
| 90 | 81 | |
| 91 | 82 | let tempImageView:UIImageView = UIImageView(frame: CGRect(x: 10, y: 10, width: self.width-20, height: self.height - 20)) |
| ... | ... | @@ -96,7 +87,7 @@ class CNBackMainView : UIView{ |
| 96 | 87 | |
| 97 | 88 | lazy var contentView : UIView = { |
| 98 | 89 | |
| 99 | - let contentView = UIView.init(frame: CGRect(x: 0, y: self.imageView.bottom - 20, width: self.width, height: self.height-self.imageView.bottom + 20)) | |
| 90 | + let contentView = UIView.init(frame: CGRect(x: 0, y: 0, width: self.width, height: self.height)) | |
| 100 | 91 | contentView.backgroundColor = UIColor.white |
| 101 | 92 | contentView.clipsToBounds = true |
| 102 | 93 | contentView.layer.cornerRadius = 20 |
| ... | ... | @@ -105,21 +96,45 @@ class CNBackMainView : UIView{ |
| 105 | 96 | |
| 106 | 97 | }() |
| 107 | 98 | |
| 99 | + lazy var bottomBackBtn : UIButton = { | |
| 100 | + let bottomBackBtn = UIButton(type: .custom) | |
| 101 | + bottomBackBtn.frame = CGRectMake(0, 0, 90, 40) | |
| 102 | + bottomBackBtn.centerX = self.contentView.width/2 | |
| 103 | + bottomBackBtn.bottom = self.contentView.height - 15 | |
| 104 | + bottomBackBtn.setTitle("回到首页", for: .normal) | |
| 105 | + bottomBackBtn.setTitleColor(UIColor("#333333"), for: .normal) | |
| 106 | + bottomBackBtn.setImage(UIImage(named: "homePage_backBtn_icon"), for: .normal) | |
| 107 | + bottomBackBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 8) | |
| 108 | + bottomBackBtn.titleLabel?.font = UIFont(name: "KohinoorTelugu-Regular", size: 15) | |
| 109 | + | |
| 110 | + bottomBackBtn.addTarget(self, action: #selector(tapAction), for: .touchUpInside) | |
| 111 | + return bottomBackBtn | |
| 112 | + }() | |
| 113 | + //MARK: - 初始化 | |
| 114 | + override init(frame: CGRect) { | |
| 115 | + super.init(frame: frame) | |
| 116 | + self.initUI() | |
| 117 | + let tap:UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(tapAction)) | |
| 118 | + self.addGestureRecognizer(tap) | |
| 119 | + } | |
| 120 | + | |
| 121 | + required init?(coder: NSCoder) { | |
| 122 | + fatalError("init(coder:) has not been implemented") | |
| 123 | + } | |
| 124 | + | |
| 108 | 125 | func initUI() |
| 109 | 126 | { |
| 110 | - self.addSubview(self.imageView) | |
| 127 | +// self.addSubview(self.imageView) | |
| 111 | 128 | self.addSubview(self.contentView) |
| 129 | + self.contentView.addSubview(self.bottomBackBtn) | |
| 112 | 130 | } |
| 113 | - | |
| 131 | + //MARK: - 事件 | |
| 114 | 132 | @objc func tapAction(){ |
| 115 | - if (self.tapTransformAciton != nil){ | |
| 116 | - self.tapTransformAciton | |
| 117 | - } | |
| 133 | + tapTransformAciton!() | |
| 118 | 134 | } |
| 119 | 135 | } |
| 120 | 136 | |
| 121 | -///旋转动画时间 | |
| 122 | -let KTransformAnimationTime:CGFloat = 0.75; | |
| 137 | + | |
| 123 | 138 | |
| 124 | 139 | ///中间主VIew |
| 125 | 140 | class CNMainView : UIView{ |
| ... | ... | @@ -134,24 +149,18 @@ class CNMainView : UIView{ |
| 134 | 149 | } |
| 135 | 150 | |
| 136 | 151 | lazy var frontView:CNFrontMainView = { |
| 137 | -// _frontView = [[CNFrontMainView alloc] initWithFrame:self.bounds]; | |
| 138 | -// __weak CNMainView *weakSelf = self; | |
| 139 | -// _frontView.tapTransformAciton = ^{ | |
| 140 | -// [weakSelf transformToBacnkView]; | |
| 141 | -// }; | |
| 152 | + | |
| 142 | 153 | let frontView = CNFrontMainView.init(frame: self.bounds) |
| 143 | - frontView.tapTransformAciton = { | |
| 144 | - | |
| 145 | - print("点击了") | |
| 154 | + frontView.tapTransformAciton = { [weak self] in | |
| 155 | + self?.transformToBacnkView(); | |
| 146 | 156 | } |
| 147 | 157 | return frontView |
| 148 | 158 | }() |
| 149 | 159 | |
| 150 | 160 | lazy var backView:CNBackMainView = { |
| 151 | 161 | let backView = CNBackMainView.init(frame: self.bounds) |
| 152 | - backView.tapTransformAciton = { | |
| 153 | - | |
| 154 | - print("点击了") | |
| 162 | + backView.tapTransformAciton = { [weak self] in | |
| 163 | + self?.transformToFrontView() | |
| 155 | 164 | } |
| 156 | 165 | return backView |
| 157 | 166 | }() |
| ... | ... | @@ -160,17 +169,18 @@ class CNMainView : UIView{ |
| 160 | 169 | { |
| 161 | 170 | self.addSubview(self.frontView) |
| 162 | 171 | self.addSubview(self.backView) |
| 172 | + | |
| 163 | 173 | self.backView.isHidden = true; |
| 164 | 174 | |
| 165 | - self.layer.cornerRadius = 20; | |
| 166 | - self.layer.shadowOpacity = 1; | |
| 167 | - self.layer.shadowColor = UIColor("#eeeeee")?.cgColor | |
| 168 | - self.layer.shadowOffset = CGSize(width: 10, height: 10) | |
| 169 | - self.layer.shadowRadius = 10; | |
| 175 | +// self.layer.cornerRadius = 20; | |
| 176 | +// self.layer.shadowOpacity = 1; | |
| 177 | +// self.layer.shadowColor = UIColor("#eeeeee")?.cgColor | |
| 178 | +// self.layer.shadowOffset = CGSize(width: 10, height: 10) | |
| 179 | +// self.layer.shadowRadius = 10; | |
| 170 | 180 | |
| 171 | 181 | } |
| 172 | 182 | |
| 173 | - /***********事件*****************/ | |
| 183 | + // MARK: - 事件 | |
| 174 | 184 | ///旋转到反面 |
| 175 | 185 | func transformToBacnkView() |
| 176 | 186 | { | ... | ... |
metaCode/Classes/Other/ViewController.swift renamed to metaCode/Classes/Main/Mine/Controller/CNMineViewController.swift
| 1 | 1 | // |
| 2 | -// ViewController.swift | |
| 2 | +// CNMineViewController.swift | |
| 3 | 3 | // metaCode |
| 4 | 4 | // |
| 5 | 5 | // Created by iOS on 2023/5/30. |
| ... | ... | @@ -8,13 +8,13 @@ |
| 8 | 8 | import UIKit |
| 9 | 9 | import CNLiveRequestBastKit |
| 10 | 10 | |
| 11 | -class ViewController: UIViewController { | |
| 11 | +class CNMineViewController: CNLiveBaseViewController { | |
| 12 | 12 | |
| 13 | 13 | override func viewDidLoad() { |
| 14 | 14 | super.viewDidLoad() |
| 15 | 15 | // Do any additional setup after loading the view. |
| 16 | 16 | |
| 17 | - self.view.backgroundColor = .gray | |
| 17 | + self.view.backgroundColor = KVCBackgroupColor | |
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | let button = UIButton() | ... | ... |
metaCode/Classes/Other/AppDelegate.swift
| ... | ... | @@ -18,8 +18,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { |
| 18 | 18 | |
| 19 | 19 | // Override point for customization after application launch. |
| 20 | 20 | window = UIWindow.init(frame: UIScreen.main.bounds) |
| 21 | - window?.backgroundColor = UIColor.white | |
| 22 | - window?.rootViewController = CNLiveLoginViewController.init() | |
| 21 | + window?.backgroundColor = KVCBackgroupColor | |
| 22 | + window?.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 23 | 23 | window?.makeKeyAndVisible() |
| 24 | 24 | |
| 25 | 25 | ... | ... |
metaCode/Supporting Files/Assets.xcassets/Home/Contents.json
0 → 100644
metaCode/Supporting Files/Assets.xcassets/collectMoneyImage.imageset/4661683514280_.pic.jpg renamed to metaCode/Supporting Files/Assets.xcassets/Home/collectMoneyImage.imageset/4661683514280_.pic.jpg
75 KB
metaCode/Supporting Files/Assets.xcassets/collectMoneyImage.imageset/Contents.json renamed to metaCode/Supporting Files/Assets.xcassets/Home/collectMoneyImage.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/Home/homePage_backBtn_icon.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "回到首页@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "回到首页@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/Home/homePage_backBtn_icon.imageset/回到首页@2x.png
0 → 100644
1.73 KB
metaCode/Supporting Files/Assets.xcassets/Home/homePage_backBtn_icon.imageset/回到首页@3x.png
0 → 100644
2.99 KB
metaCode/Supporting Files/Assets.xcassets/Home/homePage_backViewImage.imageset/4671683516653_.pic.jpg
0 → 100644
82.2 KB
metaCode/Supporting Files/Assets.xcassets/Home/homePage_backViewImage.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "filename" : "4671683516653_.pic.jpg", | |
| 5 | + "idiom" : "universal", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "author" : "xcode", | |
| 19 | + "version" : 1 | |
| 20 | + } | |
| 21 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/Home/homePage_homePage_down.imageset/4491683252485_.pic.jpg
0 → 100644
5.25 KB
metaCode/Supporting Files/Assets.xcassets/Home/homePage_homePage_down.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "4491683252485_.pic.jpg", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "author" : "xcode", | |
| 19 | + "version" : 1 | |
| 20 | + } | |
| 21 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/Home/homePage_mainView_front.imageset/4621683513846_.pic.jpg
0 → 100644
56.9 KB
metaCode/Supporting Files/Assets.xcassets/Home/homePage_mainView_front.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "4621683513846_.pic.jpg", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "author" : "xcode", | |
| 19 | + "version" : 1 | |
| 20 | + } | |
| 21 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/Home/homePage_payMoneyImage.imageset/4651683514228_.pic.jpg
0 → 100644
52.1 KB
metaCode/Supporting Files/Assets.xcassets/Home/homePage_payMoneyImage.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "4651683514228_.pic.jpg", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "author" : "xcode", | |
| 19 | + "version" : 1 | |
| 20 | + } | |
| 21 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/Home/homePage_topImage.imageset/4771683609542_.pic.jpg
0 → 100644
230 KB
metaCode/Supporting Files/Assets.xcassets/Home/homePage_topImage.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "4771683609542_.pic.jpg", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "author" : "xcode", | |
| 19 | + "version" : 1 | |
| 20 | + } | |
| 21 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/Home/homePage_zhongguorenming_bank.imageset/4431683250159_.pic.jpg
0 → 100644
79.4 KB
metaCode/Supporting Files/Assets.xcassets/Home/homePage_zhongguorenming_bank.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "4431683250159_.pic.jpg", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "author" : "xcode", | |
| 19 | + "version" : 1 | |
| 20 | + } | |
| 21 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/TabBar/Contents.json
0 → 100644
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_backgroup.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "背景图@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "背景图@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_backgroup.imageset/背景图@2x.png
0 → 100644
2.68 KB
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_backgroup.imageset/背景图@3x.png
0 → 100644
5.25 KB
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_hoem_icon_default.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "首页-未选中@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "首页-未选中@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_hoem_icon_default.imageset/首页-未选中@2x.png
0 → 100644
1.26 KB
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_hoem_icon_default.imageset/首页-未选中@3x.png
0 → 100644
2.24 KB
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_hoem_icon_selected.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "tabbar_hoem_icon_selected@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "tabbar_hoem_icon_selected@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_hoem_icon_selected.imageset/tabbar_hoem_icon_selected@2x.png
0 → 100644
1.22 KB
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_hoem_icon_selected.imageset/tabbar_hoem_icon_selected@3x.png
0 → 100644
2.25 KB
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_mine_icon_default.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "我的-未选中@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "我的-未选中@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_mine_icon_default.imageset/我的-未选中@2x.png
0 → 100644
1.1 KB
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_mine_icon_default.imageset/我的-未选中@3x.png
0 → 100644
2.03 KB
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_mine_icon_selected.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "scale" : "1x" | |
| 6 | + }, | |
| 7 | + { | |
| 8 | + "filename" : "我的@2x.png", | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "filename" : "我的@3x.png", | |
| 14 | + "idiom" : "universal", | |
| 15 | + "scale" : "3x" | |
| 16 | + } | |
| 17 | + ], | |
| 18 | + "info" : { | |
| 19 | + "author" : "xcode", | |
| 20 | + "version" : 1 | |
| 21 | + } | |
| 22 | +} | ... | ... |
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_mine_icon_selected.imageset/我的@2x.png
0 → 100644
1.05 KB
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_mine_icon_selected.imageset/我的@3x.png
0 → 100644
2 KB