Commit 1b583525 authored by 谢卓城's avatar 谢卓城

完善:组件二进制化

parent 31fd98d7
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
92C682E1E2B76AF1CEFB9EEF /* libPods-Mall-iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 44C49F2C338BEDC1BB3F86C3 /* libPods-Mall-iOS.a */; }; 6C205D1C8FFC382F580F7A74 /* Pods_Mall_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22533FD7CE2CBFCBA91A76CB /* Pods_Mall_iOS.framework */; };
BA1391422538858B0088E54E /* HomeServices.m in Sources */ = {isa = PBXBuildFile; fileRef = BA1391412538858B0088E54E /* HomeServices.m */; };
BA260BFE25354F21004A6326 /* AttributLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260BFD25354F21004A6326 /* AttributLabel.m */; }; BA260BFE25354F21004A6326 /* AttributLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260BFD25354F21004A6326 /* AttributLabel.m */; };
BA260C1125355980004A6326 /* ActivityCollectionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C0125355980004A6326 /* ActivityCollectionCell.m */; }; BA260C1125355980004A6326 /* ActivityCollectionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C0125355980004A6326 /* ActivityCollectionCell.m */; };
BA260C1225355980004A6326 /* HomeClassficationCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C0525355980004A6326 /* HomeClassficationCell.m */; }; BA260C1225355980004A6326 /* HomeClassficationCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C0525355980004A6326 /* HomeClassficationCell.m */; };
...@@ -16,9 +17,14 @@ ...@@ -16,9 +17,14 @@
BA260C1525355980004A6326 /* ActivityView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C0A25355980004A6326 /* ActivityView.m */; }; BA260C1525355980004A6326 /* ActivityView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C0A25355980004A6326 /* ActivityView.m */; };
BA260C1625355980004A6326 /* HomeClassificationView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C0C25355980004A6326 /* HomeClassificationView.m */; }; BA260C1625355980004A6326 /* HomeClassificationView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C0C25355980004A6326 /* HomeClassificationView.m */; };
BA260C1725355980004A6326 /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C0F25355980004A6326 /* HomeViewController.m */; }; BA260C1725355980004A6326 /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C0F25355980004A6326 /* HomeViewController.m */; };
BA260C2E25355C67004A6326 /* QMUIConfigurationTemplate.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C2D25355C67004A6326 /* QMUIConfigurationTemplate.m */; };
BA260C34253576A6004A6326 /* HomeGoodsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C33253576A6004A6326 /* HomeGoodsModel.m */; }; BA260C34253576A6004A6326 /* HomeGoodsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C33253576A6004A6326 /* HomeGoodsModel.m */; };
BA260C992535947E004A6326 /* ShoppingCartViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C952535947E004A6326 /* ShoppingCartViewController.m */; }; BA260C992535947E004A6326 /* ShoppingCartViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C952535947E004A6326 /* ShoppingCartViewController.m */; };
BA260C9E25359721004A6326 /* ShoppingCartCounterView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA260C9D25359721004A6326 /* ShoppingCartCounterView.m */; };
BA59FF922535DF67007F5614 /* ShoppingCartCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BA59FF912535DF67007F5614 /* ShoppingCartCell.m */; };
BA59FF9C2535F7BB007F5614 /* CounterView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA59FF9B2535F7BB007F5614 /* CounterView.m */; };
BA7196372537DD3A00D320A3 /* HomeViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BA7196362537DD3A00D320A3 /* HomeViewModel.m */; };
BA7196602537E52400D320A3 /* HomeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BA71965F2537E52400D320A3 /* HomeModel.m */; };
BA7196682537E69000D320A3 /* HomeClassificationModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BA7196672537E69000D320A3 /* HomeClassificationModel.m */; };
BA8A1F4B25342FC900321F16 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BA8A1F3D25342FC900321F16 /* Assets.xcassets */; }; BA8A1F4B25342FC900321F16 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BA8A1F3D25342FC900321F16 /* Assets.xcassets */; };
BA8A1F4C25342FC900321F16 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BA8A1F3E25342FC900321F16 /* LaunchScreen.storyboard */; }; BA8A1F4C25342FC900321F16 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BA8A1F3E25342FC900321F16 /* LaunchScreen.storyboard */; };
BA8A1F4D25342FC900321F16 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BA8A1F4025342FC900321F16 /* Main.storyboard */; }; BA8A1F4D25342FC900321F16 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BA8A1F4025342FC900321F16 /* Main.storyboard */; };
...@@ -26,18 +32,26 @@ ...@@ -26,18 +32,26 @@
BA8A1F5025342FC900321F16 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8A1F4625342FC900321F16 /* SceneDelegate.m */; }; BA8A1F5025342FC900321F16 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8A1F4625342FC900321F16 /* SceneDelegate.m */; };
BA8A1F5125342FC900321F16 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8A1F4725342FC900321F16 /* AppDelegate.m */; }; BA8A1F5125342FC900321F16 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8A1F4725342FC900321F16 /* AppDelegate.m */; };
BA8A1FC72534357300321F16 /* NMSearchBar.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8A1FC62534357300321F16 /* NMSearchBar.m */; }; BA8A1FC72534357300321F16 /* NMSearchBar.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8A1FC62534357300321F16 /* NMSearchBar.m */; };
BA8A1FE725343B2000321F16 /* ViewControllerConfigure.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8A1FE625343B1F00321F16 /* ViewControllerConfigure.m */; }; BAB53EEC25368E8500D207CF /* GoodsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BAB53EEB25368E8500D207CF /* GoodsModel.m */; };
BA8A20532534566A00321F16 /* UICollectionViewCell+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8A204B2534566A00321F16 /* UICollectionViewCell+Extension.m */; }; BAE231EB253FE248008B79CC /* AppDelegate+Theme.m in Sources */ = {isa = PBXBuildFile; fileRef = BAE231EA253FE248008B79CC /* AppDelegate+Theme.m */; };
BA8A20542534566A00321F16 /* UITableViewHeaderFooterView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8A204D2534566A00321F16 /* UITableViewHeaderFooterView+Extension.m */; }; BAE231EF253FE3DA008B79CC /* AppDelegate+Network.m in Sources */ = {isa = PBXBuildFile; fileRef = BAE231EE253FE3DA008B79CC /* AppDelegate+Network.m */; };
BA8A20552534566A00321F16 /* UITableViewCell+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8A204E2534566A00321F16 /* UITableViewCell+Extension.m */; }; BAE231F3253FE488008B79CC /* AppDelegate+UIViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BAE231F2253FE488008B79CC /* AppDelegate+UIViewController.m */; };
BA8A20562534566A00321F16 /* UICollectionReusableView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8A20502534566A00321F16 /* UICollectionReusableView+Extension.m */; }; BAF8DB8A253938C3001FA3E2 /* HomeCarouselModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BAF8DB89253938C3001FA3E2 /* HomeCarouselModel.m */; };
BA8A2064253461EA00321F16 /* UIImage+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8A2062253461EA00321F16 /* UIImage+Extension.m */; }; F94CD8372584A87B007643BE /* QMUIConfigurationTemplateDark.m in Sources */ = {isa = PBXBuildFile; fileRef = F94CD8332584A87B007643BE /* QMUIConfigurationTemplateDark.m */; };
F94CD8382584A87B007643BE /* QMUIConfigurationTemplate.m in Sources */ = {isa = PBXBuildFile; fileRef = F94CD8362584A87B007643BE /* QMUIConfigurationTemplate.m */; };
F94CD8542584AFAB007643BE /* JYTargetHomeModule.m in Sources */ = {isa = PBXBuildFile; fileRef = F94CD8532584AFAB007643BE /* JYTargetHomeModule.m */; };
F94CD85C2584B02B007643BE /* NMRouter+HomeModuleActions.m in Sources */ = {isa = PBXBuildFile; fileRef = F94CD85B2584B02B007643BE /* NMRouter+HomeModuleActions.m */; };
F94CD8622584B1A0007643BE /* JYTargetCartModule.m in Sources */ = {isa = PBXBuildFile; fileRef = F94CD8612584B1A0007643BE /* JYTargetCartModule.m */; };
F94CD8662584B1B7007643BE /* NMRouter+CartModuleActions.m in Sources */ = {isa = PBXBuildFile; fileRef = F94CD8652584B1B7007643BE /* NMRouter+CartModuleActions.m */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
22533FD7CE2CBFCBA91A76CB /* Pods_Mall_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Mall_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
44C49F2C338BEDC1BB3F86C3 /* libPods-Mall-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Mall-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 44C49F2C338BEDC1BB3F86C3 /* libPods-Mall-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Mall-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
5BEE7C60FF4FFDBC76EC95C3 /* Pods-Mall-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mall-iOS.release.xcconfig"; path = "Target Support Files/Pods-Mall-iOS/Pods-Mall-iOS.release.xcconfig"; sourceTree = "<group>"; }; 5BEE7C60FF4FFDBC76EC95C3 /* Pods-Mall-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mall-iOS.release.xcconfig"; path = "Target Support Files/Pods-Mall-iOS/Pods-Mall-iOS.release.xcconfig"; sourceTree = "<group>"; };
A5E60AD6F135115091E12287 /* Pods-Mall-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mall-iOS.debug.xcconfig"; path = "Target Support Files/Pods-Mall-iOS/Pods-Mall-iOS.debug.xcconfig"; sourceTree = "<group>"; }; A5E60AD6F135115091E12287 /* Pods-Mall-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mall-iOS.debug.xcconfig"; path = "Target Support Files/Pods-Mall-iOS/Pods-Mall-iOS.debug.xcconfig"; sourceTree = "<group>"; };
BA1391402538858B0088E54E /* HomeServices.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeServices.h; sourceTree = "<group>"; };
BA1391412538858B0088E54E /* HomeServices.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeServices.m; sourceTree = "<group>"; };
BA260BFC25354F21004A6326 /* AttributLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AttributLabel.h; sourceTree = "<group>"; }; BA260BFC25354F21004A6326 /* AttributLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AttributLabel.h; sourceTree = "<group>"; };
BA260BFD25354F21004A6326 /* AttributLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AttributLabel.m; sourceTree = "<group>"; }; BA260BFD25354F21004A6326 /* AttributLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AttributLabel.m; sourceTree = "<group>"; };
BA260C0125355980004A6326 /* ActivityCollectionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ActivityCollectionCell.m; sourceTree = "<group>"; }; BA260C0125355980004A6326 /* ActivityCollectionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ActivityCollectionCell.m; sourceTree = "<group>"; };
...@@ -54,12 +68,24 @@ ...@@ -54,12 +68,24 @@
BA260C0D25355980004A6326 /* ActivityView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivityView.h; sourceTree = "<group>"; }; BA260C0D25355980004A6326 /* ActivityView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivityView.h; sourceTree = "<group>"; };
BA260C0F25355980004A6326 /* HomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = "<group>"; }; BA260C0F25355980004A6326 /* HomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = "<group>"; };
BA260C1025355980004A6326 /* HomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeViewController.h; sourceTree = "<group>"; }; BA260C1025355980004A6326 /* HomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeViewController.h; sourceTree = "<group>"; };
BA260C2C25355C67004A6326 /* QMUIConfigurationTemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QMUIConfigurationTemplate.h; sourceTree = "<group>"; };
BA260C2D25355C67004A6326 /* QMUIConfigurationTemplate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QMUIConfigurationTemplate.m; sourceTree = "<group>"; };
BA260C32253576A6004A6326 /* HomeGoodsModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeGoodsModel.h; sourceTree = "<group>"; }; BA260C32253576A6004A6326 /* HomeGoodsModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeGoodsModel.h; sourceTree = "<group>"; };
BA260C33253576A6004A6326 /* HomeGoodsModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeGoodsModel.m; sourceTree = "<group>"; }; BA260C33253576A6004A6326 /* HomeGoodsModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeGoodsModel.m; sourceTree = "<group>"; };
BA260C942535947E004A6326 /* ShoppingCartViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShoppingCartViewController.h; sourceTree = "<group>"; }; BA260C942535947E004A6326 /* ShoppingCartViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShoppingCartViewController.h; sourceTree = "<group>"; };
BA260C952535947E004A6326 /* ShoppingCartViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShoppingCartViewController.m; sourceTree = "<group>"; }; BA260C952535947E004A6326 /* ShoppingCartViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShoppingCartViewController.m; sourceTree = "<group>"; };
BA260C9C25359721004A6326 /* ShoppingCartCounterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShoppingCartCounterView.h; sourceTree = "<group>"; };
BA260C9D25359721004A6326 /* ShoppingCartCounterView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShoppingCartCounterView.m; sourceTree = "<group>"; };
BA260CA025359AD5004A6326 /* PrefixHeader.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = "<group>"; };
BA59FF902535DF67007F5614 /* ShoppingCartCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShoppingCartCell.h; sourceTree = "<group>"; };
BA59FF912535DF67007F5614 /* ShoppingCartCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShoppingCartCell.m; sourceTree = "<group>"; };
BA59FF9A2535F7BB007F5614 /* CounterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CounterView.h; sourceTree = "<group>"; };
BA59FF9B2535F7BB007F5614 /* CounterView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CounterView.m; sourceTree = "<group>"; };
BA7196352537DD3A00D320A3 /* HomeViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeViewModel.h; sourceTree = "<group>"; };
BA7196362537DD3A00D320A3 /* HomeViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeViewModel.m; sourceTree = "<group>"; };
BA71965E2537E52400D320A3 /* HomeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeModel.h; sourceTree = "<group>"; };
BA71965F2537E52400D320A3 /* HomeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeModel.m; sourceTree = "<group>"; };
BA7196662537E69000D320A3 /* HomeClassificationModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeClassificationModel.h; sourceTree = "<group>"; };
BA7196672537E69000D320A3 /* HomeClassificationModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeClassificationModel.m; sourceTree = "<group>"; };
BA71967B2537F22E00D320A3 /* Interface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Interface.h; sourceTree = "<group>"; };
BA8A1F3D25342FC900321F16 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; BA8A1F3D25342FC900321F16 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
BA8A1F3F25342FC900321F16 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; BA8A1F3F25342FC900321F16 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
BA8A1F4125342FC900321F16 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; BA8A1F4125342FC900321F16 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
...@@ -71,20 +97,30 @@ ...@@ -71,20 +97,30 @@
BA8A1FAF2534320100321F16 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; BA8A1FAF2534320100321F16 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
BA8A1FC52534357300321F16 /* NMSearchBar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NMSearchBar.h; sourceTree = "<group>"; }; BA8A1FC52534357300321F16 /* NMSearchBar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NMSearchBar.h; sourceTree = "<group>"; };
BA8A1FC62534357300321F16 /* NMSearchBar.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NMSearchBar.m; sourceTree = "<group>"; }; BA8A1FC62534357300321F16 /* NMSearchBar.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NMSearchBar.m; sourceTree = "<group>"; };
BA8A1FE525343B1F00321F16 /* ViewControllerConfigure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewControllerConfigure.h; sourceTree = "<group>"; }; BAB53EEA25368E8500D207CF /* GoodsModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GoodsModel.h; sourceTree = "<group>"; };
BA8A1FE625343B1F00321F16 /* ViewControllerConfigure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewControllerConfigure.m; sourceTree = "<group>"; }; BAB53EEB25368E8500D207CF /* GoodsModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GoodsModel.m; sourceTree = "<group>"; };
BA8A1FEA25343CA600321F16 /* MacroDefinition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroDefinition.h; sourceTree = "<group>"; };
BA8A204B2534566A00321F16 /* UICollectionViewCell+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UICollectionViewCell+Extension.m"; sourceTree = "<group>"; };
BA8A204C2534566A00321F16 /* UICollectionReusableView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UICollectionReusableView+Extension.h"; sourceTree = "<group>"; };
BA8A204D2534566A00321F16 /* UITableViewHeaderFooterView+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableViewHeaderFooterView+Extension.m"; sourceTree = "<group>"; };
BA8A204E2534566A00321F16 /* UITableViewCell+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableViewCell+Extension.m"; sourceTree = "<group>"; };
BA8A204F2534566A00321F16 /* UICollectionViewCell+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UICollectionViewCell+Extension.h"; sourceTree = "<group>"; };
BA8A20502534566A00321F16 /* UICollectionReusableView+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UICollectionReusableView+Extension.m"; sourceTree = "<group>"; };
BA8A20512534566A00321F16 /* UITableViewCell+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableViewCell+Extension.h"; sourceTree = "<group>"; };
BA8A20522534566A00321F16 /* UITableViewHeaderFooterView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableViewHeaderFooterView+Extension.h"; sourceTree = "<group>"; };
BA8A2062253461EA00321F16 /* UIImage+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Extension.m"; sourceTree = "<group>"; };
BA8A2063253461EA00321F16 /* UIImage+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Extension.h"; sourceTree = "<group>"; };
BAC30D8D25340BA9007757AB /* Mall-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Mall-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; BAC30D8D25340BA9007757AB /* Mall-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Mall-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
BAE231E9253FE248008B79CC /* AppDelegate+Theme.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+Theme.h"; sourceTree = "<group>"; };
BAE231EA253FE248008B79CC /* AppDelegate+Theme.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "AppDelegate+Theme.m"; sourceTree = "<group>"; };
BAE231ED253FE3DA008B79CC /* AppDelegate+Network.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+Network.h"; sourceTree = "<group>"; };
BAE231EE253FE3DA008B79CC /* AppDelegate+Network.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "AppDelegate+Network.m"; sourceTree = "<group>"; };
BAE231F1253FE488008B79CC /* AppDelegate+UIViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+UIViewController.h"; sourceTree = "<group>"; };
BAE231F2253FE488008B79CC /* AppDelegate+UIViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "AppDelegate+UIViewController.m"; sourceTree = "<group>"; };
BAE232AA2540108E008B79CC /* HomeMainMacro.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeMainMacro.h; sourceTree = "<group>"; };
BAF8DB88253938C3001FA3E2 /* HomeCarouselModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeCarouselModel.h; sourceTree = "<group>"; };
BAF8DB89253938C3001FA3E2 /* HomeCarouselModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeCarouselModel.m; sourceTree = "<group>"; };
F94CD8332584A87B007643BE /* QMUIConfigurationTemplateDark.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QMUIConfigurationTemplateDark.m; sourceTree = "<group>"; };
F94CD8342584A87B007643BE /* QMUIConfigurationTemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QMUIConfigurationTemplate.h; sourceTree = "<group>"; };
F94CD8352584A87B007643BE /* QMUIConfigurationTemplateDark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QMUIConfigurationTemplateDark.h; sourceTree = "<group>"; };
F94CD8362584A87B007643BE /* QMUIConfigurationTemplate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QMUIConfigurationTemplate.m; sourceTree = "<group>"; };
F94CD8522584AFAB007643BE /* JYTargetHomeModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JYTargetHomeModule.h; sourceTree = "<group>"; };
F94CD8532584AFAB007643BE /* JYTargetHomeModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JYTargetHomeModule.m; sourceTree = "<group>"; };
F94CD85A2584B02B007643BE /* NMRouter+HomeModuleActions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NMRouter+HomeModuleActions.h"; sourceTree = "<group>"; };
F94CD85B2584B02B007643BE /* NMRouter+HomeModuleActions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NMRouter+HomeModuleActions.m"; sourceTree = "<group>"; };
F94CD8602584B1A0007643BE /* JYTargetCartModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JYTargetCartModule.h; sourceTree = "<group>"; };
F94CD8612584B1A0007643BE /* JYTargetCartModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JYTargetCartModule.m; sourceTree = "<group>"; };
F94CD8642584B1B7007643BE /* NMRouter+CartModuleActions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NMRouter+CartModuleActions.h"; sourceTree = "<group>"; };
F94CD8652584B1B7007643BE /* NMRouter+CartModuleActions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NMRouter+CartModuleActions.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -92,7 +128,7 @@ ...@@ -92,7 +128,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
92C682E1E2B76AF1CEFB9EEF /* libPods-Mall-iOS.a in Frameworks */, 6C205D1C8FFC382F580F7A74 /* Pods_Mall_iOS.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -112,6 +148,7 @@ ...@@ -112,6 +148,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
44C49F2C338BEDC1BB3F86C3 /* libPods-Mall-iOS.a */, 44C49F2C338BEDC1BB3F86C3 /* libPods-Mall-iOS.a */,
22533FD7CE2CBFCBA91A76CB /* Pods_Mall_iOS.framework */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -160,21 +197,17 @@ ...@@ -160,21 +197,17 @@
path = ViewController; path = ViewController;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
BA260C2B25355C67004A6326 /* QMUIConfigurationTemplate */ = {
isa = PBXGroup;
children = (
BA260C2C25355C67004A6326 /* QMUIConfigurationTemplate.h */,
BA260C2D25355C67004A6326 /* QMUIConfigurationTemplate.m */,
);
name = QMUIConfigurationTemplate;
path = Pods/QMUIKit/QMUIConfigurationTemplate;
sourceTree = SOURCE_ROOT;
};
BA260C3125357673004A6326 /* Model */ = { BA260C3125357673004A6326 /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
BA71965E2537E52400D320A3 /* HomeModel.h */,
BA71965F2537E52400D320A3 /* HomeModel.m */,
BAF8DB88253938C3001FA3E2 /* HomeCarouselModel.h */,
BAF8DB89253938C3001FA3E2 /* HomeCarouselModel.m */,
BA260C32253576A6004A6326 /* HomeGoodsModel.h */, BA260C32253576A6004A6326 /* HomeGoodsModel.h */,
BA260C33253576A6004A6326 /* HomeGoodsModel.m */, BA260C33253576A6004A6326 /* HomeGoodsModel.m */,
BA7196662537E69000D320A3 /* HomeClassificationModel.h */,
BA7196672537E69000D320A3 /* HomeClassificationModel.m */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -191,6 +224,8 @@ ...@@ -191,6 +224,8 @@
BA260C962535947E004A6326 /* Cell */ = { BA260C962535947E004A6326 /* Cell */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
BA59FF902535DF67007F5614 /* ShoppingCartCell.h */,
BA59FF912535DF67007F5614 /* ShoppingCartCell.m */,
); );
path = Cell; path = Cell;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -198,6 +233,10 @@ ...@@ -198,6 +233,10 @@
BA260C972535947E004A6326 /* View */ = { BA260C972535947E004A6326 /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
BA260C9C25359721004A6326 /* ShoppingCartCounterView.h */,
BA260C9D25359721004A6326 /* ShoppingCartCounterView.m */,
BA59FF9A2535F7BB007F5614 /* CounterView.h */,
BA59FF9B2535F7BB007F5614 /* CounterView.m */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -205,10 +244,23 @@ ...@@ -205,10 +244,23 @@
BA260C982535947E004A6326 /* Model */ = { BA260C982535947E004A6326 /* Model */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
BAB53EEA25368E8500D207CF /* GoodsModel.h */,
BAB53EEB25368E8500D207CF /* GoodsModel.m */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
BA7196342537DC9F00D320A3 /* VM */ = {
isa = PBXGroup;
children = (
BA7196352537DD3A00D320A3 /* HomeViewModel.h */,
BA7196362537DD3A00D320A3 /* HomeViewModel.m */,
BA1391402538858B0088E54E /* HomeServices.h */,
BA1391412538858B0088E54E /* HomeServices.m */,
);
path = VM;
sourceTree = "<group>";
};
BA8A1F3925342FC900321F16 /* Classes */ = { BA8A1F3925342FC900321F16 /* Classes */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -221,6 +273,8 @@ ...@@ -221,6 +273,8 @@
BA8A1F3A25342FC900321F16 /* Home */ = { BA8A1F3A25342FC900321F16 /* Home */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
F94CD8512584AF75007643BE /* Module */,
BA7196342537DC9F00D320A3 /* VM */,
BA260C3125357673004A6326 /* Model */, BA260C3125357673004A6326 /* Model */,
BA260C0025355980004A6326 /* Cell */, BA260C0025355980004A6326 /* Cell */,
BA260C0725355980004A6326 /* View */, BA260C0725355980004A6326 /* View */,
...@@ -232,6 +286,7 @@ ...@@ -232,6 +286,7 @@
BA8A1F3B25342FC900321F16 /* Cart */ = { BA8A1F3B25342FC900321F16 /* Cart */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
F94CD85F2584B170007643BE /* Module */,
BA260C962535947E004A6326 /* Cell */, BA260C962535947E004A6326 /* Cell */,
BA260C982535947E004A6326 /* Model */, BA260C982535947E004A6326 /* Model */,
BA260C972535947E004A6326 /* View */, BA260C972535947E004A6326 /* View */,
...@@ -259,6 +314,12 @@ ...@@ -259,6 +314,12 @@
BA8A1F4725342FC900321F16 /* AppDelegate.m */, BA8A1F4725342FC900321F16 /* AppDelegate.m */,
BA8A1F4825342FC900321F16 /* SceneDelegate.h */, BA8A1F4825342FC900321F16 /* SceneDelegate.h */,
BA8A1F4625342FC900321F16 /* SceneDelegate.m */, BA8A1F4625342FC900321F16 /* SceneDelegate.m */,
BAE231E9253FE248008B79CC /* AppDelegate+Theme.h */,
BAE231EA253FE248008B79CC /* AppDelegate+Theme.m */,
BAE231ED253FE3DA008B79CC /* AppDelegate+Network.h */,
BAE231EE253FE3DA008B79CC /* AppDelegate+Network.m */,
BAE231F1253FE488008B79CC /* AppDelegate+UIViewController.h */,
BAE231F2253FE488008B79CC /* AppDelegate+UIViewController.m */,
); );
path = AppDelegate; path = AppDelegate;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -266,23 +327,16 @@ ...@@ -266,23 +327,16 @@
BA8A1F4925342FC900321F16 /* Define */ = { BA8A1F4925342FC900321F16 /* Define */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
BA8A1FEA25343CA600321F16 /* MacroDefinition.h */, BA71967B2537F22E00D320A3 /* Interface.h */,
BA260CA025359AD5004A6326 /* PrefixHeader.pch */,
BAE232AA2540108E008B79CC /* HomeMainMacro.h */,
); );
path = Define; path = Define;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
BA8A1F4A25342FC900321F16 /* Utils */ = {
isa = PBXGroup;
children = (
BA8A1FE425343B1F00321F16 /* ViewControllerConfigure */,
);
path = Utils;
sourceTree = "<group>";
};
BA8A1FBC253434A400321F16 /* Features */ = { BA8A1FBC253434A400321F16 /* Features */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
BA260C2B25355C67004A6326 /* QMUIConfigurationTemplate */,
BA260BFB25354F21004A6326 /* AttributLabel */, BA260BFB25354F21004A6326 /* AttributLabel */,
BA8A1FBD253434C600321F16 /* NMSearchBar */, BA8A1FBD253434C600321F16 /* NMSearchBar */,
); );
...@@ -299,54 +353,10 @@ ...@@ -299,54 +353,10 @@
path = NMSearchBar; path = NMSearchBar;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
BA8A1FE425343B1F00321F16 /* ViewControllerConfigure */ = {
isa = PBXGroup;
children = (
BA8A1FE525343B1F00321F16 /* ViewControllerConfigure.h */,
BA8A1FE625343B1F00321F16 /* ViewControllerConfigure.m */,
);
path = ViewControllerConfigure;
sourceTree = "<group>";
};
BA8A20492534566A00321F16 /* Extension */ = {
isa = PBXGroup;
children = (
BA8A2061253461EA00321F16 /* UIImage(Extension) */,
BA8A204A2534566A00321F16 /* Cell(Extension) */,
);
name = Extension;
path = "Mall-iOS/Extension";
sourceTree = "<group>";
};
BA8A204A2534566A00321F16 /* Cell(Extension) */ = {
isa = PBXGroup;
children = (
BA8A204B2534566A00321F16 /* UICollectionViewCell+Extension.m */,
BA8A204C2534566A00321F16 /* UICollectionReusableView+Extension.h */,
BA8A204D2534566A00321F16 /* UITableViewHeaderFooterView+Extension.m */,
BA8A204E2534566A00321F16 /* UITableViewCell+Extension.m */,
BA8A204F2534566A00321F16 /* UICollectionViewCell+Extension.h */,
BA8A20502534566A00321F16 /* UICollectionReusableView+Extension.m */,
BA8A20512534566A00321F16 /* UITableViewCell+Extension.h */,
BA8A20522534566A00321F16 /* UITableViewHeaderFooterView+Extension.h */,
);
path = "Cell(Extension)";
sourceTree = "<group>";
};
BA8A2061253461EA00321F16 /* UIImage(Extension) */ = {
isa = PBXGroup;
children = (
BA8A2062253461EA00321F16 /* UIImage+Extension.m */,
BA8A2063253461EA00321F16 /* UIImage+Extension.h */,
);
path = "UIImage(Extension)";
sourceTree = "<group>";
};
BAC30D8425340BA9007757AB = { BAC30D8425340BA9007757AB = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
BAC30D8F25340BA9007757AB /* Mall-iOS */, BAC30D8F25340BA9007757AB /* Mall-iOS */,
BA8A20492534566A00321F16 /* Extension */,
BA8A1FBC253434A400321F16 /* Features */, BA8A1FBC253434A400321F16 /* Features */,
BAC30D8E25340BA9007757AB /* Products */, BAC30D8E25340BA9007757AB /* Products */,
084D3618CB8BE24EA87AC5D7 /* Pods */, 084D3618CB8BE24EA87AC5D7 /* Pods */,
...@@ -365,15 +375,48 @@ ...@@ -365,15 +375,48 @@
BAC30D8F25340BA9007757AB /* Mall-iOS */ = { BAC30D8F25340BA9007757AB /* Mall-iOS */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
F94CD8322584A87B007643BE /* QMUIConfigurationTemplate */,
BA8A1F4425342FC900321F16 /* AppDelegate */, BA8A1F4425342FC900321F16 /* AppDelegate */,
BA8A1F3925342FC900321F16 /* Classes */, BA8A1F3925342FC900321F16 /* Classes */,
BA8A1F4925342FC900321F16 /* Define */, BA8A1F4925342FC900321F16 /* Define */,
BA8A1F3C25342FC900321F16 /* SupportingFiles */, BA8A1F3C25342FC900321F16 /* SupportingFiles */,
BA8A1F4A25342FC900321F16 /* Utils */,
); );
path = "Mall-iOS"; path = "Mall-iOS";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
F94CD8322584A87B007643BE /* QMUIConfigurationTemplate */ = {
isa = PBXGroup;
children = (
F94CD8342584A87B007643BE /* QMUIConfigurationTemplate.h */,
F94CD8362584A87B007643BE /* QMUIConfigurationTemplate.m */,
F94CD8352584A87B007643BE /* QMUIConfigurationTemplateDark.h */,
F94CD8332584A87B007643BE /* QMUIConfigurationTemplateDark.m */,
);
path = QMUIConfigurationTemplate;
sourceTree = "<group>";
};
F94CD8512584AF75007643BE /* Module */ = {
isa = PBXGroup;
children = (
F94CD8522584AFAB007643BE /* JYTargetHomeModule.h */,
F94CD8532584AFAB007643BE /* JYTargetHomeModule.m */,
F94CD85A2584B02B007643BE /* NMRouter+HomeModuleActions.h */,
F94CD85B2584B02B007643BE /* NMRouter+HomeModuleActions.m */,
);
path = Module;
sourceTree = "<group>";
};
F94CD85F2584B170007643BE /* Module */ = {
isa = PBXGroup;
children = (
F94CD8602584B1A0007643BE /* JYTargetCartModule.h */,
F94CD8612584B1A0007643BE /* JYTargetCartModule.m */,
F94CD8642584B1B7007643BE /* NMRouter+CartModuleActions.h */,
F94CD8652584B1B7007643BE /* NMRouter+CartModuleActions.m */,
);
path = Module;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
...@@ -385,7 +428,8 @@ ...@@ -385,7 +428,8 @@
BAC30D8925340BA9007757AB /* Sources */, BAC30D8925340BA9007757AB /* Sources */,
BAC30D8A25340BA9007757AB /* Frameworks */, BAC30D8A25340BA9007757AB /* Frameworks */,
BAC30D8B25340BA9007757AB /* Resources */, BAC30D8B25340BA9007757AB /* Resources */,
0DCAFD90E2E6B9A399A7C6B2 /* [CP] Copy Pods Resources */, FA8FDD7585715C3F321EE5AC /* [CP] Embed Pods Frameworks */,
0906FC3EDDB25548C664179A /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
...@@ -441,7 +485,7 @@ ...@@ -441,7 +485,7 @@
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
0DCAFD90E2E6B9A399A7C6B2 /* [CP] Copy Pods Resources */ = { 0906FC3EDDB25548C664179A /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
...@@ -480,6 +524,23 @@ ...@@ -480,6 +524,23 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
FA8FDD7585715C3F321EE5AC /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Mall-iOS/Pods-Mall-iOS-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Mall-iOS/Pods-Mall-iOS-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Mall-iOS/Pods-Mall-iOS-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
...@@ -488,24 +549,35 @@ ...@@ -488,24 +549,35 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
BA260BFE25354F21004A6326 /* AttributLabel.m in Sources */, BA260BFE25354F21004A6326 /* AttributLabel.m in Sources */,
F94CD8622584B1A0007643BE /* JYTargetCartModule.m in Sources */,
BA8A1FC72534357300321F16 /* NMSearchBar.m in Sources */, BA8A1FC72534357300321F16 /* NMSearchBar.m in Sources */,
BA260C2E25355C67004A6326 /* QMUIConfigurationTemplate.m in Sources */,
BA260C1225355980004A6326 /* HomeClassficationCell.m in Sources */, BA260C1225355980004A6326 /* HomeClassficationCell.m in Sources */,
BAB53EEC25368E8500D207CF /* GoodsModel.m in Sources */,
BA260C1625355980004A6326 /* HomeClassificationView.m in Sources */, BA260C1625355980004A6326 /* HomeClassificationView.m in Sources */,
BA260C1325355980004A6326 /* HomeGoodsCell.m in Sources */, BA260C1325355980004A6326 /* HomeGoodsCell.m in Sources */,
BA8A2064253461EA00321F16 /* UIImage+Extension.m in Sources */, BA1391422538858B0088E54E /* HomeServices.m in Sources */,
BAE231EB253FE248008B79CC /* AppDelegate+Theme.m in Sources */,
BA8A1F4E25342FC900321F16 /* main.m in Sources */, BA8A1F4E25342FC900321F16 /* main.m in Sources */,
F94CD8662584B1B7007643BE /* NMRouter+CartModuleActions.m in Sources */,
BA260C992535947E004A6326 /* ShoppingCartViewController.m in Sources */, BA260C992535947E004A6326 /* ShoppingCartViewController.m in Sources */,
BA8A20532534566A00321F16 /* UICollectionViewCell+Extension.m in Sources */, BA7196602537E52400D320A3 /* HomeModel.m in Sources */,
BA8A20552534566A00321F16 /* UITableViewCell+Extension.m in Sources */, BAE231EF253FE3DA008B79CC /* AppDelegate+Network.m in Sources */,
BAF8DB8A253938C3001FA3E2 /* HomeCarouselModel.m in Sources */,
BA59FF9C2535F7BB007F5614 /* CounterView.m in Sources */,
BA8A1F5025342FC900321F16 /* SceneDelegate.m in Sources */, BA8A1F5025342FC900321F16 /* SceneDelegate.m in Sources */,
BA8A1F5125342FC900321F16 /* AppDelegate.m in Sources */, BA8A1F5125342FC900321F16 /* AppDelegate.m in Sources */,
BA8A20562534566A00321F16 /* UICollectionReusableView+Extension.m in Sources */, BA7196372537DD3A00D320A3 /* HomeViewModel.m in Sources */,
BA8A20542534566A00321F16 /* UITableViewHeaderFooterView+Extension.m in Sources */, F94CD8372584A87B007643BE /* QMUIConfigurationTemplateDark.m in Sources */,
BA8A1FE725343B2000321F16 /* ViewControllerConfigure.m in Sources */, F94CD8542584AFAB007643BE /* JYTargetHomeModule.m in Sources */,
BA260C9E25359721004A6326 /* ShoppingCartCounterView.m in Sources */,
F94CD85C2584B02B007643BE /* NMRouter+HomeModuleActions.m in Sources */,
F94CD8382584A87B007643BE /* QMUIConfigurationTemplate.m in Sources */,
BA59FF922535DF67007F5614 /* ShoppingCartCell.m in Sources */,
BA7196682537E69000D320A3 /* HomeClassificationModel.m in Sources */,
BA260C34253576A6004A6326 /* HomeGoodsModel.m in Sources */, BA260C34253576A6004A6326 /* HomeGoodsModel.m in Sources */,
BA260C1425355980004A6326 /* HomeCollectionHeaderView.m in Sources */, BA260C1425355980004A6326 /* HomeCollectionHeaderView.m in Sources */,
BA260C1525355980004A6326 /* ActivityView.m in Sources */, BA260C1525355980004A6326 /* ActivityView.m in Sources */,
BAE231F3253FE488008B79CC /* AppDelegate+UIViewController.m in Sources */,
BA260C1725355980004A6326 /* HomeViewController.m in Sources */, BA260C1725355980004A6326 /* HomeViewController.m in Sources */,
BA260C1125355980004A6326 /* ActivityCollectionCell.m in Sources */, BA260C1125355980004A6326 /* ActivityCollectionCell.m in Sources */,
); );
...@@ -585,7 +657,7 @@ ...@@ -585,7 +657,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = ""; INFOPLIST_FILE = "";
IPHONEOS_DEPLOYMENT_TARGET = 14.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
...@@ -639,7 +711,7 @@ ...@@ -639,7 +711,7 @@
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = ""; INFOPLIST_FILE = "";
IPHONEOS_DEPLOYMENT_TARGET = 14.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
...@@ -654,14 +726,71 @@ ...@@ -654,14 +726,71 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 2P45FGG4X5;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"${PODS_ROOT}/NMCartfileSDK/NMCartfileSDK/iOS\"",
"\"${PODS_ROOT}/NMCategories/NMCategories/Universal\"",
"\"${PODS_ROOT}/NMNetwork/NMNetwork/Universal\"",
"\"${PODS_ROOT}/NMReactiveCocoa/NMReactiveCocoa/Universal\"",
"\"${PODS_ROOT}/NMRouter/NMRouter/Universal\"",
"\"${PODS_ROOT}/NMUIChainKit/NMUIChainKit/Universal\"",
);
GCC_PREFIX_HEADER = "$(SRCROOT)/Mall-iOS/Define/PrefixHeader.pch";
HEADER_SEARCH_PATHS = (
"$(inherited)",
"\"${PODS_CONFIGURATION_BUILD_DIR}/QMUIKit/QMUIKit.framework/Headers\"",
"\"${PODS_ROOT}/Headers/Public\"",
"\"${PODS_ROOT}/Headers/Public/NMCategories\"",
"\"${PODS_ROOT}/Headers/Public/NMNetwork\"",
"\"${PODS_ROOT}/Headers/Public/NMRouter\"",
"\"${PODS_ROOT}/Headers/Public/NMUIChainKit\"",
"\"${PODS_ROOT}/Headers/Public/QMUIKit\"",
);
INFOPLIST_FILE = "$(PROJECT_DIR)/Mall-iOS/SupportingFiles/Info.plist"; INFOPLIST_FILE = "$(PROJECT_DIR)/Mall-iOS/SupportingFiles/Info.plist";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-framework",
"\"AFNetworking\"",
"-framework",
"\"CoreGraphics\"",
"-framework",
"\"Foundation\"",
"-framework",
"\"MJExtension\"",
"-framework",
"\"MJRefresh\"",
"-framework",
"\"Masonry\"",
"-framework",
"\"NMCategories\"",
"-framework",
"\"NMNetwork\"",
"-framework",
"\"NMReactiveCocoa\"",
"-framework",
"\"NMRouter\"",
"-framework",
"\"NMUIChainKit\"",
"-framework",
"\"Photos\"",
"-framework",
"\"SDWebImage\"",
"-framework",
"\"UIKit\"",
"-framework",
"\"QMUIKit\"",
"-framework",
"\"YYCache\"",
);
PRODUCT_BUNDLE_IDENTIFIER = "Nm.Mall-iOS"; PRODUCT_BUNDLE_IDENTIFIER = "Nm.Mall-iOS";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = 1;
}; };
name = Debug; name = Debug;
}; };
...@@ -672,14 +801,71 @@ ...@@ -672,14 +801,71 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 2P45FGG4X5;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"${PODS_ROOT}/NMCartfileSDK/NMCartfileSDK/iOS\"",
"\"${PODS_ROOT}/NMCategories/NMCategories/Universal\"",
"\"${PODS_ROOT}/NMNetwork/NMNetwork/Universal\"",
"\"${PODS_ROOT}/NMReactiveCocoa/NMReactiveCocoa/Universal\"",
"\"${PODS_ROOT}/NMRouter/NMRouter/Universal\"",
"\"${PODS_ROOT}/NMUIChainKit/NMUIChainKit/Universal\"",
);
GCC_PREFIX_HEADER = "$(SRCROOT)/Mall-iOS/Define/PrefixHeader.pch";
HEADER_SEARCH_PATHS = (
"$(inherited)",
"\"${PODS_CONFIGURATION_BUILD_DIR}/QMUIKit/QMUIKit.framework/Headers\"",
"\"${PODS_ROOT}/Headers/Public\"",
"\"${PODS_ROOT}/Headers/Public/NMCategories\"",
"\"${PODS_ROOT}/Headers/Public/NMNetwork\"",
"\"${PODS_ROOT}/Headers/Public/NMRouter\"",
"\"${PODS_ROOT}/Headers/Public/NMUIChainKit\"",
"\"${PODS_ROOT}/Headers/Public/QMUIKit\"",
);
INFOPLIST_FILE = "$(PROJECT_DIR)/Mall-iOS/SupportingFiles/Info.plist"; INFOPLIST_FILE = "$(PROJECT_DIR)/Mall-iOS/SupportingFiles/Info.plist";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-framework",
"\"AFNetworking\"",
"-framework",
"\"CoreGraphics\"",
"-framework",
"\"Foundation\"",
"-framework",
"\"MJExtension\"",
"-framework",
"\"MJRefresh\"",
"-framework",
"\"Masonry\"",
"-framework",
"\"NMCategories\"",
"-framework",
"\"NMNetwork\"",
"-framework",
"\"NMReactiveCocoa\"",
"-framework",
"\"NMRouter\"",
"-framework",
"\"NMUIChainKit\"",
"-framework",
"\"Photos\"",
"-framework",
"\"SDWebImage\"",
"-framework",
"\"UIKit\"",
"-framework",
"\"QMUIKit\"",
"-framework",
"\"YYCache\"",
);
PRODUCT_BUNDLE_IDENTIFIER = "Nm.Mall-iOS"; PRODUCT_BUNDLE_IDENTIFIER = "Nm.Mall-iOS";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = 1;
}; };
name = Release; name = Release;
}; };
......
//
// AppDelegate+Network.h
// Mall-iOS
//
// Created by Nemo on 2020/10/21.
//
#import "AppDelegate.h"
NS_ASSUME_NONNULL_BEGIN
@interface AppDelegate (Network)
- (void)networkApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
@end
NS_ASSUME_NONNULL_END
//
// AppDelegate+Network.m
// Mall-iOS
//
// Created by Nemo on 2020/10/21.
//
#import "AppDelegate+Network.h"
#import <NMNetwork/NMNetwork.h>
@implementation AppDelegate (Network)
- (void)networkApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[NetworkManager updateBaseUrl:API_HOST];
}
@end
//
// AppDelegate+Theme.h
// Mall-iOS
//
// Created by Nemo on 2020/10/21.
//
#import "AppDelegate.h"
NS_ASSUME_NONNULL_BEGIN
@interface AppDelegate (Theme)
- (void)themeApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
@end
NS_ASSUME_NONNULL_END
//
// AppDelegate+Theme.m
// Mall-iOS
//
// Created by Nemo on 2020/10/21.
//
#import "AppDelegate+Theme.h"
#import <NMTheme/NMTheme.h>
@implementation AppDelegate (Theme)
- (void)themeApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[NMThemeManager theme_application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
//
// AppDelegate+UIViewController.h
// Mall-iOS
//
// Created by Nemo on 2020/10/21.
//
#import "AppDelegate.h"
NS_ASSUME_NONNULL_BEGIN
@interface AppDelegate (UIViewController)
- (void)viewControllerApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;
@end
NS_ASSUME_NONNULL_END
//
// AppDelegate+UIViewController.m
// Mall-iOS
//
// Created by Nemo on 2020/10/21.
//
#import "AppDelegate+UIViewController.h"
#import <NMCategories/NMCategories.h>
#import <QMUIKit/QMUIKit.h>
#import <NMTheme/NMTheme.h>
#import "NMRouter+CartModuleActions.h"
#import "NMRouter+HomeModuleActions.h"
@implementation AppDelegate (UIViewController)
- (void)viewControllerApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self initViewController];
[self initStyle];
[self startLaunchingAnimation];
}
- (void)initStyle {
[[UIButton appearance] setExclusiveTouch:YES];
if (@available(iOS 11.0, *)){
//[UITableView appearance].contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
[UITableView appearance].estimatedRowHeight = 0;
[UITableView appearance].estimatedSectionHeaderHeight = 0;
[UITableView appearance].estimatedSectionFooterHeight = 0;
[UITableView appearance].backgroundColor = UIColor.nm_backgroundColor;
}else {
self.window.rootViewController.automaticallyAdjustsScrollViewInsets = NO;
}
}
- (void)initViewController {
UITabBarController *tab = [[UITabBarController alloc] init];
UIViewController *home = [[NMRouter sharedInstance] jyMediatorHomeViewController];
UIViewController *shopping = [[NMRouter sharedInstance] jyMediatorCartViewController];
tab.viewControllers = @[home,shopping];
self.window.rootViewController = tab;
[self.window makeKeyAndVisible];
}
- (void)startLaunchingAnimation {
UIWindow *window = self.window;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:[NSBundle mainBundle]];
UIViewController *rootVC = [storyboard instantiateInitialViewController];
UIView *launchScreenView = rootVC.view;
launchScreenView.backgroundColor = UIColor.clearColor;
//launchScreenView.frame = window.bounds;
[window addSubview:launchScreenView];
UIImageView *backgroundImageView = launchScreenView.subviews.firstObject;
backgroundImageView.clipsToBounds = YES;
/**
UIImageView *logoImageView = launchScreenView.subviews[1];
UILabel *copyrightLabel = launchScreenView.subviews.lastObject;
*/
UIView *maskView = [[UIView alloc] initWithFrame:launchScreenView.bounds];
maskView.backgroundColor = UIColor.nm_tintColor;
[launchScreenView insertSubview:maskView belowSubview:backgroundImageView];
[launchScreenView layoutIfNeeded];
[launchScreenView.constraints enumerateObjectsUsingBlock:^(__kindof NSLayoutConstraint * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
NSLog(@"%@",obj.identifier);
if ([obj.identifier isEqualToString:@"bottomAlign"]) {
obj.active = NO;
[NSLayoutConstraint constraintWithItem:backgroundImageView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:launchScreenView attribute:NSLayoutAttributeTop multiplier:1 constant:NavigationContentTop].active = YES;
*stop = YES;
}
}];
[UIView animateWithDuration:.15 delay:0.9 options:QMUIViewAnimationOptionsCurveOut animations:^{
[launchScreenView layoutIfNeeded];
//logoImageView.alpha = 0.0;
//copyrightLabel.alpha = 0;
} completion:nil];
[UIView animateWithDuration:1.2 delay:0.9 options:UIViewAnimationOptionCurveEaseOut animations:^{
maskView.alpha = 0;
backgroundImageView.alpha = 0;
} completion:^(BOOL finished) {
[launchScreenView removeFromSuperview];
}];
}
@end
...@@ -6,48 +6,37 @@ ...@@ -6,48 +6,37 @@
// //
#import "AppDelegate.h" #import "AppDelegate.h"
#import "HomeViewController.h" #import "AppDelegate+Theme.h"
#import "ShoppingCartViewController.h" #import "AppDelegate+Network.h"
#import "MacroDefinition.h" #import "AppDelegate+UIViewController.h"
#import <NMRouter/NMRouter.h>
@interface AppDelegate () @interface AppDelegate ()
@end @end
@implementation AppDelegate @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
UITabBarController *tab = [[UITabBarController alloc] init];
HomeViewController *home = [[HomeViewController alloc] init];
home.title = @"主页";
home.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"主页"
image:[UIImage imageNamed:@"index"]
selectedImage:[UIImage imageNamed:@"index_s"]];
UINavigationController* homeNav = [[UINavigationController alloc] initWithRootViewController:home];
ShoppingCartViewController *shopping = [[ShoppingCartViewController alloc] init];
shopping.title = @"购物车"; [NMRouter setNMRouterPrefixKey:@"JY"];
shopping.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"购物车"
image:[UIImage imageNamed:@"shoppingCart"]
selectedImage:[UIImage imageNamed:@"shoppingCart_s"]];
[[UITabBar appearance] setTintColor:[UIColor colorWithRed:163.0f/255.0f green:46.0f/255.0f blue:46.0f/255.0f alpha:1.0f]]; /// 网络处理
[self networkApplication:application didFinishLaunchingWithOptions:launchOptions];
/// 主题处理
[self themeApplication:application didFinishLaunchingWithOptions:launchOptions];
UINavigationController* shoppingNav = [[UINavigationController alloc] initWithRootViewController:shopping]; /// 界面
tab.viewControllers = @[homeNav,shoppingNav]; [self viewControllerApplication:application didFinishLaunchingWithOptions:launchOptions];
tab.selectedIndex = 1;
self.window.rootViewController = tab;
[self.window makeKeyAndVisible];
return YES; return YES;
} }
#pragma mark - UISceneSession lifecycle #pragma mark - UISceneSession lifecycle
/** /**
...@@ -64,9 +53,4 @@ ...@@ -64,9 +53,4 @@
} }
*/ */
@end @end
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#import "SceneDelegate.h" #import "SceneDelegate.h"
#import "HomeViewController.h" #import "HomeViewController.h"
#import "ShoppingCartViewController.h" #import "ShoppingCartViewController.h"
#import "MacroDefinition.h"
@interface SceneDelegate () @interface SceneDelegate ()
......
//
// ShoppingCartCell.h
// Mall-iOS
//
// Created by Nemo on 2020/10/13.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class GoodsModel;
@interface ShoppingCartCell : UITableViewCell
/// 商品选择
@property (nonatomic, copy) void(^selectBlock)(BOOL select);
/// 商品数量改变
@property (nonatomic, copy) void(^goodsCountChangeBlock)(NSInteger count);
@property (nonatomic, strong) GoodsModel *model;
@end
NS_ASSUME_NONNULL_END
//
// ShoppingCartCell.m
// Mall-iOS
//
// Created by Nemo on 2020/10/13.
//
#import "ShoppingCartCell.h"
#import <Masonry/Masonry.h>
#import <NMCategories/NMCategories.h>
#import "CounterView.h"
#import "GoodsModel.h"
@interface ShoppingCartCell ()
@property (nonatomic, strong) UIImageView *selectIv;
@property (nonatomic, strong) UIImageView *goodsIv;
@property (nonatomic, strong) UILabel *goodsNameLb;
@property (nonatomic, strong) UILabel *goodsSpecLb;
@property (nonatomic, strong) UILabel *goodsPriceLb;
@property (nonatomic, strong) CounterView *goodsCounterView;
@end
@implementation ShoppingCartCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.goodsIv.backgroundColor = [UIColor whiteColor];
self.selectIv.backgroundColor = [UIColor whiteColor];
self.goodsNameLb.text = @"";
self.goodsSpecLb.text = @"";
self.goodsPriceLb.text = @"";
self.goodsCounterView.count = 1;
}
-(void)setGoodsCountChangeBlock:(void (^)(NSInteger))goodsCountChangeBlock {
_goodsCountChangeBlock = goodsCountChangeBlock;
self.goodsCounterView.countChangeAction = goodsCountChangeBlock;
}
- (void)setModel:(GoodsModel *)model {
_model = model;
self.goodsNameLb.text = model.goodsName;
self.goodsSpecLb.text = model.goodsSpec;
self.goodsPriceLb.text = [NSString stringWithFormat:@"¥%.f",model.goodsPrice];
self.goodsCounterView.count = model.goodsCount;
self.selectIv.highlighted = model.isSelect;
}
#pragma mark -- business logic
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
NSSet *allTouches = [event allTouches]; //返回与当前接收者有关的所有的触摸对象
UITouch *touch = [allTouches anyObject]; //视图中的所有对象
CGPoint point = [touch locationInView:self];
if (CGRectContainsPoint(CGRectMake(0, 0, 35,self.bounds.size.height), point)) {
[self selectAction];
}else {
[super touchesBegan:touches withEvent:event];
}
}
- (void)selectAction {
self.selectIv.highlighted = !self.selectIv.highlighted;
!self.selectBlock ?: self.selectBlock(self.selectIv.highlighted);
}
#pragma --mark lazy load
- (CounterView *)goodsCounterView {
if (_goodsCounterView == nil) {
_goodsCounterView = [[CounterView alloc] init];
[self.contentView addSubview:_goodsCounterView];
[_goodsCounterView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.goodsIv);
make.right.equalTo(self.contentView).inset(27);
make.size.mas_equalTo(CGSizeMake(94, 30));
}];
}
return _goodsCounterView;
}
- (UILabel *)goodsPriceLb {
if (_goodsPriceLb == nil) {
_goodsPriceLb = [[UILabel alloc] init];
_goodsPriceLb.font = FONTSIZE(12);
_goodsPriceLb.textColor = RGBCOLOR(40, 40, 40);
[self.contentView addSubview:_goodsPriceLb];
[_goodsPriceLb mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.goodsNameLb);
make.bottom.equalTo(self.goodsIv.mas_bottom).inset(9);
}];
}
return _goodsPriceLb;
}
- (UILabel *)goodsSpecLb {
if (_goodsSpecLb == nil) {
_goodsSpecLb = [[UILabel alloc] init];
_goodsSpecLb.font = FONTSIZE(12);
_goodsSpecLb.textColor = RGBCOLOR(153, 153, 153);
[self.contentView addSubview:_goodsSpecLb];
[_goodsSpecLb mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.goodsNameLb);
make.top.equalTo(self.goodsNameLb.mas_bottom).offset(7);
}];
}
return _goodsSpecLb;
}
- (UILabel *)goodsNameLb {
if (_goodsNameLb == nil) {
_goodsNameLb = [[UILabel alloc] init];
_goodsNameLb.font = FONTSIZE(13);
_goodsNameLb.textColor = RGBCOLOR(33, 33, 33);
[self.contentView addSubview:_goodsNameLb];
[_goodsNameLb mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.goodsIv.mas_right).offset(8);
make.top.equalTo(self.goodsIv);
}];
}
return _goodsNameLb;
}
- (UIImageView *)goodsIv {
if (_goodsIv == nil) {
_goodsIv = [[UIImageView alloc] init];
_goodsIv.image = [UIImage imageNamed:@"group_portrait"];
[self.contentView addSubview:_goodsIv];
[_goodsIv mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.equalTo(self).inset(19);
make.left.equalTo(self.selectIv.mas_right).inset(7);
make.width.equalTo(self.goodsIv.mas_height).multipliedBy(1);
}];
}
return _goodsIv;
}
- (UIImageView *)selectIv {
if (_selectIv == nil) {
_selectIv = [[UIImageView alloc] init];
_selectIv.image = [UIImage imageNamed:@"check_f"];
_selectIv.highlightedImage = [UIImage imageNamed:@"check_t"];
[self.contentView addSubview:_selectIv];
[_selectIv mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(18);
make.centerY.equalTo(self);
make.left.mas_equalTo(11);
}];
}
return _selectIv;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// GoodsModel.h
// Mall-iOS
//
// Created by Nemo on 2020/10/14.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface GoodsModel : NSObject
@property (nonatomic, assign) BOOL isSelect;
/// 价格
@property (nonatomic, assign) CGFloat goodsPrice;
/// 数量
@property (nonatomic, assign) CGFloat goodsCount;
/// 图片
@property (nonatomic, copy) NSString *goodsUrl;
/// 名字
@property (nonatomic, copy) NSString *goodsName;
/// 规格
@property (nonatomic, copy) NSString *goodsSpec;
@end
NS_ASSUME_NONNULL_END
//
// GoodsModel.m
// Mall-iOS
//
// Created by Nemo on 2020/10/14.
//
#import "GoodsModel.h"
@implementation GoodsModel
@end
//
// JYTargetCartModule.h
// Mall-iOS
//
// Created by purewin on 2020/12/12.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface JYTargetCartModule : NSObject
- (UIViewController *)jyNativeCartViewController;
@end
NS_ASSUME_NONNULL_END
//
// JYTargetCartModule.m
// Mall-iOS
//
// Created by purewin on 2020/12/12.
//
#import "JYTargetCartModule.h"
#import "ShoppingCartViewController.h"
@implementation JYTargetCartModule
- (UIViewController *)jyNativeCartViewController {
ShoppingCartViewController *shopping = [[ShoppingCartViewController alloc] init];
shopping.title = @"购物车";
shopping.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"购物车"
image:[UIImage imageNamed:@"shoppingCart"]
selectedImage:[UIImage imageNamed:@"shoppingCart_s"]];
UINavigationController* shoppingNav = [[UINavigationController alloc] initWithRootViewController:shopping];
return shoppingNav;
}
@end
//
// NMRouter+CartModuleActions.h
// Mall-iOS
//
// Created by purewin on 2020/12/12.
//
#if __has_include(<NMRouter/NMRouter.h>)
#import <NMRouter/NMRouter.h>
#else
#import "NMRouter.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface NMRouter (CartModuleActions)
- (UIViewController *)jyMediatorCartViewController;
@end
NS_ASSUME_NONNULL_END
//
// NMRouter+CartModuleActions.m
// Mall-iOS
//
// Created by purewin on 2020/12/12.
//
#import "NMRouter+CartModuleActions.h"
@implementation NMRouter (CartModuleActions)
// 1. 字符串 是类名 JYXxx.h 中的 xxx 部分
NSString * const kNMMediatorCartTargetCourse = @"TargetCartModule";
// 2. 字符串是 JYxxx.h 中 定义的 jyXxx 函数名的 xxx 部分
NSString * const kNMMediatorCartActionNativToNativeCourse = @"NativeCartViewController";
- (UIViewController *)jyMediatorCartViewController {
UIViewController *viewController = [self performTarget:kNMMediatorCartTargetCourse
action:kNMMediatorCartActionNativToNativeCourse
params:nil
shouldCacheTarget:NO
];
if ([viewController isKindOfClass:[UIViewController class]]) {
// view controller 交付出去之后,可以由外界选择是push还是present
return viewController;
} else {
// 这里处理异常场景,具体如何处理取决于产品
NSLog(@"%@ 未能实例化页面", NSStringFromSelector(_cmd));
return [[UIViewController alloc] init];
}
}
@end
//
// CounterView.h
// Mall-iOS
//
// Created by Nemo on 2020/10/13.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface CounterView : UIView
@property (nonatomic, assign) NSInteger count;
@property (nonatomic, copy) void(^countChangeAction)(NSInteger count);
@end
NS_ASSUME_NONNULL_END
//
// CounterView.m
// Mall-iOS
//
// Created by Nemo on 2020/10/13.
//
#import "CounterView.h"
#import <NMCategories/NMCategories.h>
#import <Masonry/Masonry.h>
#import <QMUIKit.h>
@interface CounterView()<UITextFieldDelegate>
@property (nonatomic, strong) UITextField *countTF;
@property (nonatomic, strong) UIView *keyboardConfirmView;
@property (nonatomic, strong) UIView *keyboardBackgroundView;
@property (nonatomic, strong) UIButton *confirmBtn;
@property (nonatomic, strong) UIButton *moreBtn;
@property (nonatomic, strong) UIButton *lessBtn;
@end
@implementation CounterView
- (instancetype)init
{
self = [super init];
if (self) {
[self setupUI];
}
return self;
}
- (void)setupUI {
[self.moreBtn setImage:[UIImage imageNamed:@"goods_detail_more"] forState:UIControlStateNormal];
[self.lessBtn setImage:[UIImage imageNamed:@"goods_detail_less"] forState:UIControlStateNormal];
}
- (void)keyboardWillChangeFrame:(NSNotification *)notification{
NSDictionary *userInfo = notification.userInfo;
CGFloat duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
CGRect endFrame = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
NSLog(@"%f %@",duration,NSStringFromCGRect(endFrame));
if (!_keyboardBackgroundView.hidden) {
[kGetLastWindow() addSubview:self.keyboardBackgroundView];
}else{
self.keyboardBackgroundView.hidden = NO;
}
[self keyboardToolViewAnimationDistance:SCREEN_HEIGHT-44-endFrame.size.height];
}
#pragma mark -- business logic
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
[KNOTE() addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillShowNotification object:nil];
return YES;;
}
- (void)inputFinishAction {
NSInteger count = [self.countTF.text integerValue];
_count = count;
!self.countChangeAction ?: self.countChangeAction(_count);
[self keyboardTapAction];
}
- (void)keyboardTapAction {
self.keyboardBackgroundView.hidden = YES;
[self.countTF resignFirstResponder];
[self keyboardToolViewAnimationDistance:SCREEN_HEIGHT-44];
[KNOTE() removeObserver:self name:UIKeyboardWillShowNotification object:nil];
}
- (void)keyboardToolViewAnimationDistance:(CGFloat)distance {
NSLog(@"%f",distance);
[UIView animateWithDuration:0.25 animations:^{
self.keyboardConfirmView.qmui_top = distance;
} completion:^(BOOL finished) { }];
}
#pragma --mark set data
- (void)setCount:(NSInteger)count {
_count = count;
self.countTF.text = [NSString stringWithFormat:@"%ld",count];
}
- (void)lessAction:(UIButton *)sender {
if (_count == 1) { return; }
_count --;
self.count = _count;
!self.countChangeAction ?: self.countChangeAction(_count);
}
- (void)moreAction:(UIButton *)sender {
_count ++;
self.count = _count;
!self.countChangeAction ?: self.countChangeAction(_count);
}
- (void)drawRect:(CGRect)rect {
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(3, 3)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc]init];
maskLayer.frame = rect;
maskLayer.borderWidth = 2;
maskLayer.borderColor = RGBCOLOR(221, 221, 221).CGColor;
maskLayer.path = maskPath.CGPath;
self.layer.mask = maskLayer;
/**
UIBezierPath *path = [UIBezierPath qmui_bezierPathWithRoundedRect:rect cornerRadiusArray:@[@3,@3,@3,@3] lineWidth:0];
[[UIColor lightGrayColor] setFill];
[path fill];
CAShapeLayer *layer = [[CAShapeLayer alloc] init];
layer.frame = rect;
layer.path = path.CGPath;
self.layer.mask = layer;
*/
}
#pragma mark lazy load
- (UIButton *)confirmBtn {
if (_confirmBtn == nil) {
_confirmBtn = [UIButton buttonWithType:UIButtonTypeSystem];
[_confirmBtn setTitle:@"完成" forState:UIControlStateNormal];
[_confirmBtn addTarget:self action:@selector(inputFinishAction) forControlEvents:UIControlEventTouchUpInside];
}
return _confirmBtn;
}
- (UIView *)keyboardConfirmView {
if (_keyboardConfirmView == nil) {
_keyboardConfirmView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT-44, SCREEN_WIDTH, 44)];
_keyboardConfirmView.backgroundColor = RGBCOLOR(153, 153, 153);
[self.keyboardBackgroundView addSubview:_keyboardConfirmView];
[_keyboardConfirmView addSubview:self.confirmBtn];
[_confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self->_keyboardConfirmView);
make.right.equalTo(self->_keyboardConfirmView).inset(31);
}];
}
return _keyboardConfirmView;
}
- (UIView *)keyboardBackgroundView {
if (_keyboardBackgroundView == nil) {
_keyboardBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
UITapGestureRecognizer *tag =[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(keyboardTapAction)];
[_keyboardBackgroundView addGestureRecognizer:tag];
}
return _keyboardBackgroundView;
}
- (UITextField *)countTF {
if (_countTF == nil) {
_countTF = [[UITextField alloc] init];
_countTF.font = FONTSIZE(12);
_countTF.textColor = RGBCOLOR(51, 51, 51);
_countTF.textAlignment = NSTextAlignmentCenter;
_countTF.keyboardType = UIKeyboardTypeNumberPad;
_countTF.delegate = self;
[self addSubview:_countTF];
[_countTF mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.moreBtn.mas_left);
make.left.equalTo(self.lessBtn.mas_right);
make.top.bottom.equalTo(self);
}];
}
return _countTF;
}
- (UIButton *)moreBtn {
if (_moreBtn == nil) {
_moreBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_moreBtn addTarget:self action:@selector(moreAction:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:_moreBtn];
[_moreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(30);
make.right.top.equalTo(self);
}];
}
return _moreBtn;
}
- (UIButton *)lessBtn {
if (_lessBtn == nil) {
_lessBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_lessBtn addTarget:self action:@selector(lessAction:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:_lessBtn];
[_lessBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(30);
make.left.top.equalTo(self);
}];
}
return _lessBtn;
}
- (void)dealloc {
self.countTF.delegate = nil;
}
@end
//
// ShoppingCartCounterView.h
// Mall-iOS
//
// Created by Nemo on 2020/10/13.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface ShoppingCartCounterView : UIView
@property (nonatomic, assign) BOOL isSelectAll;
@property (nonatomic, assign) NSInteger selectCount;
@property (nonatomic, assign) CGFloat totalPrice;
@property (nonatomic, copy) void(^selectAllBlock)(BOOL isSelectAll);
@property (nonatomic, copy) void(^orderAction)(void);
@end
NS_ASSUME_NONNULL_END
//
// ShoppingCartCounterView.m
// Mall-iOS
//
// Created by Nemo on 2020/10/13.
//
#import "ShoppingCartCounterView.h"
#import <Masonry/Masonry.h>
#import <NMCategories/NMCategories.h>
#import <QMUIKit.h>
@interface ShoppingCartCounterView()
@property (nonatomic, strong) UIImageView *selectAllIv;
@property (nonatomic, strong) UILabel *selectCountLb;
@property (nonatomic, strong) UILabel *totalPriceLb;
@property (nonatomic, strong) UIButton *paymentBtn;
@end
@implementation ShoppingCartCounterView
- (void)setTotalPrice:(CGFloat)totalPrice {
_totalPrice = totalPrice;
self.totalPriceLb.text = [NSString stringWithFormat:@"合计:¥%.f",totalPrice];
}
- (void)setSelectCount:(NSInteger)selectCount {
_selectCount = selectCount;
NSString *count = (selectCount == 0)?@"全选":[NSString stringWithFormat:@"已选(%ld)",selectCount];
self.selectCountLb.text = count;
NSString *paymentStr = (selectCount == 0)?@"结算":[NSString stringWithFormat:@"结算(%ld)",selectCount];
[self.paymentBtn setTitle:paymentStr forState:UIControlStateNormal];
}
#pragma mark -- business logic
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
NSSet *allTouches = [event allTouches]; //返回与当前接收者有关的所有的触摸对象
UITouch *touch = [allTouches anyObject]; //视图中的所有对象
CGPoint point = [touch locationInView:self];
if (CGRectContainsPoint(CGRectMake(0, 0, 37,self.qmui_height), point)) {
[self selectAllAction];
}else {
[super touchesBegan:touches withEvent:event];
}
}
- (void)selectAllAction {
self.selectAllIv.highlighted = !self.selectAllIv.highlighted;
!self.selectAllBlock ?: self.selectAllBlock(self.selectAllIv.highlighted);
}
- (void)setIsSelectAll:(BOOL)isSelectAll {
_isSelectAll = isSelectAll;
self.selectAllIv.highlighted = isSelectAll;
}
- (void)paymentAction {
!self.orderAction ?: self.orderAction();
}
#pragma --mark lazy load
- (UILabel *)totalPriceLb {
if (_totalPriceLb == nil) {
_totalPriceLb = [[UILabel alloc] init];
_totalPriceLb.textColor = RGBCOLOR(178,37,46);
[self addSubview:_totalPriceLb];
[_totalPriceLb mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.paymentBtn.mas_left).inset(14);
make.centerY.equalTo(self);
}];
}
return _totalPriceLb;
}
- (UIButton *)paymentBtn {
if (_paymentBtn == nil) {
_paymentBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_paymentBtn setTitle:@"结算" forState:UIControlStateNormal];
[_paymentBtn setBackgroundColor:RGBCOLOR(178,37,46)];
[_paymentBtn setTitleColor:QMUICMI.whiteColor forState:UIControlStateNormal];
[_paymentBtn setTitleColor:QMUICMI.whiteColor forState:UIControlStateHighlighted];
[_paymentBtn addTarget:self action:@selector(paymentAction) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:_paymentBtn];
[_paymentBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(49);
make.width.mas_equalTo(110);
make.right.bottom.equalTo(self);
}];
}
return _paymentBtn;
}
- (UILabel *)selectCountLb {
if (_selectCountLb == nil) {
_selectCountLb = [[UILabel alloc] init];
_selectCountLb.font = FONTSIZE(15);
[self addSubview:_selectCountLb];
[_selectCountLb mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.selectAllIv.mas_right).offset(10);
make.centerY.equalTo(self.selectAllIv);
}];
}
return _selectCountLb;
}
- (UIImageView *)selectAllIv {
if (_selectAllIv == nil) {
_selectAllIv = [[UIImageView alloc] init];
_selectAllIv.image = [UIImage imageNamed:@"check_f"];
_selectAllIv.highlightedImage = [UIImage imageNamed:@"check_t"];
[self addSubview:_selectAllIv];
[_selectAllIv mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(18);
make.centerY.equalTo(self);
make.left.mas_equalTo(11);
}];
}
return _selectAllIv;
}
@end
...@@ -6,8 +6,24 @@ ...@@ -6,8 +6,24 @@
// //
#import "ShoppingCartViewController.h" #import "ShoppingCartViewController.h"
#import "ShoppingCartCounterView.h"
#import <NMReactiveCocoa/ReactiveObjC.h>
#import <QMUIKit/QMUIKit.h>
#import <Masonry/Masonry.h>
#import <NMCategories/NMCategories.h>
#import <NMUIChainKit/NMUIChainKit.h>
#import "ShoppingCartCell.h"
#import "GoodsModel.h"
@interface ShoppingCartViewController () @interface ShoppingCartViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) ShoppingCartCounterView *shoppingCounterView;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *dataSource;
/// 已选择的商品数组
@property (nonatomic, strong) NSMutableArray *selectGoodsSource;
@property (nonatomic, assign) CGFloat totalPrice;
@end @end
...@@ -16,14 +32,252 @@ ...@@ -16,14 +32,252 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[self setUp]; [self setupUI];
[self requstNewData];
} }
-(void)setUp { -(void)setupUI {
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
self.shoppingCounterView.selectCount = 0;
self.shoppingCounterView.totalPrice = 0;
self.shoppingCounterView.isSelectAll = NO;
// [self.tableView reloadData];
}
- (void)requstNewData {
for (int i = 0; i < 7; i ++) {
GoodsModel *model = [[GoodsModel alloc] init];
model.isSelect = (i % 2) && (i < 6);
model.goodsName = [NSString stringWithFormat:@"90分户外休闲中长厚款鹅绒羽绒服 %d",i];
model.goodsSpec = [NSString stringWithFormat:@"XL;黑色 %d",i];
model.goodsUrl = @"";
model.goodsCount = i+1;
model.goodsPrice = (i + 1) * (arc4random() % 100);
[self.dataSource addObject:model];
if (model.isSelect) {
self.totalPrice += (model.goodsPrice*model.goodsCount);
[self.selectGoodsSource addObject:model];
}
}
self.title = [NSString stringWithFormat:@"购物车(%ld)",self.dataSource.count];
[self goodsChangeAction];
[self.tableView reloadData];
}
#pragma mark -- business logic
- (void)orderAction {
NSMutableString *info = [NSMutableString string];
CGFloat totalPrice = 0;
for (GoodsModel *model in self.selectGoodsSource) {
[info appendFormat:@"商品名:%@\n商品数量 :%.f\n商品价:%.f\n",model.goodsName,model.goodsCount,model.goodsPrice];
totalPrice += (model.goodsCount*model.goodsPrice);
}
[info appendFormat:@"总价:%f",totalPrice];
[QMUITips showInfo:info inView:self.view hideAfterDelay:6];
}
- (void)selectAllGood:(BOOL)isSelect {
if (!isSelect) {
[self.selectGoodsSource removeAllObjects];
self.totalPrice = 0;
for (GoodsModel *model in self.dataSource) {
model.isSelect = isSelect;
}
}else{
NSPredicate *pre = [NSPredicate predicateWithFormat:@"self.isSelect = %d",!isSelect];
NSArray *unSelectGoods = [self.dataSource filteredArrayUsingPredicate:pre];
for (GoodsModel *model in unSelectGoods) {
model.isSelect = isSelect;
self.totalPrice += (model.goodsPrice*model.goodsCount);
[self.selectGoodsSource addObject:model];
}
}
[self.tableView reloadData];
[self goodsChangeAction];
}
- (void)goodsChangeAction {
self.shoppingCounterView.selectCount = self.selectGoodsSource.count;
self.shoppingCounterView.isSelectAll = (self.dataSource.count == self.selectGoodsSource.count);
self.shoppingCounterView.totalPrice = self.totalPrice;
}
- (void)changeGoodsCount:(GoodsModel *)model count:(NSInteger)count {
if (count > 99) {
[QMUITips showError:[NSString stringWithFormat:@"超出商品:%@的库存",model.goodsName] inView:self.view hideAfterDelay:2];
NSInteger row = [self.dataSource indexOfObject:model];
if (row < self.dataSource.count) {
NSIndexPath *path = [NSIndexPath indexPathForRow:row inSection:0];
[self.tableView reloadRowsAtIndexPaths:@[path] withRowAnimation:UITableViewRowAnimationNone];
}else{
[self.tableView reloadData];
}
return;
}
if (model.isSelect) {
if (model.goodsCount > count) {
self.totalPrice -= (model.goodsPrice*(model.goodsCount - count));
}else{
self.totalPrice += (model.goodsPrice*(count - model.goodsCount));
}
self.shoppingCounterView.totalPrice = self.totalPrice;
}
model.goodsCount = count;
NSLog(@"总价:%.f",self.totalPrice);
}
- (void)selectGoods:(GoodsModel *)model isSelect:(BOOL)select{
//NSLog(@"indexPath:%ld",indexPath.row);
//GoodsModel *model = self.dataSource[indexPath.row];
model.isSelect = select;
if (select) {
self.totalPrice += (model.goodsPrice*model.goodsCount);
[self.selectGoodsSource addObject:model];
}else{
self.totalPrice -= (model.goodsPrice*model.goodsCount);
[self.selectGoodsSource removeObject:model];
}
[self goodsChangeAction];
}
- (void)deleteIndex:(GoodsModel *)model {
QMUIAlertAction *cancel = [QMUIAlertAction actionWithTitle:@"取消" style:QMUIAlertActionStyleCancel handler:NULL];
@weakify(self);
QMUIAlertAction *delete = [QMUIAlertAction actionWithTitle:@"删除" style:QMUIAlertActionStyleDestructive handler:^(__kindof QMUIAlertController * _Nonnull aAlertController, QMUIAlertAction * _Nonnull action) {
@strongify(self);
self.title = [NSString stringWithFormat:@"购物车(%ld)",self.dataSource.count];
if (model.isSelect) {
[self selectGoods:model isSelect:NO];
}
NSInteger row = [self.dataSource indexOfObject:model];
[self.dataSource removeObject:model];
if (row < self.dataSource.count) {
NSIndexPath *path = [NSIndexPath indexPathForRow:row inSection:0];
[self.tableView deleteRowsAtIndexPaths:@[path] withRowAnimation:UITableViewRowAnimationFade];
}else{
[self.tableView reloadData];
}
}];
QMUIAlertController *alertController = [QMUIAlertController alertControllerWithTitle:@"确定删除?" message:[NSString stringWithFormat:@"确定删除商品\n%@",model.goodsName] preferredStyle:QMUIAlertControllerStyleAlert];
[alertController addAction:cancel];
[alertController addAction:delete];
[alertController showWithAnimated:YES];
}
#pragma --mark delegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataSource.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ShoppingCartCell *cell = [tableView dequeueReusableCellWithIdentifier:NMUIChainModelIdentifier(ShoppingCartCell.class) forIndexPath:indexPath];
GoodsModel *model = self.dataSource[indexPath.row];
cell.model = model;
@weakify(self);
cell.selectBlock = ^(BOOL select) {
@strongify(self);
[self selectGoods:model isSelect:select];
};
cell.goodsCountChangeBlock = ^(NSInteger count) {
@strongify(self);
[self changeGoodsCount:model count:count];
};
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
GoodsModel *model = self.dataSource[indexPath.row];
[QMUITips showInfo:[NSString stringWithFormat:@"商品信息:%@",model.goodsName] inView:self.view hideAfterDelay:2];
NSLog(@"%s",__func__);
}
-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath{
GoodsModel *model = self.dataSource[indexPath.row];
@weakify(self);
UITableViewRowAction *deleteRowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"删除" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
@strongify(self);
[self deleteIndex:model];
}];
//修改RowAction的颜色
deleteRowAction.backgroundColor = QMUICMI.redColor;
return @[deleteRowAction];
}
#pragma --mark lazy load
- (UITableView *)tableView {
if (_tableView == nil) {
UITableViewModelCreate()
.delegate(self)
.dataSource(self)
.addToSuperView(self.view)
.rowHeight(113.0/375.0*SCREEN_WIDTH)
.registerCellClass(ShoppingCartCell.class, NMUIChainModelIdentifier(ShoppingCartCell.class))
.makeMasonry(^(MASConstraintMaker * _Nonnull make) {
make.edges.equalTo(self.view).insets(UIEdgeInsetsMake(0, 0, TabBarHeight+49, 0));
})
.assignTo(^(__kindof UIView * _Nonnull view) {
self->_tableView = view;
});
}
return _tableView;
}
- (NSMutableArray *)selectGoodsSource {
if (_selectGoodsSource == nil) {
_selectGoodsSource = [[NSMutableArray alloc] init];
}
return _selectGoodsSource;
}
- (NSMutableArray *)dataSource {
if (_dataSource == nil) {
_dataSource = [[NSMutableArray alloc] init];
}
return _dataSource;
}
- (ShoppingCartCounterView *)shoppingCounterView {
if (_shoppingCounterView == nil) {
_shoppingCounterView = [[ShoppingCartCounterView alloc] init];
[self.view addSubview:_shoppingCounterView];
@weakify(self);
_shoppingCounterView.selectAllBlock = ^(BOOL isSelectAll) {
@strongify(self);
[self selectAllGood:isSelectAll];
};
_shoppingCounterView.orderAction = ^{
@strongify(self);
[self orderAction];
};
[_shoppingCounterView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view);
make.height.mas_equalTo(49);
make.bottom.inset(TabBarHeight);
}];
}
return _shoppingCounterView;
} }
@end @end
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
// //
#import "ActivityCollectionCell.h" #import "ActivityCollectionCell.h"
#import <Masonry.h> #import <Masonry/Masonry.h>
#import "MacroDefinition.h" #import <NMCategories/NMCategories.h>
#import <NMTheme/NMTheme.h>
@interface ActivityCollectionCell() @interface ActivityCollectionCell()
@property (nonatomic, strong) UIImageView *iconIv; @property (nonatomic, strong) UIImageView *iconIv;
...@@ -26,8 +27,10 @@ ...@@ -26,8 +27,10 @@
} }
- (void)setup { - (void)setup {
self.backgroundColor = RGBCOLOR(247, 247, 247);
// self.backgroundColor = RGBCOLOR(247, 247, 247);
self.backgroundColor = UIColor.nm_backgroundColor;
[self.contentView addSubview:self.iconIv]; [self.contentView addSubview:self.iconIv];
[self.iconIv mas_makeConstraints:^(MASConstraintMaker *make) { [self.iconIv mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self); make.edges.equalTo(self);
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
// //
#import "HomeClassficationCell.h" #import "HomeClassficationCell.h"
#import "MacroDefinition.h" #import <NMCategories/NMCategories.h>
#import <Masonry.h> #import <Masonry/Masonry.h>
@interface HomeClassficationCell() @interface HomeClassficationCell()
@property (nonatomic, strong) UIImageView *iconIv; @property (nonatomic, strong) UIImageView *iconIv;
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
// //
#import "HomeGoodsCell.h" #import "HomeGoodsCell.h"
#import <Masonry.h> #import <Masonry/Masonry.h>
#import "MacroDefinition.h" #import <NMCategories/NMCategories.h>
#import "AttributLabel.h" #import "AttributLabel.h"
#import "HomeGoodsModel.h" #import "HomeGoodsModel.h"
......
//
// HomeCarouselModel.h
// Mall-iOS
//
// Created by Nemo on 2020/10/16.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface HomeCarouselModel : NSObject
/// icon Url
@property (nonatomic, copy) NSString *picture;
/// icon name
@property (nonatomic, copy) NSString *name;
+ (instancetype)homeCarouselModelWithDict:(NSDictionary *)dict;
@end
NS_ASSUME_NONNULL_END
//
// HomeCarouselModel.m
// Mall-iOS
//
// Created by Nemo on 2020/10/16.
//
#import "HomeCarouselModel.h"
@implementation HomeCarouselModel
+ (instancetype)homeCarouselModelWithDict:(NSDictionary *)dict {
HomeCarouselModel *model = [[HomeCarouselModel alloc] init];
model.picture = [NSString stringWithFormat:@"%@/%@",API_HOST,dict[@"picture"]];
model.name = dict[@"name"];
return model;
}
@end
//
// HomeClassificationModel.h
// Mall-iOS
//
// Created by Nemo on 2020/10/15.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface HomeClassificationModel : NSObject
/// icon Url
@property (nonatomic, copy) NSString *iconUrl;
/// icon name
@property (nonatomic, copy) NSString *iconName;
+ (instancetype)homeClassificationModelWithDict:(NSDictionary *)dict;
@end
NS_ASSUME_NONNULL_END
//
// HomeClassificationModel.m
// Mall-iOS
//
// Created by Nemo on 2020/10/15.
//
#import "HomeClassificationModel.h"
@implementation HomeClassificationModel
+ (instancetype)homeClassificationModelWithDict:(NSDictionary *)dict {
HomeClassificationModel *model = [[HomeClassificationModel alloc] init];
model.iconUrl = [NSString stringWithFormat:@"%@/%@",API_HOST,dict[@"picture"]];
model.iconName = dict[@"name"];
return model;
}
@end
//
// HomeModel.h
// Mall-iOS
//
// Created by Nemo on 2020/10/15.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class HomeGoodsModel,HomeClassificationModel,HomeCarouselModel;
@interface HomeModel : NSObject
@property (nonatomic, strong) NSMutableArray <HomeCarouselModel *>*carouselAraay;
@property (nonatomic, strong) NSMutableArray <HomeClassificationModel *>*classificaAraay;
@property (nonatomic, strong) NSMutableArray <HomeGoodsModel *>*goodsArray;
@end
NS_ASSUME_NONNULL_END
//
// HomeModel.m
// Mall-iOS
//
// Created by Nemo on 2020/10/15.
//
#import "HomeModel.h"
@implementation HomeModel
@end
//
// JYTargetHomeModule.h
// Mall-iOS
//
// Created by purewin on 2020/12/12.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface JYTargetHomeModule : NSObject
- (UIViewController *)jyNativeHomeViewController;
@end
NS_ASSUME_NONNULL_END
//
// JYTargetHomeModule.m
// Mall-iOS
//
// Created by purewin on 2020/12/12.
//
#import "JYTargetHomeModule.h"
#import "HomeViewController.h"
@implementation JYTargetHomeModule
- (UIViewController *)jyNativeHomeViewController {
HomeViewController *home = [HomeViewController homeViewController];
home.title = @"主页";
home.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"主页"
image:[UIImage imageNamed:@"index"]
selectedImage:[UIImage imageNamed:@"index_s"]];
UINavigationController* homeNav = [[UINavigationController alloc] initWithRootViewController:home];
return homeNav;
}
@end
//
// NMRouter+HomeModuleActions.h
// Mall-iOS
//
// Created by purewin on 2020/12/12.
//
#if __has_include(<NMRouter/NMRouter.h>)
#import <NMRouter/NMRouter.h>
#else
#import "NMRouter.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@interface NMRouter (HomeModuleActions)
- (UIViewController *)jyMediatorHomeViewController;
@end
NS_ASSUME_NONNULL_END
//
// NMRouter+HomeModuleActions.m
// Mall-iOS
//
// Created by purewin on 2020/12/12.
//
#import "NMRouter+HomeModuleActions.h"
@implementation NMRouter (HomeModuleActions)
// 1. 字符串 是类名 JYXxx.h 中的 xxx 部分
NSString * const kNMMediatorHomeTargetCourse = @"TargetHomeModule";
// 2. 字符串是 JYxxx.h 中 定义的 jyXxx 函数名的 xxx 部分
NSString * const kNMMediatorHomeActionNativToNativeCourse = @"NativeHomeViewController";
- (UIViewController *)jyMediatorHomeViewController {
UIViewController *viewController = [self performTarget:kNMMediatorHomeTargetCourse
action:kNMMediatorHomeActionNativToNativeCourse
params:nil
shouldCacheTarget:NO
];
if ([viewController isKindOfClass:[UIViewController class]]) {
// view controller 交付出去之后,可以由外界选择是push还是present
return viewController;
} else {
// 这里处理异常场景,具体如何处理取决于产品
NSLog(@"%@ 未能实例化页面", NSStringFromSelector(_cmd));
return [[UIViewController alloc] init];
}
}
@end
//
// HomeServices.h
// Mall-iOS
//
// Created by Nemo on 2020/10/15.
//
#import <Foundation/Foundation.h>
#import <NMReactiveCocoa/ReactiveObjC.h>
NS_ASSUME_NONNULL_BEGIN
@interface HomeServices : NSObject
- (RACSignal *)carouselSignal;
@end
NS_ASSUME_NONNULL_END
//
// HomeServices.m
// Mall-iOS
//
// Created by Nemo on 2020/10/15.
//
#import "HomeServices.h"
#import <NMNetwork/NMNetwork.h>
@implementation HomeServices
- (RACSignal *)carouselSignal {
return [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber> _Nonnull subscriber) {
NSURLSessionDataTask *task = [NetworkManager POST:URLShopping() parameters:nil success:^(id _Nullable responseObject) {
[subscriber sendNext:responseObject];
[subscriber sendCompleted];
} failure:^(id _Nullable obj, NSError * _Nullable error) {
[subscriber sendError:error];
}];
return [RACDisposable disposableWithBlock:^{
//完成后清理不需要的资源
[task cancel];
}];
}];
}
@end
//
// HomeViewModel.h
// Mall-iOS
//
// Created by Nemo on 2020/10/15.
//
#import <Foundation/Foundation.h>
#import "HomeServices.h"
#import "HomeModel.h"
NS_ASSUME_NONNULL_BEGIN
@class RACCommand;
@interface HomeViewModel : NSObject
@property (nonatomic, strong) HomeModel *model;
@property (strong, nonatomic) RACCommand *homeCommand;
@property (nonatomic, strong) RACSubject *errSubject;
- (instancetype)initServices:(HomeServices *)services;
@end
NS_ASSUME_NONNULL_END
//
// HomeViewModel.m
// Mall-iOS
//
// Created by Nemo on 2020/10/15.
//
#import "HomeViewModel.h"
#import <NMReactiveCocoa/ReactiveObjC.h>
#import "HomeCarouselModel.h"
@interface HomeViewModel()
@property (nonatomic, strong) HomeServices *services;
@end
@implementation HomeViewModel
- (instancetype)initServices:(HomeServices *)services
{
self = [super init];
if (self) {
_services = services;
_model = [[HomeModel alloc] init];
_errSubject = [RACSubject subject];
[self initCommand];
}
return self;
}
- (void)initCommand {
@weakify(self);
self.homeCommand = [[RACCommand alloc] initWithSignalBlock:^RACSignal * _Nonnull(id _Nullable input) {
@strongify(self);
return [[self.services carouselSignal] logAll];
}];
[self.homeCommand.executionSignals subscribeNext:^(RACSignal* innerSignal) {
[innerSignal subscribeNext:^(NSArray *x) {
@strongify(self);
NSMutableArray *datas = [[NSMutableArray alloc] initWithCapacity:x.count];
for (NSDictionary *dict in x) {
HomeCarouselModel *homeCarouselModel = [HomeCarouselModel homeCarouselModelWithDict:dict];
[datas addObject:homeCarouselModel];
}
self.model.carouselAraay = datas;
}];
}];
[[RACSubject merge:@[self.homeCommand.errors]] subscribe:self.errSubject];
}
-(void)requestData{
//网络请求1
RACSignal *signal1 = [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
NSLog(@"网络请求1");
[subscriber sendNext:@"网络请求1"];
return nil;
}];
//网络请求2
RACSignal *signal2 = [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
NSLog(@"网络请求2");
[subscriber sendNext:@"网络请求2"];
return nil;
}];
//网络请求3
RACSignal *signal3 = [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
NSLog(@"网络请求3");
[subscriber sendNext:@"网络请求3"];
return nil;
}];
[self rac_liftSelector:@selector(dealDataData1:data2:data3:) withSignals:signal1,signal2,signal3, nil];
}
-(void)dealDataData1:(id)data1 data2:(id)data2 data3:(id)data3 {
}
@end
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
// //
#import "ActivityView.h" #import "ActivityView.h"
#import "UICollectionViewCell+Extension.h" #import <Masonry/Masonry.h>
#import <NMTheme/NMTheme.h>
#import <NMUIChainKit/NMUIChainKit.h>
#import "ActivityCollectionCell.h" #import "ActivityCollectionCell.h"
#import <Masonry.h>
#import <QMUIKit.h> #import <QMUIKit.h>
@interface ActivityView()<UICollectionViewDelegate,UICollectionViewDataSource> @interface ActivityView()<UICollectionViewDelegate,UICollectionViewDataSource>
...@@ -30,9 +31,7 @@ ...@@ -30,9 +31,7 @@
-(void)setupUI { -(void)setupUI {
self.backgroundColor = [UIColor whiteColor]; self.backgroundColor = [UIColor whiteColor];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { [self.collectionView reloadData];
make.edges.equalTo(self);
}];
} }
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
...@@ -41,7 +40,7 @@ ...@@ -41,7 +40,7 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
ActivityCollectionCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:[ActivityCollectionCell identifier] forIndexPath:indexPath]; ActivityCollectionCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NMUIChainModelIdentifier(ActivityCollectionCell.class) forIndexPath:indexPath];
return cell; return cell;
} }
...@@ -59,15 +58,20 @@ ...@@ -59,15 +58,20 @@
layout.itemSize = CGSizeMake(width, height); layout.itemSize = CGSizeMake(width, height);
layout.sectionInset = UIEdgeInsetsMake(0, 5, 0, 0); layout.sectionInset = UIEdgeInsetsMake(0, 5, 0, 0);
_collectionView = [[UICollectionView alloc]initWithFrame:CGRectZero collectionViewLayout:layout]; UICollectionViewCreateWithLayout(layout).makeChain
_collectionView.delegate = self; .addToSuperView(self)
_collectionView.dataSource = self; .delegate(self)
_collectionView.showsHorizontalScrollIndicator = NO; .dataSource(self)
_collectionView.showsVerticalScrollIndicator = NO; .showsHorizontalScrollIndicator(NO)
_collectionView.backgroundColor = [UIColor whiteColor]; .showsHorizontalScrollIndicator(NO)
[self addSubview:_collectionView]; .backgroundColor(UIColor.nm_backgroundColor)
.registerCellClass(ActivityCollectionCell.class, NMUIChainModelIdentifier(ActivityCollectionCell.class))
[ActivityCollectionCell registerClassForCollectionView:_collectionView]; .assignTo(^(__kindof UIView * _Nonnull view) {
self->_collectionView = view;
})
.makeMasonry(^(MASConstraintMaker * _Nonnull make) {
make.edges.equalTo(self);
});
} }
return _collectionView; return _collectionView;
......
...@@ -16,15 +16,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -16,15 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) NSArray <HomeClassificationModel *>*dataSource; @property (nonatomic, strong) NSArray <HomeClassificationModel *>*dataSource;
@end @property (nonatomic, copy) void(^cellClickAction)(HomeClassificationModel *model);
@interface HomeClassificationModel : NSObject
/// icon Url
@property (nonatomic, copy) NSString *iconUrl;
/// icon name
@property (nonatomic, copy) NSString *iconName;
@end @end
......
...@@ -6,10 +6,11 @@ ...@@ -6,10 +6,11 @@
// //
#import "HomeClassificationView.h" #import "HomeClassificationView.h"
#import <QMUIKit.h> #import <NMCategories/NMCategories.h>
#import <NMUIChainKit/NMUIChainKit.h>
#import <NMTheme/NMTheme.h>
#import "HomeClassficationCell.h" #import "HomeClassficationCell.h"
#import "UICollectionViewCell+Extension.h" #import "HomeClassificationModel.h"
#import <Masonry.h>
@interface HomeClassificationView()<UICollectionViewDelegate,UICollectionViewDataSource> @interface HomeClassificationView()<UICollectionViewDelegate,UICollectionViewDataSource>
@property (nonatomic, strong) UICollectionView *collectionView; @property (nonatomic, strong) UICollectionView *collectionView;
...@@ -27,15 +28,11 @@ ...@@ -27,15 +28,11 @@
} }
-(void)setupUI { -(void)setupUI {
self.backgroundColor = [UIColor whiteColor]; self.backgroundColor = UIColor.nm_backgroundColor;
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
} }
- (void)setDataSource:(NSArray<HomeClassificationModel *> *)dataSource { - (void)setDataSource:(NSArray<HomeClassificationModel *> *)dataSource {
_dataSource = dataSource; _dataSource = dataSource;
[self.collectionView reloadData]; [self.collectionView reloadData];
} }
...@@ -48,7 +45,7 @@ ...@@ -48,7 +45,7 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
HomeClassficationCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:[HomeClassficationCell identifier] forIndexPath:indexPath]; HomeClassficationCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NMUIChainModelIdentifier(HomeClassficationCell.class) forIndexPath:indexPath];
HomeClassificationModel *model = self.dataSource[indexPath.row]; HomeClassificationModel *model = self.dataSource[indexPath.row];
cell.iconName = model.iconName; cell.iconName = model.iconName;
...@@ -58,7 +55,9 @@ ...@@ -58,7 +55,9 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
HomeClassificationModel *model = self.dataSource[indexPath.row]; HomeClassificationModel *model = self.dataSource[indexPath.row];
[QMUITips showSucceed:model.iconName inView:QMUIHelper.visibleViewController.view hideAfterDelay:2]; !self.cellClickAction ?: self.cellClickAction(model);
//[QMUITips showSucceed:model.iconName inView:QMUIHelper.visibleViewController.view hideAfterDelay:2];
} }
...@@ -66,7 +65,7 @@ ...@@ -66,7 +65,7 @@
if (_collectionView == nil) { if (_collectionView == nil) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init]; UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init];
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
CGFloat lineSpacing = (SCREEN_WIDTH -45*5)/6.0; CGFloat lineSpacing = (NMScreenWidth() -45*5)/6.0;
// 上下的距离 // 上下的距离
layout.minimumLineSpacing = lineSpacing; layout.minimumLineSpacing = lineSpacing;
layout.minimumInteritemSpacing = 20; layout.minimumInteritemSpacing = 20;
...@@ -75,16 +74,20 @@ ...@@ -75,16 +74,20 @@
layout.itemSize = CGSizeMake(45, 72); layout.itemSize = CGSizeMake(45, 72);
layout.sectionInset = UIEdgeInsetsMake(30, lineSpacing, 30, 0); layout.sectionInset = UIEdgeInsetsMake(30, lineSpacing, 30, 0);
_collectionView = [[UICollectionView alloc]initWithFrame:CGRectZero collectionViewLayout:layout]; UICollectionViewCreateWithLayout(layout).makeChain
_collectionView.delegate = self; .dataSource(self)
_collectionView.dataSource = self; .delegate(self)
_collectionView.decelerationRate = 0.8; .showsVerticalScrollIndicator(NO)
_collectionView.showsHorizontalScrollIndicator = NO; .showsHorizontalScrollIndicator(NO)
_collectionView.showsVerticalScrollIndicator = NO; .backgroundColor(UIColor.nm_backgroundColor)
_collectionView.backgroundColor = [UIColor whiteColor]; .addToSuperView(self)
[self addSubview:_collectionView]; .registerCellClass(HomeClassficationCell.class, NMUIChainModelIdentifier(HomeClassficationCell.class))
.assignTo(^(__kindof UIView * _Nonnull view) {
[HomeClassficationCell registerClassForCollectionView:_collectionView]; self->_collectionView = view;
})
.makeMasonry(^(MASConstraintMaker * _Nonnull make) {
make.edges.equalTo(self);
});
} }
return _collectionView; return _collectionView;
...@@ -92,7 +95,3 @@ ...@@ -92,7 +95,3 @@
@end @end
@implementation HomeClassificationModel
@end
...@@ -9,10 +9,16 @@ ...@@ -9,10 +9,16 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@class HomeClassificationModel;
@interface HomeCollectionHeaderView : UICollectionReusableView @interface HomeCollectionHeaderView : UICollectionReusableView
@property (nonatomic, strong) NSDictionary *headerDict; @property (nonatomic, strong) NSDictionary *headerDict;
@property (nonatomic, copy) void(^searchActionBlcok)(void);
@property (nonatomic, copy) void(^cellAction)(HomeClassificationModel *model);
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -6,16 +6,16 @@ ...@@ -6,16 +6,16 @@
// //
#import "HomeCollectionHeaderView.h" #import "HomeCollectionHeaderView.h"
#import <Masonry.h> #import <Masonry/Masonry.h>
#import "MacroDefinition.h" #import <NMCategories/NMCategories.h>
#import <SDCycleScrollView.h>
#import "UIImage+Extension.h" #import <NMCycleScrollView/SDCycleScrollView.h>
#import "HomeCarouselModel.h"
#import "HomeClassificationView.h" #import "HomeClassificationView.h"
#import "ActivityView.h" #import "ActivityView.h"
#import <SDWebImage.h> #import <SDWebImage/SDWebImage.h>
#import <QMUIKit.h>
@interface HomeCollectionHeaderView()<SDCycleScrollViewDelegate> @interface HomeCollectionHeaderView()
@property (nonatomic, strong) UIButton *searchBtn; @property (nonatomic, strong) UIButton *searchBtn;
@property (nonatomic, strong) SDCycleScrollView *cycleView; @property (nonatomic, strong) SDCycleScrollView *cycleView;
@property (nonatomic, strong) HomeClassificationView *homeClassficationView; @property (nonatomic, strong) HomeClassificationView *homeClassficationView;
...@@ -78,36 +78,35 @@ ...@@ -78,36 +78,35 @@
[self.layer addSublayer:bottomLine]; [self.layer addSublayer:bottomLine];
} }
- (void)setCellAction:(void (^)(HomeClassificationModel * _Nonnull))cellAction {
_cellAction = cellAction;
self.homeClassficationView.cellClickAction = cellAction;
}
- (void)setHeaderDict:(NSDictionary *)headerDict { - (void)setHeaderDict:(NSDictionary *)headerDict {
_headerDict = headerDict; _headerDict = headerDict;
NSArray *ary = @[@"居家",@"鞋包配饰",@"服装", NSArray *classificaAry = headerDict[@"Classifica"];
@"电器",@"婴童",@"饮食", if (classificaAry.count > 0) {
@"特色区",@"洗护",@"餐厨",@"文体"]; self.homeClassficationView.dataSource = classificaAry;
@autoreleasepool { }
NSMutableArray <HomeClassificationModel *>*list = [[NSMutableArray alloc] init]; NSArray *carouselsAry = headerDict[@"Carousels"];
for (int i = 0; i < ary.count; i ++) { if (carouselsAry.count > 0) {
HomeClassificationModel *model = [[HomeClassificationModel alloc] init]; NSMutableArray *carouselsURLs = [[NSMutableArray alloc] initWithCapacity:carouselsAry.count];
model.iconUrl = @""; for (HomeCarouselModel *model in carouselsAry) {
model.iconName = ary[i]; [carouselsURLs addObject:model.picture];
[list addObject:model];
} }
self.homeClassficationView.dataSource = list; // self.cycleView.imageURLStringsGroup = carouselsURLs;
} }
} }
-(void)searchAction { -(void)searchAction {
NSLog(@"======test"); !self.searchActionBlcok ?: self.searchActionBlcok();
[QMUITips showSucceed:@"搜索被点击!" inView:kAppWindow() hideAfterDelay:2];
} }
- (UIImageView *)recommendIv { - (UIImageView *)recommendIv {
if (_recommendIv == nil) { if (_recommendIv == nil) {
_recommendIv = [[UIImageView alloc] init]; _recommendIv = [[UIImageView alloc] init];
[self addSubview:_recommendIv]; [self addSubview:_recommendIv];
CGFloat height = 100.0/360.0*SCREEN_WIDTH; CGFloat height = 100.0/360.0*NMScreenWidth();
[_recommendIv mas_makeConstraints:^(MASConstraintMaker *make) { [_recommendIv mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(height); make.height.mas_equalTo(height);
make.top.equalTo(self.homeClassficationView.mas_bottom); make.top.equalTo(self.homeClassficationView.mas_bottom);
...@@ -120,7 +119,7 @@ ...@@ -120,7 +119,7 @@
if (_activityView == nil) { if (_activityView == nil) {
_activityView = [[ActivityView alloc] init]; _activityView = [[ActivityView alloc] init];
[self addSubview:_activityView]; [self addSubview:_activityView];
CGFloat width = (SCREEN_WIDTH-15)/2.0; CGFloat width = (NMScreenWidth()-15)/2.0;
CGFloat height = 135.0/180.0*width; CGFloat height = 135.0/180.0*width;
[_activityView mas_makeConstraints:^(MASConstraintMaker *make) { [_activityView mas_makeConstraints:^(MASConstraintMaker *make) {
...@@ -135,7 +134,7 @@ ...@@ -135,7 +134,7 @@
if (_homeClassficationView == nil) { if (_homeClassficationView == nil) {
_homeClassficationView = [[HomeClassificationView alloc] init]; _homeClassficationView = [[HomeClassificationView alloc] init];
[self addSubview:_homeClassficationView]; [self addSubview:_homeClassficationView];
CGFloat height = 231.0/375.0*SCREEN_WIDTH; CGFloat height = 231.0/375.0*NMScreenWidth();
[_homeClassficationView mas_makeConstraints:^(MASConstraintMaker *make) { [_homeClassficationView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(height); make.height.mas_equalTo(height);
make.top.equalTo(self.cycleView.mas_bottom); make.top.equalTo(self.cycleView.mas_bottom);
...@@ -146,8 +145,8 @@ ...@@ -146,8 +145,8 @@
} }
- (SDCycleScrollView *)cycleView { - (SDCycleScrollView *)cycleView {
if (_cycleView == nil) { if (_cycleView == nil) {
CGFloat height = 170.0/SCREEN_WIDTH*375.0; CGFloat height = 170.0/NMScreenWidth()*375.0;
_cycleView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 43, SCREEN_WIDTH, height) delegate:self placeholderImage:[UIImage imageWithColor:[UIColor grayColor]]]; _cycleView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 43, NMScreenWidth(), height) imageURLStringsGroup:@[]];
_cycleView.backgroundColor = [UIColor whiteColor]; _cycleView.backgroundColor = [UIColor whiteColor];
[self addSubview:_cycleView]; [self addSubview:_cycleView];
} }
......
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface HomeViewController : UIViewController @interface HomeViewController : UIViewController
+ (instancetype)homeViewController;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -6,17 +6,23 @@ ...@@ -6,17 +6,23 @@
// //
#import "HomeViewController.h" #import "HomeViewController.h"
#import <Masonry.h> #import <Masonry/Masonry.h>
#import <NMCategories/NMCategories.h>
#import <QMUIKit.h> #import <QMUIKit.h>
#import <MJRefresh.h> #import <NMRouter.h>
#import "HomeCollectionHeaderView.h"
#import "UICollectionViewCell+Extension.h"
#import "UICollectionReusableView+Extension.h"
#import "HomeGoodsCell.h" #import "HomeGoodsCell.h"
#import "MacroDefinition.h"
#import "HomeGoodsModel.h" #import "HomeGoodsModel.h"
#import "HomeViewModel.h"
#import "HomeClassificationModel.h"
#import "HomeCollectionHeaderView.h"
#import <NMUIChainKit/NMUIChainKit.h>
//#import <JYSearchModule/JYSearchModule.h>
#import <JYSearchModule.h>
@interface HomeViewController ()<UICollectionViewDelegate,UICollectionViewDataSource> @interface HomeViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
@property (nonatomic, strong) HomeViewModel *viewModel;
@property (nonatomic, strong) UICollectionView *collectionView; @property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, assign) CGFloat collectionViewHeaderHeight; @property (nonatomic, assign) CGFloat collectionViewHeaderHeight;
@property (nonatomic, strong) NSMutableArray *dataSource; @property (nonatomic, strong) NSMutableArray *dataSource;
...@@ -24,11 +30,26 @@ ...@@ -24,11 +30,26 @@
@implementation HomeViewController @implementation HomeViewController
+ (instancetype)homeViewController {
HomeViewModel *viewModel = [[HomeViewModel alloc] initServices:[[HomeServices alloc] init]];
return [[self alloc] initWithViewModel:viewModel];
}
- (instancetype)initWithViewModel:(HomeViewModel *)viewModel {
if (self = [super init]) {
self.viewModel = viewModel;
}
return self;
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[self setUp]; [self setUp];
[self bindViewModel];
[self requestNewData]; [self requestNewData];
} }
...@@ -45,8 +66,24 @@ ...@@ -45,8 +66,24 @@
model.goodsType = (i%2)?HomeGoodsModelTypeNone:HomeGoodsModelTypeCom; model.goodsType = (i%2)?HomeGoodsModelTypeNone:HomeGoodsModelTypeCom;
[self.dataSource addObject:model]; [self.dataSource addObject:model];
} }
NSArray *ary = @[@"居家",@"鞋包配饰",@"服装",
@"电器",@"婴童",@"饮食",
@"特色区",@"洗护",@"餐厨",@"文体"];
NSMutableArray <HomeClassificationModel *>*list = [[NSMutableArray alloc] initWithCapacity:ary.count];
for (int i = 0; i < ary.count; i ++) {
HomeClassificationModel *model = [[HomeClassificationModel alloc] init];
model.iconUrl = @"";
model.iconName = ary[i];
[list addObject:model];
}
self.viewModel.model.classificaAraay = list;
[self.collectionView reloadData]; [self.collectionView reloadData];
[self.collectionView.mj_header endRefreshing]; [self.collectionView.mj_header endRefreshing];
} }
- (void)requestMoreData { - (void)requestMoreData {
...@@ -69,26 +106,44 @@ ...@@ -69,26 +106,44 @@
self.collectionViewHeaderHeight = 926.0/375*SCREEN_WIDTH; self.collectionViewHeaderHeight = 926.0/375*SCREEN_WIDTH;
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.collectionView];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
_dataSource = [[NSMutableArray alloc] init]; _dataSource = [[NSMutableArray alloc] init];
WeakSelf @weakify(self);
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ [self.collectionView footerWithRefreshingBlock:^{
[weakSelf requestMoreData]; @strongify(self);
[self requestMoreData];
}]; }];
footer.automaticallyChangeAlpha = YES; [self.collectionView headerWithRefreshingBlock:^{
self.collectionView.mj_footer = footer; @strongify(self);
self.collectionView.mj_header = [MJRefreshStateHeader headerWithRefreshingBlock:^{ [self requestNewData];
[weakSelf requestNewData];
}]; }];
} }
- (void)searchAction { - (void)searchAction {
UIViewController *search = [[NMRouter sharedInstance] jyMediatorViewController];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:search];
if(@available(iOS 13.0, *)) {
nav.modalPresentationStyle = UIModalPresentationFullScreen;
}
[self presentViewController:nav animated:NO completion:nil];
}
- (void)bindViewModel {
[self.viewModel.homeCommand execute:@"aaaa"];
@weakify(self);
[[RACObserve(self.viewModel.model, carouselAraay) skip:1] subscribeNext:^(id _Nullable x) {
@strongify(self);
[self.collectionView reloadData];
}];
[[self.viewModel.errSubject distinctUntilChanged] subscribeNext:^(NSError *err) {
@strongify(self);
[self.collectionView endRefresh];
[self showFailToast:[NSString stringWithFormat:@"%@",err.userInfo[NSLocalizedDescriptionKey]]];
}];
} }
#pragma mark - UICollectionViewDelegate #pragma mark - UICollectionViewDelegate
...@@ -97,7 +152,17 @@ ...@@ -97,7 +152,17 @@
if ([kind isEqualToString:UICollectionElementKindSectionHeader]){ if ([kind isEqualToString:UICollectionElementKindSectionHeader]){
HomeCollectionHeaderView *header = [HomeCollectionHeaderView dequeueReusableSupplementaryHeaderViewOfKind:collectionView index:indexPath]; HomeCollectionHeaderView *header = [HomeCollectionHeaderView dequeueReusableSupplementaryHeaderViewOfKind:collectionView index:indexPath];
header.headerDict = @{}; header.headerDict = @{@"Carousels":self.viewModel.model.carouselAraay?:@[],
@"Classifica":self.viewModel.model.classificaAraay?:@[]};
@weakify(self);
header.searchActionBlcok = ^{
@strongify(self);
[self searchAction];
};
header.cellAction = ^(HomeClassificationModel * _Nonnull model) {
@strongify(self);
[self showWarningToast:model.iconName];
};
return header; return header;
} }
return [UICollectionReusableView new]; return [UICollectionReusableView new];
...@@ -112,7 +177,7 @@ ...@@ -112,7 +177,7 @@
} }
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
HomeGoodsCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:[HomeGoodsCell identifier] forIndexPath:indexPath]; HomeGoodsCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NMUIChainModelIdentifier(HomeGoodsCell.class) forIndexPath:indexPath];
cell.model = self.dataSource[indexPath.row]; cell.model = self.dataSource[indexPath.row];
return cell; return cell;
...@@ -129,18 +194,21 @@ ...@@ -129,18 +194,21 @@
layout.itemSize = CGSizeMake(width, height); layout.itemSize = CGSizeMake(width, height);
layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0); layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
_collectionView = [[UICollectionView alloc]initWithFrame:CGRectZero collectionViewLayout:layout]; UICollectionViewCreateWithLayout(layout).makeChain
_collectionView.delegate = self; .addToSuperView(self.view)
_collectionView.dataSource = self; .delegate(self)
_collectionView.decelerationRate = 0.8; .dataSource(self)
_collectionView.showsHorizontalScrollIndicator = NO; .showsHorizontalScrollIndicator(NO)
_collectionView.showsVerticalScrollIndicator = NO; .showsHorizontalScrollIndicator(NO)
_collectionView.backgroundColor = RGBCOLOR(238, 238, 238); .backgroundColor(RGBCOLOR(238, 238, 238))
[self.view addSubview:_collectionView]; .registerHeaderViewClass(HomeCollectionHeaderView.class, NMUIChainModelIdentifier(HomeCollectionHeaderView.class))
.registerCellClass(HomeGoodsCell.class, NMUIChainModelIdentifier(HomeGoodsCell.class))
[HomeGoodsCell registerClassForCollectionView:_collectionView]; .assignTo(^(__kindof UIView * _Nonnull view) {
self->_collectionView = view;
[HomeCollectionHeaderView registerClassHeaderForCollectionView:_collectionView]; })
.makeMasonry(^(MASConstraintMaker * _Nonnull make) {
make.edges.equalTo(self.view);
});
} }
return _collectionView; return _collectionView;
} }
......
// //
// UITableViewCell+Extension.h // SearchTagViewCell.h
// xiangwan // xiangwan
// //
// Created by mac on 2019/8/17. // Created by mac on 2019/8/23.
// Copyright © 2019 mac. All rights reserved. // Copyright © 2019 mac. All rights reserved.
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "NMTagView.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface UITableViewCell (Extension) @interface SearchTagViewCell : UITableViewCell
@property (nonatomic, weak) UILabel *headerLb;
/// cell Class注册方法 @property (weak, nonatomic) NMTagView *tagView;
+ (void)registerClassForTableView:(UITableView *)tableView; @property (nonatomic, assign) BOOL showClearBtn;
/// cell Nib注册方法
+ (void)registerNibForTableView:(UITableView *)tableView;
+ (NSString *)identifier;
@property (nonatomic, copy) void(^clearAction)(void);
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
//
// SearchTagViewCell.m
// xiangwan
//
// Created by mac on 2019/8/23.
// Copyright © 2019 mac. All rights reserved.
//
#import "SearchTagViewCell.h"
@interface SearchTagViewCell()
@property (nonatomic, weak) UIButton *clearBtn;
@end
@implementation SearchTagViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setup];
}
return self;
}
- (void)setup {
UILabel *headerLb = [[UILabel alloc] init];
headerLb.font = [UIFont systemFontOfSize:16];
[self.contentView addSubview:headerLb];
self.headerLb = headerLb;
[headerLb mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.top.mas_equalTo(24);
make.height.mas_equalTo(21);
}];
UIButton *clearBtn = [UIButton buttonWithType:UIButtonTypeSystem];
[clearBtn setTitle:@"清空" forState:UIControlStateNormal];
[clearBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
clearBtn.titleLabel.font = [UIFont systemFontOfSize:16];
[clearBtn addTarget:self action:@selector(clearBtnAction) forControlEvents:UIControlEventTouchUpInside];
[self.contentView addSubview:clearBtn];
self.clearBtn = clearBtn;
[clearBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(headerLb);
make.right.inset(16);
}];
NMTagView *tagView = [[NMTagView alloc] init];
[self.contentView addSubview:tagView];
self.tagView = tagView;
[tagView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.contentView);
make.left.right.inset(16);
make.top.equalTo(headerLb.mas_bottom).offset(16);
}];
}
-(void)setShowClearBtn:(BOOL)showClearBtn {
_showClearBtn = showClearBtn;
self.clearBtn.hidden = !showClearBtn;
}
- (void)clearBtnAction {
!self.clearAction ?: self.clearAction();
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// JYSearchModule.h
// JYSearchModule
//
// Created by Nemo on 2020/10/16.
// Copyright © 2020 AgoniNemo. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for JYSearchModule.
FOUNDATION_EXPORT double JYSearchModuleVersionNumber;
//! Project version string for JYSearchModule.
FOUNDATION_EXPORT const unsigned char JYSearchModuleVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <JYSearchModule/PublicHeader.h>
#import "NMRouter+SearchModuleActions.h"
//
// SearchTagHeaderModel.h
// xiangwan
//
// Created by mac on 2019/8/23.
// Copyright © 2019 mac. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class SearchTagModel;
@interface SearchTagHeaderModel : NSObject
@property (nonatomic, strong) NSString *headerText;
@property (nonatomic, strong) NSArray <SearchTagModel *>*tagModels;
@end
NS_ASSUME_NONNULL_END
//
// SearchTagHeaderModel.m
// xiangwan
//
// Created by mac on 2019/8/23.
// Copyright © 2019 mac. All rights reserved.
//
#import "SearchTagHeaderModel.h"
@implementation SearchTagHeaderModel
@end
//
// SearchTagModel.h
// xiangwan
//
// Created by mac on 2019/8/23.
// Copyright © 2019 mac. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SearchTagModel : NSObject
@property (nonatomic, strong) NSString *tagText;
@end
NS_ASSUME_NONNULL_END
//
// SearchTagModel.m
// xiangwan
//
// Created by mac on 2019/8/23.
// Copyright © 2019 mac. All rights reserved.
//
#import "SearchTagModel.h"
@implementation SearchTagModel
@end
//
// JYSearchTargetModule.h
// JYSearchModule_Example
//
// Created by Nemo on 2020/10/16.
// Copyright © 2020 AgoniNemo. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface JYSearchTargetModule : NSObject
- (UIViewController *)jyNativeSearchViewController;
@end
NS_ASSUME_NONNULL_END
//
// JYSearchTargetModule.m
// JYSearchModule_Example
//
// Created by Nemo on 2020/10/16.
// Copyright © 2020 AgoniNemo. All rights reserved.
//
#import "JYSearchTargetModule.h"
#import "JYSearchViewController.h"
@implementation JYSearchTargetModule
- (UIViewController *)jyNativeSearchViewController {
JYSearchViewController *viewController = [JYSearchViewController jySearchViewController];
return viewController;
}
@end
//
// NMRouter+SearchModuleActions.h
// Mall-iOS
//
// Created by Nemo on 2020/10/16.
//
#import "NMRouter.h"
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface NMRouter (SearchModuleActions)
// 外部调用的方法
- (UIViewController *)jyMediatorViewController;
@end
NS_ASSUME_NONNULL_END
//
// NMRouter+SearchModuleActions.m
// Mall-iOS
//
// Created by Nemo on 2020/10/16.
//
#import "NMRouter+SearchModuleActions.h"
// 1. 字符串 是类名 JYXxx.h 中的 xxx 部分
NSString * const kCTMediatorTargetCourse = @"SearchTargetModule";
// 2. 字符串是 JYxxx.h 中 定义的 jyXxx 函数名的 xxx 部分
NSString * const kCTMediatorActionNativToNativeCourse = @"NativeSearchViewController";
@implementation NMRouter (SearchModuleActions)
- (UIViewController *)jyMediatorViewController {
UIViewController *viewController = [self performTarget:kCTMediatorTargetCourse
action:kCTMediatorActionNativToNativeCourse
params:nil
shouldCacheTarget:NO
];
if ([viewController isKindOfClass:[UIViewController class]]) {
// view controller 交付出去之后,可以由外界选择是push还是present
return viewController;
} else {
// 这里处理异常场景,具体如何处理取决于产品
NSLog(@"%@ 未能实例化页面", NSStringFromSelector(_cmd));
return [[UIViewController alloc] init];
}
}
@end
//
// NMTag.h
// CQ_App
//
// Created by mac on 2019/4/9.
// Copyright © 2019年 mac. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface NMTag : NSObject
@property (copy, nonatomic, nullable) NSString *text;
@property (copy, nonatomic, nullable) NSAttributedString *attributedText;
@property (strong, nonatomic, nullable) UIColor *textColor;
///backgound color
@property (strong, nonatomic, nullable) UIColor *bgColor;
@property (strong, nonatomic, nullable) UIColor *highlightedBgColor;
///background image
@property (strong, nonatomic, nullable) UIImage *bgImg;
@property (assign, nonatomic) CGFloat cornerRadius;
@property (strong, nonatomic, nullable) UIColor *borderColor;
@property (assign, nonatomic) CGFloat borderWidth;
///like padding in css
@property (assign, nonatomic) UIEdgeInsets padding;
@property (strong, nonatomic, nullable) UIFont *font;
///if no font is specified, system font with fontSize is used
@property (assign, nonatomic) CGFloat fontSize;
///default:YES
@property (assign, nonatomic) BOOL enable;
- (nonnull instancetype)initWithText: (nonnull NSString *)text;
+ (nonnull instancetype)tagWithText: (nonnull NSString *)text;
@end
NS_ASSUME_NONNULL_END
//
// NMTag.m
// CQ_App
//
// Created by mac on 2019/4/9.
// Copyright © 2019年 mac. All rights reserved.
//
#import "NMTag.h"
static const CGFloat kDefaultFontSize = 13.0;
@implementation NMTag
- (instancetype)init {
self = [super init];
if (self) {
_fontSize = kDefaultFontSize;
_textColor = [UIColor colorWithRed:34.0/255.0 green:34.0/255.0 blue:34.0/255.0 alpha:1];
_bgColor = [UIColor whiteColor];
_enable = YES;
}
return self;
}
- (instancetype)initWithText: (NSString *)text {
self = [self init];
if (self) {
_text = text;
}
return self;
}
+ (instancetype)tagWithText: (NSString *)text {
return [[self alloc] initWithText: text];
}
@end
// //
// ViewControllerConfigure.h // NMTagButton.h
// CQ_App // CQ_App
// //
// Created by mac on 2019/3/22. // Created by mac on 2019/4/9.
// Copyright © 2019年 mac. All rights reserved. // Copyright © 2019年 mac. All rights reserved.
// //
...@@ -10,8 +10,9 @@ ...@@ -10,8 +10,9 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface ViewControllerConfigure : NSObject @class NMTag;
@interface NMTagButton : UIButton
+ (nonnull instancetype)buttonWithTag: (nonnull NMTag *)tag;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
//
// NMTagButton.m
// CQ_App
//
// Created by mac on 2019/4/9.
// Copyright © 2019年 mac. All rights reserved.
//
#import "NMTagButton.h"
#import "NMTag.h"
@implementation NMTagButton
+ (instancetype)buttonWithTag: (NMTag *)tag {
NMTagButton *btn = [super buttonWithType:UIButtonTypeCustom];
if (tag.attributedText) {
[btn setAttributedTitle: tag.attributedText forState: UIControlStateNormal];
} else {
[btn setTitle: tag.text forState:UIControlStateNormal];
[btn setTitleColor: tag.textColor forState: UIControlStateNormal];
btn.titleLabel.font = tag.font ?: [UIFont systemFontOfSize:tag.fontSize];
}
btn.backgroundColor = tag.bgColor;
btn.contentEdgeInsets = tag.padding;
btn.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
if (tag.bgImg) {
[btn setBackgroundImage: tag.bgImg forState: UIControlStateNormal];
}
if (tag.borderColor) {
btn.layer.borderColor = tag.borderColor.CGColor;
}
if (tag.borderWidth) {
btn.layer.borderWidth = tag.borderWidth;
}
btn.userInteractionEnabled = tag.enable;
if (tag.enable) {
UIColor *highlightedBgColor = tag.highlightedBgColor ?: [self darkerColor:btn.backgroundColor];
[btn setBackgroundImage:[self imageWithColor:highlightedBgColor] forState:UIControlStateHighlighted];
}
btn.layer.cornerRadius = tag.cornerRadius;
btn.layer.masksToBounds = YES;
return btn;
}
+ (UIImage *)imageWithColor:(UIColor *)color {
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
+ (UIColor *)darkerColor:(UIColor *)color {
CGFloat h, s, b, a;
if ([color getHue:&h saturation:&s brightness:&b alpha:&a])
return [UIColor colorWithHue:h
saturation:s
brightness:b * 0.85
alpha:a];
return color;
}
@end
//
// NMTagView.h
// CQ_App
//
// Created by mac on 2019/4/9.
// Copyright © 2019年 mac. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "NMTag.h"
NS_ASSUME_NONNULL_BEGIN
@interface NMTagView : UIView
@property (assign, nonatomic) UIEdgeInsets padding; //内边距
@property (assign, nonatomic) CGFloat lineSpacing; //行间距
@property (assign, nonatomic) CGFloat interitemSpacing; //item间距
@property (assign, nonatomic) CGFloat preferredMaxLayoutWidth; //最大宽度
@property (assign, nonatomic) CGFloat regularWidth; //!< 固定宽度
@property (nonatomic,assign ) CGFloat regularHeight; //!< 固定高度
@property (assign, nonatomic) BOOL singleLine;
@property (nonatomic, assign) BOOL isTagBtnEnable; //标签按钮是否可点击 NO:可点击, YES: 不可点击
@property (copy, nonatomic, nullable) void (^didTapTagAtIndex)(NSUInteger index);
- (void)addTag: (nonnull NMTag *)tag;
- (void)insertTag: (nonnull NMTag *)tag atIndex:(NSUInteger)index;
- (void)removeTag: (nonnull NMTag *)tag;
- (void)removeTagAtIndex: (NSUInteger)index;
- (void)removeAllTags;
@end
NS_ASSUME_NONNULL_END
//
// NMTagView.m
// CQ_App
//
// Created by mac on 2019/4/9.
// Copyright © 2019年 mac. All rights reserved.
//
#import "NMTagView.h"
#import "NMTagButton.h"
@interface NMTagView ()
@property (strong, nonatomic, nullable) NSMutableArray *tags;
@property (assign, nonatomic) BOOL didSetup;
@property (nonatomic,assign) BOOL isIntrinsicWidth; //!<是否宽度固定
@property (nonatomic,assign) BOOL isIntrinsicHeight; //!<是否高度固定
@end
@implementation NMTagView
// 重写setter给bool赋值
- (void)setRegularWidth:(CGFloat)intrinsicWidth
{
if (_regularWidth != intrinsicWidth) {
_regularWidth = intrinsicWidth;
if (intrinsicWidth == 0) {
self.isIntrinsicWidth = NO;
}
else
{
self.isIntrinsicWidth = YES;
}
}
}
- (void)setRegularHeight:(CGFloat)intrinsicHeight
{
if (_regularHeight != intrinsicHeight) {
_regularHeight = intrinsicHeight;
if (intrinsicHeight == 0)
{
self.isIntrinsicHeight = NO;
}
else
{
self.isIntrinsicHeight = YES;
}
}
}
#pragma mark - Lifecycle
- (CGSize)intrinsicContentSize {
if (!self.tags.count) {
return CGSizeZero;
}
NSArray *subviews = self.subviews;
UIView *previousView = nil;
CGFloat topPadding = self.padding.top;
CGFloat bottomPadding = self.padding.bottom;
CGFloat leftPadding = self.padding.left;
CGFloat rightPadding = self.padding.right;
CGFloat itemSpacing = self.interitemSpacing;
CGFloat lineSpacing = self.lineSpacing;
CGFloat currentX = leftPadding;
CGFloat intrinsicHeight = topPadding; //初始固定高度
CGFloat intrinsicWidth = leftPadding; //初始固定宽度
if (!self.singleLine && self.preferredMaxLayoutWidth > 0) {
NSInteger lineCount = 0; //累加行数
for (UIView *view in subviews) {
CGSize size = view.intrinsicContentSize;
// 宽度和高度通过参数的0或者非0来进行赋值
CGFloat width = self.isIntrinsicWidth?self.regularWidth:size.width;
CGFloat height = self.isIntrinsicHeight?self.regularHeight:size.height;
if (previousView) { //上一个tagbutton是否存在
// CGFloat width = size.width;
currentX += itemSpacing;
if (currentX + width + rightPadding <= self.preferredMaxLayoutWidth) { //计算是否换行
currentX += width;
} else {
lineCount ++;
currentX = leftPadding + width;
intrinsicHeight += height;
}
} else {
lineCount ++;
intrinsicHeight += height;
currentX += width;
}
previousView = view;
intrinsicWidth = MAX(intrinsicWidth, currentX + rightPadding);
}
intrinsicHeight += bottomPadding + lineSpacing * (lineCount - 1);
} else {
for (UIView *view in subviews) {
CGSize size = view.intrinsicContentSize;
intrinsicWidth += self.isIntrinsicWidth?self.regularWidth:size.width;
}
intrinsicWidth += itemSpacing * (subviews.count - 1) + rightPadding;
intrinsicHeight += ((UIView *)subviews.firstObject).intrinsicContentSize.height + bottomPadding;
}
return CGSizeMake(intrinsicWidth, intrinsicHeight);
}
- (void)layoutSubviews {
if (!self.singleLine) {
self.preferredMaxLayoutWidth = self.frame.size.width;
}
[super layoutSubviews];
[self layoutTags];
}
#pragma mark - Custom accessors
- (NSMutableArray *)tags {
if(!_tags) {
_tags = [NSMutableArray array];
}
return _tags;
}
- (void)setPreferredMaxLayoutWidth: (CGFloat)preferredMaxLayoutWidth {
if (preferredMaxLayoutWidth != _preferredMaxLayoutWidth) {
_preferredMaxLayoutWidth = preferredMaxLayoutWidth;
_didSetup = NO;
[self invalidateIntrinsicContentSize];
}
}
#pragma mark - Private
- (void)layoutTags {
if (self.didSetup || !self.tags.count) {
return;
}
NSArray *subviews = self.subviews;
UIView *previousView = nil;
CGFloat topPadding = self.padding.top;
CGFloat leftPadding = self.padding.left;
CGFloat rightPadding = self.padding.right;
CGFloat itemSpacing = self.interitemSpacing;
CGFloat lineSpacing = self.lineSpacing;
CGFloat currentX = leftPadding;
if (!self.singleLine && self.preferredMaxLayoutWidth > 0) {
for (UIView *view in subviews) {
CGSize size = view.intrinsicContentSize;
CGFloat width1 = self.isIntrinsicWidth?self.regularWidth:size.width;
CGFloat height1 = self.isIntrinsicHeight?self.regularHeight:size.height;
if (previousView) {
// CGFloat width = size.width;
currentX += itemSpacing;
if (currentX + width1 + rightPadding <= self.preferredMaxLayoutWidth) {
view.frame = CGRectMake(currentX, CGRectGetMinY(previousView.frame), width1, height1);
currentX += width1;
} else {
CGFloat width = MIN(width1, self.preferredMaxLayoutWidth - leftPadding - rightPadding);
view.frame = CGRectMake(leftPadding, CGRectGetMaxY(previousView.frame) + lineSpacing, width, height1);
currentX = leftPadding + width;
}
} else {
CGFloat width = MIN(width1, self.preferredMaxLayoutWidth - leftPadding - rightPadding);
view.frame = CGRectMake(leftPadding, topPadding, width, height1);
currentX += width;
}
previousView = view;
}
} else {
for (UIView *view in subviews) {
CGSize size = view.intrinsicContentSize;
view.frame = CGRectMake(currentX, topPadding, self.isIntrinsicWidth?self.regularWidth:size.width, self.isIntrinsicHeight?self.regularHeight:size.height);
currentX += self.isIntrinsicWidth?self.regularWidth:size.width;
previousView = view;
}
}
self.didSetup = YES;
}
#pragma mark - IBActions
- (void)onTag: (UIButton *)btn {
if (self.didTapTagAtIndex) {
self.didTapTagAtIndex([self.subviews indexOfObject: btn]);
}
}
#pragma mark - Public
- (void)addTag: (NMTag *)tag {
NSParameterAssert(tag);
NMTagButton *btn = [NMTagButton buttonWithTag: tag];
btn.userInteractionEnabled = !self.isTagBtnEnable;
[btn addTarget: self action: @selector(onTag:) forControlEvents: UIControlEventTouchUpInside];
[self addSubview: btn];
[self.tags addObject: tag];
self.didSetup = NO;
[self invalidateIntrinsicContentSize];
}
- (void)insertTag: (NMTag *)tag atIndex: (NSUInteger)index {
NSParameterAssert(tag);
if (index + 1 > self.tags.count) {
[self addTag: tag];
} else {
NMTagButton *btn = [NMTagButton buttonWithTag: tag];
[btn addTarget: self action: @selector(onTag:) forControlEvents: UIControlEventTouchUpInside];
[self insertSubview: btn atIndex: index];
[self.tags insertObject: tag atIndex: index];
self.didSetup = NO;
[self invalidateIntrinsicContentSize];
}
}
- (void)removeTag: (NMTag *)tag {
NSParameterAssert(tag);
NSUInteger index = [self.tags indexOfObject: tag];
if (NSNotFound == index) {
return;
}
[self.tags removeObjectAtIndex: index];
if (self.subviews.count > index) {
[self.subviews[index] removeFromSuperview];
}
self.didSetup = NO;
[self invalidateIntrinsicContentSize];
}
- (void)removeTagAtIndex: (NSUInteger)index {
if (index + 1 > self.tags.count) {
return;
}
[self.tags removeObjectAtIndex: index];
if (self.subviews.count > index) {
[self.subviews[index] removeFromSuperview];
}
self.didSetup = NO;
[self invalidateIntrinsicContentSize];
}
- (void)removeAllTags {
[self.tags removeAllObjects];
for (UIView *view in self.subviews) {
[view removeFromSuperview];
}
self.didSetup = NO;
[self invalidateIntrinsicContentSize];
}
@end
//
// SKSearchBar.h
// xiangwan
//
// Created by cqmac on 2019/9/23.
// Copyright © 2019 mac. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SKSearchBar : UITextField <UITextFieldDelegate>
/// 最大字数,emoji算两个字,中英文都算一个字。
@property(nonatomic, assign) NSInteger maxLength;
/// 如果需要自定义UITextField的delegate,请用textField.bridgeDelegate = self 代替 textField.delegate = self
@property(nonatomic, weak) id<UITextFieldDelegate> bridgeDelegate;
@end
NS_ASSUME_NONNULL_END
//
// SKSearchBar.m
// xiangwan
//
// Created by cqmac on 2019/9/23.
// Copyright © 2019 mac. All rights reserved.
//
#import "SKSearchBar.h"
@interface SKSearchBar()
@end
@implementation SKSearchBar
- (instancetype)init {
self = [super init];
if (self) {
[self setup];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame {
if(self = [super initWithFrame:frame]){
[self setup];
}
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder{
if(self = [super initWithCoder:aDecoder]){
[self setup];
}
return self;
}
- (void)setup{
_maxLength = 0;
[self addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
self.delegate = self;
[self initLeftIcon:@"public_s_search"];
}
- (void)initLeftIcon:(NSString *)leftIcon {
UIView *view = [[UIView alloc] init];
UIImageView *iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:leftIcon]];
[view addSubview:iv];
self.leftViewMode = UITextFieldViewModeAlways;
self.leftView = iv;
self.layer.masksToBounds = YES;
self.layer.cornerRadius = 5;
}
- (CGRect)leftViewRectForBounds:(CGRect)bounds {
CGRect leftRect = [super leftViewRectForBounds:bounds];
leftRect.origin.x += 10; //右边偏10
return leftRect;
}
//UITextField 文字与输入框的距离
- (CGRect)textRectForBounds:(CGRect)bounds{
return CGRectInset(bounds, 33, 0);
}
//控制文本的位置
- (CGRect)editingRectForBounds:(CGRect)bounds{
return CGRectInset(bounds, 33, 0);
}
- (CGRect)rightViewRectForBounds:(CGRect)bounds {
CGRect rightRect = [super rightViewRectForBounds:bounds];
rightRect.origin.x -= 10; //左边偏10
return rightRect;
}
/**
主要是用于中文输入的场景
剩余的允许输入的字数较少时,限制拼音字符的输入,提升体验
*/
- (NSInteger)allowMaxMarkLength:(NSInteger)remainLength{
NSInteger length = 0;
if(remainLength > 2){
length = NSIntegerMax;
}else if(remainLength > 0){
length = remainLength * 6; //一个中文对应的拼音一般不超过6个
}
return length;
}
- (void)textFieldDidChange:(UITextField *)textField
{
if(_maxLength <= 0){
return;
}
NSString *text = textField.text;
UITextRange *selectedRange = [textField markedTextRange];
UITextPosition *position = [textField positionFromPosition:selectedRange.start offset:0];
//没有高亮选择的字,则对已输入的文字进行字数统计和限制,防止中文/emoj被截断
if (!position){
if (text.length > _maxLength){
NSRange rangeIndex = [text rangeOfComposedCharacterSequenceAtIndex:_maxLength];
if (rangeIndex.length == 1){
textField.text = [text substringToIndex:_maxLength];
}else{
if(_maxLength == 1){
textField.text = @"";
}else{
NSRange rangeRange = [text rangeOfComposedCharacterSequencesForRange:NSMakeRange(0, _maxLength - 1 )];
textField.text = [text substringWithRange:rangeRange];
}
}
}
}
}
#pragma mark -- UITextFieldDelegate
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
if([_bridgeDelegate respondsToSelector:@selector(textField:shouldChangeCharactersInRange:replacementString:)]){
return [_bridgeDelegate textField:textField shouldChangeCharactersInRange:range replacementString:string];
}
// if(_maxLength <= 0){
// //输入钱的正则表达式,可输入正负,小数点前5位,小数点后2位,位数可控
// NSString *toString = [textField.text stringByReplacingCharactersInRange:range withString:string];
// if (toString.length > 0) {
// NSString *stringRegex = @"(\\+|\\-)?(([0]|(0[.]\\d{0,2}))|([1-9]\\d{0,4}(([.]\\d{0,2})?)))?";
// NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", stringRegex];
// BOOL flag = [phoneTest evaluateWithObject:toString];
// if (!flag) {
// return NO;
// }
// }
// return YES;
// }
UITextRange *selectedRange = [textField markedTextRange];//高亮选择的字
UITextPosition *startPos = [textField positionFromPosition:selectedRange.start offset:0];
UITextPosition *endPos = [textField positionFromPosition:selectedRange.end offset:0];
NSInteger markLength = [textField offsetFromPosition:startPos toPosition:endPos];
NSInteger confirmlength = textField.text.length - markLength - range.length;//已经确认输入的字符长度
if(confirmlength >= _maxLength ){
return NO;
}
NSInteger allowMaxMarkLength = [self allowMaxMarkLength:_maxLength - confirmlength];
if(markLength > allowMaxMarkLength ){// && string.length > 0){
return NO;
}
return YES;
}
// return NO to disallow editing.
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
if([_bridgeDelegate respondsToSelector:@selector(textFieldShouldBeginEditing:)]){
return [_bridgeDelegate textFieldShouldBeginEditing:textField];
}else{
return YES;
}
}
// became first responder
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
if([_bridgeDelegate respondsToSelector:@selector(textFieldDidBeginEditing:)]){
[_bridgeDelegate textFieldDidBeginEditing:textField];
}
}
// return YES to allow editing to stop and to resign first responder status. NO to disallow the editing session to end
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
if([_bridgeDelegate respondsToSelector:@selector(textFieldShouldEndEditing:)]){
return [_bridgeDelegate textFieldShouldEndEditing:textField];
}else{
return YES;
}
}
// may be called if forced even if shouldEndEditing returns NO (e.g. view removed from window) or endEditing:YES called
- (void)textFieldDidEndEditing:(UITextField *)textField
{
if([_bridgeDelegate respondsToSelector:@selector(textFieldDidEndEditing:)]){
[_bridgeDelegate textFieldDidEndEditing:textField];
}
}
// called when clear button pressed. return NO to ignore (no notifications)
- (BOOL)textFieldShouldClear:(UITextField *)textField
{
if([_bridgeDelegate respondsToSelector:@selector(textFieldShouldClear:)]){
return [_bridgeDelegate textFieldShouldClear:textField];
}
return YES;
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
if([_bridgeDelegate respondsToSelector:@selector(textFieldShouldReturn:)]){
return [_bridgeDelegate textFieldShouldReturn:textField];
}
return NO;
}
@end
//
// SearchTagView.h
// xiangwan
//
// Created by mac on 2019/8/23.
// Copyright © 2019 mac. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SearchTagModel.h"
#import "SearchTagHeaderModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SearchTagView : UIView
@property (nonatomic, copy) void(^tagClick)(NSString * text);
@property (nonatomic, copy) void(^clearAll)(void);
@property (nonatomic, strong) NSArray *datas;
- (void)insertSection:(SearchTagHeaderModel *)item;
- (NSInteger)insertRow:(SearchTagModel *)item;
@end
NS_ASSUME_NONNULL_END
//
// SearchTagView.m
// xiangwan
//
// Created by mac on 2019/8/23.
// Copyright © 2019 mac. All rights reserved.
//
#import "SearchTagView.h"
#import "SearchTagViewCell.h"
#import "SearchTagHeaderModel.h"
#import "NMTag.h"
#import <UITableView+FDTemplateLayoutCell.h>
#define nScreenWidth UIScreen.mainScreen.bounds.size.width
@interface SearchTagView()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *dataSource;
@end
@implementation SearchTagView
- (instancetype)init
{
self = [super init];
if (self) {
[self setup];
}
return self;
}
- (void)setup {
[self addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
[self.tableView registerClass:[SearchTagViewCell class] forCellReuseIdentifier:[self identifier]];
}
- (NSString *)identifier {
return [NSString stringWithFormat:@"%@Id",[SearchTagViewCell class]];
}
-(void)setDatas:(NSArray *)datas {
_datas = datas;
self.dataSource = [[NSMutableArray alloc] initWithArray:datas];
[self.tableView reloadData];
}
- (void)insertSection:(SearchTagHeaderModel *)item {
[self.dataSource insertObject:item atIndex:0];
NSIndexPath *insert = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView insertRowsAtIndexPaths:@[insert] withRowAnimation:UITableViewRowAnimationNone];
}
- (NSInteger)insertRow:(SearchTagModel *)item {
NSInteger idx = [self checkRepeat:item.tagText];
if (idx == -1) {
SearchTagHeaderModel *model = self.dataSource.firstObject;
NSMutableArray *ary = [[NSMutableArray alloc] initWithArray:model.tagModels];
if (ary.count > 9) {
[ary removeLastObject];
}
[ary insertObject:item atIndex:0];
model.tagModels = ary;
}
NSIndexPath *insert = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView reloadRowsAtIndexPaths:@[insert] withRowAnimation:UITableViewRowAnimationNone];
return idx;
}
- (NSInteger)checkRepeat:(NSString *)text {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"tagText = %@",text];
SearchTagHeaderModel *model = self.dataSource.firstObject;
NSArray *result = [model.tagModels filteredArrayUsingPredicate:predicate];
SearchTagModel *item = result.firstObject;
NSInteger index = [model.tagModels indexOfObject:item];
if (index < model.tagModels.count && index != 0) {
NSMutableArray *ary = [[NSMutableArray alloc] initWithArray:model.tagModels];
[ary exchangeObjectAtIndex:0 withObjectAtIndex:index];
model.tagModels = ary;
}
return (result.count == 0)?-1:index;
}
- (void)clearRecord {
[self.dataSource removeObjectAtIndex:0];
NSIndexPath *insert = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView deleteRowsAtIndexPaths:@[insert] withRowAnimation:UITableViewRowAnimationNone];
!self.clearAll ?: self.clearAll();
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.dataSource.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
SearchTagViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[self identifier]];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.showClearBtn = (indexPath.row == 0 && self.dataSource.count > 1);
[self configCell:cell indexPath:indexPath];
@weakify(self);
cell.clearAction = ^{
@strongify(self);
[self clearRecord];
};
return cell;
}
- (void)configCell:(SearchTagViewCell *)cell indexPath:(NSIndexPath *)indexPath
{
[cell.tagView removeAllTags];
cell.tagView.preferredMaxLayoutWidth = nScreenWidth-32;
//cell.tagView.padding = UIEdgeInsetsMake(0, 0, 0, 0);
cell.tagView.lineSpacing = 10;
cell.tagView.interitemSpacing = 10;
cell.tagView.singleLine = NO;
// 给出两个字段,如果给的是0,那么就是变化的,如果给的不是0,那么就是固定的
// cell.tagView.regularWidth = 80;
// cell.tagView.regularHeight = 30;
SearchTagHeaderModel *model = self.dataSource[indexPath.row];
cell.headerLb.text = model.headerText;
NSArray *arr = model.tagModels;
@weakify(self);
[arr enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
@strongify(self);
SearchTagModel *subModel = arr[idx];
NMTag *tag = [self createTag:subModel.tagText];
[cell.tagView addTag:tag];
}];
cell.tagView.didTapTagAtIndex = ^(NSUInteger index) {
@strongify(self);
SearchTagModel *subModel = arr[index];
[self cellAction:subModel];
};
}
- (void)cellAction:(SearchTagModel *)model {
if (self.tagClick) {
self.tagClick(model.tagText);
}
}
- (NMTag *)createTag:(NSString *)text {
NMTag *tag = [[NMTag alloc] initWithText:text];
tag.font = [UIFont systemFontOfSize:14];
tag.textColor = [UIColor colorWithRed:34.0/255 green:34.0/255 blue:34.0/255 alpha:1];
tag.bgColor = [UIColor colorWithRed:249.0/255 green:249.0/255 blue:249.0/255 alpha:1];
tag.cornerRadius = 8;
tag.enable = YES;
tag.padding = UIEdgeInsetsMake(6, 16, 6, 16);
return tag;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
@weakify(self);
return [tableView fd_heightForCellWithIdentifier:[self identifier] configuration:^(id cell) {
@strongify(self);
[self configCell:cell indexPath:indexPath];
}];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
-(UITableView *)tableView {
if (_tableView == nil) {
_tableView = [[UITableView alloc] init];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.tableFooterView = [UIView new];
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
return _tableView;
}
-(NSMutableArray *)dataSource {
if (_dataSource == nil) {
_dataSource = [[NSMutableArray alloc] init];
}
return _dataSource;
}
@end
//
// JYSearchViewController.h
// Mall-iOS
//
// Created by Nemo on 2020/10/16.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface JYSearchViewController : UIViewController
+ (instancetype)jySearchViewController;
@end
NS_ASSUME_NONNULL_END
//
// JYSearchViewController.m
// Mall-iOS
//
// Created by Nemo on 2020/10/16.
//
#import "JYSearchViewController.h"
#import "SearchTagView.h"
#import "SKSearchBar.h"
#import <QMUIKit.h>
@interface JYSearchViewController ()
@property (nonatomic, weak) SKSearchBar *search;
@property (nonatomic, weak) SearchTagView *tagView;
@property (nonatomic, weak) UIButton *searchBtn;
@property (nonatomic, strong) NSMutableArray *historys;
@property (nonatomic, strong) NSMutableArray *searchDataSource;
@property (nonatomic, assign) NSInteger index;
@end
@implementation JYSearchViewController
+ (instancetype)jySearchViewController {
//HomeViewModel *viewModel = [[HomeViewModel alloc] initServices:[[HomeServices alloc] init]];
return [[self alloc] init];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor redColor];
}
- (void)createTagView {
SearchTagView *tagView = [[SearchTagView alloc] init];
[self.view addSubview:tagView];
self.tagView = tagView;
@weakify(self);
tagView.tagClick = ^(NSString * _Nonnull text) {
@strongify(self);
self.search.text = text;
//[self searchAction];
};
tagView.clearAll = ^{
@strongify(self);
[self.historys removeAllObjects];
[self.searchDataSource removeObjectAtIndex:0];
//[[DatabaseCenter sharedDatabaseCenter].historyDBMager deleteAllConditions:nil];
};
/**
[tagView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) {
@strongify(self);
[self.search resignFirstResponder];
}]];
*/
[tagView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.mas_equalTo(0);
make.bottom.inset(291);
}];
}
- (void)initData {
self.historys = [[NSMutableArray alloc] initWithArray:@[]];
NSArray *hotWords = @[];
if (hotWords.count == 0) {
hotWords = @[@{@"text":@"吃饭"},@{@"text":@"喝东西"},@{@"text":@"唱歌"}];
}
self.searchDataSource = [[NSMutableArray alloc] init];
if (self.historys.count > 0) {
[self.searchDataSource addObject:@{@"data":self.historys,@"title":@"历史记录"}];
}
[self.searchDataSource addObject:@{@"data":hotWords,@"title":@"热搜"}];
NSMutableArray *arry = [[NSMutableArray alloc] init];
for (int i = 0; i < self.searchDataSource.count; i ++) {
NSDictionary *dict = self.searchDataSource[i];
SearchTagHeaderModel *model = [[SearchTagHeaderModel alloc] init];
model.headerText = dict[@"title"];
NSMutableArray *ary = [[NSMutableArray alloc] init];
NSArray *datas = dict[@"data"];
for (int j = 0; j < datas.count; j ++) {
NSDictionary *dt = datas[j];
SearchTagModel *subMdl = [[SearchTagModel alloc] init];
subMdl.tagText = dt[@"text"];
[ary addObject:subMdl];
}
model.tagModels = ary;
[arry addObject:model];
}
self.tagView.datas = arry;
}
@end
//
// HomeMainMacro.h
// Mall-iOS
//
// Created by Nemo on 2020/10/21.
//
#ifndef HomeMainMacro_h
#define HomeMainMacro_h
#ifdef DEBUG
#define NSLog(format, ...) printf("[%s] %s [第%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
#else
#define NSLog(format, ...)
#endif
#endif /* HomeMainMacro_h */
//
// Interface.h
//
#ifndef Interface_h
#define Interface_h
#import <UIKit/UIKit.h>
#pragma mark ****** 接口信息 ******
#if DevelopMent ==0
/*********正式环境*********/ // 119.23.50.171
//域名 app.xwattendit.com
#define API_HOST @"https://dev.changein.cn/pw-weapp-api"
#elif DevelopMent ==1
/*********开发环境*********/
#define API_HOST @"https://dev.changein.cn/pw-weapp-api"
#else
/*********测试环境*********/
#define API_HOST @"https://dev.changein.cn/pw-weapp-api"
#endif
#pragma mark - ——————— 详细接口地址 ————————
//测试接口
CG_INLINE NSString * URLTest() {
return @"/api/";
}
#pragma mark - ——————— 1.首页相关 ————————
//首页接口
CG_INLINE NSString * URLShopping() {
return @"/shoppingMall/index/shoppingMallIndexAdv";
}
//获取热门关键词列表
CG_INLINE NSString * URLHotWordList() {
return @"/pw-weapp-api/search/getHotWordList";
}
#pragma mark - ——————— 其他相关 ————————
#endif /* Interface_h */
//
// MacroDefinition.h
// CQ_App
//
// Created by mac on 2019/3/20.
// Copyright © 2019年 mac. All rights reserved.
//
#ifndef MacroDefinition_h
#define MacroDefinition_h
#pragma mark ****** 宏方法 ******
//iOS 11.0 配置
#define AdjustsScrollViewInsetNever(controller,view) if(@available(iOS 11.0, *)) {view.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;} else if([controller isKindOfClass:[UIViewController class]]) {controller.automaticallyAdjustsScrollViewInsets = false;}
#define kStatusBarAndNavigationBarHeight (nScreenHeight() >= 812.0 ? 88.f : 64.f)
#define kSafeAreaBottomHeight (nScreenHeight() >= 812.0 ? 34.0f : 0.0)
#define kTabbarHeight (nScreenHeight() >= 812.0 ? 83.f : 49.f)
//数据验证
#define StrValid(f) (f!=nil && [f isKindOfClass:[NSString class]] && ![f isEqualToString:@""])
#define SafeStr(f) (StrValid(f) ? f:@"")
#define HasString(str,key) ([str rangeOfString:key].location!=NSNotFound)
#define ValidStr(f) StrValid(f)
#define ValidDict(f) (f!=nil && [f isKindOfClass:[NSDictionary class]] && [f count]>0)
#define ValidArray(f) (f!=nil && [f isKindOfClass:[NSArray class]] && [f count]>0)
#define ValidNum(f) (f!=nil && [f isKindOfClass:[NSNumber class]])
#define ValidClass(f,cls) (f!=nil && [f isKindOfClass:[cls class]])
#define ValidData(f) (f!=nil && [f isKindOfClass:[NSData class]])
//单例化一个类
#define SINGLETON_FOR_HEADER(className) \
\
+ (className *)shared##className;
#define SINGLETON_FOR_CLASS(className) \
static className *shared##className = nil;\
+(instancetype)allocWithZone:(struct _NSZone *)zone\
{\
static dispatch_once_t onceToken;\
dispatch_once(&onceToken, ^{\
if (shared##className == nil) {\
shared##className = [super allocWithZone:zone];\
}\
});\
return shared##className;\
}\
+(instancetype)shared##className\
{\
return [[self alloc] init];\
}\
-(id)copyWithZone:(NSZone *)zone\
{\
return shared##className;\
}\
-(id)mutableCopyWithZone:(NSZone *)zone\
{\
return shared##className;\
}
#pragma mark ————— 获取系统对象内联方法 —————
CG_INLINE UIWindow *kGetLastWindow() {
UIWindow *lastWindow = [UIApplication sharedApplication].keyWindow;
if (!lastWindow) {
lastWindow = [UIApplication sharedApplication].windows.lastObject;
}
return lastWindow;
}
CG_INLINE UIApplication *kApplication() {
return [UIApplication sharedApplication];
}
CG_INLINE UIView *kAppWindow() {
return [UIApplication sharedApplication].delegate.window;
}
CG_INLINE UIViewController *kRootViewController() {
return [UIApplication sharedApplication].delegate.window.rootViewController;
}
/**
CG_INLINE CGFloat nScreenWidth() {
return SCREEN_WIDTH;
}
CG_INLINE CGFloat nScreenHeight() {
return YYScreenSize().height;
}
*/
CG_INLINE CGFloat kSafeAreaTopHeight() {
return [[UIApplication sharedApplication] statusBarFrame].size.height;
}
/**
CG_INLINE CGFloat tabBarHeight() {
return 40+(nScreenHeight() >= 812.0 ? 34.0f : 5.0);
}
CG_INLINE CGFloat kKeyboardHeight() {
if(nScreenHeight() == 812 && nScreenWidth() == 375){
return 291.f;
}else if(nScreenHeight() == 736 && nScreenWidth() == 414){
return 216.f;
}else if(nScreenHeight() == 667 && nScreenWidth() == 375){
return 216.f;
}else if(nScreenHeight() == 568 && nScreenWidth() == 320){
return 253.f;
}else{
return 216.f;
}
}
*/
#pragma mark - ——————— 字体内联方法 ————————
CG_INLINE UIFont *FONTSIZE(CGFloat a) {
return [UIFont fontWithName:@"PingFangSC-Regular" size:a];
}
CG_INLINE UIFont *FONTBOLDSIZE(CGFloat a) {
return [UIFont fontWithName:@"PingFangSC-Semibold" size:a];
}
#pragma mark ————— UICOLOR内联方法 —————
/**
* 输入RGBA值获取颜色
*
* @param r RED值
* @param g GREEN值
* @param b BLUE值
* @param a 透明度
*
* @return UIColor
*/
CG_INLINE UIColor * RGBACOLOR(CGFloat r,CGFloat g,CGFloat b,CGFloat a) {
return [UIColor colorWithRed:(r) / 255.0f green:(g) / 255.0f blue:(b) / 255.0f alpha:(a)];
}
/**
输入RGB值获取颜色
@param r RED值
@param g GREEN值
@param b BLUE值
@return UIColor
*/
CG_INLINE UIColor * RGBCOLOR(CGFloat r,CGFloat g,CGFloat b) {
return [UIColor colorWithRed:(r) / 255.0f green:(g) / 255.0f blue:(b) / 255.0f alpha:1];
}
/**
* 输入16进制值获取颜色
*
* @param rgbValue 16进制值
*
* @return UIColor
*/
CG_INLINE UIColor * HEXCOLOR(NSUInteger rgbValue) {
return [UIColor colorWithRed:(((float)((rgbValue & 0xFF0000) >> 16))) / 255.0f green:((float)((rgbValue & 0xFF00) >> 8)) / 255.0f blue:((float)(rgbValue & 0xFF)) / 255.0f alpha:1];
}
/**
随机颜色
@return 随机颜色
*/
CG_INLINE UIColor * RandomColor() {
return [UIColor colorWithRed:arc4random_uniform(256) / 255.0f green:arc4random_uniform(256) / 255.0f blue:arc4random_uniform(256) / 255.0f alpha:1];
}
#pragma mark ————— 通知中心 —————
/**
通知中心
@return NSNotificationCenter
*/
CG_INLINE NSNotificationCenter * KNOTE() {
return [NSNotificationCenter defaultCenter];
}
/**
通知中心发送通知
@param name 通知名称
@param obj 通知参数
*/
CG_INLINE void KNOTEPost(NSString *name,id obj) {
[[NSNotificationCenter defaultCenter] postNotificationName:name object:obj];
}
/**
通知中心发送通知
@param name 通知名称
@param obj 通知参数
@param userInfo 传递参数
*/
CG_INLINE void KNOTEPostUserInfo(NSString *name,id obj, NSDictionary *userInfo) {
[[NSNotificationCenter defaultCenter] postNotificationName:name object:obj userInfo:userInfo];
}
/**
移除通知监听
@param name 通知名称
*/
CG_INLINE void KNOTERemoveObserver(NSString *name,id _self) {
[[NSNotificationCenter defaultCenter] removeObserver:_self name:name object:nil];
}
/**
添加通知观察者
@param observer 观察对象
@param selector 相应事件
@param name 通知名称
*/
CG_INLINE void KNOTEAddObserver(NSString *name,NSString *selector,id observer) {
[[NSNotificationCenter defaultCenter] addObserver:observer selector:@selector(selector) name:name object:nil];
}
#pragma mark ————— 偏好设置UserDefault —————
/**
用户设置偏好设置
@param keyName 偏好名称
@param object 值
*/
CG_INLINE void UserDefaults_Set_WithKey(NSString *keyName,id object) {
[[NSUserDefaults standardUserDefaults] setObject:object forKey:keyName];
[[NSUserDefaults standardUserDefaults] synchronize];
}
/**
用户设置偏好获取
@param keyName 偏好名称
*/
CG_INLINE id UserDefaults_Get_WithKey(NSString *keyName) {
return [[NSUserDefaults standardUserDefaults] objectForKey:keyName];
}
/**
用户设置偏好删除
@param keyName 偏好名称
*/
CG_INLINE void UserDefaults_Del_WithKey(NSString *keyName) {
[[NSUserDefaults standardUserDefaults] removeObjectForKey:keyName];
[[NSUserDefaults standardUserDefaults] synchronize];
}
#pragma mark ————— 多线程内联函数 —————
//GCD - 一次性执行
CG_INLINE void kDISPATCH_ONCE_BLOCK(dispatch_block_t onceBlock) {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, onceBlock);
}
//GCD - 在Main线程上运行
CG_INLINE void kDISPATCH_MAIN_THREAD(dispatch_block_t block) {
dispatch_async(dispatch_get_main_queue(), block);
}
//GCD - 开启异步线程
CG_INLINE void kDISPATCH_GLOBAL_QUEUE_DEFAULT(dispatch_block_t block) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
}
//GCD - 延时
CG_INLINE void kDISPATCH_AFTER(CGFloat seconds,dispatch_block_t block) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(seconds * NSEC_PER_SEC)), dispatch_get_main_queue(), block);
}
//基础数据转字符串
CG_INLINE NSString *IntegerString(NSInteger integer) {
return [NSString stringWithFormat:@"%li",integer];
}
//CGFloat转字符串
CG_INLINE NSString *FloatString(CGFloat f) {
return [NSString stringWithFormat:@"%.f",f];
}
//弱引用
#define WeakSelf __weak typeof(self) weakSelf = self;
#define StrongSelf __strong typeof(weakSelf) strongSelf = weakSelf;
#ifdef DEBUG
#define NSLog(format, ...) printf("[%s] %s [第%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
#else
#define NSLog(format, ...)
#endif
#endif /* MacroDefinition_h */
//
// PrefixHeader.pch
// CQ_App
//
// Created by mac on 2019/3/20.
// Copyright © 2019年 mac. All rights reserved.
//
#ifndef PrefixHeader_pch
#define PrefixHeader_pch
#pragma mark -----界面相关-----
#import "HomeMainMacro.h"
#pragma mark -----网络相关-----
#import "Interface.h"
#pragma mark -----其他-----
#endif /* PrefixHeader_pch */
//
// UICollectionReusableView+Extension.h
// xiangwan
//
// Created by mac on 2019/8/27.
// Copyright © 2019 mac. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UICollectionReusableView (Extension)
/// Footer Class注册方法
+ (void)registerClassFooterForCollectionView:(UICollectionView *)collectionView;
/// Header Class注册方法
+ (void)registerClassHeaderForCollectionView:(UICollectionView *)collectionView;
/// Footer Nib注册方法
+ (void)registerNibFooterForCollectionView:(UICollectionView *)collectionView;
/// Header Nib注册方法
+ (void)registerNibHeaderForCollectionView:(UICollectionView *)collectionView;
+(instancetype)dequeueReusableSupplementaryHeaderViewOfKind:(UICollectionView *)collectionView index:(NSIndexPath *)indexPath;
+(instancetype)dequeueReusableSupplementaryFooterViewOfKind:(UICollectionView *)collectionView index:(NSIndexPath *)indexPath;
@end
NS_ASSUME_NONNULL_END
//
// UICollectionReusableView+Extension.m
// xiangwan
//
// Created by mac on 2019/8/27.
// Copyright © 2019 mac. All rights reserved.
//
#import "UICollectionReusableView+Extension.h"
@implementation UICollectionReusableView (Extension)
+ (void)registerClassFooterForCollectionView:(UICollectionView *)collectionView {
[collectionView registerClass:self forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:[self identifier]];
}
+ (void)registerNibFooterForCollectionView:(UICollectionView *)collectionView {
[collectionView registerNib:[UINib nibWithNibName:[self className]
bundle:[NSBundle mainBundle]] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:[self identifier]];
}
+ (void)registerNibHeaderForCollectionView:(UICollectionView *)collectionView {
[collectionView registerNib:[UINib nibWithNibName:[self className]
bundle:[NSBundle mainBundle]] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:[self identifier]];
}
+ (void)registerClassHeaderForCollectionView:(UICollectionView *)collectionView {
[collectionView registerClass:self forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:[self identifier]];
}
+ (instancetype)dequeueReusableSupplementaryHeaderViewOfKind:(UICollectionView *)collectionView index:(NSIndexPath *)indexPath{
return [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:[self identifier] forIndexPath:indexPath];
}
+ (instancetype)dequeueReusableSupplementaryFooterViewOfKind:(UICollectionView *)collectionView index:(NSIndexPath *)indexPath {
return [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:[self identifier] forIndexPath:indexPath];
}
+ (NSString *)identifier {
return [NSString stringWithFormat:@"%@Id",[self className]];
}
+ (NSString *)className {
return NSStringFromClass(self);
}
@end
//
// UICollectionViewCell+Extension.h
// xiangwan
//
// Created by mac on 2019/8/17.
// Copyright © 2019 mac. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UICollectionViewCell (Extension)
/// cell Class注册方法
+ (void)registerClassForCollectionView:(UICollectionView *)collectionView;
/// cell Nib注册方法
+ (void)registerNibForCollectionView:(UICollectionView *)collectionView;
+ (NSString *)identifier;
@end
NS_ASSUME_NONNULL_END
//
// UICollectionViewCell+Extension.m
// xiangwan
//
// Created by mac on 2019/8/17.
// Copyright © 2019 mac. All rights reserved.
//
#import "UICollectionViewCell+Extension.h"
@implementation UICollectionViewCell (Extension)
+ (void)registerClassForCollectionView:(UICollectionView *)collectionView {
[collectionView registerClass:self forCellWithReuseIdentifier:[self identifier]];
}
+ (void)registerNibForCollectionView:(UICollectionView *)collectionView {
[collectionView registerNib:[UINib nibWithNibName:[self className]
bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:[self identifier]];
}
+ (NSString *)identifier {
return [NSString stringWithFormat:@"%@Id",[self className]];
}
+ (NSString *)className {
return NSStringFromClass(self);
}
@end
//
// UITableViewCell+Extension.m
// xiangwan
//
// Created by mac on 2019/8/17.
// Copyright © 2019 mac. All rights reserved.
//
#import "UITableViewCell+Extension.h"
@implementation UITableViewCell (Extension)
+ (void)registerClassForTableView:(UITableView *)tableView {
[tableView registerClass:self forCellReuseIdentifier:[self identifier]];
}
+ (void)registerNibForTableView:(UITableView *)tableView {
[tableView registerNib:[UINib nibWithNibName:[self className]
bundle:[NSBundle mainBundle]] forCellReuseIdentifier:[self identifier]];
}
+ (NSString *)identifier {
return [NSString stringWithFormat:@"%@Id",[self className]];
}
+ (NSString *)className {
return NSStringFromClass(self);
}
@end
//
// UITableViewHeaderFooterView+Extension.h
// xiangwan
//
// Created by mac on 2019/10/8.
// Copyright © 2019 mac. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UITableViewHeaderFooterView (Extension)
/// Class注册方法
+ (void)registerClassHeaderFooterForTableView:(UITableView *)tableView;
/// Nib注册方法
+ (void)registerNibHeaderFooterForTableView:(UITableView *)tableView;
+ (NSString *)identifier;
@end
NS_ASSUME_NONNULL_END
//
// UITableViewHeaderFooterView+Extension.m
// xiangwan
//
// Created by mac on 2019/10/8.
// Copyright © 2019 mac. All rights reserved.
//
#import "UITableViewHeaderFooterView+Extension.h"
@implementation UITableViewHeaderFooterView (Extension)
+ (void)registerClassHeaderFooterForTableView:(UITableView *)tableView {
[tableView registerClass:self forHeaderFooterViewReuseIdentifier:[self identifier]];
}
+ (void)registerNibHeaderFooterForTableView:(UITableView *)tableView {
[tableView registerNib:[UINib nibWithNibName:[self className]
bundle:[NSBundle mainBundle]] forHeaderFooterViewReuseIdentifier:[self identifier]];
}
+ (NSString *)identifier {
return [NSString stringWithFormat:@"%@Id",[self className]];
}
+ (NSString *)className {
return NSStringFromClass(self);
}
@end
//
// UIImage+Extension.h
// xiangwan
//
// Created by mac on 2019/8/5.
// Copyright © 2019 mac. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIImage (Extension)
+ (UIImage *)imageWithColor:(UIColor *)color;
// 生成二维码
+ (UIImage *)generateQRCode:(NSString *)code size:(CGSize)size;
//生成一个圆角图片
- (UIImage *)circleImage;
///毛玻璃
- (UIImage *)blurryImage:(UIImage *)image withBlurLevel:(CGFloat)blur;
///根据颜色和圆的半径来创建一个圆形图片
+ (UIImage *)createImageWithColor:(UIColor *)color radius:(CGFloat)radius;
///根据一个view来创建一个 Image
+ (UIImage*)creatImageWithView:(UIView *)theView;
/**
图片组 本地
@param array 原生image arr
@param bgColor 新生成image 背景色
@return image 组合
*/
+ (UIImage *)groupIconWith:(NSArray *)array bgColor:(UIColor *)bgColor;
/**
图片组 本地
@param corner 新生成组合图片背景圆角
@param array 原生image arr
@param bgColor 新生成image 背景色
@return image 组合
*/
+ (UIImage *)groupIconWith:(NSArray *)array corner:(CGFloat)corner bgColor:(UIColor *)bgColor;
/**
图片组合 网络请求,使用SD缓存到本地磁盘,请求前先去缓存中哈希查找是否有缓存
@param URLArray 图片url 数组
@param corner 新生成组合图片背景圆角
@param bgColor 新生成组合图片背景颜色
@param Success 组合成功回调
@param Failed 组合失败回调
*/
+ (void )groupIconWithURLArray:(NSArray *)URLArray
corner:(CGFloat)corner
bgColor:(UIColor *)bgColor
Success:(void(^)(UIImage *image))Success
Failed:(void(^)(NSString *fail))Failed;
/**
图片组合 网络请求,使用SD缓存到本地磁盘,请求前先去缓存中哈希查找是否有缓存
@param URLArray 图片url 数组
@param bgColor 新生成组合图片背景颜色
@param Success 组合成功回调
@param Failed 组合失败回调
*/
+ (void)groupIconWithURLArray:(NSArray *)URLArray
bgColor:(UIColor *)bgColor
Success:(void(^)(UIImage *image))Success
Failed:(void(^)(NSString *fail))Failed;
/// 旋转90度
- (UIImage *)normalizedImage;
/// 压缩图片使图片文件小于指定大小
- (NSData *)compressWithMaxLength:(NSUInteger)maxLength;
/**
缓存图片到SDWebImage
@param url 图片url(如:files/activityPic/xxxx/xxx.jpg)
*/
- (void)cacheImageWithUrl:(NSString *)url;
@end
NS_ASSUME_NONNULL_END
//
// UIImage+Extension.m
// xiangwan
//
// Created by mac on 2019/8/5.
// Copyright © 2019 mac. All rights reserved.
//
#import "UIImage+Extension.h"
#import <Accelerate/Accelerate.h>
#import <SDWebImage/SDWebImage.h>
static NSString *QiInputCorrectionLevelL = @"L";//!< L: 7%
static NSString *QiInputCorrectionLevelM = @"M";//!< M: 15%
static NSString *QiInputCorrectionLevelQ = @"Q";//!< Q: 25%
static NSString *QiInputCorrectionLevelH = @"H";//!< H: 30%
@implementation UIImage (Extension)
/* 生成一个圆角图片 */
- (UIImage *)circleImage {
//裁剪图片:获取图形上下文
//1.开启图形上下文 scale:比例因素 点:像素比例 填0:自动识别比例因素
UIGraphicsBeginImageContextWithOptions(self.size, NO, 0);
//2.描述圆形裁剪区域
UIBezierPath *clipPath = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, self.size.width, self.size.height)];
//3.设置为裁剪区域
[clipPath addClip];
//4.画图片
[self drawAtPoint:CGPointZero];
//5.取出图片
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
//6.关闭上下文
UIGraphicsEndImageContext();
return image;
}
+ (UIImage *)imageWithColor:(UIColor *)color {
CGRect rect = CGRectMake(0, 0, 1.0f, 1.0f);
// 开启位图上下文
UIGraphicsBeginImageContext(rect.size);
// 开启上下文
CGContextRef ref = UIGraphicsGetCurrentContext();
// 使用color演示填充上下文
CGContextSetFillColorWithColor(ref, color.CGColor);
// 渲染上下文
CGContextFillRect(ref, rect);
// 从上下文中获取图片
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
// 结束上下文
UIGraphicsEndImageContext();
return image;
}
// 生成二维码
+ (UIImage *)generateQRCode:(NSString *)code size:(CGSize)size {
NSData *codeData = [code dataUsingEncoding:NSUTF8StringEncoding];
// 使用CIQRCodeGenerator创建filter
CIFilter *filter = [CIFilter filterWithName:@"CIQRCodeGenerator" withInputParameters:@{@"inputMessage": codeData, @"inputCorrectionLevel": QiInputCorrectionLevelL}];
// 由filter.outputImage直接转成的UIImage不太清楚,需要做高清处理
UIImage *codeImage = [self scaleImage:filter.outputImage toSize:size];
return codeImage;
}
// 缩放图片(生成高质量图片)
+ (UIImage *)scaleImage:(CIImage *)image toSize:(CGSize)size {
//! 将CIImage转成CGImageRef
CGRect integralRect = image.extent;// CGRectIntegral(image.extent);// 将rect取整后返回,origin取舍,size取入
CGImageRef imageRef = [[CIContext context] createCGImage:image fromRect:integralRect];
//! 创建上下文
CGFloat sideScale = fminf(size.width / integralRect.size.width, size.width / integralRect.size.height) * [UIScreen mainScreen].scale;// 计算需要缩放的比例
size_t contextRefWidth = ceilf(integralRect.size.width * sideScale);
size_t contextRefHeight = ceilf(integralRect.size.height * sideScale);
CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceGray();
CGContextRef contextRef = CGBitmapContextCreate(nil, contextRefWidth, contextRefHeight, 8, 0, colorSpaceRef, (CGBitmapInfo)kCGImageAlphaNone);// 灰度、不透明
CGColorSpaceRelease(colorSpaceRef);
CGContextSetInterpolationQuality(contextRef, kCGInterpolationNone);// 设置上下文无插值
CGContextScaleCTM(contextRef, sideScale, sideScale);// 设置上下文缩放
CGContextDrawImage(contextRef, integralRect, imageRef);// 在上下文中的integralRect中绘制imageRef
CGImageRelease(imageRef);
//! 从上下文中获取CGImageRef
CGImageRef scaledImageRef = CGBitmapContextCreateImage(contextRef);
CGContextRelease(contextRef);
//! 将CGImageRefc转成UIImage
UIImage *scaledImage = [UIImage imageWithCGImage:scaledImageRef scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp];
CGImageRelease(scaledImageRef);
return scaledImage;
}
///毛玻璃
- (UIImage *)blurryImage:(UIImage *)image withBlurLevel:(CGFloat)blur {
if (blur < 0.f || blur > 1.f) {
blur = 0.5f;
}
int boxSize = (int)(blur * 40);
boxSize = boxSize - (boxSize % 2) + 1;
CGImageRef img = image.CGImage;
vImage_Buffer inBuffer, outBuffer;
vImage_Error error;
void *pixelBuffer;
CGDataProviderRef inProvider = CGImageGetDataProvider(img);
CFDataRef inBitmapData = CGDataProviderCopyData(inProvider);
inBuffer.width = CGImageGetWidth(img);
inBuffer.height = CGImageGetHeight(img);
inBuffer.rowBytes = CGImageGetBytesPerRow(img);
inBuffer.data = (void*)CFDataGetBytePtr(inBitmapData);
pixelBuffer = malloc(CGImageGetBytesPerRow(img) *
CGImageGetHeight(img));
if(pixelBuffer == NULL) NSLog(@"No pixelbuffer");
outBuffer.data = pixelBuffer;
outBuffer.width = CGImageGetWidth(img);
outBuffer.height = CGImageGetHeight(img);
outBuffer.rowBytes = CGImageGetBytesPerRow(img);
error = vImageBoxConvolve_ARGB8888(&inBuffer,
&outBuffer,
NULL,
0,
0,
boxSize,
boxSize,
NULL,
kvImageEdgeExtend);
if (error) {
NSLog(@"error from convolution %ld", error);
}
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef ctx = CGBitmapContextCreate(
outBuffer.data,
outBuffer.width,
outBuffer.height,
8,
outBuffer.rowBytes,
colorSpace,
kCGImageAlphaNoneSkipLast);
CGImageRef imageRef = CGBitmapContextCreateImage (ctx);
UIImage *returnImage = [UIImage imageWithCGImage:imageRef];
//clean up
CGContextRelease(ctx);
CGColorSpaceRelease(colorSpace);
free(pixelBuffer);
CFRelease(inBitmapData);
CGImageRelease(imageRef);
return returnImage;
}
//根据颜色和圆的半径来创建一个圆形图片
+ (UIImage *)createImageWithColor:(UIColor *)color radius:(CGFloat)radius{
CGRect rect = CGRectMake(0.0f, 0.0f,radius * 2 + 4, radius * 2 + 4);
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0.0);
CGContextRef context =UIGraphicsGetCurrentContext();
CGContextSetRGBStrokeColor(context,1,1,1,1.0);//画笔线的颜色
CGContextSetFillColorWithColor(context, color.CGColor);//填充颜色
CGContextSetLineWidth(context, 4.0);//线的宽度
CGContextAddArc(context, radius + 2,radius + 2, radius, 0, 2*3.14159265358979323846, 0); //添加一个圆
CGContextDrawPath(context, kCGPathFillStroke); //绘制路径加填充
UIImage *myImage =UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return myImage;
}
//根据一个view来创建一个 Image
+ (UIImage*)creatImageWithView:(UIView *)theView {
CGRect rect = theView.frame;
UIGraphicsBeginImageContextWithOptions(rect.size, NO, [UIScreen mainScreen].scale);
CGContextRef context = UIGraphicsGetCurrentContext();
[theView.layer renderInContext:context];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
/**
图片组合 网络请求,使用SD缓存到本地磁盘,请求前先去缓存中哈希查找是否有缓存
@param URLArray 图片url 数组
@param corner 新生成组合图片背景圆角
@param bgColor 新生成组合图片背景颜色
@param Success 组合成功回调
@param Failed 组合失败回调
*/
+(void)groupIconWithURLArray:(NSArray *)URLArray
corner:(CGFloat)corner
bgColor:(UIColor *)bgColor
Success:(void(^)(UIImage *image))Success
Failed:(void(^)(NSString *fail))Failed
{
UIImage *cacheImage;
NSString *cacheKey = [URLArray componentsJoinedByString:@"-"];
SDImageCache* cache = [SDImageCache sharedImageCache];
//此方法会先从memory中取。
cacheImage = [cache imageFromDiskCacheForKey:cacheKey];
if (cacheImage) {
if (Success) {
Success(cacheImage);
}
return;
}
UIImageView *imageView = [[UIImageView alloc] init];
NSMutableArray *imageArray = [NSMutableArray array];
dispatch_group_t g = dispatch_group_create();
dispatch_queue_t globalQueue=dispatch_get_global_queue(0, 0);
__block BOOL loadFail = NO;
//3.添加任务,让队列调度,任务执行情况,最后通知调度组
for (int i = 0; i<URLArray.count; i++) {
NSURL *url = [NSURL URLWithString:URLArray[i]];
//请求
dispatch_group_enter(g);
dispatch_group_async(g, globalQueue, ^{
NSLog(@"task %d%@",i,[NSThread currentThread]);
NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:url];
//此方法会先从memory中取
UIImage *imageToShare = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:key];
if (!imageToShare){
NSData *data = [NSData dataWithContentsOfURL:url];
imageToShare = [UIImage imageWithData:data];
}
if (imageToShare) {
[imageArray addObject:imageToShare];
}else{
NSLog(@"imageToShare 为空");
loadFail = YES;
}
dispatch_group_leave(g);
});
}
//4.所有任务执行完毕后,通知调度组
//用一个调度组,可以监听全局队列的任务,主队列去执行最后的任务
//dispatch_group_notify 本身也是异步的!
dispatch_group_notify(g, dispatch_get_main_queue(), ^{
//更新UI,通知用户
// NSLog(@"OK更新UI,通知用户 %@",[NSThread currentThread]);
imageView.image = [UIImage groupIconWith:imageArray corner:corner bgColor:[UIColor groupTableViewBackgroundColor]];
[[SDImageCache sharedImageCache] storeImage:imageView.image forKey:cacheKey toDisk:YES completion:^{
NSLog(@"缓存图片成功%@",[NSThread currentThread]);
}];
if (Success) {
Success(imageView.image);
}
if (Failed && loadFail) {
Failed(@"头像下载失败");
[[SDImageCache sharedImageCache] removeImageForKey:cacheKey fromDisk:YES withCompletion:^{
NSLog(@"清空失败的默认图片");
}];
}
});
// NSLog(@"come %@", [NSThread currentThread]);
}
+ (void)groupIconWithURLArray:(NSArray *)URLArray
bgColor:(UIColor *)bgColor
Success:(void(^)(UIImage *image))Success
Failed:(void(^)(NSString *fail))Failed
{
UIImage *cacheImage;
NSString *cacheKey = [URLArray componentsJoinedByString:@"-"];
SDImageCache* cache = [SDImageCache sharedImageCache];
//此方法会先从memory中取。
cacheImage = [cache imageFromDiskCacheForKey:cacheKey];
if (cacheImage) {
if (Success) {
Success(cacheImage);
}
return;
}
UIImageView *imageView = [[UIImageView alloc] init];
NSMutableArray *imageArray = [NSMutableArray array];
__block BOOL loadFail = NO;
dispatch_group_t g = dispatch_group_create();
dispatch_queue_t globalQueue=dispatch_get_global_queue(0, 0);
//3.添加任务,让队列调度,任务执行情况,最后通知调度组
for (int i = 0; i<URLArray.count; i++) {
NSURL *url = [NSURL URLWithString:URLArray[i]];
//请求
dispatch_group_enter(g);
dispatch_group_async(g, globalQueue, ^{
NSLog(@"task %d%@",i,[NSThread currentThread]);
NSString *key = [[SDWebImageManager sharedManager] cacheKeyForURL:url];
//此方法会先从memory中取
UIImage *imageToShare = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:key];
if (!imageToShare){
NSData *data = [NSData dataWithContentsOfURL:url];
imageToShare = [UIImage imageWithData:data];
}
if (imageToShare) {
[imageArray addObject:imageToShare];
}else{
NSLog(@"imageToShare 为空");
loadFail = YES;
}
dispatch_group_leave(g);
});
}
//4.所有任务执行完毕后,通知调度组
//用一个调度组,可以监听全局队列的任务,主队列去执行最后的任务
//dispatch_group_notify 本身也是异步的!
dispatch_group_notify(g, dispatch_get_main_queue(), ^{
//更新UI,通知用户
// NSLog(@"OK更新UI,通知用户 %@",[NSThread currentThread]);
imageView.image = [UIImage groupIconWith:imageArray bgColor:[UIColor groupTableViewBackgroundColor]];
[[SDImageCache sharedImageCache] storeImage:imageView.image forKey:cacheKey toDisk:YES completion:^{
NSLog(@"缓存图片成功%@",[NSThread currentThread]);
}];
if (Success) {
Success(imageView.image);
}
if (Failed && loadFail) {
Failed(@"头像下载失败");
[[SDImageCache sharedImageCache] removeImageForKey:cacheKey fromDisk:YES withCompletion:^{
NSLog(@"清空失败的默认图片");
}];
}
});
// NSLog(@"come %@", [NSThread currentThread]);
}
+ (UIImage *)groupIconWith:(NSArray *)array bgColor:(UIColor *)bgColor {
CGSize finalSize = CGSizeMake(100, 100);
CGRect rect = CGRectZero;
rect.size = finalSize;
UIGraphicsBeginImageContext(finalSize);
if (bgColor) {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, bgColor.CGColor);
CGContextSetFillColorWithColor(context, bgColor.CGColor);
CGContextSetLineWidth(context, 1.0);
CGContextMoveToPoint(context, 0, 0);
CGContextAddLineToPoint(context, 0, 100);
CGContextAddLineToPoint(context, 100, 100);
CGContextAddLineToPoint(context, 100, 0);
CGContextAddLineToPoint(context, 0, 0);
CGContextClosePath(context);
CGContextDrawPath(context, kCGPathFillStroke);
}
if (array.count >= 2) {
NSArray *rects = [self eachRectInGroupWithCount2:array.count];
int count = 0;
for (id obj in array) {
if (count > rects.count-1) {
break;
}
UIImage *image;
if ([obj isKindOfClass:[NSString class]]) {
image = [UIImage imageNamed:(NSString *)obj];
} else if ([obj isKindOfClass:[UIImage class]]){
image = (UIImage *)obj;
} else {
NSLog(@"%s Unrecognizable class type", __FUNCTION__);
break;
}
CGRect rect = CGRectFromString([rects objectAtIndex:count]);
[image drawInRect:rect];
count++;
}
}
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
+ (UIImage *)groupIconWith:(NSArray *)array corner:(CGFloat)cornerRadius bgColor:(UIColor *)bgColor {
CGSize finalSize = CGSizeMake(100, 100);
CGRect rect = CGRectZero;
rect.size = finalSize;
UIGraphicsBeginImageContext(finalSize);
if (bgColor) {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, bgColor.CGColor);
CGContextSetFillColorWithColor(context, bgColor.CGColor);
/*画圆角矩形*/
CGSize rectSize = finalSize;
CGContextMoveToPoint(context, rectSize.width, cornerRadius * 2); // 开始坐标右边开始
CGContextAddArcToPoint(context, rectSize.width, rectSize.height, rectSize.width - 10, rectSize.height, cornerRadius); // 右下角
CGContextAddArcToPoint(context, 0, rectSize.height, 0, rectSize.height - 10, cornerRadius); // 左下角
CGContextAddArcToPoint(context, 0, 0, cornerRadius * 2, 0, cornerRadius); // 左上角
CGContextAddArcToPoint(context, rectSize.width, 0, rectSize.width, cornerRadius * 2, cornerRadius); // 右上角
CGContextClosePath(context);
CGContextDrawPath(context, kCGPathFillStroke);
}
if (array.count >= 2) {
NSArray *rects = [self eachRectInGroupWithCount2:array.count];
int count = 0;
for (id obj in array) {
if (count > rects.count-1) {
break;
}
UIImage *image;
if ([obj isKindOfClass:[NSString class]]) {
image = [UIImage imageNamed:(NSString *)obj];
} else if ([obj isKindOfClass:[UIImage class]]){
image = (UIImage *)obj;
} else {
NSLog(@"%s Unrecognizable class type", __FUNCTION__);
break;
}
CGRect rect = CGRectFromString([rects objectAtIndex:count]);
[image drawInRect:rect];
count++;
}
}
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
+ (NSArray *)eachRectInGroupWithCount:(NSInteger)count {
NSArray *rects = nil;
CGFloat sizeValue = 100;
CGFloat padding = 8;
CGFloat eachWidth = (sizeValue - padding*3) / 2;
CGRect rect1 = CGRectMake(sizeValue/2 - eachWidth/2, padding, eachWidth, eachWidth);
CGRect rect2 = CGRectMake(padding, padding*2 + eachWidth, eachWidth, eachWidth);
CGRect rect3 = CGRectMake(padding*2 + eachWidth, padding*2 + eachWidth, eachWidth, eachWidth);
if (count == 3) {
rects = @[NSStringFromCGRect(rect1), NSStringFromCGRect(rect2), NSStringFromCGRect(rect3)];
} else if (count == 4) {
CGRect rect0 = CGRectMake(padding, padding, eachWidth, eachWidth);
rect1 = CGRectMake(padding*2, padding, eachWidth, eachWidth);
rects = @[NSStringFromCGRect(rect0), NSStringFromCGRect(rect1), NSStringFromCGRect(rect2), NSStringFromCGRect(rect3)];
}
return rects;
}
+ (NSArray *)eachRectInGroupWithCount2:(NSInteger)count {
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:count];
CGFloat sizeValue = 100;
CGFloat padding = 2;
CGFloat eachWidth;
if (count <= 4) {
eachWidth = (sizeValue - padding*3) / 2;
[self getRects:array padding:padding width:eachWidth count:4];
} else {
padding = padding / 2;
eachWidth = (sizeValue - padding*4) / 3;
[self getRects:array padding:padding width:eachWidth count:9];
}
if (count < 4) {
[array removeObjectAtIndex:0];
CGRect rect = CGRectFromString([array objectAtIndex:0]);
rect.origin.x = (sizeValue - eachWidth) / 2;
[array replaceObjectAtIndex:0 withObject:NSStringFromCGRect(rect)];
if (count == 2) {
[array removeObjectAtIndex:0];
NSMutableArray *tempArray = [[NSMutableArray alloc] initWithCapacity:2];
for (NSString *rectStr in array) {
CGRect rect = CGRectFromString(rectStr);
rect.origin.y -= (padding+eachWidth)/2;
[tempArray addObject:NSStringFromCGRect(rect)];
}
[array removeAllObjects];
[array addObjectsFromArray:tempArray];
}
} else if (count != 4 && count <= 6) {
[array removeObjectsInRange:NSMakeRange(0, 3)];
NSMutableArray *tempArray = [[NSMutableArray alloc] initWithCapacity:6];
for (NSString *rectStr in array) {
CGRect rect = CGRectFromString(rectStr);
rect.origin.y -= (padding+eachWidth)/2;
[tempArray addObject:NSStringFromCGRect(rect)];
}
[array removeAllObjects];
[array addObjectsFromArray:tempArray];
if (count == 5) {
[tempArray removeAllObjects];
[array removeObjectAtIndex:0];
for (int i=0; i<2; i++) {
CGRect rect = CGRectFromString([array objectAtIndex:i]);
rect.origin.x -= (padding+eachWidth)/2;
[tempArray addObject:NSStringFromCGRect(rect)];
}
[array replaceObjectsInRange:NSMakeRange(0, 2) withObjectsFromArray:tempArray];
}
} else if (count != 4 && count < 9) {
if (count == 8) {
[array removeObjectAtIndex:0];
NSMutableArray *tempArray = [[NSMutableArray alloc] initWithCapacity:2];
for (int i=0; i<2; i++) {
CGRect rect = CGRectFromString([array objectAtIndex:i]);
rect.origin.x -= (padding+eachWidth)/2;
[tempArray addObject:NSStringFromCGRect(rect)];
}
[array replaceObjectsInRange:NSMakeRange(0, 2) withObjectsFromArray:tempArray];
} else {
[array removeObjectAtIndex:2];
[array removeObjectAtIndex:0];
}
}
return array;
}
+ (void)getRects:(NSMutableArray *)array padding:(CGFloat)padding width:(CGFloat)eachWidth count:(int)count {
for (int i=0; i<count; i++) {
int sqrtInt = (int)sqrt(count);
int line = i%sqrtInt;
int row = i/sqrtInt;
CGRect rect = CGRectMake(padding * (line+1) + eachWidth * line, padding * (row+1) + eachWidth * row, eachWidth, eachWidth);
[array addObject:NSStringFromCGRect(rect)];
}
}
/// 旋转90度
- (UIImage *)normalizedImage{
if (self.imageOrientation == UIImageOrientationUp) return self;
UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale);
[self drawInRect:(CGRect){0, 0, self.size}];
UIImage *normalizedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return normalizedImage;
}
-(NSData *)compressWithMaxLength:(NSUInteger)maxLength{
// Compress by quality
CGFloat compression = 1;
NSData *data = UIImageJPEGRepresentation(self, compression);
//NSLog(@"Before compressing quality, image size = %ld KB",data.length/1024);
if (data.length < maxLength) return data;
CGFloat max = 1;
CGFloat min = 0;
for (int i = 0; i < 6; ++i) {
compression = (max + min) / 2;
data = UIImageJPEGRepresentation(self, compression);
//NSLog(@"Compression = %.1f", compression);
//NSLog(@"In compressing quality loop, image size = %ld KB", data.length / 1024);
if (data.length < maxLength * 0.9) {
min = compression;
} else if (data.length > maxLength) {
max = compression;
} else {
break;
}
}
//NSLog(@"After compressing quality, image size = %ld KB", data.length / 1024);
if (data.length < maxLength) return data;
UIImage *resultImage = [UIImage imageWithData:data];
// Compress by size
NSUInteger lastDataLength = 0;
while (data.length > maxLength && data.length != lastDataLength) {
lastDataLength = data.length;
CGFloat ratio = (CGFloat)maxLength / data.length;
//NSLog(@"Ratio = %.1f", ratio);
CGSize size = CGSizeMake((NSUInteger)(resultImage.size.width * sqrtf(ratio)),
(NSUInteger)(resultImage.size.height * sqrtf(ratio))); // Use NSUInteger to prevent white blank
UIGraphicsBeginImageContext(size);
[resultImage drawInRect:CGRectMake(0, 0, size.width, size.height)];
resultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
data = UIImageJPEGRepresentation(resultImage, compression);
//NSLog(@"In compressing size loop, image size = %ld KB", data.length / 1024);
}
//NSLog(@"After compressing size loop, image size = %ld KB", data.length / 1024);
return data;
}
/// 缓存图片到SDWebImage
- (void)cacheImageWithUrl:(NSString *)url {
[[SDImageCache sharedImageCache] storeImage:self forKey:url toDisk:YES completion:^{
NSLog(@"缓存图片成功 %@",url);
}];
}
@end
// //
// AttributLabel.h // AttributLabel.h
// CQ_App
// //
// Created by mac on 2019/6/25. // Created by mac on 2019/6/25.
// Copyright © 2019 mac. All rights reserved. // Copyright © 2019 mac. All rights reserved.
......
// //
// AttributLabel.m // AttributLabel.m
// CQ_App
// //
// Created by mac on 2019/6/25. // Created by mac on 2019/6/25.
// Copyright © 2019 mac. All rights reserved. // Copyright © 2019 mac. All rights reserved.
// //
#import "AttributLabel.h" #import "AttributLabel.h"
#import "MacroDefinition.h" #import <NMCategories/NMCategories.h>
@implementation AttributLabel @implementation AttributLabel
-(void)setSolidString:(NSString *)solidString { -(void)setSolidString:(NSString *)solidString {
_solidString = solidString; _solidString = solidString;
NSAttributedString *attrStr = [[NSAttributedString alloc]initWithString:solidString attributes: @{NSFontAttributeName:FONTSIZE(12.0f),NSForegroundColorAttributeName:[UIColor redColor],NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle|NSUnderlinePatternSolid),NSStrikethroughColorAttributeName:[UIColor redColor]}];
NSAttributedString *attrStr = [[NSAttributedString alloc]initWithString:solidString attributes: @{NSFontAttributeName:FONTSIZE(14),NSForegroundColorAttributeName:[UIColor redColor],NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle|NSUnderlinePatternSolid),NSStrikethroughColorAttributeName:[UIColor redColor]}];
self.attributedText = attrStr; self.attributedText = attrStr;
} }
......
//
// QMUIConfigurationTemplate.h
//
// Created by QMUI Team on 15/3/29.
// Copyright (c) 2015年 QMUI Team. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <QMUIKit/QMUIKit.h>
#import <NMTheme/NMThemeProtocol.h>
/**
* QMUIConfigurationTemplate 是一份配置表,用于配合 QMUIConfiguration 来管理整个 App 的全局样式,使用方式:
* 在 QMUI 项目代码的文件夹里找到 QMUIConfigurationTemplate 目录,把里面所有文件复制到自己项目里,保证能被编译到即可,不需要在某些地方 import,也不需要手动运行。
*
* @warning 更新 QMUIKit 的版本时,请留意 Release Log 里是否有提醒更新配置表,请尽量保持自己项目里的配置表与 QMUIKit 里的配置表一致,避免遗漏新的属性。
* @warning 配置表的 class 名必须以 QMUIConfigurationTemplate 开头,并且实现 <QMUIConfigurationTemplateProtocol>,因为这两者是 QMUI 识别该 NSObject 是否为一份配置表的条件。
* @warning QMUI 2.3.0 之后,配置表改为自动运行,不需要再在某个地方手动运行了。
*/
@interface QMUIConfigurationTemplate : NSObject<NMThemeProtocol>
@end
//
// QMUIConfigurationTemplate.m
// qmui
//
// Created by QMUI Team on 15/3/29.
// Copyright (c) 2015年 QMUI Team. All rights reserved.
//
#import "QMUIConfigurationTemplate.h"
#import <NMTheme/NMThemeManager.h>
#import <NMTheme/NMCommonUI.h>
@implementation QMUIConfigurationTemplate
static UIImage *disclosureIndicatorImage;
static UIImage *disclosureIndicatorImageDark;
#pragma mark - <QMUIConfigurationTemplateProtocol>
- (void)applyConfigurationTemplate {
if (!disclosureIndicatorImage) disclosureIndicatorImage = [UIImage qmui_imageWithShape:QMUIImageShapeDisclosureIndicator size:CGSizeMake(6, 10) lineWidth:1 tintColor:UIColorGray7];
if (!disclosureIndicatorImageDark) disclosureIndicatorImageDark = [UIImage qmui_imageWithShape:QMUIImageShapeDisclosureIndicator size:CGSizeMake(6, 10) lineWidth:1 tintColor:UIColorMake(98, 100, 104)];
// === 修改配置值 === //
#pragma mark - Global Color
QMUICMI.clearColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0]; // UIColorClear : 透明色
QMUICMI.whiteColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:1]; // UIColorWhite : 白色(不用 [UIColor whiteColor] 是希望保持颜色空间为 RGB)
QMUICMI.blackColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1]; // UIColorBlack : 黑色(不用 [UIColor blackColor] 是希望保持颜色空间为 RGB)
QMUICMI.grayColor = UIColorGray4; // UIColorGray : 最常用的灰色
QMUICMI.grayDarkenColor = UIColor.nm_mainTextColor; // UIColorGrayDarken : 深一点的灰色
QMUICMI.grayLightenColor = UIColorGray7; // UIColorGrayLighten : 浅一点的灰色
QMUICMI.redColor = UIColorMake(250, 58, 58); // UIColorRed : 红色
QMUICMI.greenColor = UIColorTheme4; // UIColorGreen : 绿色
QMUICMI.blueColor = UIColorTheme6; // UIColorBlue : 蓝色
QMUICMI.yellowColor = UIColorTheme3; // UIColorYellow : 黄色
QMUICMI.linkColor = UIColorMake(56, 116, 171); // UIColorLink : 文字链接颜色
QMUICMI.disabledColor = UIColorGray; // UIColorDisabled : 全局 disabled 的颜色,一般用于 UIControl 等控件
QMUICMI.backgroundColor = UIColor.nm_backgroundColor; // UIColorForBackground : 界面背景色,默认用于 QMUICommonViewController.view 的背景色
QMUICMI.maskDarkColor = UIColorMakeWithRGBA(0, 0, 0, .35f); // UIColorMask : 深色的背景遮罩,默认用于 QMAlertController、QMUIDialogViewController 等弹出控件的遮罩
QMUICMI.maskLightColor = UIColorMakeWithRGBA(255, 255, 255, .5f); // UIColorMaskWhite : 浅色的背景遮罩,QMUIKit 里默认没用到,只是占个位
QMUICMI.separatorColor = UIColor.nm_separatorColor; // UIColorSeparator : 全局默认的分割线颜色,默认用于列表分隔线颜色、UIView (QMUIBorder) 分隔线颜色
QMUICMI.separatorDashedColor = UIColorMake(17, 17, 17); // UIColorSeparatorDashed : 全局默认的虚线分隔线的颜色,默认 QMUIKit 暂时没用到
QMUICMI.placeholderColor = UIColor.nm_placeholderColor; // UIColorPlaceholder,全局的输入框的 placeholder 颜色,默认用于 QMUITextField、QMUITextView,不影响系统 UIKit 的输入框
#pragma mark - UIControl
QMUICMI.controlHighlightedAlpha = 0.5f; // UIControlHighlightedAlpha : UIControl 系列控件在 highlighted 时的 alpha,默认用于 QMUIButton、 QMUINavigationTitleView
QMUICMI.controlDisabledAlpha = 0.5f; // UIControlDisabledAlpha : UIControl 系列控件在 disabled 时的 alpha,默认用于 QMUIButton
#pragma mark - UIButton
QMUICMI.buttonHighlightedAlpha = UIControlHighlightedAlpha; // ButtonHighlightedAlpha : QMUIButton 在 highlighted 时的 alpha,不影响系统的 UIButton
QMUICMI.buttonDisabledAlpha = UIControlDisabledAlpha; // ButtonDisabledAlpha : QMUIButton 在 disabled 时的 alpha,不影响系统的 UIButton
QMUICMI.buttonTintColor = UIColor.nm_tintColor; // ButtonTintColor : QMUIButton 默认的 tintColor,不影响系统的 UIButton
QMUICMI.ghostButtonColorBlue = UIColorBlue; // GhostButtonColorBlue : QMUIGhostButtonColorBlue 的颜色
QMUICMI.ghostButtonColorRed = UIColorRed; // GhostButtonColorRed : QMUIGhostButtonColorRed 的颜色
QMUICMI.ghostButtonColorGreen = UIColorGreen; // GhostButtonColorGreen : QMUIGhostButtonColorGreen 的颜色
QMUICMI.ghostButtonColorGray = UIColorGray; // GhostButtonColorGray : QMUIGhostButtonColorGray 的颜色
QMUICMI.ghostButtonColorWhite = UIColorWhite; // GhostButtonColorWhite : QMUIGhostButtonColorWhite 的颜色
QMUICMI.fillButtonColorBlue = UIColorBlue; // FillButtonColorBlue : QMUIFillButtonColorBlue 的颜色
QMUICMI.fillButtonColorRed = UIColorRed; // FillButtonColorRed : QMUIFillButtonColorRed 的颜色
QMUICMI.fillButtonColorGreen = UIColorGreen; // FillButtonColorGreen : QMUIFillButtonColorGreen 的颜色
QMUICMI.fillButtonColorGray = UIColorGray; // FillButtonColorGray : QMUIFillButtonColorGray 的颜色
QMUICMI.fillButtonColorWhite = UIColorWhite; // FillButtonColorWhite : QMUIFillButtonColorWhite 的颜色
#pragma mark - TextInput
QMUICMI.textFieldTextColor = UIColor.nm_titleTextColor; // TextFieldTextColor : QMUITextField、QMUITextView 的 textColor,不影响 UIKit 的输入框
QMUICMI.textFieldTintColor = UIColor.nm_tintColor; // TextFieldTintColor : QMUITextField、QMUITextView 的 tintColor,不影响 UIKit 的输入框
QMUICMI.textFieldTextInsets = UIEdgeInsetsMake(0, 7, 0, 7); // TextFieldTextInsets : QMUITextField 的内边距,不影响 UITextField
QMUICMI.keyboardAppearance = UIKeyboardAppearanceDefault; // KeyboardAppearance : UITextView、UITextField、UISearchBar 的 keyboardAppearance
#pragma mark - UISwitch
QMUICMI.switchOnTintColor = UIColor.nm_tintColor; // SwitchOnTintColor : UISwitch 打开时的背景色(除了圆点外的其他颜色)
QMUICMI.switchOffTintColor = UIColor.nm_separatorColor; // SwitchOffTintColor : UISwitch 关闭时的背景色(除了圆点外的其他颜色)
QMUICMI.switchTintColor = SwitchOnTintColor; // SwitchTintColor : UISwitch 关闭时的周围边框颜色
QMUICMI.switchThumbTintColor = nil; // SwitchThumbTintColor : UISwitch 中间的操控圆点的颜色
#pragma mark - NavigationBar
QMUICMI.navBarHighlightedAlpha = 0.2f; // NavBarHighlightedAlpha : QMUINavigationButton 在 highlighted 时的 alpha
QMUICMI.navBarDisabledAlpha = 0.2f; // NavBarDisabledAlpha : QMUINavigationButton 在 disabled 时的 alpha
QMUICMI.navBarButtonFont = UIFontMake(17); // NavBarButtonFont : QMUINavigationButtonTypeNormal 的字体(由于系统存在一些 bug,这个属性默认不对 UIBarButtonItem 生效)
QMUICMI.navBarButtonFontBold = UIFontBoldMake(17); // NavBarButtonFontBold : QMUINavigationButtonTypeBold 的字体
QMUICMI.navBarBackgroundImage = nil;
//QMUICMI.navBarBackgroundImage = [UIImageMake(@"navigationbar_background") resizableImageWithCapInsets:UIEdgeInsetsMake(0, 1, 0, 1) resizingMode:UIImageResizingModeStretch]; // NavBarBackgroundImage : UINavigationBar 的背景图,注意 navigationBar 的高度会受多个因素(是否全面屏、是否使用了 navigationItem.prompt、是否将 UISearchBar 作为 titleView)的影响,要检查各种情况是否都显示正常。
QMUICMI.navBarShadowImage = nil; // NavBarShadowImage : UINavigationBar.shadowImage,也即导航栏底部那条分隔线,配合 NavBarShadowImageColor 使用。
QMUICMI.navBarShadowImageColor = UIColorClear; // NavBarShadowImageColor : UINavigationBar.shadowImage 的颜色,如果为 nil,则使用 NavBarShadowImage 的值,如果 NavBarShadowImage 也为 nil,则使用系统默认的分隔线。如果不为 nil,而 NavBarShadowImage 为 nil,则自动创建一张 1px 高的图并将其设置为 NavBarShadowImageColor 的颜色然后设置上去,如果 NavBarShadowImage 不为 nil 且 renderingMode 不为 UIImageRenderingModeAlwaysOriginal,则将 NavBarShadowImage 设置为 NavBarShadowImageColor 的颜色然后设置上去。
QMUICMI.navBarBarTintColor = UIColorBlue; // NavBarBarTintColor : UINavigationBar.barTintColor,也即背景色
QMUICMI.navBarStyle = UIBarStyleDefault; // NavBarStyle : UINavigationBar 的 barStyle
QMUICMI.navBarTintColor = UIColorWhite; // NavBarTintColor : QMUINavigationBar 的 tintColor,也即导航栏上面的按钮颜色
QMUICMI.navBarTitleColor = NavBarTintColor; // NavBarTitleColor : UINavigationBar 的标题颜色,以及 QMUINavigationTitleView 的默认文字颜色
QMUICMI.navBarTitleFont = UIFontBoldMake(17); // NavBarTitleFont : UINavigationBar 的标题字体,以及 QMUINavigationTitleView 的默认字体
QMUICMI.navBarLargeTitleColor = nil; // NavBarLargeTitleColor : UINavigationBar 在大标题模式下的标题颜色,仅在 iOS 11 之后才有效
QMUICMI.navBarLargeTitleFont = nil; // NavBarLargeTitleFont : UINavigationBar 在大标题模式下的标题字体,仅在 iOS 11 之后才有效
QMUICMI.navBarBackButtonTitlePositionAdjustment = UIOffsetZero; // NavBarBarBackButtonTitlePositionAdjustment : 导航栏返回按钮的文字偏移
QMUICMI.sizeNavBarBackIndicatorImageAutomatically = YES; // SizeNavBarBackIndicatorImageAutomatically : 是否要自动调整 NavBarBackIndicatorImage 的 size 为 (13, 21)
QMUICMI.navBarBackIndicatorImage = [UIImage qmui_imageWithShape:QMUIImageShapeNavBack size:CGSizeMake(12, 20) tintColor:NavBarTintColor]; // NavBarBackIndicatorImage : 导航栏的返回按钮的图片,图片尺寸建议为(13, 21),否则最终的图片位置无法与系统原生的位置保持一致
QMUICMI.navBarCloseButtonImage = [UIImage qmui_imageWithShape:QMUIImageShapeNavClose size:CGSizeMake(16, 16) tintColor:NavBarTintColor]; // NavBarCloseButtonImage : QMUINavigationButton 用到的 × 的按钮图片
QMUICMI.navBarLoadingMarginRight = 3; // NavBarLoadingMarginRight : QMUINavigationTitleView 里左边 loading 的右边距
QMUICMI.navBarAccessoryViewMarginLeft = 5; // NavBarAccessoryViewMarginLeft : QMUINavigationTitleView 里右边 accessoryView 的左边距
if (@available(iOS 13.0, *)) {
}else{
QMUICMI.navBarActivityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;// NavBarActivityIndicatorViewStyle : QMUINavigationTitleView 里左边 loading 的主题
}
QMUICMI.navBarAccessoryViewTypeDisclosureIndicatorImage = [[UIImage qmui_imageWithShape:QMUIImageShapeTriangle size:CGSizeMake(8, 5) tintColor:nil] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; // NavBarAccessoryViewTypeDisclosureIndicatorImage : QMUINavigationTitleView 右边箭头的图片
#pragma mark - TabBar
QMUICMI.tabBarBackgroundImage = [[UIImage qmui_imageWithColor:UIColorMake(249, 249, 249)] resizableImageWithCapInsets:UIEdgeInsetsMake(1, 1, 1, 1)]; // TabBarBackgroundImage : UITabBar 的背景图,建议使用 resizableImage,否则在 UITabBar (NavigationController) 的 setBackgroundImage: 里会每次都视为 image 发生了变化(isEqual: 为 NO)
QMUICMI.tabBarBarTintColor = nil; // TabBarBarTintColor : UITabBar 的 barTintColor,如果需要看到磨砂效果则应该提供半透明的色值
QMUICMI.tabBarShadowImageColor = UIColorSeparator; // TabBarShadowImageColor : UITabBar 的 shadowImage 的颜色,会自动创建一张 1px 高的图片
QMUICMI.tabBarStyle = UIBarStyleDefault; // TabBarStyle : UITabBar 的 barStyle
QMUICMI.tabBarItemTitleFont = nil; // TabBarItemTitleFont : UITabBarItem 的标题字体
QMUICMI.tabBarItemTitleColor = UIColor.nm_descriptionTextColor; // TabBarItemTitleColor : 未选中的 UITabBarItem 的标题颜色
QMUICMI.tabBarItemTitleColorSelected = UIColor.nm_tintColor; // TabBarItemTitleColorSelected : 选中的 UITabBarItem 的标题颜色
QMUICMI.tabBarItemImageColor = TabBarItemTitleColor; // TabBarItemImageColor : UITabBarItem 未选中时的图片颜色
QMUICMI.tabBarItemImageColorSelected = TabBarItemTitleColorSelected; // TabBarItemImageColorSelected : UITabBarItem 选中时的图片颜色
#pragma mark - Toolbar
QMUICMI.toolBarHighlightedAlpha = 0.4f; // ToolBarHighlightedAlpha : QMUIToolbarButton 在 highlighted 状态下的 alpha
QMUICMI.toolBarDisabledAlpha = 0.4f; // ToolBarDisabledAlpha : QMUIToolbarButton 在 disabled 状态下的 alpha
QMUICMI.toolBarTintColor = UIColor.nm_tintColor; // ToolBarTintColor : UIToolbar 的 tintColor,以及 QMUIToolbarButton normal 状态下的文字颜色
QMUICMI.toolBarTintColorHighlighted = [ToolBarTintColor colorWithAlphaComponent:ToolBarHighlightedAlpha]; // ToolBarTintColorHighlighted : QMUIToolbarButton 在 highlighted 状态下的文字颜色
QMUICMI.toolBarTintColorDisabled = [ToolBarTintColor colorWithAlphaComponent:ToolBarDisabledAlpha]; // ToolBarTintColorDisabled : QMUIToolbarButton 在 disabled 状态下的文字颜色
QMUICMI.toolBarBackgroundImage = nil; // ToolBarBackgroundImage : UIToolbar 的背景图
QMUICMI.toolBarBarTintColor = nil; // ToolBarBarTintColor : UIToolbar 的 tintColor
QMUICMI.toolBarShadowImageColor = UIColorSeparator; // ToolBarShadowImageColor : UIToolbar 的 shadowImage 的颜色,会自动创建一张 1px 高的图片
QMUICMI.toolBarStyle = UIBarStyleDefault; // ToolBarStyle : UIToolbar 的 barStyle
QMUICMI.toolBarButtonFont = UIFontMake(17); // ToolBarButtonFont : QMUIToolbarButton 的字体
#pragma mark - SearchBar
QMUICMI.searchBarTextFieldBackgroundImage = UIImage.nm_searchBarTextFieldBackgroundImage; // SearchBarTextFieldBackgroundImage : QMUISearchBar 里的文本框的背景图,图片高度会决定输入框的高度
QMUICMI.searchBarTextFieldBorderColor = nil; // SearchBarTextFieldBorderColor : QMUISearchBar 里的文本框的边框颜色
QMUICMI.searchBarTextFieldCornerRadius = 4.0; // SearchBarTextFieldCornerRadius : QMUISearchBar 里的文本框的圆角大小,-1 表示圆角大小为输入框高度的一半
QMUICMI.searchBarBackgroundImage = UIImage.nm_searchBarBackgroundImage; // SearchBarBackgroundImage : 搜索框的背景图,如果需要设置底部分隔线的颜色也请绘制到图片里
QMUICMI.searchBarTintColor = UIColor.nm_tintColor; // SearchBarTintColor : QMUISearchBar 的 tintColor,也即上面的操作控件的主题色
QMUICMI.searchBarTextColor = UIColor.nm_titleTextColor; // SearchBarTextColor : QMUISearchBar 里的文本框的文字颜色
QMUICMI.searchBarPlaceholderColor = [UIColor qmui_colorWithThemeProvider:^UIColor * _Nonnull(__kindof QMUIThemeManager * _Nonnull manager, NSString * _Nullable identifier, NSObject<NMThemeProtocol> *theme) {
if ([identifier isEqualToString:NMThemeIdentifierDark]) {
return theme.themePlaceholderColor;
}
return UIColorMake(136, 136, 143);
}]; // SearchBarPlaceholderColor : QMUISearchBar 里的文本框的 placeholder 颜色
QMUICMI.searchBarFont = UIFontMake(15); // SearchBarFont : QMUISearchBar 里的文本框的文字字体及 placeholder 的字体
QMUICMI.searchBarSearchIconImage = nil; // SearchBarSearchIconImage : QMUISearchBar 里的放大镜 icon
QMUICMI.searchBarClearIconImage = nil; // SearchBarClearIconImage : QMUISearchBar 里的文本框输入文字时右边的清空按钮的图片
#pragma mark - Plain TableView
/// 开启后UITableView会多出(Section/Footer)Height
QMUICMI.tableViewEstimatedHeightEnabled = NO; // TableViewEstimatedHeightEnabled : 是否要开启全局 QMUITableView 和 UITableView 的 estimatedRow(Section/Footer)Height
QMUICMI.tableViewBackgroundColor = UIColorForBackground; // TableViewBackgroundColor : Plain 类型的 QMUITableView 的背景色颜色
QMUICMI.tableSectionIndexColor = UIColorGrayDarken; // TableSectionIndexColor : 列表右边的字母索引条的文字颜色
QMUICMI.tableSectionIndexBackgroundColor = UIColorClear; // TableSectionIndexBackgroundColor : 列表右边的字母索引条的背景色
QMUICMI.tableSectionIndexTrackingBackgroundColor = UIColorClear; // TableSectionIndexTrackingBackgroundColor : 列表右边的字母索引条在选中时的背景色
QMUICMI.tableViewSeparatorColor = UIColorSeparator; // TableViewSeparatorColor : 列表的分隔线颜色
QMUICMI.tableViewCellNormalHeight = 56; // TableViewCellNormalHeight : QMUITableView 的默认 cell 高度
QMUICMI.tableViewCellTitleLabelColor = UIColor.nm_mainTextColor; // TableViewCellTitleLabelColor : QMUITableViewCell 的 textLabel 的文字颜色
QMUICMI.tableViewCellDetailLabelColor = UIColor.nm_descriptionTextColor; // TableViewCellDetailLabelColor : QMUITableViewCell 的 detailTextLabel 的文字颜色
QMUICMI.tableViewCellBackgroundColor = UIColorForBackground; // TableViewCellBackgroundColor : QMUITableViewCell 的背景色
QMUICMI.tableViewCellSelectedBackgroundColor = UIColor.nm_backgroundColorHighlighted; // TableViewCellSelectedBackgroundColor : QMUITableViewCell 点击时的背景色
QMUICMI.tableViewCellWarningBackgroundColor = UIColorYellow; // TableViewCellWarningBackgroundColor : QMUITableViewCell 用于表示警告时的背景色,备用
QMUICMI.tableViewCellDisclosureIndicatorImage = [UIImage qmui_imageWithThemeProvider:^UIImage * _Nonnull(__kindof QMUIThemeManager * _Nonnull manager, NSString * _Nullable identifier, NSObject<NMThemeProtocol> * _Nullable theme) {
return [identifier isEqualToString:NMThemeIdentifierDark] ? disclosureIndicatorImageDark : disclosureIndicatorImage;
}]; // TableViewCellDisclosureIndicatorImage : QMUITableViewCell 当 accessoryType 为 UITableViewCellAccessoryDisclosureIndicator 时的箭头的图片
QMUICMI.tableViewCellCheckmarkImage = [UIImage qmui_imageWithShape:QMUIImageShapeCheckmark size:CGSizeMake(15, 12) tintColor:UIColor.nm_tintColor]; // TableViewCellCheckmarkImage : QMUITableViewCell 当 accessoryType 为 UITableViewCellAccessoryCheckmark 时的打钩的图片
QMUICMI.tableViewCellDetailButtonImage = [UIImage qmui_imageWithShape:QMUIImageShapeDetailButtonImage size:CGSizeMake(20, 20) tintColor:UIColor.nm_tintColor]; // TableViewCellDetailButtonImage : QMUITableViewCell 当 accessoryType 为 UITableViewCellAccessoryDetailButton 或 UITableViewCellAccessoryDetailDisclosureButton 时右边的 i 按钮图片
QMUICMI.tableViewCellSpacingBetweenDetailButtonAndDisclosureIndicator = 12; // TableViewCellSpacingBetweenDetailButtonAndDisclosureIndicator : 列表 cell 右边的 i 按钮和向右箭头之间的间距(仅当两者都使用了自定义图片并且同时显示时才生效)
QMUICMI.tableViewSectionHeaderBackgroundColor = UIColor.nm_separatorColor; // TableViewSectionHeaderBackgroundColor : Plain 类型的 QMUITableView sectionHeader 的背景色
QMUICMI.tableViewSectionFooterBackgroundColor = UIColor.nm_separatorColor; // TableViewSectionFooterBackgroundColor : Plain 类型的 QMUITableView sectionFooter 的背景色
QMUICMI.tableViewSectionHeaderFont = UIFontBoldMake(12); // TableViewSectionHeaderFont : Plain 类型的 QMUITableView sectionHeader 里的文字字体
QMUICMI.tableViewSectionFooterFont = UIFontBoldMake(12); // TableViewSectionFooterFont : Plain 类型的 QMUITableView sectionFooter 里的文字字体
QMUICMI.tableViewSectionHeaderTextColor = UIColorGray5; // TableViewSectionHeaderTextColor : Plain 类型的 QMUITableView sectionHeader 里的文字颜色
QMUICMI.tableViewSectionFooterTextColor = UIColorGray; // TableViewSectionFooterTextColor : Plain 类型的 QMUITableView sectionFooter 里的文字颜色
QMUICMI.tableViewSectionHeaderAccessoryMargins = UIEdgeInsetsMake(0, 15, 0, 0); // TableViewSectionHeaderAccessoryMargins : Plain 类型的 QMUITableView sectionHeader accessoryView 的间距
QMUICMI.tableViewSectionFooterAccessoryMargins = UIEdgeInsetsMake(0, 15, 0, 0); // TableViewSectionFooterAccessoryMargins : Plain 类型的 QMUITableView sectionFooter accessoryView 的间距
QMUICMI.tableViewSectionHeaderContentInset = UIEdgeInsetsMake(4, 15, 4, 15); // TableViewSectionHeaderContentInset : Plain 类型的 QMUITableView sectionHeader 里的内容的 padding
QMUICMI.tableViewSectionFooterContentInset = UIEdgeInsetsMake(4, 15, 4, 15); // TableViewSectionFooterContentInset : Plain 类型的 QMUITableView sectionFooter 里的内容的 padding
#pragma mark - Grouped TableView
QMUICMI.tableViewGroupedBackgroundColor = [UIColor qmui_colorWithThemeProvider:^UIColor * _Nonnull(__kindof QMUIThemeManager * _Nonnull manager, NSString * _Nullable identifier, NSObject<NMThemeProtocol> * _Nullable theme) {
if ([identifier isEqualToString:NMThemeIdentifierDark]) {
return QMUICMI.tableViewBackgroundColor;
}
return UIColorMake(246, 246, 246);
}]; // TableViewGroupedBackgroundColor : Grouped 类型的 QMUITableView 的背景色
//QMUICMI.tableViewGroupedSeparatorColor = TableViewSeparatorColor; // TableViewGroupedSeparatorColor : Grouped 类型的 QMUITableView 分隔线颜色
QMUICMI.tableViewGroupedCellTitleLabelColor = TableViewCellTitleLabelColor; // TableViewGroupedCellTitleLabelColor : Grouped 类型的 QMUITableView cell 里的标题颜色
QMUICMI.tableViewGroupedCellDetailLabelColor = TableViewCellDetailLabelColor; // TableViewGroupedCellDetailLabelColor : Grouped 类型的 QMUITableView cell 里的副标题颜色
QMUICMI.tableViewGroupedCellBackgroundColor = UIColor.nm_backgroundColorLighten; // TableViewGroupedCellBackgroundColor : Grouped 类型的 QMUITableView cell 背景色
QMUICMI.tableViewGroupedCellSelectedBackgroundColor = TableViewCellSelectedBackgroundColor; // TableViewGroupedCellSelectedBackgroundColor : Grouped 类型的 QMUITableView cell 点击时的背景色
QMUICMI.tableViewGroupedCellWarningBackgroundColor = TableViewCellWarningBackgroundColor; // tableViewGroupedCellWarningBackgroundColor : Grouped 类型的 QMUITableView cell 在提醒状态下的背景色
QMUICMI.tableViewGroupedSectionHeaderFont = UIFontMake(12); // TableViewGroupedSectionHeaderFont : Grouped 类型的 QMUITableView sectionHeader 里的文字字体
QMUICMI.tableViewGroupedSectionFooterFont = UIFontMake(12); // TableViewGroupedSectionFooterFont : Grouped 类型的 QMUITableView sectionFooter 里的文字字体
QMUICMI.tableViewGroupedSectionHeaderTextColor = UIColorGrayDarken; // TableViewGroupedSectionHeaderTextColor : Grouped 类型的 QMUITableView sectionHeader 里的文字颜色
QMUICMI.tableViewGroupedSectionFooterTextColor = TableViewGroupedSectionHeaderTextColor; // TableViewGroupedSectionFooterTextColor : Grouped 类型的 QMUITableView sectionFooter 里的文字颜色
QMUICMI.tableViewGroupedSectionHeaderAccessoryMargins = UIEdgeInsetsMake(0, 15, 0, 0); // TableViewGroupedSectionHeaderAccessoryMargins : Grouped 类型的 QMUITableView sectionHeader accessoryView 的间距
QMUICMI.tableViewGroupedSectionFooterAccessoryMargins = UIEdgeInsetsMake(0, 15, 0, 0); // TableViewGroupedSectionFooterAccessoryMargins : Grouped 类型的 QMUITableView sectionFooter accessoryView 的间距
QMUICMI.tableViewGroupedSectionHeaderDefaultHeight = 20; // TableViewGroupedSectionHeaderDefaultHeight : Grouped 类型的 QMUITableView sectionHeader 的默认高度(也即没使用自定义的 sectionHeaderView 时的高度),注意如果不需要间距,请用 CGFLOAT_MIN
QMUICMI.tableViewGroupedSectionFooterDefaultHeight = 0; // TableViewGroupedSectionFooterDefaultHeight : Grouped 类型的 QMUITableView sectionFooter 的默认高度(也即没使用自定义的 sectionFooterView 时的高度),注意如果不需要间距,请用 CGFLOAT_MIN
QMUICMI.tableViewGroupedSectionHeaderContentInset = UIEdgeInsetsMake(16, PreferredValueForiPhone(20, 15, 15, 15), 8, PreferredValueForiPhone(20, 15, 15, 15)); // TableViewGroupedSectionHeaderContentInset : Grouped 类型的 QMUITableView sectionHeader 里的内容的 padding
QMUICMI.tableViewGroupedSectionFooterContentInset = UIEdgeInsetsMake(8, TableViewGroupedSectionHeaderContentInset.left, 2, TableViewGroupedSectionHeaderContentInset.right); // TableViewGroupedSectionFooterContentInset : Grouped 类型的 QMUITableView sectionFooter 里的内容的 padding
#pragma mark - InsetGrouped TableView
//QMUICMI.tableViewInsetGroupedCornerRadius = 10; // TableViewInsetGroupedCornerRadius : InsetGrouped 类型的 UITableView 内 cell 的圆角值
//QMUICMI.tableViewInsetGroupedHorizontalInset = PreferredValueForVisualDevice(20, 15); // TableViewInsetGroupedHorizontalInset: InsetGrouped 类型的 UITableView 内的左右缩进值
//QMUICMI.tableViewInsetGroupedBackgroundColor = TableViewGroupedBackgroundColor; // TableViewInsetGroupedBackgroundColor : InsetGrouped 类型的 UITableView 的背景色
//QMUICMI.tableViewInsetGroupedSeparatorColor = TableViewGroupedSeparatorColor; // TableViewInsetGroupedSeparatorColor : InsetGrouped 类型的 QMUITableView 分隔线颜色
//QMUICMI.tableViewInsetGroupedCellTitleLabelColor = TableViewGroupedCellTitleLabelColor; // TableViewInsetGroupedCellTitleLabelColor : InsetGrouped 类型的 QMUITableView cell 里的标题颜色
//QMUICMI.tableViewInsetGroupedCellDetailLabelColor = TableViewGroupedCellDetailLabelColor; // TableViewInsetGroupedCellDetailLabelColor : InsetGrouped 类型的 QMUITableView cell 里的副标题颜色
//QMUICMI.tableViewInsetGroupedCellBackgroundColor = TableViewGroupedCellBackgroundColor; // TableViewInsetGroupedCellBackgroundColor : InsetGrouped 类型的 QMUITableView cell 背景色
//QMUICMI.tableViewInsetGroupedCellSelectedBackgroundColor = TableViewGroupedCellSelectedBackgroundColor; // TableViewInsetGroupedCellSelectedBackgroundColor : InsetGrouped 类型的 QMUITableView cell 点击时的背景色
//QMUICMI.tableViewInsetGroupedCellWarningBackgroundColor = TableViewGroupedCellWarningBackgroundColor; // TableViewInsetGroupedCellWarningBackgroundColor : InsetGrouped 类型的 QMUITableView cell 在提醒状态下的背景色
//QMUICMI.tableViewInsetGroupedSectionHeaderFont = TableViewGroupedSectionHeaderFont; // TableViewInsetGroupedSectionHeaderFont : InsetGrouped 类型的 QMUITableView sectionHeader 里的文字字体
//QMUICMI.tableViewInsetGroupedSectionFooterFont = TableViewGroupedSectionFooterFont; // TableViewInsetGroupedSectionFooterFont : InsetGrouped 类型的 QMUITableView sectionFooter 里的文字字体
//QMUICMI.tableViewInsetGroupedSectionHeaderTextColor = TableViewGroupedSectionHeaderTextColor; // TableViewInsetGroupedSectionHeaderTextColor : InsetGrouped 类型的 QMUITableView sectionHeader 里的文字颜色
//QMUICMI.tableViewInsetGroupedSectionFooterTextColor = TableViewGroupedSectionFooterTextColor; // TableViewInsetGroupedSectionFooterTextColor : InsetGrouped 类型的 QMUITableView sectionFooter 里的文字颜色
//QMUICMI.tableViewInsetGroupedSectionHeaderAccessoryMargins = TableViewGroupedSectionHeaderAccessoryMargins; // TableViewInsetGroupedSectionHeaderAccessoryMargins : InsetGrouped 类型的 QMUITableView sectionHeader accessoryView 的间距
//QMUICMI.tableViewInsetGroupedSectionFooterAccessoryMargins = TableViewGroupedSectionFooterAccessoryMargins; // TableViewInsetGroupedSectionFooterAccessoryMargins : InsetGrouped 类型的 QMUITableView sectionFooter accessoryView 的间距
//QMUICMI.tableViewInsetGroupedSectionHeaderDefaultHeight = TableViewGroupedSectionHeaderDefaultHeight; // TableViewInsetGroupedSectionHeaderDefaultHeight : InsetGrouped 类型的 QMUITableView sectionHeader 的默认高度(也即没使用自定义的 sectionHeaderView 时的高度),注意如果不需要间距,请用 CGFLOAT_MIN
//QMUICMI.tableViewInsetGroupedSectionFooterDefaultHeight = TableViewGroupedSectionFooterDefaultHeight; // TableViewInsetGroupedSectionFooterDefaultHeight : InsetGrouped 类型的 QMUITableView sectionFooter 的默认高度(也即没使用自定义的 sectionFooterView 时的高度),注意如果不需要间距,请用 CGFLOAT_MIN
//QMUICMI.tableViewInsetGroupedSectionHeaderContentInset = TableViewGroupedSectionHeaderContentInset; // TableViewInsetGroupedSectionHeaderContentInset : InsetGrouped 类型的 QMUITableView sectionHeader 里的内容的 padding
//QMUICMI.tableViewInsetGroupedSectionFooterContentInset = TableViewGroupedSectionFooterContentInset; // TableViewInsetGroupedSectionFooterContentInset : InsetGrouped 类型的 QMUITableView sectionFooter 里的内容的 padding
#pragma mark - UIWindowLevel
QMUICMI.windowLevelQMUIAlertView = UIWindowLevelAlert - 4.0; // UIWindowLevelQMUIAlertView : QMUIModalPresentationViewController、QMUIPopupContainerView 里使用的 UIWindow 的 windowLevel
QMUICMI.windowLevelQMUIConsole = 1; // UIWindowLevelQMUIConsole : QMUIConsole 内部的 UIWindow 的 windowLevel
#pragma mark - QMUILog
QMUICMI.shouldPrintDefaultLog = YES; // ShouldPrintDefaultLog : 是否允许输出 QMUILogLevelDefault 级别的 log
QMUICMI.shouldPrintInfoLog = YES; // ShouldPrintInfoLog : 是否允许输出 QMUILogLevelInfo 级别的 log
QMUICMI.shouldPrintWarnLog = YES; // ShouldPrintInfoLog : 是否允许输出 QMUILogLevelWarn 级别的 log
QMUICMI.shouldPrintQMUIWarnLogToConsole = YES; // ShouldPrintQMUIWarnLogToConsole : 是否在出现 QMUILogWarn 时自动把这些 log 以 QMUIConsole 的方式显示到设备屏幕上
#pragma mark - QMUIBadge
QMUICMI.badgeBackgroundColor = UIColorRed; // BadgeBackgroundColor : QMUIBadge 上的未读数的背景色
QMUICMI.badgeTextColor = UIColorWhite; // BadgeTextColor : QMUIBadge 上的未读数的文字颜色
QMUICMI.badgeFont = UIFontBoldMake(11); // BadgeFont : QMUIBadge 上的未读数的字体
QMUICMI.badgeContentEdgeInsets = UIEdgeInsetsMake(2, 4, 2, 4); // BadgeContentEdgeInsets : QMUIBadge 上的未读数与圆圈之间的 padding
//QMUICMI.badgeOffset = CGPointMake(-9, 11); // BadgeOffset : QMUIBadge 上的未读数相对于目标 view 右上角的偏移
//QMUICMI.badgeOffsetLandscape = CGPointMake(-9, 6); // BadgeOffsetLandscape : QMUIBadge 上的未读数在横屏下相对于目标 view 右上角的偏移
BeginIgnoreDeprecatedWarning
QMUICMI.badgeCenterOffset = CGPointMake(14, -10); // BadgeCenterOffset : QMUIBadge 未读数相对于目标 view 中心的偏移
QMUICMI.badgeCenterOffsetLandscape = CGPointMake(16, -7); // BadgeCenterOffsetLandscape : QMUIBadge 未读数在横屏下相对于目标 view 中心的偏移
EndIgnoreDeprecatedWarning
QMUICMI.updatesIndicatorColor = UIColorRed; // UpdatesIndicatorColor : QMUIBadge 上的未读红点的颜色
QMUICMI.updatesIndicatorSize = CGSizeMake(7, 7); // UpdatesIndicatorSize : QMUIBadge 上的未读红点的大小
//QMUICMI.updatesIndicatorOffset = CGPointMake(4, UpdatesIndicatorSize.height);// UpdatesIndicatorOffset : QMUIBadge 未读红点相对于目标 view 右上角的偏移
//QMUICMI.updatesIndicatorOffsetLandscape = UpdatesIndicatorOffset; // UpdatesIndicatorOffsetLandscape : QMUIBadge 未读红点在横屏下相对于目标 view 右上角的偏移
BeginIgnoreDeprecatedWarning
QMUICMI.updatesIndicatorCenterOffset = CGPointMake(14, -10); // UpdatesIndicatorCenterOffset : QMUIBadge 未读红点相对于目标 view 中心的偏移
QMUICMI.updatesIndicatorCenterOffsetLandscape = CGPointMake(14, -10); // UpdatesIndicatorCenterOffsetLandscape : QMUIBadge 未读红点在横屏下相对于目标 view 中心点的偏移
EndIgnoreDeprecatedWarning
#pragma mark - Others
QMUICMI.automaticCustomNavigationBarTransitionStyle = NO; // AutomaticCustomNavigationBarTransitionStyle : 界面 push/pop 时是否要自动根据两个界面的 barTintColor/backgroundImage/shadowImage 的样式差异来决定是否使用自定义的导航栏效果
QMUICMI.supportedOrientationMask = UIInterfaceOrientationMaskAll; // SupportedOrientationMask : 默认支持的横竖屏方向
QMUICMI.automaticallyRotateDeviceOrientation = YES; // AutomaticallyRotateDeviceOrientation : 是否在界面切换或 viewController.supportedOrientationMask 发生变化时自动旋转屏幕
QMUICMI.statusbarStyleLightInitially = YES; // StatusbarStyleLightInitially : 默认的状态栏内容是否使用白色,默认为 NO,在 iOS 13 下会自动根据是否 Dark Mode 而切换样式,iOS 12 及以前则为黑色。生效范围:处于 QMUITabBarController 或 QMUINavigationController 内的 vc,或者 QMUICommonViewController 及其子类。
QMUICMI.needsBackBarButtonItemTitle = NO; // NeedsBackBarButtonItemTitle : 全局是否需要返回按钮的 title,不需要则只显示一个返回image
QMUICMI.hidesBottomBarWhenPushedInitially = YES; // HidesBottomBarWhenPushedInitially : QMUICommonViewController.hidesBottomBarWhenPushed 的初始值,默认为 NO,以保持与系统默认值一致,但通常建议改为 YES,因为一般只有 tabBar 首页那几个界面要求为 NO
QMUICMI.preventConcurrentNavigationControllerTransitions = YES; // PreventConcurrentNavigationControllerTransitions : 自动保护 QMUINavigationController 在上一次 push/pop 尚未结束的时候就进行下一次 push/pop 的行为,避免产生 crash
QMUICMI.navigationBarHiddenInitially = NO; // NavigationBarHiddenInitially : QMUINavigationControllerDelegate preferredNavigationBarHidden 的初始值,默认为NO
QMUICMI.shouldFixTabBarTransitionBugInIPhoneX = YES; // ShouldFixTabBarTransitionBugInIPhoneX : 是否需要自动修复 iOS 11 下,iPhone X 的设备在 push 界面时,tabBar 会瞬间往上跳的 bug
QMUICMI.shouldFixTabBarButtonBugForAll = NO; // ShouldFixTabBarButtonBugForAll : 是否要对 iOS 12.1.1 及以后的版本也修复手势返回时 tabBarButton 布局错误的 bug(issue #410),默认为 NO
QMUICMI.shouldFixTabBarSafeAreaInsetsBug = YES; // ShouldFixTabBarSafeAreaInsetsBug : 是否要对 iOS 11 及以后的版本修复当存在 UITabBar 时,UIScrollView 的 inset.bottom 可能错误的 bug(issue #218 #934),默认为 YES
QMUICMI.shouldFixSearchBarMaskViewLayoutBug = YES; // ShouldFixSearchBarMaskViewLayoutBug : 是否自动修复 UISearchController.searchBar 被当作 tableHeaderView 使用时可能出现的布局 bug(issue #950)
QMUICMI.sendAnalyticsToQMUITeam = YES; // SendAnalyticsToQMUITeam : 是否允许在 DEBUG 模式下上报 Bundle Identifier 和 Display Name 给 QMUI 统计用
QMUICMI.dynamicPreferredValueForIPad = NO; // DynamicPreferredValueForIPad : 当 iPad 处于 Slide Over 或 Split View 分屏模式下,宏 `PreferredValueForXXX` 是否把 iPad 视为某种屏幕宽度近似的 iPhone 来取值。
if (@available(iOS 13.0, *)) {
QMUICMI.ignoreKVCAccessProhibited = NO; // IgnoreKVCAccessProhibited : 是否全局忽略 iOS 13 对 KVC 访问 UIKit 私有属性的限制
QMUICMI.adjustScrollIndicatorInsetsByContentInsetAdjustment = YES; // AdjustScrollIndicatorInsetsByContentInsetAdjustment : 当将 UIScrollView.contentInsetAdjustmentBehavior 设为 UIScrollViewContentInsetAdjustmentNever 时,是否自动将 UIScrollView.automaticallyAdjustsScrollIndicatorInsets 设为 NO,以保证原本在 iOS 12 下的代码不用修改就能在 iOS 13 下正常控制滚动条的位置。
}
}
// QMUI 2.3.0 版本里,配置表新增这个方法,返回 YES 表示在 App 启动时要自动应用这份配置表。仅当你的 App 里存在多份配置表时,才需要把除默认配置表之外的其他配置表的返回值改为 NO。
- (BOOL)shouldApplyTemplateAutomatically {
[QMUIThemeManagerCenter.defaultThemeManager addThemeIdentifier:self.themeName theme:self];
NSString *selectedThemeIdentifier = [[NSUserDefaults standardUserDefaults] stringForKey:NMSelectedThemeIdentifier];
BOOL result = [selectedThemeIdentifier isEqualToString:self.themeName] || (!selectedThemeIdentifier && !QMUIThemeManagerCenter.defaultThemeManager.currentThemeIdentifier);
if (result) {
QMUIThemeManagerCenter.defaultThemeManager.currentTheme = self;
}
return result;
}
#pragma mark - <NMThemeProtocol>
- (UIColor *)themeBackgroundColor {
return UIColorWhite;
}
- (UIColor *)themeBackgroundColorLighten {
return self.themeBackgroundColor;
}
- (UIColor *)themeBackgroundColorHighlighted {
return UIColorMake(238, 239, 241);
}
- (UIColor *)themeTintColor {
return UIColorTheme6;
}
- (UIColor *)themeTitleTextColor {
return UIColorGray1;
}
- (UIColor *)themeMainTextColor {
return UIColorGray3;
}
- (UIColor *)themeDescriptionTextColor {
return UIColorGray6;
}
- (UIColor *)themePlaceholderColor {
return UIColorGray8;
}
- (UIColor *)themeCodeColor {
return self.themeTintColor;
}
- (UIColor *)themeSeparatorColor {
return UIColorMake(222, 224, 226);
}
- (UIColor *)themeGridItemTintColor {
return self.themeTintColor;
}
- (NSString *)themeName {
return NMThemeIdentifierDefault;
}
@end
//
// QMUIConfigurationTemplate.h
//
// Created by QMUI Team on 15/3/29.
// Copyright (c) 2015年 QMUI Team. All rights reserved.
//
#import "QMUIConfigurationTemplate.h"
@interface QMUIConfigurationTemplateDark : QMUIConfigurationTemplate
@end
//
// QMUIConfigurationTemplate.m
// qmui
//
// Created by QMUI Team on 15/3/29.
// Copyright (c) 2015年 QMUI Team. All rights reserved.
//
#import "QMUIConfigurationTemplateDark.h"
#import <NMTheme/NMCommonUI.h>
@implementation QMUIConfigurationTemplateDark
#pragma mark - <QMUIConfigurationTemplateProtocol>
- (void)applyConfigurationTemplate {
[super applyConfigurationTemplate];
QMUICMI.keyboardAppearance = UIKeyboardAppearanceDark;
//QMUICMI.navBarBackgroundImage = nil;
QMUICMI.navBarStyle = UIBarStyleBlack;
QMUICMI.navBarBarTintColor = UIColorBlack;
QMUICMI.tabBarBackgroundImage = nil;
QMUICMI.tabBarStyle = UIBarStyleBlack;
QMUICMI.toolBarStyle = UIBarStyleBlack;
}
// QMUI 2.3.0 版本里,配置表新增这个方法,返回 YES 表示在 App 启动时要自动应用这份配置表。仅当你的 App 里存在多份配置表时,才需要把除默认配置表之外的其他配置表的返回值改为 NO。
- (BOOL)shouldApplyTemplateAutomatically {
[QMUIThemeManagerCenter.defaultThemeManager addThemeIdentifier:self.themeName theme:self];
NSString *selectedThemeIdentifier = [[NSUserDefaults standardUserDefaults] stringForKey:NMSelectedThemeIdentifier];
BOOL result = [selectedThemeIdentifier isEqualToString:self.themeName];
if (result) {
QMUIThemeManagerCenter.defaultThemeManager.currentTheme = self;
}
return result;
}
#pragma mark - <QDThemeProtocol>
- (UIColor *)themeBackgroundColor {
return UIColorBlack;
}
- (UIColor *)themeBackgroundColorLighten {
return UIColorMake(28, 28, 30);
}
- (UIColor *)themeBackgroundColorHighlighted {
return UIColorMake(48, 49, 51);
}
- (UIColor *)themeTintColor {
return UIColorTheme10;
}
- (UIColor *)themeTitleTextColor {
return UIColorDarkGray1;
}
- (UIColor *)themeMainTextColor {
return UIColorDarkGray3;
}
- (UIColor *)themeDescriptionTextColor {
return UIColorDarkGray6;
}
- (UIColor *)themePlaceholderColor {
return UIColorDarkGray8;
}
- (UIColor *)themeCodeColor {
return self.themeTintColor;
}
- (UIColor *)themeSeparatorColor {
return UIColorMake(46, 50, 54);
}
- (NSString *)themeName {
return NMThemeIdentifierDark;
}
@end
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "check_f.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "check_t.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "universal_but_less@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "universal_but_less@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "universal_but_increase@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "universal_but_increase@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "launch_background.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "navigationbar_background.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
...@@ -11,10 +14,21 @@ ...@@ -11,10 +14,21 @@
<objects> <objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController"> <viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="launch_background" translatesAutoresizingMaskIntoConstraints="NO" id="Mnx-MV-pJA">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="K3I-sc-POa"/>
<color key="backgroundColor" systemColor="systemTealColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="Mnx-MV-pJA" secondAttribute="bottom" identifier="bottomAlign" id="QTi-Jz-lDD"/>
<constraint firstItem="Mnx-MV-pJA" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="bBJ-p7-H3l"/>
<constraint firstItem="Mnx-MV-pJA" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="hwD-f1-VCb"/>
<constraint firstAttribute="trailing" secondItem="Mnx-MV-pJA" secondAttribute="trailing" id="ke1-8Y-B3q"/>
</constraints>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
...@@ -22,4 +36,10 @@ ...@@ -22,4 +36,10 @@
<point key="canvasLocation" x="53" y="375"/> <point key="canvasLocation" x="53" y="375"/>
</scene> </scene>
</scenes> </scenes>
<resources>
<image name="launch_background" width="375" height="667"/>
<systemColor name="systemTealColor">
<color red="0.35294117647058826" green="0.78431372549019607" blue="0.98039215686274506" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document> </document>
//
// ViewControllerConfigure.m
// CQ_App
//
// Created by mac on 2019/3/22.
// Copyright © 2019年 mac. All rights reserved.
//
#import "ViewControllerConfigure.h"
#import "MacroDefinition.h"
#import <Aspects.h>
@implementation ViewControllerConfigure
+(void)load {
[super load];
/**
kDISPATCH_AFTER(0.5, ^{
[ViewControllerConfigure sharedInstance];
});
*/
}
+ (instancetype)sharedInstance
{
static dispatch_once_t onceToken;
static ViewControllerConfigure *sharedInstance;
dispatch_once(&onceToken, ^{
sharedInstance = [[ViewControllerConfigure alloc] init];
});
return sharedInstance;
}
- (instancetype)init
{
self = [super init];
if (self) {
/* 在这里做好方法拦截
[UIViewController aspect_hookSelector:@selector(loadView) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo>aspectInfo){
[self loadView:[aspectInfo instance]];
} error:NULL];*/
[UIViewController aspect_hookSelector:@selector(viewWillAppear:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> aspectInfo, BOOL animated){
[self viewWillAppear:animated viewController:[aspectInfo instance]];
} error:NULL];
[UIViewController aspect_hookSelector:@selector(viewDidLoad) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> aspectInfo) {
[self viewDidLoadViewController:[aspectInfo instance]];
} error:NULL];
/**
[UIViewController aspect_hookSelector:@selector(viewDidDisappear:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> aspectInfo, BOOL animated){
[self viewDidDisappear:animated viewController:[aspectInfo instance]];
} error:NULL];
[UIViewController aspect_hookSelector:@selector(viewDidAppear:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> aspectInfo, BOOL animated){
[self viewDidAppear:animated viewController:[aspectInfo instance]];
} error:NULL];*/
}
return self;
}
/*
下面的这些方法中就可以做到自动拦截了。
所以在你原来的架构中,大部分封装UIViewController的基类或者其他的什么基类,都可以使用这种方法让这些基类消失。
*/
#pragma mark - fake methods
- (void)viewDidDisappear:(BOOL)animated viewController:(UIViewController *)viewController {}
- (void)viewDidAppear:(BOOL)animated viewController:(UIViewController *)viewController {}
- (void)viewWillAppear:(BOOL)animated viewController:(UIViewController *)viewController {
/* 你可以使用这个方法进行打日志,初始化基础业务相关的内容 */
//NSLog(@"%@ viewWillAppear",viewController.className);
}
- (void)viewDidLoadViewController:(UIViewController *)viewController {
/* 你可以使用这个方法进行打日志,初始化基础业务相关的内容 */
//NSLog(@"%@ viewDidLoad",viewController.className);
[self setupViewsViewController:viewController];
// 判断是否有上级页面,有的话再调用
if ([viewController.navigationController.viewControllers indexOfObject:viewController] > 0) {
[self setupLeftBarButtonViewController:viewController];
}
}
- (void)setupViewsViewController:(UIViewController *)viewController {
// 设置应用的背景色
if ((![viewController.class isKindOfClass:[UIViewController class]])) {
viewController.view.backgroundColor = [UIColor whiteColor];
}
}
- (void)setupLeftBarButtonViewController:(UIViewController *)viewController{
// 自定义 leftBarButtonItem ,UIImageRenderingModeAlwaysOriginal 防止图片被渲染
viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
initWithImage:[[UIImage imageNamed:@"public_back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
style:UIBarButtonItemStylePlain
target:self action:@selector(leftBarButtonClick)];
}
#pragma mark - 返回按钮的点击事件
- (void)leftBarButtonClick {
//[[[AppDelegate shareAppDelegate] currentViewController].navigationController popViewControllerAnimated:YES];
}
@end
# Uncomment the next line to define a global platform for your project # Uncomment the next line to define a global platform for your project
# platform :ios, '9.0' use_frameworks!
platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git' source 'https://github.com/CocoaPods/Specs.git'
source 'http://git.changein.cn/xzc168520/pwspecs.git' source 'http://git.changein.cn/xzc168520/pwspecs.git'
target 'Mall-iOS' do target 'Mall-iOS' do
# pod 'NMUIChainKit'
# pod 'NMReactiveCocoa'
pod 'NMCartfileSDK/MLeaksFinderCore'
pod 'NMMemoryProfiler'
pod 'NMTheme', :git => 'http://git.changein.cn/xzc168520/nmtheme.git'
pod 'NMCycleScrollView'
pod 'JYSearchModule'
pod 'MJRefresh'
pod 'Masonry'
pod 'ReactiveObjC'
pod 'MLeaksFinder', :configurations => ['Debug']
pod 'Aspects'
pod 'FBMemoryProfiler'
pod 'NMRouter'
pod 'SDCycleScrollView','1.80'
pod 'QMUIKit'
end end
PODS:
- FBRetainCycleDetector (0.1.4)
- FMDB/SQLCipher (2.7.5):
- SQLCipher
- JYSearchModule (0.1.3):
- JYSearchModule/Cell (= 0.1.3)
- JYSearchModule/Define (= 0.1.3)
- JYSearchModule/Model (= 0.1.3)
- JYSearchModule/Module (= 0.1.3)
- JYSearchModule/NMTagView (= 0.1.3)
- JYSearchModule/View (= 0.1.3)
- JYSearchModule/ViewControll (= 0.1.3)
- JYSearchModule/ViewModel (= 0.1.3)
- NMCartfileSDK/FDTemplateLayoutCell
- NMCartfileSDK/Masonry
- NMEncryptedDB
- NMNetwork
- NMReactiveCocoa
- NMRouter
- NMUIChainKit
- JYSearchModule/Cell (0.1.3):
- JYSearchModule/Define
- JYSearchModule/Model
- JYSearchModule/NMTagView
- NMCartfileSDK/FDTemplateLayoutCell
- NMCartfileSDK/Masonry
- NMEncryptedDB
- NMNetwork
- NMReactiveCocoa
- NMRouter
- NMUIChainKit
- JYSearchModule/Define (0.1.3):
- JYSearchModule/Model
- NMCartfileSDK/FDTemplateLayoutCell
- NMCartfileSDK/Masonry
- NMEncryptedDB
- NMNetwork
- NMReactiveCocoa
- NMRouter
- NMUIChainKit
- JYSearchModule/Model (0.1.3):
- NMCartfileSDK/FDTemplateLayoutCell
- NMCartfileSDK/Masonry
- NMEncryptedDB
- NMNetwork
- NMReactiveCocoa
- NMRouter
- NMUIChainKit
- JYSearchModule/Module (0.1.3):
- JYSearchModule/ViewControll
- NMCartfileSDK/FDTemplateLayoutCell
- NMCartfileSDK/Masonry
- NMEncryptedDB
- NMNetwork
- NMReactiveCocoa
- NMRouter
- NMUIChainKit
- JYSearchModule/NMTagView (0.1.3):
- NMCartfileSDK/FDTemplateLayoutCell
- NMCartfileSDK/Masonry
- NMEncryptedDB
- NMNetwork
- NMReactiveCocoa
- NMRouter
- NMUIChainKit
- JYSearchModule/View (0.1.3):
- JYSearchModule/Cell
- JYSearchModule/Model
- JYSearchModule/NMTagView
- NMCartfileSDK/FDTemplateLayoutCell
- NMCartfileSDK/Masonry
- NMEncryptedDB
- NMNetwork
- NMReactiveCocoa
- NMRouter
- NMUIChainKit
- JYSearchModule/ViewControll (0.1.3):
- JYSearchModule/Cell
- JYSearchModule/View
- JYSearchModule/ViewModel
- NMCartfileSDK/FDTemplateLayoutCell
- NMCartfileSDK/Masonry
- NMEncryptedDB
- NMNetwork
- NMReactiveCocoa
- NMRouter
- NMUIChainKit
- JYSearchModule/ViewModel (0.1.3):
- JYSearchModule/Define
- NMCartfileSDK/FDTemplateLayoutCell
- NMCartfileSDK/Masonry
- NMEncryptedDB
- NMNetwork
- NMReactiveCocoa
- NMRouter
- NMUIChainKit
- MLeaksFinder (1.0.0):
- FBRetainCycleDetector
- NMCartfileSDK/AFNetworking (0.1.3)
- NMCartfileSDK/FBMemoryProfiler (0.1.3)
- NMCartfileSDK/FDTemplateLayoutCell (0.1.3)
- NMCartfileSDK/Masonry (0.1.3)
- NMCartfileSDK/MJExtension (0.1.3)
- NMCartfileSDK/MJRefresh (0.1.3)
- NMCartfileSDK/MLeaksFinderCore (0.1.3):
- MLeaksFinder (~> 1.0.0)
- NMCartfileSDK/QMUIKitCore (0.1.3):
- QMUIKit/QMUIComponents/QMUIAlertController
- QMUIKit/QMUIComponents/QMUITheme
- QMUIKit/QMUIComponents/QMUITips
- QMUIKit/QMUICore
- NMCartfileSDK/SDWebImage (0.1.3)
- NMCartfileSDK/SQLCipherCore (0.1.3):
- FMDB/SQLCipher (~> 2.7.5)
- NMCartfileSDK/YYCache (0.1.3)
- NMCategories/Universal (0.2.0):
- NMCartfileSDK/MJExtension
- NMCartfileSDK/MJRefresh
- NMCartfileSDK/QMUIKitCore
- NMCartfileSDK/SDWebImage
- NMCycleScrollView (0.1.0):
- NMCycleScrollView/Universal (= 0.1.0)
- NMCycleScrollView/Universal (0.1.0):
- NMCartfileSDK/SDWebImage
- NMEncryptedDB (0.1.3):
- NMCartfileSDK/SQLCipherCore
- NMEncryptedDB/Universal (= 0.1.3)
- NMEncryptedDB/Universal (0.1.3):
- NMCartfileSDK/SQLCipherCore
- NMMemoryProfiler (0.1.1):
- NMMemoryProfiler/Universal (= 0.1.1)
- NMMemoryProfiler/Universal (0.1.1):
- NMCartfileSDK/FBMemoryProfiler
- NMNetwork (0.2.2):
- NMNetwork/Universal (= 0.2.2)
- NMNetwork/Universal (0.2.2):
- NMCartfileSDK/AFNetworking
- NMCartfileSDK/MJExtension
- NMCartfileSDK/YYCache
- NMReactiveCocoa (0.1.1):
- NMReactiveCocoa/Universal (= 0.1.1)
- NMReactiveCocoa/Universal (0.1.1)
- NMRouter (0.1.2):
- NMRouter/Universal (= 0.1.2)
- NMRouter/Universal (0.1.2)
- NMTheme (0.1.5):
- NMCartfileSDK/QMUIKitCore
- NMTheme/Universal (= 0.1.5)
- NMTheme/Universal (0.1.5):
- NMCartfileSDK/QMUIKitCore
- NMUIChainKit (0.1.5):
- NMUIChainKit/Universal (= 0.1.5)
- NMUIChainKit/Universal (0.1.5):
- NMCartfileSDK/Masonry
- NMCategories/Universal
- QMUIKit/QMUIComponents/QMUIAlertController (4.1.3):
- QMUIKit/QMUIComponents/QMUIAppearance
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUIComponents/QMUIKeyboardManager
- QMUIKit/QMUIComponents/QMUIModalPresentationViewController
- QMUIKit/QMUIComponents/QMUITextField
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIAppearance (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIAssetLibrary (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIButton (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUICAAnimationExtension (4.1.3):
- QMUIKit/QMUIComponents/QMUIMultipleDelegates
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUICALayerExtension (4.1.3):
- QMUIKit/QMUIComponents/QMUIMultipleDelegates
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUICollectionViewPagingLayout (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIConsole (4.1.3):
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUIComponents/QMUICAAnimationExtension
- QMUIKit/QMUIComponents/QMUIPopupMenuView
- QMUIKit/QMUIComponents/QMUITextField
- QMUIKit/QMUIComponents/QMUITextView
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIEmotionView (4.1.3):
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIEmptyView (4.1.3):
- QMUIKit/QMUIComponents/QMUIAppearance
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIFillButton (4.1.3):
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIGhostButton (4.1.3):
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIGridView (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIImagePickerLibrary (4.1.3):
- QMUIKit/QMUIComponents/QMUIAlertController
- QMUIKit/QMUIComponents/QMUIAppearance
- QMUIKit/QMUIComponents/QMUIAssetLibrary
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUIComponents/QMUIEmptyView
- QMUIKit/QMUIComponents/QMUIImagePreviewView
- QMUIKit/QMUIComponents/QMUINavigationButton
- QMUIKit/QMUIComponents/QMUITableViewCell
- QMUIKit/QMUIComponents/QMUIZoomImageView
- QMUIKit/QMUICore
- QMUIKit/QMUIMainFrame
- QMUIKit/QMUIComponents/QMUIImagePreviewView (4.1.3):
- QMUIKit/QMUIComponents/QMUIAppearance
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUIComponents/QMUICollectionViewPagingLayout
- QMUIKit/QMUIComponents/QMUIEmptyView
- QMUIKit/QMUIComponents/QMUIPieProgressView
- QMUIKit/QMUIComponents/QMUIZoomImageView
- QMUIKit/QMUICore
- QMUIKit/QMUIMainFrame
- QMUIKit/QMUIComponents/QMUIKeyboardManager (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUILabel (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUILinkButton (4.1.3):
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIModalPresentationViewController (4.1.3):
- QMUIKit/QMUIComponents/QMUIAppearance
- QMUIKit/QMUIComponents/QMUIKeyboardManager
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIMultipleDelegates (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUINavigationButton (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIMainFrame
- QMUIKit/QMUIComponents/QMUINavigationTitleView (4.1.3):
- QMUIKit/QMUIComponents/QMUIAppearance
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIPieProgressView (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIPopupContainerView (4.1.3):
- QMUIKit/QMUIComponents/QMUIAppearance
- QMUIKit/QMUICore
- QMUIKit/QMUIMainFrame
- QMUIKit/QMUIComponents/QMUIPopupMenuView (4.1.3):
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUIComponents/QMUIPopupContainerView
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUISlider (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUITableView (4.1.3):
- QMUIKit/QMUIComponents/QMUITableViewProtocols
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUITableViewCell (4.1.3):
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUITableViewHeaderFooterView (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUITableViewProtocols (4.1.3):
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUITextField (4.1.3):
- QMUIKit/QMUIComponents/QMUIMultipleDelegates
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUITextView (4.1.3):
- QMUIKit/QMUIComponents/QMUILabel
- QMUIKit/QMUIComponents/QMUIMultipleDelegates
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUITheme (4.1.3):
- QMUIKit/QMUIComponents/QMUIAlertController
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUIComponents/QMUIConsole
- QMUIKit/QMUIComponents/QMUIEmotionView
- QMUIKit/QMUIComponents/QMUIEmptyView
- QMUIKit/QMUIComponents/QMUIFillButton
- QMUIKit/QMUIComponents/QMUIGhostButton
- QMUIKit/QMUIComponents/QMUIGridView
- QMUIKit/QMUIComponents/QMUIImagePickerLibrary
- QMUIKit/QMUIComponents/QMUIImagePreviewView
- QMUIKit/QMUIComponents/QMUILabel
- QMUIKit/QMUIComponents/QMUILinkButton
- QMUIKit/QMUIComponents/QMUIModalPresentationViewController
- QMUIKit/QMUIComponents/QMUIPopupContainerView
- QMUIKit/QMUIComponents/QMUIPopupMenuView
- QMUIKit/QMUIComponents/QMUISlider
- QMUIKit/QMUIComponents/QMUITextField
- QMUIKit/QMUIComponents/QMUITextView
- QMUIKit/QMUIComponents/QMUIToastView
- QMUIKit/QMUIComponents/QMUIVisualEffectView
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUITips (4.1.3):
- QMUIKit/QMUIComponents/QMUIToastView
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIToastView (4.1.3):
- QMUIKit/QMUIComponents/QMUIKeyboardManager
- QMUIKit/QMUIComponents/QMUIVisualEffectView
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIVisualEffectView (4.1.3):
- QMUIKit/QMUIComponents/QMUICALayerExtension
- QMUIKit/QMUICore
- QMUIKit/QMUIComponents/QMUIZoomImageView (4.1.3):
- QMUIKit/QMUIComponents/QMUIAssetLibrary
- QMUIKit/QMUIComponents/QMUIButton
- QMUIKit/QMUIComponents/QMUIEmptyView
- QMUIKit/QMUIComponents/QMUIPieProgressView
- QMUIKit/QMUIComponents/QMUISlider
- QMUIKit/QMUICore
- QMUIKit/QMUICore (4.1.3):
- QMUIKit/QMUILog
- QMUIKit/QMUIWeakObjectContainer
- QMUIKit/QMUILog (4.1.3)
- QMUIKit/QMUIMainFrame (4.1.3):
- QMUIKit/QMUIComponents/QMUIEmptyView
- QMUIKit/QMUIComponents/QMUIKeyboardManager
- QMUIKit/QMUIComponents/QMUIMultipleDelegates
- QMUIKit/QMUIComponents/QMUINavigationTitleView
- QMUIKit/QMUIComponents/QMUITableView
- QMUIKit/QMUIComponents/QMUITableViewHeaderFooterView
- QMUIKit/QMUICore
- QMUIKit/QMUILog
- QMUIKit/QMUIWeakObjectContainer (4.1.3)
- SQLCipher (4.4.2):
- SQLCipher/standard (= 4.4.2)
- SQLCipher/common (4.4.2)
- SQLCipher/standard (4.4.2):
- SQLCipher/common
DEPENDENCIES:
- JYSearchModule
- NMCartfileSDK/MLeaksFinderCore
- NMCycleScrollView
- NMMemoryProfiler
- NMTheme (from `http://git.changein.cn/xzc168520/nmtheme.git`)
SPEC REPOS:
http://git.changein.cn/xzc168520/pwspecs.git:
- JYSearchModule
- NMCartfileSDK
- NMCategories
- NMCycleScrollView
- NMEncryptedDB
- NMMemoryProfiler
- NMNetwork
- NMReactiveCocoa
- NMRouter
- NMUIChainKit
https://github.com/CocoaPods/Specs.git:
- FBRetainCycleDetector
- FMDB
- MLeaksFinder
- QMUIKit
- SQLCipher
EXTERNAL SOURCES:
NMTheme:
:git: http://git.changein.cn/xzc168520/nmtheme.git
CHECKOUT OPTIONS:
NMTheme:
:commit: a50f76ccf2ef3f65ef702ad392958124e1d3c9f5
:git: http://git.changein.cn/xzc168520/nmtheme.git
SPEC CHECKSUMS:
FBRetainCycleDetector: 46f8179bbb1c587deee3ea838a1a3ee02acf5015
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
JYSearchModule: 94c5d596f20ecac3f5c30f1697ea6f9b746de853
MLeaksFinder: 8c435bd2f6d070af18cff082b503b21adc130fc0
NMCartfileSDK: bb16385916f09f309987aa9562e84ffc91232835
NMCategories: 55df450419d935b37adc1e1fe0ed36cc698c4a71
NMCycleScrollView: c9055887d68ebb99e433afb0f2d34fe78df425b4
NMEncryptedDB: 457350747b3e95b4ad25fbabf8d6c812bcee3713
NMMemoryProfiler: a77d57bc5527f90e8116fdbf5a47688ad4f50dd6
NMNetwork: 25feaec0e8b1caefca7a73d858808a0f2796e565
NMReactiveCocoa: faca311865d15979191bb225fcd0a8714ccf2c15
NMRouter: ca1c428cad0abd20293c4dcd075e1afd845bac1f
NMTheme: 7c0860bd20488963d4902142eafd55685d988009
NMUIChainKit: 8c7be6cff5ea7706d4935a8bc5d64df8f1fa9687
QMUIKit: 1063a99f90aedd6e2dd65026ce0df46e6785e67b
SQLCipher: 1ab0b9486a77d141e72e92ff30681926ed79c07a
PODFILE CHECKSUM: e5d1e4f213f9883b5755bf8bfa3c6e5fd1d999ef
COCOAPODS: 1.10.0
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