├── .gitignore ├── LICENSE ├── MyBaseProject.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── MyBaseProject.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── MyBaseProject ├── Base │ ├── BRBaseViewController │ │ ├── BRBaseViewController.h │ │ └── BRBaseViewController.m │ ├── BRNavigationController │ │ ├── BRNavigationController.h │ │ └── BRNavigationController.m │ └── BRTabBarController │ │ ├── BRTabBarController.h │ │ └── BRTabBarController.m ├── Define │ ├── BRConfig.h │ ├── BRConst.h │ ├── BRConst.m │ └── BRMacros.h ├── Main │ ├── AppDelegate.h │ └── AppDelegate.m ├── Modules │ └── Login&Register │ │ └── Controller │ │ ├── BRLoginViewController.h │ │ └── BRLoginViewController.m ├── Other │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── PrefixHeader.pch │ └── main.m ├── Resource │ └── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ └── Contents.json │ │ ├── Contents.json │ │ └── tabBar │ │ ├── Contents.json │ │ ├── LCTabBarBadge.imageset │ │ ├── Contents.json │ │ └── LCTabBarBadge@2x.png │ │ ├── icon_tabbar_discovery.imageset │ │ ├── Contents.json │ │ └── icon_tabbar_discovery.png │ │ ├── icon_tabbar_discovery_selected.imageset │ │ ├── Contents.json │ │ └── icon_tabbar_discovery_selected.png │ │ ├── icon_tabbar_homepage.imageset │ │ ├── Contents.json │ │ ├── icon_tabbar_homepage.png │ │ └── icon_tabbar_homepage@2x.png │ │ ├── icon_tabbar_homepage_selected.imageset │ │ ├── Contents.json │ │ ├── icon_tabbar_homepage_selected.png │ │ └── icon_tabbar_homepage_selected@2x.png │ │ ├── icon_tabbar_merchant_normal.imageset │ │ ├── Contents.json │ │ ├── icon_tabbar_merchant_normal.png │ │ └── icon_tabbar_merchant_normal@2x.png │ │ ├── icon_tabbar_merchant_selected.imageset │ │ ├── Contents.json │ │ ├── icon_tabbar_merchant_selected.png │ │ └── icon_tabbar_merchant_selected@2x.png │ │ ├── icon_tabbar_mine.imageset │ │ ├── Contents.json │ │ ├── icon_tabbar_mine.png │ │ └── icon_tabbar_mine@2x.png │ │ ├── icon_tabbar_mine_selected.imageset │ │ ├── Contents.json │ │ ├── icon_tabbar_mine_selected.png │ │ └── icon_tabbar_mine_selected@2x.png │ │ ├── icon_tabbar_misc.imageset │ │ ├── Contents.json │ │ ├── icon_tabbar_misc.png │ │ └── icon_tabbar_misc@2x.png │ │ ├── icon_tabbar_misc_selected.imageset │ │ ├── Contents.json │ │ ├── icon_tabbar_misc_selected.png │ │ └── icon_tabbar_misc_selected@2x.png │ │ ├── icon_tabbar_nearby.imageset │ │ ├── Contents.json │ │ └── icon_tabbar_nearby.png │ │ ├── icon_tabbar_nearby_selected.imageset │ │ ├── Contents.json │ │ └── icon_tabbar_nearby_selected.png │ │ ├── icon_tabbar_onsite.imageset │ │ ├── Contents.json │ │ └── icon_tabbar_onsite@2x.png │ │ ├── icon_tabbar_onsite_new.imageset │ │ ├── Contents.json │ │ └── icon_tabbar_onsite_new@2x.png │ │ └── icon_tabbar_onsite_selected.imageset │ │ ├── Contents.json │ │ └── icon_tabbar_onsite_selected@2x.png └── Utils │ └── BRKit │ ├── BRKit.h │ ├── BRKitMacro.h │ ├── Foundation │ ├── BRMethod.h │ ├── NSArray+BRAdd.h │ ├── NSArray+BRAdd.m │ ├── NSDate+BRAdd.h │ ├── NSDate+BRAdd.m │ ├── NSDictionary+BRAdd.h │ ├── NSDictionary+BRAdd.m │ ├── NSNumber+BRAdd.h │ ├── NSNumber+BRAdd.m │ ├── NSString+BRAdd.h │ ├── NSString+BRAdd.m │ ├── NSTimer+BRAdd.h │ └── NSTimer+BRAdd.m │ └── UIKit │ ├── UIButton+BRAdd.h │ ├── UIButton+BRAdd.m │ ├── UIColor+BRAdd.h │ ├── UIColor+BRAdd.m │ ├── UIControl+BRAdd.h │ ├── UIControl+BRAdd.m │ ├── UIImage+BRAdd.h │ ├── UIImage+BRAdd.m │ ├── UIImageView+BRAdd.h │ ├── UIImageView+BRAdd.m │ ├── UITextField+BRAdd.h │ ├── UITextField+BRAdd.m │ ├── UITextView+BRAdd.h │ ├── UITextView+BRAdd.m │ ├── UIView+BRAdd.h │ └── UIView+BRAdd.m ├── Podfile ├── Podfile.lock └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /MyBaseProject.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4565A7E220BFA00200313434 /* UIView+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7C320BFA00200313434 /* UIView+BRAdd.m */; }; 11 | 4565A7E320BFA00200313434 /* UIImageView+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7C520BFA00200313434 /* UIImageView+BRAdd.m */; }; 12 | 4565A7E420BFA00200313434 /* UIColor+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7C720BFA00200313434 /* UIColor+BRAdd.m */; }; 13 | 4565A7E520BFA00200313434 /* UITextField+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7C920BFA00200313434 /* UITextField+BRAdd.m */; }; 14 | 4565A7E620BFA00200313434 /* UIControl+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7CC20BFA00200313434 /* UIControl+BRAdd.m */; }; 15 | 4565A7E720BFA00200313434 /* UIImage+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7CE20BFA00200313434 /* UIImage+BRAdd.m */; }; 16 | 4565A7E820BFA00200313434 /* UITextView+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7D020BFA00200313434 /* UITextView+BRAdd.m */; }; 17 | 4565A7E920BFA00200313434 /* UIButton+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7D220BFA00200313434 /* UIButton+BRAdd.m */; }; 18 | 4565A7EA20BFA00200313434 /* NSNumber+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7D920BFA00200313434 /* NSNumber+BRAdd.m */; }; 19 | 4565A7EB20BFA00200313434 /* NSArray+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7DA20BFA00200313434 /* NSArray+BRAdd.m */; }; 20 | 4565A7EC20BFA00200313434 /* NSDictionary+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7DB20BFA00200313434 /* NSDictionary+BRAdd.m */; }; 21 | 4565A7ED20BFA00200313434 /* NSString+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7DC20BFA00200313434 /* NSString+BRAdd.m */; }; 22 | 4565A7EE20BFA00200313434 /* NSDate+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7DD20BFA00200313434 /* NSDate+BRAdd.m */; }; 23 | 4565A7EF20BFA00200313434 /* NSTimer+BRAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7E020BFA00200313434 /* NSTimer+BRAdd.m */; }; 24 | 4565A7F920C0E15800313434 /* BRLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4565A7F820C0E15800313434 /* BRLoginViewController.m */; }; 25 | 6C0AF448F4FC876175B688CE /* libPods-MyBaseProject.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7263652FA340768308475A43 /* libPods-MyBaseProject.a */; }; 26 | C5081FBD20BD453100531B70 /* BRTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = C5081FBC20BD453100531B70 /* BRTabBarController.m */; }; 27 | C5081FC120BD4A6700531B70 /* BRBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C5081FC020BD4A6700531B70 /* BRBaseViewController.m */; }; 28 | C5081FC520BD585300531B70 /* BRNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = C5081FC420BD585300531B70 /* BRNavigationController.m */; }; 29 | C5B6F21B20971004002276E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C5B6F21A20971004002276E0 /* AppDelegate.m */; }; 30 | C5B6F22120971004002276E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C5B6F21F20971004002276E0 /* Main.storyboard */; }; 31 | C5B6F22320971006002276E0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C5B6F22220971006002276E0 /* Assets.xcassets */; }; 32 | C5B6F22620971006002276E0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C5B6F22420971006002276E0 /* LaunchScreen.storyboard */; }; 33 | C5B6F22920971006002276E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C5B6F22820971006002276E0 /* main.m */; }; 34 | C5B6F27C20971FE9002276E0 /* BRConst.m in Sources */ = {isa = PBXBuildFile; fileRef = C5B6F27B20971FE9002276E0 /* BRConst.m */; }; 35 | /* End PBXBuildFile section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 3FECF1899AA61880DF5661AB /* Pods-MyBaseProject.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MyBaseProject.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MyBaseProject/Pods-MyBaseProject.debug.xcconfig"; sourceTree = ""; }; 39 | 4565A7C120BFA00200313434 /* BRKitMacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BRKitMacro.h; sourceTree = ""; }; 40 | 4565A7C320BFA00200313434 /* UIView+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+BRAdd.m"; sourceTree = ""; }; 41 | 4565A7C420BFA00200313434 /* UIImage+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+BRAdd.h"; sourceTree = ""; }; 42 | 4565A7C520BFA00200313434 /* UIImageView+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+BRAdd.m"; sourceTree = ""; }; 43 | 4565A7C620BFA00200313434 /* UIControl+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIControl+BRAdd.h"; sourceTree = ""; }; 44 | 4565A7C720BFA00200313434 /* UIColor+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+BRAdd.m"; sourceTree = ""; }; 45 | 4565A7C820BFA00200313434 /* UIButton+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+BRAdd.h"; sourceTree = ""; }; 46 | 4565A7C920BFA00200313434 /* UITextField+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITextField+BRAdd.m"; sourceTree = ""; }; 47 | 4565A7CA20BFA00200313434 /* UITextView+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITextView+BRAdd.h"; sourceTree = ""; }; 48 | 4565A7CB20BFA00200313434 /* UIView+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+BRAdd.h"; sourceTree = ""; }; 49 | 4565A7CC20BFA00200313434 /* UIControl+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIControl+BRAdd.m"; sourceTree = ""; }; 50 | 4565A7CD20BFA00200313434 /* UIImageView+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+BRAdd.h"; sourceTree = ""; }; 51 | 4565A7CE20BFA00200313434 /* UIImage+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+BRAdd.m"; sourceTree = ""; }; 52 | 4565A7CF20BFA00200313434 /* UIColor+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+BRAdd.h"; sourceTree = ""; }; 53 | 4565A7D020BFA00200313434 /* UITextView+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITextView+BRAdd.m"; sourceTree = ""; }; 54 | 4565A7D120BFA00200313434 /* UITextField+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITextField+BRAdd.h"; sourceTree = ""; }; 55 | 4565A7D220BFA00200313434 /* UIButton+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+BRAdd.m"; sourceTree = ""; }; 56 | 4565A7D420BFA00200313434 /* NSDictionary+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+BRAdd.h"; sourceTree = ""; }; 57 | 4565A7D520BFA00200313434 /* NSString+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+BRAdd.h"; sourceTree = ""; }; 58 | 4565A7D620BFA00200313434 /* BRMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BRMethod.h; sourceTree = ""; }; 59 | 4565A7D720BFA00200313434 /* NSDate+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+BRAdd.h"; sourceTree = ""; }; 60 | 4565A7D820BFA00200313434 /* NSTimer+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTimer+BRAdd.h"; sourceTree = ""; }; 61 | 4565A7D920BFA00200313434 /* NSNumber+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSNumber+BRAdd.m"; sourceTree = ""; }; 62 | 4565A7DA20BFA00200313434 /* NSArray+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+BRAdd.m"; sourceTree = ""; }; 63 | 4565A7DB20BFA00200313434 /* NSDictionary+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+BRAdd.m"; sourceTree = ""; }; 64 | 4565A7DC20BFA00200313434 /* NSString+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+BRAdd.m"; sourceTree = ""; }; 65 | 4565A7DD20BFA00200313434 /* NSDate+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+BRAdd.m"; sourceTree = ""; }; 66 | 4565A7DE20BFA00200313434 /* NSArray+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+BRAdd.h"; sourceTree = ""; }; 67 | 4565A7DF20BFA00200313434 /* NSNumber+BRAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNumber+BRAdd.h"; sourceTree = ""; }; 68 | 4565A7E020BFA00200313434 /* NSTimer+BRAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTimer+BRAdd.m"; sourceTree = ""; }; 69 | 4565A7E120BFA00200313434 /* BRKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BRKit.h; sourceTree = ""; }; 70 | 4565A7F720C0E15800313434 /* BRLoginViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BRLoginViewController.h; sourceTree = ""; }; 71 | 4565A7F820C0E15800313434 /* BRLoginViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BRLoginViewController.m; sourceTree = ""; }; 72 | 7263652FA340768308475A43 /* libPods-MyBaseProject.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MyBaseProject.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 73 | BC56A4F9F864D893551485DE /* Pods-MyBaseProject.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MyBaseProject.release.xcconfig"; path = "Pods/Target Support Files/Pods-MyBaseProject/Pods-MyBaseProject.release.xcconfig"; sourceTree = ""; }; 74 | C5081FBB20BD453100531B70 /* BRTabBarController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BRTabBarController.h; sourceTree = ""; }; 75 | C5081FBC20BD453100531B70 /* BRTabBarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BRTabBarController.m; sourceTree = ""; }; 76 | C5081FBF20BD4A6700531B70 /* BRBaseViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BRBaseViewController.h; sourceTree = ""; }; 77 | C5081FC020BD4A6700531B70 /* BRBaseViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BRBaseViewController.m; sourceTree = ""; }; 78 | C5081FC320BD585300531B70 /* BRNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BRNavigationController.h; sourceTree = ""; }; 79 | C5081FC420BD585300531B70 /* BRNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BRNavigationController.m; sourceTree = ""; }; 80 | C5B6F21620971004002276E0 /* MyBaseProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MyBaseProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; 81 | C5B6F21920971004002276E0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 82 | C5B6F21A20971004002276E0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 83 | C5B6F22020971004002276E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 84 | C5B6F22220971006002276E0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 85 | C5B6F22520971006002276E0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 86 | C5B6F22720971006002276E0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 87 | C5B6F22820971006002276E0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 88 | C5B6F27A20971F55002276E0 /* BRMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BRMacros.h; sourceTree = ""; }; 89 | C5B6F27B20971FE9002276E0 /* BRConst.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BRConst.m; sourceTree = ""; }; 90 | C5B6F27D2097200F002276E0 /* BRConst.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BRConst.h; sourceTree = ""; }; 91 | C5B6F27E20972460002276E0 /* BRConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BRConfig.h; sourceTree = ""; }; 92 | C5B6F27F20974F9D002276E0 /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; }; 93 | /* End PBXFileReference section */ 94 | 95 | /* Begin PBXFrameworksBuildPhase section */ 96 | C5B6F21320971004002276E0 /* Frameworks */ = { 97 | isa = PBXFrameworksBuildPhase; 98 | buildActionMask = 2147483647; 99 | files = ( 100 | 6C0AF448F4FC876175B688CE /* libPods-MyBaseProject.a in Frameworks */, 101 | ); 102 | runOnlyForDeploymentPostprocessing = 0; 103 | }; 104 | /* End PBXFrameworksBuildPhase section */ 105 | 106 | /* Begin PBXGroup section */ 107 | 3C51AB7C10CB0D98E11C32E5 /* Pods */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 3FECF1899AA61880DF5661AB /* Pods-MyBaseProject.debug.xcconfig */, 111 | BC56A4F9F864D893551485DE /* Pods-MyBaseProject.release.xcconfig */, 112 | ); 113 | name = Pods; 114 | sourceTree = ""; 115 | }; 116 | 3DB65C99F4BCADFAEF84642A /* Frameworks */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 7263652FA340768308475A43 /* libPods-MyBaseProject.a */, 120 | ); 121 | name = Frameworks; 122 | sourceTree = ""; 123 | }; 124 | 4565A7B720BEF0A700313434 /* Manager */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | ); 128 | path = Manager; 129 | sourceTree = ""; 130 | }; 131 | 4565A7BA20BEF0FF00313434 /* Utils */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 4565A7C020BFA00200313434 /* BRKit */, 135 | ); 136 | path = Utils; 137 | sourceTree = ""; 138 | }; 139 | 4565A7BB20BEF72600313434 /* Modules */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | 4565A7BC20BEF72F00313434 /* Login&Register */, 143 | 4565A7BD20BEF73600313434 /* Home */, 144 | 4565A7BE20BEF73D00313434 /* Mine */, 145 | ); 146 | path = Modules; 147 | sourceTree = ""; 148 | }; 149 | 4565A7BC20BEF72F00313434 /* Login&Register */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 4565A7F620C0E12700313434 /* Handler */, 153 | 4565A7F520C0E11E00313434 /* Model */, 154 | 4565A7F420C0DF9000313434 /* View */, 155 | 4565A7F320C0DF8000313434 /* Controller */, 156 | ); 157 | path = "Login&Register"; 158 | sourceTree = ""; 159 | }; 160 | 4565A7BD20BEF73600313434 /* Home */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | ); 164 | path = Home; 165 | sourceTree = ""; 166 | }; 167 | 4565A7BE20BEF73D00313434 /* Mine */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | ); 171 | path = Mine; 172 | sourceTree = ""; 173 | }; 174 | 4565A7BF20BEF76500313434 /* Vendor */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | ); 178 | path = Vendor; 179 | sourceTree = ""; 180 | }; 181 | 4565A7C020BFA00200313434 /* BRKit */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 4565A7E120BFA00200313434 /* BRKit.h */, 185 | 4565A7C120BFA00200313434 /* BRKitMacro.h */, 186 | 4565A7C220BFA00200313434 /* UIKit */, 187 | 4565A7D320BFA00200313434 /* Foundation */, 188 | ); 189 | path = BRKit; 190 | sourceTree = ""; 191 | }; 192 | 4565A7C220BFA00200313434 /* UIKit */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | 4565A7C320BFA00200313434 /* UIView+BRAdd.m */, 196 | 4565A7C420BFA00200313434 /* UIImage+BRAdd.h */, 197 | 4565A7CE20BFA00200313434 /* UIImage+BRAdd.m */, 198 | 4565A7C520BFA00200313434 /* UIImageView+BRAdd.m */, 199 | 4565A7C620BFA00200313434 /* UIControl+BRAdd.h */, 200 | 4565A7C720BFA00200313434 /* UIColor+BRAdd.m */, 201 | 4565A7C820BFA00200313434 /* UIButton+BRAdd.h */, 202 | 4565A7C920BFA00200313434 /* UITextField+BRAdd.m */, 203 | 4565A7CA20BFA00200313434 /* UITextView+BRAdd.h */, 204 | 4565A7CB20BFA00200313434 /* UIView+BRAdd.h */, 205 | 4565A7CC20BFA00200313434 /* UIControl+BRAdd.m */, 206 | 4565A7CD20BFA00200313434 /* UIImageView+BRAdd.h */, 207 | 4565A7CF20BFA00200313434 /* UIColor+BRAdd.h */, 208 | 4565A7D020BFA00200313434 /* UITextView+BRAdd.m */, 209 | 4565A7D120BFA00200313434 /* UITextField+BRAdd.h */, 210 | 4565A7D220BFA00200313434 /* UIButton+BRAdd.m */, 211 | ); 212 | path = UIKit; 213 | sourceTree = ""; 214 | }; 215 | 4565A7D320BFA00200313434 /* Foundation */ = { 216 | isa = PBXGroup; 217 | children = ( 218 | 4565A7D420BFA00200313434 /* NSDictionary+BRAdd.h */, 219 | 4565A7D520BFA00200313434 /* NSString+BRAdd.h */, 220 | 4565A7D620BFA00200313434 /* BRMethod.h */, 221 | 4565A7D720BFA00200313434 /* NSDate+BRAdd.h */, 222 | 4565A7D820BFA00200313434 /* NSTimer+BRAdd.h */, 223 | 4565A7D920BFA00200313434 /* NSNumber+BRAdd.m */, 224 | 4565A7DA20BFA00200313434 /* NSArray+BRAdd.m */, 225 | 4565A7DB20BFA00200313434 /* NSDictionary+BRAdd.m */, 226 | 4565A7DC20BFA00200313434 /* NSString+BRAdd.m */, 227 | 4565A7DD20BFA00200313434 /* NSDate+BRAdd.m */, 228 | 4565A7DE20BFA00200313434 /* NSArray+BRAdd.h */, 229 | 4565A7DF20BFA00200313434 /* NSNumber+BRAdd.h */, 230 | 4565A7E020BFA00200313434 /* NSTimer+BRAdd.m */, 231 | ); 232 | path = Foundation; 233 | sourceTree = ""; 234 | }; 235 | 4565A7F320C0DF8000313434 /* Controller */ = { 236 | isa = PBXGroup; 237 | children = ( 238 | 4565A7F720C0E15800313434 /* BRLoginViewController.h */, 239 | 4565A7F820C0E15800313434 /* BRLoginViewController.m */, 240 | ); 241 | path = Controller; 242 | sourceTree = ""; 243 | }; 244 | 4565A7F420C0DF9000313434 /* View */ = { 245 | isa = PBXGroup; 246 | children = ( 247 | ); 248 | path = View; 249 | sourceTree = ""; 250 | }; 251 | 4565A7F520C0E11E00313434 /* Model */ = { 252 | isa = PBXGroup; 253 | children = ( 254 | ); 255 | path = Model; 256 | sourceTree = ""; 257 | }; 258 | 4565A7F620C0E12700313434 /* Handler */ = { 259 | isa = PBXGroup; 260 | children = ( 261 | ); 262 | path = Handler; 263 | sourceTree = ""; 264 | }; 265 | C5081FBA20BD44F300531B70 /* BRTabBarController */ = { 266 | isa = PBXGroup; 267 | children = ( 268 | C5081FBB20BD453100531B70 /* BRTabBarController.h */, 269 | C5081FBC20BD453100531B70 /* BRTabBarController.m */, 270 | ); 271 | path = BRTabBarController; 272 | sourceTree = ""; 273 | }; 274 | C5081FBE20BD49F600531B70 /* BRBaseViewController */ = { 275 | isa = PBXGroup; 276 | children = ( 277 | C5081FBF20BD4A6700531B70 /* BRBaseViewController.h */, 278 | C5081FC020BD4A6700531B70 /* BRBaseViewController.m */, 279 | ); 280 | path = BRBaseViewController; 281 | sourceTree = ""; 282 | }; 283 | C5081FC220BD583200531B70 /* BRNavigationController */ = { 284 | isa = PBXGroup; 285 | children = ( 286 | C5081FC320BD585300531B70 /* BRNavigationController.h */, 287 | C5081FC420BD585300531B70 /* BRNavigationController.m */, 288 | ); 289 | path = BRNavigationController; 290 | sourceTree = ""; 291 | }; 292 | C5B6F20D20971004002276E0 = { 293 | isa = PBXGroup; 294 | children = ( 295 | C5B6F21820971004002276E0 /* MyBaseProject */, 296 | C5B6F21720971004002276E0 /* Products */, 297 | 3C51AB7C10CB0D98E11C32E5 /* Pods */, 298 | 3DB65C99F4BCADFAEF84642A /* Frameworks */, 299 | ); 300 | sourceTree = ""; 301 | }; 302 | C5B6F21720971004002276E0 /* Products */ = { 303 | isa = PBXGroup; 304 | children = ( 305 | C5B6F21620971004002276E0 /* MyBaseProject.app */, 306 | ); 307 | name = Products; 308 | sourceTree = ""; 309 | }; 310 | C5B6F21820971004002276E0 /* MyBaseProject */ = { 311 | isa = PBXGroup; 312 | children = ( 313 | C5B6F23320971750002276E0 /* Define */, 314 | C5B6F23720971858002276E0 /* Base */, 315 | C5B6F22F209711E3002276E0 /* Main */, 316 | 4565A7BB20BEF72600313434 /* Modules */, 317 | 4565A7B720BEF0A700313434 /* Manager */, 318 | 4565A7BA20BEF0FF00313434 /* Utils */, 319 | 4565A7BF20BEF76500313434 /* Vendor */, 320 | C5B6F2382097186A002276E0 /* Resource */, 321 | C5B6F23920971870002276E0 /* Other */, 322 | ); 323 | path = MyBaseProject; 324 | sourceTree = ""; 325 | }; 326 | C5B6F22F209711E3002276E0 /* Main */ = { 327 | isa = PBXGroup; 328 | children = ( 329 | C5B6F21920971004002276E0 /* AppDelegate.h */, 330 | C5B6F21A20971004002276E0 /* AppDelegate.m */, 331 | ); 332 | path = Main; 333 | sourceTree = ""; 334 | }; 335 | C5B6F23320971750002276E0 /* Define */ = { 336 | isa = PBXGroup; 337 | children = ( 338 | C5B6F27A20971F55002276E0 /* BRMacros.h */, 339 | C5B6F27E20972460002276E0 /* BRConfig.h */, 340 | C5B6F27D2097200F002276E0 /* BRConst.h */, 341 | C5B6F27B20971FE9002276E0 /* BRConst.m */, 342 | ); 343 | path = Define; 344 | sourceTree = ""; 345 | }; 346 | C5B6F23720971858002276E0 /* Base */ = { 347 | isa = PBXGroup; 348 | children = ( 349 | C5081FBE20BD49F600531B70 /* BRBaseViewController */, 350 | C5081FC220BD583200531B70 /* BRNavigationController */, 351 | C5081FBA20BD44F300531B70 /* BRTabBarController */, 352 | ); 353 | path = Base; 354 | sourceTree = ""; 355 | }; 356 | C5B6F2382097186A002276E0 /* Resource */ = { 357 | isa = PBXGroup; 358 | children = ( 359 | C5B6F22220971006002276E0 /* Assets.xcassets */, 360 | ); 361 | path = Resource; 362 | sourceTree = ""; 363 | }; 364 | C5B6F23920971870002276E0 /* Other */ = { 365 | isa = PBXGroup; 366 | children = ( 367 | C5B6F27F20974F9D002276E0 /* PrefixHeader.pch */, 368 | C5B6F21F20971004002276E0 /* Main.storyboard */, 369 | C5B6F22420971006002276E0 /* LaunchScreen.storyboard */, 370 | C5B6F22720971006002276E0 /* Info.plist */, 371 | C5B6F22820971006002276E0 /* main.m */, 372 | ); 373 | path = Other; 374 | sourceTree = ""; 375 | }; 376 | /* End PBXGroup section */ 377 | 378 | /* Begin PBXNativeTarget section */ 379 | C5B6F21520971004002276E0 /* MyBaseProject */ = { 380 | isa = PBXNativeTarget; 381 | buildConfigurationList = C5B6F22C20971006002276E0 /* Build configuration list for PBXNativeTarget "MyBaseProject" */; 382 | buildPhases = ( 383 | 7CAC7D9C7591BBB319293F91 /* [CP] Check Pods Manifest.lock */, 384 | C5B6F21220971004002276E0 /* Sources */, 385 | C5B6F21320971004002276E0 /* Frameworks */, 386 | C5B6F21420971004002276E0 /* Resources */, 387 | ); 388 | buildRules = ( 389 | ); 390 | dependencies = ( 391 | ); 392 | name = MyBaseProject; 393 | productName = MyBaseProject; 394 | productReference = C5B6F21620971004002276E0 /* MyBaseProject.app */; 395 | productType = "com.apple.product-type.application"; 396 | }; 397 | /* End PBXNativeTarget section */ 398 | 399 | /* Begin PBXProject section */ 400 | C5B6F20E20971004002276E0 /* Project object */ = { 401 | isa = PBXProject; 402 | attributes = { 403 | CLASSPREFIX = BR; 404 | LastUpgradeCheck = 0930; 405 | ORGANIZATIONNAME = 91renb; 406 | TargetAttributes = { 407 | C5B6F21520971004002276E0 = { 408 | CreatedOnToolsVersion = 9.3; 409 | }; 410 | }; 411 | }; 412 | buildConfigurationList = C5B6F21120971004002276E0 /* Build configuration list for PBXProject "MyBaseProject" */; 413 | compatibilityVersion = "Xcode 9.3"; 414 | developmentRegion = en; 415 | hasScannedForEncodings = 0; 416 | knownRegions = ( 417 | en, 418 | Base, 419 | ); 420 | mainGroup = C5B6F20D20971004002276E0; 421 | productRefGroup = C5B6F21720971004002276E0 /* Products */; 422 | projectDirPath = ""; 423 | projectRoot = ""; 424 | targets = ( 425 | C5B6F21520971004002276E0 /* MyBaseProject */, 426 | ); 427 | }; 428 | /* End PBXProject section */ 429 | 430 | /* Begin PBXResourcesBuildPhase section */ 431 | C5B6F21420971004002276E0 /* Resources */ = { 432 | isa = PBXResourcesBuildPhase; 433 | buildActionMask = 2147483647; 434 | files = ( 435 | C5B6F22620971006002276E0 /* LaunchScreen.storyboard in Resources */, 436 | C5B6F22320971006002276E0 /* Assets.xcassets in Resources */, 437 | C5B6F22120971004002276E0 /* Main.storyboard in Resources */, 438 | ); 439 | runOnlyForDeploymentPostprocessing = 0; 440 | }; 441 | /* End PBXResourcesBuildPhase section */ 442 | 443 | /* Begin PBXShellScriptBuildPhase section */ 444 | 7CAC7D9C7591BBB319293F91 /* [CP] Check Pods Manifest.lock */ = { 445 | isa = PBXShellScriptBuildPhase; 446 | buildActionMask = 2147483647; 447 | files = ( 448 | ); 449 | inputPaths = ( 450 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 451 | "${PODS_ROOT}/Manifest.lock", 452 | ); 453 | name = "[CP] Check Pods Manifest.lock"; 454 | outputPaths = ( 455 | "$(DERIVED_FILE_DIR)/Pods-MyBaseProject-checkManifestLockResult.txt", 456 | ); 457 | runOnlyForDeploymentPostprocessing = 0; 458 | shellPath = /bin/sh; 459 | 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"; 460 | showEnvVarsInLog = 0; 461 | }; 462 | /* End PBXShellScriptBuildPhase section */ 463 | 464 | /* Begin PBXSourcesBuildPhase section */ 465 | C5B6F21220971004002276E0 /* Sources */ = { 466 | isa = PBXSourcesBuildPhase; 467 | buildActionMask = 2147483647; 468 | files = ( 469 | C5081FC120BD4A6700531B70 /* BRBaseViewController.m in Sources */, 470 | 4565A7EC20BFA00200313434 /* NSDictionary+BRAdd.m in Sources */, 471 | C5B6F22920971006002276E0 /* main.m in Sources */, 472 | 4565A7EB20BFA00200313434 /* NSArray+BRAdd.m in Sources */, 473 | 4565A7EF20BFA00200313434 /* NSTimer+BRAdd.m in Sources */, 474 | 4565A7E320BFA00200313434 /* UIImageView+BRAdd.m in Sources */, 475 | 4565A7E520BFA00200313434 /* UITextField+BRAdd.m in Sources */, 476 | 4565A7EE20BFA00200313434 /* NSDate+BRAdd.m in Sources */, 477 | C5B6F27C20971FE9002276E0 /* BRConst.m in Sources */, 478 | C5B6F21B20971004002276E0 /* AppDelegate.m in Sources */, 479 | 4565A7E620BFA00200313434 /* UIControl+BRAdd.m in Sources */, 480 | 4565A7E920BFA00200313434 /* UIButton+BRAdd.m in Sources */, 481 | 4565A7EA20BFA00200313434 /* NSNumber+BRAdd.m in Sources */, 482 | 4565A7ED20BFA00200313434 /* NSString+BRAdd.m in Sources */, 483 | 4565A7E720BFA00200313434 /* UIImage+BRAdd.m in Sources */, 484 | 4565A7E420BFA00200313434 /* UIColor+BRAdd.m in Sources */, 485 | 4565A7E220BFA00200313434 /* UIView+BRAdd.m in Sources */, 486 | C5081FBD20BD453100531B70 /* BRTabBarController.m in Sources */, 487 | C5081FC520BD585300531B70 /* BRNavigationController.m in Sources */, 488 | 4565A7E820BFA00200313434 /* UITextView+BRAdd.m in Sources */, 489 | 4565A7F920C0E15800313434 /* BRLoginViewController.m in Sources */, 490 | ); 491 | runOnlyForDeploymentPostprocessing = 0; 492 | }; 493 | /* End PBXSourcesBuildPhase section */ 494 | 495 | /* Begin PBXVariantGroup section */ 496 | C5B6F21F20971004002276E0 /* Main.storyboard */ = { 497 | isa = PBXVariantGroup; 498 | children = ( 499 | C5B6F22020971004002276E0 /* Base */, 500 | ); 501 | name = Main.storyboard; 502 | sourceTree = ""; 503 | }; 504 | C5B6F22420971006002276E0 /* LaunchScreen.storyboard */ = { 505 | isa = PBXVariantGroup; 506 | children = ( 507 | C5B6F22520971006002276E0 /* Base */, 508 | ); 509 | name = LaunchScreen.storyboard; 510 | sourceTree = ""; 511 | }; 512 | /* End PBXVariantGroup section */ 513 | 514 | /* Begin XCBuildConfiguration section */ 515 | C5B6F22A20971006002276E0 /* Debug */ = { 516 | isa = XCBuildConfiguration; 517 | buildSettings = { 518 | ALWAYS_SEARCH_USER_PATHS = NO; 519 | CLANG_ANALYZER_NONNULL = YES; 520 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 521 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 522 | CLANG_CXX_LIBRARY = "libc++"; 523 | CLANG_ENABLE_MODULES = YES; 524 | CLANG_ENABLE_OBJC_ARC = YES; 525 | CLANG_ENABLE_OBJC_WEAK = YES; 526 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 527 | CLANG_WARN_BOOL_CONVERSION = YES; 528 | CLANG_WARN_COMMA = YES; 529 | CLANG_WARN_CONSTANT_CONVERSION = YES; 530 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 531 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 532 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 533 | CLANG_WARN_EMPTY_BODY = YES; 534 | CLANG_WARN_ENUM_CONVERSION = YES; 535 | CLANG_WARN_INFINITE_RECURSION = YES; 536 | CLANG_WARN_INT_CONVERSION = YES; 537 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 538 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 539 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 540 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 541 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 542 | CLANG_WARN_STRICT_PROTOTYPES = YES; 543 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 544 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 545 | CLANG_WARN_UNREACHABLE_CODE = YES; 546 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 547 | CODE_SIGN_IDENTITY = "iPhone Developer"; 548 | COPY_PHASE_STRIP = NO; 549 | DEBUG_INFORMATION_FORMAT = dwarf; 550 | ENABLE_STRICT_OBJC_MSGSEND = YES; 551 | ENABLE_TESTABILITY = YES; 552 | GCC_C_LANGUAGE_STANDARD = gnu11; 553 | GCC_DYNAMIC_NO_PIC = NO; 554 | GCC_NO_COMMON_BLOCKS = YES; 555 | GCC_OPTIMIZATION_LEVEL = 0; 556 | GCC_PREPROCESSOR_DEFINITIONS = ( 557 | "DEBUG=1", 558 | "$(inherited)", 559 | ); 560 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 561 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 562 | GCC_WARN_UNDECLARED_SELECTOR = YES; 563 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 564 | GCC_WARN_UNUSED_FUNCTION = YES; 565 | GCC_WARN_UNUSED_VARIABLE = YES; 566 | IPHONEOS_DEPLOYMENT_TARGET = 11.3; 567 | MTL_ENABLE_DEBUG_INFO = YES; 568 | ONLY_ACTIVE_ARCH = YES; 569 | SDKROOT = iphoneos; 570 | }; 571 | name = Debug; 572 | }; 573 | C5B6F22B20971006002276E0 /* Release */ = { 574 | isa = XCBuildConfiguration; 575 | buildSettings = { 576 | ALWAYS_SEARCH_USER_PATHS = NO; 577 | CLANG_ANALYZER_NONNULL = YES; 578 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 579 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 580 | CLANG_CXX_LIBRARY = "libc++"; 581 | CLANG_ENABLE_MODULES = YES; 582 | CLANG_ENABLE_OBJC_ARC = YES; 583 | CLANG_ENABLE_OBJC_WEAK = YES; 584 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 585 | CLANG_WARN_BOOL_CONVERSION = YES; 586 | CLANG_WARN_COMMA = YES; 587 | CLANG_WARN_CONSTANT_CONVERSION = YES; 588 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 589 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 590 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 591 | CLANG_WARN_EMPTY_BODY = YES; 592 | CLANG_WARN_ENUM_CONVERSION = YES; 593 | CLANG_WARN_INFINITE_RECURSION = YES; 594 | CLANG_WARN_INT_CONVERSION = YES; 595 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 596 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 597 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 598 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 599 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 600 | CLANG_WARN_STRICT_PROTOTYPES = YES; 601 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 602 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 603 | CLANG_WARN_UNREACHABLE_CODE = YES; 604 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 605 | CODE_SIGN_IDENTITY = "iPhone Developer"; 606 | COPY_PHASE_STRIP = NO; 607 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 608 | ENABLE_NS_ASSERTIONS = NO; 609 | ENABLE_STRICT_OBJC_MSGSEND = YES; 610 | GCC_C_LANGUAGE_STANDARD = gnu11; 611 | GCC_NO_COMMON_BLOCKS = YES; 612 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 613 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 614 | GCC_WARN_UNDECLARED_SELECTOR = YES; 615 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 616 | GCC_WARN_UNUSED_FUNCTION = YES; 617 | GCC_WARN_UNUSED_VARIABLE = YES; 618 | IPHONEOS_DEPLOYMENT_TARGET = 11.3; 619 | MTL_ENABLE_DEBUG_INFO = NO; 620 | SDKROOT = iphoneos; 621 | VALIDATE_PRODUCT = YES; 622 | }; 623 | name = Release; 624 | }; 625 | C5B6F22D20971006002276E0 /* Debug */ = { 626 | isa = XCBuildConfiguration; 627 | baseConfigurationReference = 3FECF1899AA61880DF5661AB /* Pods-MyBaseProject.debug.xcconfig */; 628 | buildSettings = { 629 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 630 | CODE_SIGN_STYLE = Automatic; 631 | GCC_PREFIX_HEADER = "$(SRCROOT)/MyBaseProject/Other/PrefixHeader.pch"; 632 | INFOPLIST_FILE = "$(SRCROOT)/MyBaseProject/Other/Info.plist"; 633 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 634 | LD_RUNPATH_SEARCH_PATHS = ( 635 | "$(inherited)", 636 | "@executable_path/Frameworks", 637 | ); 638 | PRODUCT_BUNDLE_IDENTIFIER = com.91renb.MyBaseProject; 639 | PRODUCT_NAME = "$(TARGET_NAME)"; 640 | TARGETED_DEVICE_FAMILY = 1; 641 | }; 642 | name = Debug; 643 | }; 644 | C5B6F22E20971006002276E0 /* Release */ = { 645 | isa = XCBuildConfiguration; 646 | baseConfigurationReference = BC56A4F9F864D893551485DE /* Pods-MyBaseProject.release.xcconfig */; 647 | buildSettings = { 648 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 649 | CODE_SIGN_STYLE = Automatic; 650 | GCC_PREFIX_HEADER = "$(SRCROOT)/MyBaseProject/Other/PrefixHeader.pch"; 651 | INFOPLIST_FILE = "$(SRCROOT)/MyBaseProject/Other/Info.plist"; 652 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 653 | LD_RUNPATH_SEARCH_PATHS = ( 654 | "$(inherited)", 655 | "@executable_path/Frameworks", 656 | ); 657 | PRODUCT_BUNDLE_IDENTIFIER = com.91renb.MyBaseProject; 658 | PRODUCT_NAME = "$(TARGET_NAME)"; 659 | TARGETED_DEVICE_FAMILY = 1; 660 | }; 661 | name = Release; 662 | }; 663 | /* End XCBuildConfiguration section */ 664 | 665 | /* Begin XCConfigurationList section */ 666 | C5B6F21120971004002276E0 /* Build configuration list for PBXProject "MyBaseProject" */ = { 667 | isa = XCConfigurationList; 668 | buildConfigurations = ( 669 | C5B6F22A20971006002276E0 /* Debug */, 670 | C5B6F22B20971006002276E0 /* Release */, 671 | ); 672 | defaultConfigurationIsVisible = 0; 673 | defaultConfigurationName = Release; 674 | }; 675 | C5B6F22C20971006002276E0 /* Build configuration list for PBXNativeTarget "MyBaseProject" */ = { 676 | isa = XCConfigurationList; 677 | buildConfigurations = ( 678 | C5B6F22D20971006002276E0 /* Debug */, 679 | C5B6F22E20971006002276E0 /* Release */, 680 | ); 681 | defaultConfigurationIsVisible = 0; 682 | defaultConfigurationName = Release; 683 | }; 684 | /* End XCConfigurationList section */ 685 | }; 686 | rootObject = C5B6F20E20971004002276E0 /* Project object */; 687 | } 688 | -------------------------------------------------------------------------------- /MyBaseProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MyBaseProject.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MyBaseProject.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /MyBaseProject.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MyBaseProject/Base/BRBaseViewController/BRBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BRBaseViewController.h 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/5/29. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// 自定义 ViewController 的基类 12 | @interface BRBaseViewController : UIViewController 13 | /** 修改状态栏颜色 */ 14 | @property (nonatomic, assign) UIStatusBarStyle statusBarStyle; 15 | /** 是否显示返回按钮, 默认情况是NO */ 16 | @property (nonatomic, assign) BOOL hideBackBtn; 17 | /** 默认返回按钮的点击事件,默认是返回,子类可重写 */ 18 | - (void)clickBackBtn; 19 | 20 | /** 21 | * 导航栏添加图标按钮 22 | * 23 | * @param imageNames 图标数组 24 | * @param isLeft 是否是左边 非左即右 25 | * @param target 目标 self 26 | * @param action 按钮的点击方法 27 | */ 28 | - (void)setupNavigationItemWithImageNames:(NSArray *)imageNames isLeft:(BOOL)isLeft target:(id)target action:(SEL)action; 29 | 30 | /** 31 | * 导航栏添加文本按钮 32 | * 33 | * @param titles 文本数组 34 | * @param isLeft 是否是左边 非左即右 35 | * @param target 目标 self 36 | * @param action 按钮的点击方法 37 | */ 38 | - (void)setupNavigationItemWithTitles:(NSArray *)titles isLeft:(BOOL)isLeft target:(id)target action:(SEL)action; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /MyBaseProject/Base/BRBaseViewController/BRBaseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BRBaseViewController.m 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/5/29. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "BRBaseViewController.h" 10 | 11 | @interface BRBaseViewController () 12 | 13 | @end 14 | 15 | @implementation BRBaseViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // 设置默认样式 20 | [self setupDefaultStyle]; 21 | } 22 | 23 | - (void)setupDefaultStyle { 24 | //是否显示返回按钮 25 | self.hideBackBtn = NO; 26 | //默认导航栏样式:黑字 27 | self.statusBarStyle = UIStatusBarStyleLightContent; 28 | } 29 | 30 | #pragma mark - 动态更新状态栏颜色 31 | - (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle { 32 | _statusBarStyle = statusBarStyle; 33 | [self setNeedsStatusBarAppearanceUpdate]; 34 | } 35 | 36 | - (UIStatusBarStyle)preferredStatusBarStyle { 37 | return _statusBarStyle; 38 | } 39 | 40 | #pragma mark - 是否显示返回按钮 41 | - (void)setHideBackBtn:(BOOL)hideBackBtn { 42 | _hideBackBtn = hideBackBtn; 43 | // 当VC所在的导航控制器中的VC个数大于1 或者 是present出来的VC时,才展示返回按钮,其他情况不展示 44 | if (!hideBackBtn && (self.navigationController.viewControllers.count > 1 || self.navigationController.presentingViewController != nil)) { 45 | [self setupNavigationItemWithImageNames:@[@"back_icon"] isLeft:YES target:self action:@selector(clickBackBtn)]; 46 | } else { 47 | self.navigationItem.hidesBackButton = YES; 48 | UIBarButtonItem * NULLBar = [[UIBarButtonItem alloc]initWithCustomView:[UIView new]]; 49 | self.navigationItem.leftBarButtonItem = NULLBar; 50 | } 51 | } 52 | 53 | - (void)clickBackBtn { 54 | if (self.presentingViewController) { 55 | [self dismissViewControllerAnimated:YES completion:nil]; 56 | } else { 57 | [self.navigationController popViewControllerAnimated:YES]; 58 | } 59 | } 60 | 61 | #pragma mark - 设置导航栏的图片按钮 62 | - (void)setupNavigationItemWithImageNames:(NSArray *)imageNames isLeft:(BOOL)isLeft target:(id)target action:(SEL)action { 63 | NSMutableArray *items = [[NSMutableArray alloc] init]; 64 | //调整按钮位置 65 | // UIBarButtonItem* spaceItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; 66 | // //将宽度设为负值 67 | // spaceItem.width= -5; 68 | // [items addObject:spaceItem]; 69 | NSInteger i = 0; 70 | for (NSString * imageName in imageNames) { 71 | UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom]; 72 | [btn setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal]; 73 | btn.frame = CGRectMake(0, 0, 30, 30); 74 | [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; 75 | 76 | if (isLeft) { 77 | [btn setContentEdgeInsets:UIEdgeInsetsMake(0, -10, 0, 10)]; 78 | } else { 79 | [btn setContentEdgeInsets:UIEdgeInsetsMake(0, 10, 0, -10)]; 80 | } 81 | 82 | btn.tag = i++; 83 | UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:btn]; 84 | [items addObject:item]; 85 | } 86 | if (isLeft) { 87 | self.navigationItem.leftBarButtonItems = items; 88 | } else { 89 | self.navigationItem.rightBarButtonItems = items; 90 | } 91 | } 92 | 93 | #pragma mark — 设置导航栏的文字按钮 94 | - (void)setupNavigationItemWithTitles:(NSArray *)titles isLeft:(BOOL)isLeft target:(id)target action:(SEL)action { 95 | NSMutableArray *items = [[NSMutableArray alloc] init]; 96 | //调整按钮位置 97 | // UIBarButtonItem* spaceItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; 98 | // //将宽度设为负值 99 | // spaceItem.width= -5; 100 | // [items addObject:spaceItem]; 101 | 102 | NSInteger i = 0; 103 | for (NSString * title in titles) { 104 | UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom]; 105 | btn.frame = CGRectMake(0, 0, 30, 30); 106 | [btn setTitle:title forState:UIControlStateNormal]; 107 | [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; 108 | btn.titleLabel.font = [UIFont systemFontOfSize:16]; 109 | [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 110 | btn.tag = i++; 111 | [btn sizeToFit]; 112 | 113 | //设置偏移 114 | if (isLeft) { 115 | [btn setContentEdgeInsets:UIEdgeInsetsMake(0, -10, 0, 10)]; 116 | } else { 117 | [btn setContentEdgeInsets:UIEdgeInsetsMake(0, 10, 0, -10)]; 118 | } 119 | UIBarButtonItem * item = [[UIBarButtonItem alloc] initWithCustomView:btn]; 120 | [items addObject:item]; 121 | } 122 | if (isLeft) { 123 | self.navigationItem.leftBarButtonItems = items; 124 | } else { 125 | self.navigationItem.rightBarButtonItems = items; 126 | } 127 | } 128 | 129 | 130 | @end 131 | -------------------------------------------------------------------------------- /MyBaseProject/Base/BRNavigationController/BRNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BRNavigationController.h 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/5/29. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BRNavigationController : UINavigationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MyBaseProject/Base/BRNavigationController/BRNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BRNavigationController.m 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/5/29. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "BRNavigationController.h" 10 | 11 | @interface BRNavigationController () 12 | 13 | @end 14 | 15 | @implementation BRNavigationController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // 1.设置导航栏背景颜色 20 | self.navigationBar.barTintColor = kBRThemeColor; 21 | //[self.navigationBar setBackgroundImage:[UIImage imageNamed:@"navbar_bg2"] forBarMetrics:UIBarMetricsDefault]; 22 | 23 | // 此行代码能将状态栏和导航栏字体颜色全体改变,只能是黑色或白色 24 | self.navigationBar.barStyle = UIBarStyleBlack; 25 | 26 | // 2.设置导航栏所有子视图(返回图片)的颜色 27 | self.navigationBar.tintColor = [UIColor whiteColor]; 28 | 29 | // 3.设置 title 颜色 30 | self.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]}; 31 | self.navigationBar.backIndicatorImage = [UIImage new]; 32 | 33 | // 将系统默认的返回按钮设置到导航栏可见区域外(防止与自定义的返回按钮重叠) 34 | [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -100) forBarMetrics:UIBarMetricsDefault]; 35 | 36 | self.delegate = self; 37 | // 设置返回手势的代理 38 | self.interactivePopGestureRecognizer.delegate = self; 39 | } 40 | 41 | #pragma mark - 重写父类导航控制器的push方法 42 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { 43 | // 判断非根视图控制器 44 | if (self.viewControllers.count > 0) { 45 | // 设置导航栏左上角的返回按钮 (非根控制器才需要设置返回按钮) 46 | // viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.backButton]; 47 | // 隐藏底部的工具条 48 | viewController.hidesBottomBarWhenPushed = YES; 49 | } 50 | // 执行跳转 51 | [super pushViewController:viewController animated:animated]; 52 | } 53 | 54 | /** 55 | * 设置是否允许返回手势: 因为修改了系统的返回按钮,所以还需要设置手势事件 56 | * 手势识别对象会调用这个代理方法来决定手势是否有效 57 | * 58 | * @return YES : 手势有效, NO : 手势无效 59 | */ 60 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { 61 | // 当前导航控制器的子控制器有2个以上的时候,手势有效 62 | return self.childViewControllers.count > 1; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /MyBaseProject/Base/BRTabBarController/BRTabBarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BRTabBarController.h 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/5/29. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BRTabBarController : UITabBarController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MyBaseProject/Base/BRTabBarController/BRTabBarController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BRTabBarController.m 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/5/29. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "BRTabBarController.h" 10 | #import "BRNavigationController.h" 11 | 12 | @interface BRTabBarController () 13 | //@property (nonatomic, strong) NSMutableArray *controllers; //tabbar root VC 14 | 15 | @end 16 | 17 | @implementation BRTabBarController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | self.tabBar.barTintColor = [UIColor whiteColor]; 22 | // 未选中字体颜色 23 | [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor lightGrayColor], NSFontAttributeName:[UIFont systemFontOfSize:10]} forState:UIControlStateNormal]; 24 | // 选中字体颜色 25 | [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:kBRThemeColor, NSFontAttributeName:[UIFont systemFontOfSize:10]} forState:UIControlStateSelected]; 26 | self.delegate = self; 27 | [self setupUI]; 28 | } 29 | 30 | - (void)setupUI { 31 | // 初始化tabbar 32 | [self setupTabBar]; 33 | // 添加子控制器 34 | [self setupAllChildViewController]; 35 | } 36 | 37 | #pragma mark - 初始化TabBar 38 | - (void)setupTabBar { 39 | // 设置背景色 去掉分割线 40 | // [self setValue:[XYTabBar new] forKey:@"tabBar"]; 41 | [self.tabBar setBackgroundColor:[UIColor whiteColor]]; 42 | [self.tabBar setBackgroundImage:[UIImage new]]; 43 | } 44 | 45 | #pragma mark - 初始化VC 46 | - (void)setupAllChildViewController { 47 | UIViewController *homeVC = [[UIViewController alloc]init]; 48 | [self setupChildViewController:homeVC title:@"首页" imageName:@"icon_tabbar_homepage" selectImageName:@"icon_tabbar_homepage_selected"]; 49 | 50 | UIViewController *makeFriendVC = [[UIViewController alloc]init]; 51 | [self setupChildViewController:makeFriendVC title:@"分类" imageName:@"icon_tabbar_onsite" selectImageName:@"icon_tabbar_onsite_selected"]; 52 | 53 | UIViewController *msgVC = [UIViewController new]; 54 | [self setupChildViewController:msgVC title:@"消息" imageName:@"icon_tabbar_merchant_normal" selectImageName:@"icon_tabbar_merchant_selected"]; 55 | 56 | UIViewController *mineVC = [[UIViewController alloc]init]; 57 | [self setupChildViewController:mineVC title:@"我的" imageName:@"icon_tabbar_mine" selectImageName:@"icon_tabbar_mine_selected"]; 58 | } 59 | 60 | - (void)setupChildViewController:(UIViewController *)viewController title:(NSString *)title imageName:(NSString *)imageName selectImageName:(NSString *)selectImageName { 61 | viewController.title = title; 62 | viewController.tabBarItem.title = title; 63 | // 显示原图,避免被系统渲染成蓝色 64 | viewController.tabBarItem.image = [UIImage br_originalImage:imageName]; 65 | viewController.tabBarItem.selectedImage = [UIImage br_originalImage:selectImageName]; 66 | // viewController.tabBarItem.badgeValue = @"100"; 67 | // 数字、小红点、文字 68 | viewController.tabBarItem.badgeValue = @"5"; 69 | // 包装导航控制器 70 | BRNavigationController *nav = [[BRNavigationController alloc]initWithRootViewController:viewController]; 71 | [self addChildViewController:nav]; 72 | } 73 | 74 | #pragma mark - UITabBarControllerDelegate 75 | - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { 76 | NSLog(@"选中 %ld", tabBarController.selectedIndex); 77 | } 78 | 79 | // 拦截tabbar跳转 80 | - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController { 81 | // [viewController.tabBarItem.title isEqualToString:@"分类"] 82 | if (viewController == self.childViewControllers[1]) { 83 | // 如果当前未登录,先去登录,再调整到当前viewController 84 | // return [BSVisitorHelper actionRequireLoginWithCompletionBlock:^{ 85 | // [tabBarController setSelectedViewController:viewController]; 86 | // }]; 87 | } 88 | return YES; 89 | } 90 | 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /MyBaseProject/Define/BRConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // BRConfig.h 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/4/30. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #ifndef BRConfig_h 10 | #define BRConfig_h 11 | 12 | #define APP_DEVELOP_SERVER 1 // APP开发环境 13 | #define APP_TEST_SERVER 0 // APP测试环境 14 | #define APP_PRODUCT_SERVER 0 // APP发布环境 15 | 16 | /// 主题颜色 17 | #define kBRThemeColor [UIColor br_colorWithHexString:@"#30aca0"] 18 | /// 文本颜色 19 | #define kBRTextColor [UIColor br_colorWithHexString:@"#464646"] 20 | /// 副文本颜色 21 | #define kBRText2Color [UIColor br_colorWithHexString:@"#999999"] 22 | 23 | 24 | #endif /* BRConfig_h */ 25 | -------------------------------------------------------------------------------- /MyBaseProject/Define/BRConst.h: -------------------------------------------------------------------------------- 1 | // 2 | // BRConst.h 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/4/30. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | // 常量 13 | FOUNDATION_EXTERN NSString *const kApiUrl; // APP接口基本地址 14 | FOUNDATION_EXTERN NSString *const kImageUrl; // APP图片资源基本地址 15 | FOUNDATION_EXTERN NSString *const kWebUrl; // APP网页基本地址 16 | 17 | //=================消息推送 Key============= 18 | // 令牌失效 19 | UIKIT_EXTERN NSString *const BRAccessTokenExpiredNotifKey; 20 | 21 | 22 | //================= NSUserDefault Key============= 23 | // 首页数据缓存 key 24 | FOUNDATION_EXTERN NSString *const BRUserDefaultsHomeDataKey; 25 | 26 | -------------------------------------------------------------------------------- /MyBaseProject/Define/BRConst.m: -------------------------------------------------------------------------------- 1 | // 2 | // BRConst.m 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/4/30. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "BRConst.h" 10 | #import "BRConfig.h" 11 | 12 | #if APP_DEVELOP_SERVER 13 | NSString *const kApiUrl = @"http://10.8.3.166:8100/cas-app/"; 14 | NSString *const kImageUrl = @"http://10.8.3.166:8110/cfs-file/upload/image/"; 15 | NSString *const kWebUrl = @"http://10.8.3.166:8120/cas-api/routing/thirdpart"; 16 | #endif 17 | 18 | #if APP_TEST_SERVER 19 | NSString *const kApiUrl = @"http://10.8.3.166:8100/cas-app/"; 20 | NSString *const kImageUrl = @"http://10.8.3.166:8110/cfs-file/upload/image/"; 21 | NSString *const kWebUrl = @"http://10.8.3.166:8120/cas-api/routing/thirdpart"; 22 | #endif 23 | 24 | #if APP_PRODUCT_SERVER 25 | NSString *const kApiUrl = @"http://10.8.3.166:8100/cas-app/"; 26 | NSString *const kImageUrl = @"http://10.8.3.166:8110/cfs-file/upload/image/"; 27 | NSString *const kWebUrl = @"http://10.8.3.166:8120/cas-api/routing/thirdpart"; 28 | #endif 29 | 30 | //=================来自服务端定义============= 31 | 32 | // 消息推送通知key 33 | NSString *const BRNotificationLocationSuccessKey = @"BRNotificationLocationSuccessKey"; 34 | 35 | // 首页数据缓存 key 36 | NSString *const BRUserDefaultsHomeDataKey = @"BRUserDefaultsHomeDataKey"; 37 | -------------------------------------------------------------------------------- /MyBaseProject/Define/BRMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // BRMacros.h 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/4/30. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #ifndef BRMacros_h 10 | #define BRMacros_h 11 | 12 | /// 屏幕大小、宽、高 13 | #define SCREEN_BOUNDS [UIScreen mainScreen].bounds 14 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 15 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 16 | 17 | // 当前线程 18 | #define CURRENT_THREAD NSLog(@"当前线程:%@", [NSThread currentThread]); 19 | 20 | /// AppDelegate 对象 21 | #define appDelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate]) 22 | 23 | /// 保证 #ifdef 中的宏定义只会在 OC 的代码中被引用。否则,一旦引入 C/C++ 的代码或者框架,就会出错! 24 | #ifdef __OBJC__ 25 | 26 | // 日志输出宏定义 27 | #ifdef DEBUG 28 | // 调试状态 29 | // #define NSLog(fmt, ...) NSLog((@" %s [第%d行] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 30 | #define NSLog(FORMAT, ...) fprintf(stderr, "【%s: %zd】%s %s\n", [[[NSString stringWithUTF8String: __FILE__] lastPathComponent] UTF8String], __LINE__, __func__, [[NSString stringWithFormat: FORMAT, ## __VA_ARGS__] UTF8String]); 31 | #else 32 | // 发布状态 33 | #define NSLog(...) 34 | #endif 35 | 36 | #endif 37 | 38 | #endif /* BRMacros_h */ 39 | -------------------------------------------------------------------------------- /MyBaseProject/Main/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/4/30. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /MyBaseProject/Main/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/4/30. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "BRTabBarController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 21 | self.window.backgroundColor = [UIColor whiteColor]; 22 | BRTabBarController *tabBar = [[BRTabBarController alloc] init]; 23 | self.window.rootViewController = tabBar; 24 | [self.window makeKeyAndVisible]; 25 | 26 | return YES; 27 | } 28 | 29 | 30 | - (void)applicationWillResignActive:(UIApplication *)application { 31 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 32 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 33 | } 34 | 35 | 36 | - (void)applicationDidEnterBackground:(UIApplication *)application { 37 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 39 | } 40 | 41 | 42 | - (void)applicationWillEnterForeground:(UIApplication *)application { 43 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 44 | } 45 | 46 | 47 | - (void)applicationDidBecomeActive:(UIApplication *)application { 48 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 49 | } 50 | 51 | 52 | - (void)applicationWillTerminate:(UIApplication *)application { 53 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 54 | } 55 | 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /MyBaseProject/Modules/Login&Register/Controller/BRLoginViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BRLoginViewController.h 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/6/1. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "BRBaseViewController.h" 10 | 11 | @interface BRLoginViewController : BRBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MyBaseProject/Modules/Login&Register/Controller/BRLoginViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BRLoginViewController.m 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/6/1. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "BRLoginViewController.h" 10 | 11 | @interface BRLoginViewController () 12 | @property (nonatomic, strong) UIImageView *logoImageView; 13 | //@property (nonatomic, strong) UIImageView *logoImageView; 14 | //@property (nonatomic, strong) UIImageView *logoImageView; 15 | 16 | @end 17 | 18 | @implementation BRLoginViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.navigationItem.title = @"登录"; 23 | } 24 | 25 | - (UIImageView *)logoImageView { 26 | if (!_logoImageView) { 27 | _logoImageView = [[UIImageView alloc]init]; 28 | _logoImageView.backgroundColor = [UIColor whiteColor]; 29 | } 30 | return _logoImageView; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /MyBaseProject/Other/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /MyBaseProject/Other/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /MyBaseProject/Other/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | 33 | UISupportedInterfaceOrientations~ipad 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationPortraitUpsideDown 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /MyBaseProject/Other/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/4/30. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | //宏 13 | #import "BRMacros.h" 14 | #import "BRConst.h" 15 | #import "BRConfig.h" 16 | 17 | // 自定义 18 | #import "BRKit.h" 19 | 20 | 21 | // 第三方 22 | #import 23 | 24 | #endif /* PrefixHeader_pch */ 25 | -------------------------------------------------------------------------------- /MyBaseProject/Other/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MyBaseProject 4 | // 5 | // Created by 任波 on 2018/4/30. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/LCTabBarBadge.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "LCTabBarBadge@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/LCTabBarBadge.imageset/LCTabBarBadge@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/LCTabBarBadge.imageset/LCTabBarBadge@2x.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_discovery.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_tabbar_discovery.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_discovery.imageset/icon_tabbar_discovery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_discovery.imageset/icon_tabbar_discovery.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_discovery_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_tabbar_discovery_selected.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_discovery_selected.imageset/icon_tabbar_discovery_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_discovery_selected.imageset/icon_tabbar_discovery_selected.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_homepage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_tabbar_homepage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_tabbar_homepage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_homepage.imageset/icon_tabbar_homepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_homepage.imageset/icon_tabbar_homepage.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_homepage.imageset/icon_tabbar_homepage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_homepage.imageset/icon_tabbar_homepage@2x.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_homepage_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_tabbar_homepage_selected.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_tabbar_homepage_selected@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_homepage_selected.imageset/icon_tabbar_homepage_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_homepage_selected.imageset/icon_tabbar_homepage_selected.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_homepage_selected.imageset/icon_tabbar_homepage_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_homepage_selected.imageset/icon_tabbar_homepage_selected@2x.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_merchant_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_tabbar_merchant_normal.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_tabbar_merchant_normal@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_merchant_normal.imageset/icon_tabbar_merchant_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_merchant_normal.imageset/icon_tabbar_merchant_normal.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_merchant_normal.imageset/icon_tabbar_merchant_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_merchant_normal.imageset/icon_tabbar_merchant_normal@2x.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_merchant_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_tabbar_merchant_selected.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_tabbar_merchant_selected@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_merchant_selected.imageset/icon_tabbar_merchant_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_merchant_selected.imageset/icon_tabbar_merchant_selected.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_merchant_selected.imageset/icon_tabbar_merchant_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_merchant_selected.imageset/icon_tabbar_merchant_selected@2x.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_mine.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_tabbar_mine.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_tabbar_mine@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_mine.imageset/icon_tabbar_mine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_mine.imageset/icon_tabbar_mine.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_mine.imageset/icon_tabbar_mine@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_mine.imageset/icon_tabbar_mine@2x.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_mine_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_tabbar_mine_selected.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_tabbar_mine_selected@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_mine_selected.imageset/icon_tabbar_mine_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_mine_selected.imageset/icon_tabbar_mine_selected.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_mine_selected.imageset/icon_tabbar_mine_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_mine_selected.imageset/icon_tabbar_mine_selected@2x.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_misc.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_tabbar_misc.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_tabbar_misc@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_misc.imageset/icon_tabbar_misc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_misc.imageset/icon_tabbar_misc.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_misc.imageset/icon_tabbar_misc@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_misc.imageset/icon_tabbar_misc@2x.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_misc_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_tabbar_misc_selected.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon_tabbar_misc_selected@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_misc_selected.imageset/icon_tabbar_misc_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_misc_selected.imageset/icon_tabbar_misc_selected.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_misc_selected.imageset/icon_tabbar_misc_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_misc_selected.imageset/icon_tabbar_misc_selected@2x.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_nearby.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_tabbar_nearby.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_nearby.imageset/icon_tabbar_nearby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_nearby.imageset/icon_tabbar_nearby.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_nearby_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon_tabbar_nearby_selected.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_nearby_selected.imageset/icon_tabbar_nearby_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_nearby_selected.imageset/icon_tabbar_nearby_selected.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_onsite.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_tabbar_onsite@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_onsite.imageset/icon_tabbar_onsite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_onsite.imageset/icon_tabbar_onsite@2x.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_onsite_new.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_tabbar_onsite_new@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_onsite_new.imageset/icon_tabbar_onsite_new@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_onsite_new.imageset/icon_tabbar_onsite_new@2x.png -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_onsite_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_tabbar_onsite_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_onsite_selected.imageset/icon_tabbar_onsite_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agiapp/MyBaseProject/7133407063cf7a1a385bf8e4a9395f39d8c12108/MyBaseProject/Resource/Assets.xcassets/tabBar/icon_tabbar_onsite_selected.imageset/icon_tabbar_onsite_selected@2x.png -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/BRKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // BRKit.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/4/20. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #ifndef BRKit_h 10 | #define BRKit_h 11 | 12 | #if __has_include() 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | #import 19 | #import 20 | #import 21 | 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | 28 | #else 29 | 30 | #import "BRKitMacro.h" 31 | #import "BRMethod.h" 32 | #import "NSString+BRAdd.h" 33 | #import "NSArray+BRAdd.h" 34 | #import "NSDictionary+BRAdd.h" 35 | #import "NSDate+BRAdd.h" 36 | #import "NSNumber+BRAdd.h" 37 | #import "NSTimer+BRAdd.h" 38 | 39 | #import "UIView+BRAdd.h" 40 | #import "UIImage+BRAdd.h" 41 | #import "UIImageView+BRAdd.h" 42 | #import "UIButton+BRAdd.h" 43 | #import "UIColor+BRAdd.h" 44 | 45 | #endif 46 | 47 | 48 | #endif /* BRKit_h */ 49 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/BRKitMacro.h: -------------------------------------------------------------------------------- 1 | // 2 | // BRKitMacro.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/4/20. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #ifndef BRKitMacro_h 10 | #define BRKitMacro_h 11 | 12 | /** 13 | 合成弱引用/强引用 14 | 15 | Example: 16 | @weakify(self) 17 | [self doSomething^{ 18 | @strongify(self) 19 | if (!self) return; 20 | ... 21 | }]; 22 | 23 | */ 24 | #ifndef weakify 25 | #if DEBUG 26 | #if __has_feature(objc_arc) 27 | #define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object; 28 | #else 29 | #define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object; 30 | #endif 31 | #else 32 | #if __has_feature(objc_arc) 33 | #define weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object; 34 | #else 35 | #define weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object; 36 | #endif 37 | #endif 38 | #endif 39 | 40 | #ifndef strongify 41 | #if DEBUG 42 | #if __has_feature(objc_arc) 43 | #define strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object; 44 | #else 45 | #define strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object; 46 | #endif 47 | #else 48 | #if __has_feature(objc_arc) 49 | #define strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object; 50 | #else 51 | #define strongify(object) try{} @finally{} __typeof__(object) object = block##_##object; 52 | #endif 53 | #endif 54 | #endif 55 | 56 | /** 常用的断言 */ 57 | #define BRAssertNil(condition, description, ...) NSAssert(!(condition), (description), ##__VA_ARGS__) 58 | #define BRCAssertNil(condition, description, ...) NSCAssert(!(condition), (description), ##__VA_ARGS__) 59 | 60 | #define BRAssertNotNil(condition, description, ...) NSAssert((condition), (description), ##__VA_ARGS__) 61 | #define BRCAssertNotNil(condition, description, ...) NSCAssert((condition), (description), ##__VA_ARGS__) 62 | 63 | #define BRAssertMainThread() NSAssert([NSThread isMainThread], @"This method must be called on the main thread") 64 | #define BRCAssertMainThread() NSCAssert([NSThread isMainThread], @"This method must be called on the main thread") 65 | 66 | /** 67 | 静态库中编写 Category 时的便利宏,用于解决 Category 方法从静态库中加载需要特别设置的问题。 68 | 加入这个宏后,不需要再在 Xcode 的 Other Liker Fliags 中设置链接库参数(-Objc / -all_load / -force_load) 69 | ******************************************************************************* 70 | 使用:在静态库中每个分类的 @implementation 前添加这个宏 71 | Example: 72 | #import "NSString+BRAdd.h" 73 | 74 | BRSYNTH_DUMMY_CLASS(NSString_BRAdd) 75 | @implementation NSString (BRAdd) 76 | @end 77 | */ 78 | #ifndef BRSYNTH_DUMMY_CLASS 79 | 80 | #define BRSYNTH_DUMMY_CLASS(_name_) \ 81 | @interface BRSYNTH_DUMMY_CLASS_ ## _name_ : NSObject @end \ 82 | @implementation BRSYNTH_DUMMY_CLASS_ ## _name_ @end 83 | 84 | #endif 85 | 86 | /** 交换两个数值 */ 87 | #ifndef BR_SWAP 88 | #define BR_SWAP(_a_, _b_) do { __typeof__(_a_) _tmp_ = (_a_); (_a_) = (_b_); (_b_) = _tmp_; } while (0) 89 | #endif 90 | 91 | #endif /* BRKitMacro_h */ 92 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/BRMethod.h: -------------------------------------------------------------------------------- 1 | // 2 | // BRMethod.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/4/20. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #ifndef BRMethod_h 10 | #define BRMethod_h 11 | 12 | ///================================================== 13 | /// static inline 内联函数 14 | ///================================================== 15 | 16 | //static inline UIEdgeInsets br_safeAreaInset(UIView *view) { 17 | // if (@available(iOS 11.0, *)) { 18 | // return view.safeAreaInsets; 19 | // } 20 | // return UIEdgeInsetsZero; 21 | //} 22 | 23 | //static inline MASConstraint * br_safeAreaBottom(MASConstraintMaker *make,UIView *view) { 24 | // if (@available(iOS 11.0, *)) { 25 | // //mas_safeAreaLayoutGuideBottom 26 | // return make.bottom.equalTo(view.mas_safeAreaLayoutGuideBottom); 27 | // } 28 | // return make.bottom.equalTo(view); 29 | //} 30 | 31 | static inline BOOL br_isZeroFloat(float f) { 32 | const float EPSINON = 0.0001; 33 | if ((f >= -EPSINON) && f <= EPSINON) { 34 | return YES; 35 | } 36 | return NO; 37 | } 38 | 39 | /** 获取字符串(对象转字符串)*/ 40 | static inline NSString *br_stringFromObject(id object) { 41 | if (object == nil || 42 | [object isEqual:[NSNull null]] || 43 | [object isEqual:@"(null)"] || 44 | [object isEqual:@"null"]) { 45 | return @""; 46 | } else if ([object isKindOfClass:[NSString class]]) { 47 | return object; 48 | } else if ([object respondsToSelector:@selector(stringValue)]){ 49 | return [object stringValue]; 50 | } else { 51 | return [object description]; 52 | } 53 | } 54 | 55 | /** 判断对象是否为空 */ 56 | static inline BOOL br_isEmpty(id thing) { 57 | return thing == nil || 58 | [thing isEqual:[NSNull null]] || 59 | [thing isEqual:@"null"] || 60 | [thing isEqual:@"(null)"] || 61 | ([thing respondsToSelector:@selector(length)] 62 | && [(NSData *)thing length] == 0) || 63 | ([thing respondsToSelector:@selector(count)] 64 | && [(NSArray *)thing count] == 0); 65 | } 66 | 67 | /** 获取非空字符串 */ 68 | static inline NSString *br_nonullString(NSString *obj) { 69 | if (obj == nil || 70 | [obj isEqual:[NSNull null]] || 71 | [obj isEqual:@"(null)"] || 72 | [obj isEqual:@"null"]) { 73 | return @""; 74 | } 75 | return obj; 76 | } 77 | 78 | #endif /* BRMethod_h */ 79 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/NSArray+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/4/21. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NSArray (BRAdd) 14 | /** 数组/字典 转 json字符串 */ 15 | - (nullable NSString *)br_toJsonString; 16 | /** 数组倒序 */ 17 | - (NSArray *)br_reverse; 18 | 19 | @end 20 | 21 | @interface NSMutableArray (BRAdd) 22 | /** 添加元素 */ 23 | - (void)br_addObject:(id)anObject; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/NSArray+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/4/21. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "NSArray+BRAdd.h" 10 | #import "BRKitMacro.h" 11 | #import "BRMethod.h" 12 | 13 | BRSYNTH_DUMMY_CLASS(NSArray_BRAdd) 14 | 15 | @implementation NSArray (BRAdd) 16 | 17 | #pragma mark - 数组 转 json字符串 18 | - (NSString *)br_toJsonString { 19 | if ([NSJSONSerialization isValidJSONObject:self]) { 20 | NSError *error = nil; 21 | // 1.转化为 JSON 格式的 NSData 22 | NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:NSJSONWritingPrettyPrinted error:&error]; 23 | if (error) { 24 | NSLog(@"数组转JSON字符串失败:%@", error); 25 | } 26 | // 2.转化为 JSON 格式的 NSString 27 | return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; 28 | } 29 | return nil; 30 | } 31 | 32 | #pragma mark - 数组倒序 33 | - (NSArray *)br_reverse { 34 | return [[self reverseObjectEnumerator] allObjects]; 35 | } 36 | 37 | @end 38 | 39 | @implementation NSMutableArray (BRAdd) 40 | #pragma mark - 添加元素 41 | - (void)br_addObject:(id)anObject { 42 | if (br_isEmpty(anObject)) { 43 | return; 44 | } 45 | [self addObject:anObject]; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/NSDate+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDate+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NSDate (BRAdd) 14 | 15 | /** 获取系统当前的时间戳,即当前时间距1970的秒数(以毫秒为单位) */ 16 | + (NSString *)br_timestamp; 17 | 18 | /** 获取当前的时间 */ 19 | + (NSString *)br_currentDateString; 20 | 21 | /** 22 | * 按指定格式获取当前的时间 23 | * 24 | * @param formatterStr 设置格式:yyyy-MM-dd HH:mm:ss 25 | */ 26 | + (nullable NSString *)br_currentDateStringWithFormat:(NSString *)formatterStr; 27 | 28 | /** 29 | * 返回指定时间差值的日期字符串 30 | * 31 | * @param delta 时间差值 32 | * @return 日期字符串,格式:yyyy-MM-dd HH:mm:ss 33 | */ 34 | + (nullable NSString *)br_dateStringWithDelta:(NSTimeInterval)delta; 35 | 36 | /** 37 | * 返回日期格式字符串 38 | * 39 | * @param dateStr 需要转换的时间点 40 | * @return 日期字符串 41 | * 返回具体格式如下: 42 | * - 刚刚(一分钟内) 43 | * - X分钟前(一小时内) 44 | * - X小时前(当天) 45 | * - MM-dd HH:mm(一年内) 46 | * - yyyy-MM-dd HH:mm(更早期) 47 | */ 48 | + (nullable NSString *)br_dateDescriptionWithTargetDate:(NSString *)dateStr andTargetDateFormat:(NSString *)dateFormatStr; 49 | 50 | @end 51 | 52 | NS_ASSUME_NONNULL_END 53 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/NSDate+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDate+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "NSDate+BRAdd.h" 10 | #import "BRKitMacro.h" 11 | 12 | BRSYNTH_DUMMY_CLASS(NSDate_BRAdd) 13 | 14 | @implementation NSDate (BRAdd) 15 | 16 | #pragma mark - 获取系统当前的时间戳,即当前时间距1970的秒数(以毫秒为单位) 17 | + (NSString *)br_timestamp { 18 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0]; 19 | /** 当前时间距1970的秒数。*1000 是精确到毫秒,不乘就是精确到秒 */ 20 | NSTimeInterval interval = [date timeIntervalSince1970] * 1000; 21 | NSString *timeString = [NSString stringWithFormat:@"%0.f", interval]; 22 | 23 | return timeString; 24 | } 25 | 26 | #pragma mark - 获取当前的时间 27 | + (NSString *)br_currentDateString { 28 | return [self br_currentDateStringWithFormat:@"yyyy-MM-dd HH:mm:ss"]; 29 | } 30 | 31 | #pragma mark - 按指定格式获取当前的时间 32 | + (NSString *)br_currentDateStringWithFormat:(NSString *)formatterStr { 33 | // 获取系统当前时间 34 | NSDate *currentDate = [NSDate date]; 35 | // 用于格式化NSDate对象 36 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 37 | // 设置格式:yyyy-MM-dd HH:mm:ss 38 | formatter.dateFormat = formatterStr; 39 | // 将 NSDate 按 formatter格式 转成 NSString 40 | NSString *currentDateStr = [formatter stringFromDate:currentDate]; 41 | // 输出currentDateStr 42 | return currentDateStr; 43 | } 44 | 45 | #pragma mark - 返回指定时间差值的日期字符串 46 | + (NSString *)br_dateStringWithDelta:(NSTimeInterval)delta { 47 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:delta]; 48 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 49 | formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; 50 | return [formatter stringFromDate:date]; 51 | } 52 | 53 | #pragma mark - 返回日期格式字符串 @"2016-10-16 14:30:30" @"yyyy-MM-dd HH:mm:ss" 54 | // 注意:一个日期字符串必须 与 它相应的日期格式对应,这个才能被系统识别为日期 55 | + (NSString *)br_dateDescriptionWithTargetDate:(NSString *)dateStr andTargetDateFormat:(NSString *)dateFormatStr { 56 | // 1.获取当前时间 57 | NSDate *currentDate = [NSDate date]; 58 | // 2.目标时间 59 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 60 | formatter.dateFormat = dateFormatStr; 61 | NSDate *targetDate = [formatter dateFromString:dateStr]; 62 | 63 | NSCalendar *calendar = [NSCalendar currentCalendar]; 64 | NSDateFormatter *returnFormatter = [[NSDateFormatter alloc] init]; 65 | if ([calendar isDate:targetDate equalToDate:currentDate toUnitGranularity:NSCalendarUnitYear]) { 66 | if ([calendar isDateInToday:targetDate]) { 67 | NSDateComponents *components = [calendar components:NSCalendarUnitMinute | NSCalendarUnitHour fromDate:targetDate toDate:currentDate options:0]; 68 | if (components.hour == 0) { 69 | if (components.minute == 0) { 70 | return @"刚刚"; 71 | } else { 72 | return [NSString stringWithFormat:@"%ld分钟前", (long)components.minute]; 73 | } 74 | } else { 75 | return [NSString stringWithFormat:@"%ld小时前", (long)components.hour]; 76 | } 77 | } else if ([calendar isDateInYesterday:targetDate]) { 78 | return @"昨天"; 79 | } else { 80 | returnFormatter.dateFormat = @"M-d"; 81 | return [returnFormatter stringFromDate:targetDate]; 82 | } 83 | } else { 84 | returnFormatter.dateFormat = @"yyyy-M-d"; 85 | return [returnFormatter stringFromDate:targetDate]; 86 | } 87 | return nil; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/NSDictionary+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/4/22. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NSDictionary (BRAdd) 14 | /** 字典 转 json字符串 */ 15 | - (nullable NSString *)br_toJsonString; 16 | /** 把字典拼成url字符串 */ 17 | - (nullable NSString *)br_toURLString; 18 | 19 | @end 20 | 21 | @interface NSMutableDictionary (BRAdd) 22 | /** 给可变字典添加键值对 */ 23 | - (void)br_setObject:(id)anObject forKey:(id)aKey; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/NSDictionary+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/4/22. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "NSDictionary+BRAdd.h" 10 | #import "BRKitMacro.h" 11 | #import "BRMethod.h" 12 | 13 | BRSYNTH_DUMMY_CLASS(NSDictionary_BRAdd) 14 | 15 | @implementation NSDictionary (BRAdd) 16 | 17 | #pragma mark - 字典 转 json字符串 18 | - (NSString *)br_toJsonString { 19 | if ([NSJSONSerialization isValidJSONObject:self]) { 20 | NSError *error = nil; 21 | // 1.转化为 JSON 格式的 NSData 22 | NSData *jsonData = [NSJSONSerialization dataWithJSONObject:self options:NSJSONWritingPrettyPrinted error:&error]; 23 | if (error) { 24 | NSLog(@"字典转JSON字符串失败:%@", error); 25 | } 26 | // 2.转化为 JSON 格式的 NSString 27 | return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; 28 | } 29 | return nil; 30 | } 31 | 32 | #pragma mark - 把字典拼成url字符串 33 | - (NSString *)br_toURLString { 34 | NSMutableString *mutableStr = [NSMutableString string]; 35 | // 遍历字典把键值拼起来 36 | [self enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL *_Nonnull stop) { 37 | [mutableStr appendFormat:@"%@=", key]; 38 | [mutableStr appendFormat:@"%@", obj]; 39 | [mutableStr appendFormat:@"%@", @"&"]; 40 | }]; 41 | NSString *result = [mutableStr copy]; 42 | // 去掉最后一个& 43 | if ([result hasSuffix:@"&"]) { 44 | result = [result substringToIndex:result.length - 2]; 45 | } 46 | return result; 47 | } 48 | 49 | @end 50 | 51 | 52 | @implementation NSMutableDictionary (BRAdd) 53 | 54 | #pragma mark - 给可变字典添加键值对 55 | - (void)br_setObject:(id)anObject forKey:(id)aKey { 56 | if (br_isEmpty(aKey)) { 57 | return; 58 | } 59 | if (br_isEmpty(anObject) && ![anObject isEqual:@""]) { 60 | return; 61 | } 62 | [self setObject:anObject forKey:aKey]; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/NSNumber+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSNumber+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NSNumber (BRAdd) 14 | /** 15 | Creates and returns an NSNumber object from a string. 16 | Valid format: @"12", @"12.345", @" -0xFF", @" .23e99 "... 17 | 18 | @param string The string described an number. 19 | 20 | @return an NSNumber when parse succeed, or nil if an error occurs. 21 | */ 22 | + (nullable NSNumber *)numberWithString:(NSString *)string; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/NSNumber+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSNumber+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "NSNumber+BRAdd.h" 10 | #import "NSString+BRAdd.h" 11 | #import "BRKitMacro.h" 12 | 13 | BRSYNTH_DUMMY_CLASS(NSNumber_BRAdd) 14 | 15 | @implementation NSNumber (BRAdd) 16 | 17 | + (NSNumber *)numberWithString:(NSString *)string { 18 | NSString *str = [[string br_stringByTrim] lowercaseString]; 19 | if (!str || !str.length) { 20 | return nil; 21 | } 22 | 23 | static NSDictionary *dic; 24 | static dispatch_once_t onceToken; 25 | dispatch_once(&onceToken, ^{ 26 | dic = @{@"true" : @(YES), 27 | @"yes" : @(YES), 28 | @"false" : @(NO), 29 | @"no" : @(NO), 30 | @"nil" : [NSNull null], 31 | @"null" : [NSNull null], 32 | @"" : [NSNull null]}; 33 | }); 34 | NSNumber *num = dic[str]; 35 | if (num != nil) { 36 | if (num == (id)[NSNull null]) return nil; 37 | return num; 38 | } 39 | 40 | // 16进制数字 41 | int sign = 0; 42 | if ([str hasPrefix:@"0x"]) sign = 1; 43 | else if ([str hasPrefix:@"-0x"]) sign = -1; 44 | if (sign != 0) { 45 | NSScanner *scan = [NSScanner scannerWithString:str]; 46 | unsigned num = -1; 47 | BOOL suc = [scan scanHexInt:&num]; 48 | if (suc) 49 | return [NSNumber numberWithLong:((long)num * sign)]; 50 | else 51 | return nil; 52 | } 53 | 54 | NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; 55 | [formatter setNumberStyle:NSNumberFormatterDecimalStyle]; 56 | return [formatter numberFromString:string]; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/NSString+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/4/19. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface NSString (BRAdd) 15 | 16 | /** 判断是否是有效的(非空/非空白)字符串 */ 17 | - (BOOL)br_isValidString; 18 | 19 | /** 判断是否包含指定字符串 */ 20 | - (BOOL)br_containsString:(NSString *)string; 21 | 22 | /* 修剪字符串(去掉头尾两边的空格和换行符)*/ 23 | - (NSString *)br_stringByTrim; 24 | 25 | /** md5加密 */ 26 | - (nullable NSString *)br_md5String; 27 | 28 | /** 29 | * 获取文本的大小 30 | * 31 | * @param font 文本字体 32 | * @param maxSize 文本区域的最大范围大小 33 | * @param lineBreakMode 字符截断类型 34 | * 35 | * @return 文本大小 36 | */ 37 | - (CGSize)br_getTextSize:(UIFont *)font maxSize:(CGSize)maxSize mode:(NSLineBreakMode)lineBreakMode; 38 | 39 | /** 40 | * 获取文本的宽度 41 | * 42 | * @param font 文本字体 43 | * @param height 文本高度 44 | * 45 | * @return 文本宽度 46 | */ 47 | - (CGFloat)br_getTextWidth:(UIFont *)font height:(CGFloat)height; 48 | 49 | /** 50 | * 获取文本的高度 51 | * 52 | * @param font 文本字体 53 | * @param width 文本宽度 54 | * 55 | * @return 文本高度 56 | */ 57 | - (CGFloat)br_getTextHeight:(UIFont *)font width:(CGFloat)width; 58 | 59 | 60 | ///================================================== 61 | /// 正则表达式 62 | ///================================================== 63 | /** 判断是否是有效的手机号 */ 64 | - (BOOL)br_isValidPhoneNumber; 65 | 66 | /** 判断是否是有效的用户密码 */ 67 | - (BOOL)br_isValidPassword; 68 | 69 | /** 判断是否是有效的用户名(20位的中文或英文)*/ 70 | - (BOOL)br_isValidUserName; 71 | 72 | /** 判断是否是有效的邮箱 */ 73 | - (BOOL)br_isValidEmail; 74 | 75 | /** 判断是否是有效的URL */ 76 | - (BOOL)isValidUrl; 77 | 78 | /** 判断是否是有效的银行卡号 */ 79 | - (BOOL)br_isValidBankNumber; 80 | 81 | /** 判断是否是有效的身份证号 */ 82 | - (BOOL)br_isValidIDCardNumber; 83 | 84 | /** 判断是否是有效的IP地址 */ 85 | - (BOOL)br_isValidIPAddress; 86 | 87 | /** 判断是否是纯汉字 */ 88 | - (BOOL)br_isValidChinese; 89 | 90 | /** 判断是否是邮政编码 */ 91 | - (BOOL)br_isValidPostalcode; 92 | 93 | /** 判断是否是工商税号 */ 94 | - (BOOL)br_isValidTaxNo; 95 | 96 | /** 判断是否是车牌号 */ 97 | - (BOOL)br_isCarNumber; 98 | 99 | /** 通过身份证获取性别(1:男, 2:女) */ 100 | - (nullable NSNumber *)br_getGenderFromIDCard; 101 | 102 | /** 隐藏证件号指定位数字(如:360723********6341) */ 103 | - (nullable NSString *)br_hideCharacters:(NSUInteger)location length:(NSUInteger)length; 104 | 105 | @end 106 | 107 | NS_ASSUME_NONNULL_END 108 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/NSString+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/4/19. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "NSString+BRAdd.h" 10 | #include 11 | #import "BRKitMacro.h" 12 | 13 | BRSYNTH_DUMMY_CLASS(NSString_BRAdd) 14 | 15 | @implementation NSString (BRAdd) 16 | 17 | #pragma mark - 判断是否是有效的(非空/非空白)字符串 18 | // @"(null)", @"null", nil, @"", @" ", @"\n" will Returns NO; otherwise Returns YES. 19 | - (BOOL)br_isValidString { 20 | // 1. 判断是否是 非空字符串 21 | if (self == nil || 22 | [self isEqual:[NSNull null]] || 23 | [self isEqual:@"(null)"] || 24 | [self isEqual:@"null"]) { 25 | return NO; 26 | } 27 | // 2. 判断是否是 非空白字符串 28 | if ([[self br_stringByTrim] length] == 0) { 29 | return NO; 30 | } 31 | return YES; 32 | } 33 | 34 | #pragma mark - 判断是否包含指定字符串 35 | - (BOOL)br_containsString:(NSString *)string { 36 | if (string == nil) return NO; 37 | return [self rangeOfString:string].location != NSNotFound; 38 | } 39 | 40 | #pragma mark - 修剪字符串(去掉头尾两边的空格和换行符) 41 | - (NSString *)br_stringByTrim { 42 | NSCharacterSet *set = [NSCharacterSet whitespaceAndNewlineCharacterSet]; 43 | return [self stringByTrimmingCharactersInSet:set]; 44 | } 45 | 46 | #pragma mark - md5加密 47 | - (NSString *)br_md5String { 48 | NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding]; 49 | unsigned char result[CC_MD5_DIGEST_LENGTH]; 50 | CC_MD5(data.bytes, (CC_LONG)data.length, result); 51 | NSString *md5Str = [NSString stringWithFormat: 52 | @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", 53 | result[0], result[1], result[2], result[3], 54 | result[4], result[5], result[6], result[7], 55 | result[8], result[9], result[10], result[11], 56 | result[12], result[13], result[14], result[15] 57 | ]; 58 | return [md5Str lowercaseString]; 59 | } 60 | 61 | #pragma mark - 获取文本的大小 62 | - (CGSize)br_getTextSize:(UIFont *)font maxSize:(CGSize)maxSize mode:(NSLineBreakMode)lineBreakMode { 63 | NSMutableDictionary *attributes = [[NSMutableDictionary alloc]init]; 64 | attributes[NSFontAttributeName] = font; 65 | if (lineBreakMode != NSLineBreakByWordWrapping) { 66 | NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new]; 67 | paragraphStyle.lineBreakMode = lineBreakMode; 68 | attributes[NSParagraphStyleAttributeName] = paragraphStyle; 69 | } 70 | // 计算文本的的rect 71 | CGRect rect = [self boundingRectWithSize:maxSize 72 | options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading 73 | attributes:attributes 74 | context:nil]; 75 | return rect.size; 76 | } 77 | 78 | #pragma mark - 获取文本的宽度 79 | - (CGFloat)br_getTextWidth:(UIFont *)font height:(CGFloat)height { 80 | CGSize size = [self br_getTextSize:font maxSize:CGSizeMake(MAXFLOAT, height) mode:NSLineBreakByWordWrapping]; 81 | return size.width; 82 | } 83 | 84 | #pragma mark - 获取文本的高度 85 | - (CGFloat)br_getTextHeight:(UIFont *)font width:(CGFloat)width { 86 | CGSize size = [self br_getTextSize:font maxSize:CGSizeMake(width, MAXFLOAT) mode:NSLineBreakByWordWrapping]; 87 | return size.height; 88 | } 89 | 90 | ///================================================== 91 | /// 正则表达式 92 | ///================================================== 93 | #pragma mark - 判断是否是有效的手机号 94 | - (BOOL)br_isValidPhoneNumber { 95 | NSString *telNumber = [self stringByReplacingOccurrencesOfString:@" " withString:@""]; 96 | /** 97 | * 手机号码 98 | * 移动:134[0-8],135,136,137,138,139,150,151,157,158,159,182,187,188 99 | * 联通:130,131,132,152,155,156,185,186 100 | * 电信:133,1349,153,180,189,181(增加) 101 | */ 102 | if (telNumber.length == 11) { 103 | // 移动号段正则表达式 104 | NSString *CM_NUM = @"^((13[4-9])|(147)|(15[0-2,7-9])|(178)|(18[2-4,7-8]))\\d{8}|(1705)\\d{7}$"; 105 | // 联通号段正则表达式 106 | NSString *CU_NUM = @"^((13[0-2])|(145)|(15[5-6])|(176)|(18[5,6]))\\d{8}|(1709)\\d{7}$"; 107 | // 电信号段正则表达式 108 | NSString *CT_NUM = @"^((133)|(153)|(177)|(18[0,1,9]))\\d{8}$"; 109 | if ([self br_isValidateByRegex:CM_NUM] || [self br_isValidateByRegex:CU_NUM] || [self br_isValidateByRegex:CT_NUM]) { 110 | return YES; 111 | } else { 112 | return NO; 113 | } 114 | } else { 115 | return NO; 116 | } 117 | } 118 | 119 | #pragma mark - 判断是否是有效的用户密码 120 | - (BOOL)br_isValidPassword { 121 | // 以字母开头,只能包含“字母”,“数字”,“下划线”,长度6~18 122 | NSString *regex = @"^([a-zA-Z]|[a-zA-Z0-9_]|[0-9]){6,18}$"; 123 | return [self br_isValidateByRegex:regex]; 124 | } 125 | 126 | #pragma mark - 判断是否是有效的用户名(20位的中文或英文) 127 | - (BOOL)br_isValidUserName { 128 | NSString *regex = @"^[a-zA-Z一-龥]{1,20}"; 129 | return [self br_isValidateByRegex:regex]; 130 | } 131 | 132 | #pragma mark - 判断是否是有效的邮箱 133 | - (BOOL)br_isValidEmail { 134 | NSString *regex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; 135 | return [self br_isValidateByRegex:regex]; 136 | } 137 | 138 | #pragma mark - 判断是否是有效的URL 139 | - (BOOL)isValidUrl { 140 | NSString *regex = @"(http|https)://((\\w)*|([0-9]*)|([-|_])*)+([\\.|/]((\\w)*|([0-9]*)|([-|_])*))+"; 141 | return [self br_isValidateByRegex:regex]; 142 | } 143 | 144 | #pragma mark - 判断是否是有效的银行卡号 145 | - (BOOL)br_isValidBankNumber { 146 | NSString *regex =@"^\\d{16,19}$|^\\d{6}[- ]\\d{10,13}$|^\\d{4}[- ]\\d{4}[- ]\\d{4}[- ]\\d{4,7}$"; 147 | return [self br_isValidateByRegex:regex]; 148 | } 149 | 150 | #pragma mark - 判断是否是有效的身份证号 151 | - (BOOL)br_isValidIDCardNumber { 152 | NSString *value = self; 153 | value = [value stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; 154 | NSInteger length = 0; 155 | if (!value) { 156 | return NO; 157 | } else { 158 | length = value.length; 159 | if (length !=15 && length !=18) { 160 | return NO; 161 | } 162 | } 163 | // 省份代码 164 | NSArray *areasArray = @[@"11",@"12", @"13",@"14", @"15",@"21", @"22",@"23", @"31",@"32", @"33",@"34", @"35",@"36", @"37",@"41", @"42",@"43", @"44",@"45", @"46",@"50", @"51",@"52", @"53",@"54", @"61",@"62", @"63",@"64", @"65",@"71", @"81",@"82", @"91"]; 165 | 166 | NSString *valueStart2 = [value substringToIndex:2]; 167 | BOOL areaFlag = NO; 168 | for (NSString *areaCode in areasArray) { 169 | if ([areaCode isEqualToString:valueStart2]) { 170 | areaFlag =YES; 171 | break; 172 | } 173 | } 174 | 175 | if (!areaFlag) { 176 | return false; 177 | } 178 | 179 | NSRegularExpression *regularExpression; 180 | NSUInteger numberofMatch; 181 | 182 | int year =0; 183 | switch (length) { 184 | case 15: 185 | year = [value substringWithRange:NSMakeRange(6,2)].intValue + 1900; 186 | if (year % 4 == 0 || (year % 100 == 0 && year % 4 == 0)) { 187 | 188 | regularExpression = [[NSRegularExpression alloc]initWithPattern:@"^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}$" options:NSRegularExpressionCaseInsensitive error:nil];//测试出生日期的合法性 189 | } else { 190 | regularExpression = [[NSRegularExpression alloc]initWithPattern:@"^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}$" options:NSRegularExpressionCaseInsensitive error:nil];//测试出生日期的合法性 191 | } 192 | numberofMatch = [regularExpression numberOfMatchesInString:value 193 | options:NSMatchingReportProgress 194 | range:NSMakeRange(0, value.length)]; 195 | 196 | if(numberofMatch >0) { 197 | return YES; 198 | } else { 199 | return NO; 200 | } 201 | case 18: 202 | year = [value substringWithRange:NSMakeRange(6,4)].intValue; 203 | if (year % 4 == 0 || (year % 100 == 0 && year % 4 == 0)) { 204 | regularExpression = [[NSRegularExpression alloc]initWithPattern:@"^[1-9][0-9]{5}(19|20)[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}[0-9Xx]$" options:NSRegularExpressionCaseInsensitive error:nil];//测试出生日期的合法性 205 | } else { 206 | regularExpression = [[NSRegularExpression alloc]initWithPattern:@"^[1-9][0-9]{5}(19|20)[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}[0-9Xx]$" options:NSRegularExpressionCaseInsensitive error:nil];//测试出生日期的合法性 207 | } 208 | numberofMatch = [regularExpression numberOfMatchesInString:value 209 | options:NSMatchingReportProgress 210 | range:NSMakeRange(0, value.length)]; 211 | if(numberofMatch > 0) { 212 | int S = ([value substringWithRange:NSMakeRange(0,1)].intValue + [value substringWithRange:NSMakeRange(10,1)].intValue) *7 + ([value substringWithRange:NSMakeRange(1,1)].intValue + [value substringWithRange:NSMakeRange(11,1)].intValue) *9 + ([value substringWithRange:NSMakeRange(2,1)].intValue + [value substringWithRange:NSMakeRange(12,1)].intValue) *10 + ([value substringWithRange:NSMakeRange(3,1)].intValue + [value substringWithRange:NSMakeRange(13,1)].intValue) *5 + ([value substringWithRange:NSMakeRange(4,1)].intValue + [value substringWithRange:NSMakeRange(14,1)].intValue) *8 + ([value substringWithRange:NSMakeRange(5,1)].intValue + [value substringWithRange:NSMakeRange(15,1)].intValue) *4 + ([value substringWithRange:NSMakeRange(6,1)].intValue + [value substringWithRange:NSMakeRange(16,1)].intValue) *2 + [value substringWithRange:NSMakeRange(7,1)].intValue *1 + [value substringWithRange:NSMakeRange(8,1)].intValue *6 + [value substringWithRange:NSMakeRange(9,1)].intValue *3; 213 | int Y = S %11; 214 | NSString *M = @"F"; 215 | NSString *JYM = @"10X98765432"; 216 | M = [JYM substringWithRange:NSMakeRange(Y,1)];// 判断校验位 217 | NSString *validateData = [value substringWithRange:NSMakeRange(17,1)]; 218 | validateData = [validateData uppercaseString]; 219 | if ([M isEqualToString:validateData]) { 220 | return YES;// 检测ID的校验位 221 | } else { 222 | return NO; 223 | } 224 | } else { 225 | return NO; 226 | } 227 | default: 228 | return false; 229 | } 230 | } 231 | 232 | #pragma mark - 判断是否是有效的IP地址 233 | - (BOOL)br_isValidIPAddress { 234 | NSString *regex = [NSString stringWithFormat:@"^(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})\\\\.(\\\\d{1,3})$"]; 235 | BOOL rc = [self br_isValidateByRegex:regex]; 236 | if (rc) { 237 | NSArray *componds = [self componentsSeparatedByString:@","]; 238 | BOOL v = YES; 239 | for (NSString *s in componds) { 240 | if (s.integerValue > 255) { 241 | v = NO; 242 | break; 243 | } 244 | } 245 | return v; 246 | } 247 | return NO; 248 | } 249 | 250 | #pragma mark - 判断是否是纯汉字 251 | - (BOOL)br_isValidChinese { 252 | NSString *regex = @"^[\\u4e00-\\u9fa5]+$"; 253 | return [self br_isValidateByRegex:regex]; 254 | } 255 | 256 | #pragma mark - 判断是否是邮政编码 257 | - (BOOL)br_isValidPostalcode { 258 | NSString *regex = @"^[0-8]\\\\d{5}(?!\\\\d)$"; 259 | return [self br_isValidateByRegex:regex]; 260 | } 261 | 262 | #pragma mark - 判断是否是工商税号 263 | - (BOOL)br_isValidTaxNo { 264 | NSString *regex = @"[0-9]\\\\d{13}([0-9]|X)$"; 265 | return [self br_isValidateByRegex:regex]; 266 | } 267 | 268 | #pragma mark - 判断是否是车牌号 269 | - (BOOL)br_isCarNumber { 270 | // 车牌号:湘K-DE829 香港车牌号码:粤Z-J499港 271 | // 其中\\u4e00-\\u9fa5表示unicode编码中汉字已编码部分,\\u9fa5-\\u9fff是保留部分,将来可能会添加 272 | NSString *regex = @"^[\\u4e00-\\u9fff]{1}[a-zA-Z]{1}[-][a-zA-Z_0-9]{4}[a-zA-Z_0-9_\\u4e00-\\u9fff]$"; 273 | return [self br_isValidateByRegex:regex]; 274 | } 275 | 276 | #pragma mark - 匹配正则表达式的一些简单封装 277 | - (BOOL)br_isValidateByRegex:(NSString *)regex { 278 | NSPredicate *pre = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex]; 279 | return [pre evaluateWithObject:self]; 280 | } 281 | 282 | #pragma mark - 通过身份证获取性别 283 | - (NSNumber *)br_getGenderFromIDCard { 284 | if (self.length < 16) return nil; 285 | NSUInteger lenght = self.length; 286 | NSString *sex = [self substringWithRange:NSMakeRange(lenght - 2, 1)]; 287 | if ([sex intValue] % 2 == 1) { 288 | return @1; 289 | } 290 | return @2; 291 | } 292 | 293 | #pragma mark - 隐藏证件号指定位数字 294 | - (NSString *)br_hideCharacters:(NSUInteger)location length:(NSUInteger)length { 295 | if (self.length > length && length > 0) { 296 | NSMutableString *str = [[NSMutableString alloc]init]; 297 | for (NSInteger i = 0; i < length; i++) { 298 | [str appendString:@"*"]; 299 | } 300 | return [self stringByReplacingCharactersInRange:NSMakeRange(location, length) withString:[str copy]]; 301 | } 302 | return self; 303 | } 304 | 305 | @end 306 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/NSTimer+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSTimer+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NSTimer (BRAdd) 14 | 15 | + (NSTimer *)br_scheduledTimerWithTimeInterval:(NSTimeInterval)seconds repeats:(BOOL)repeats block:(void (^)(NSTimer *timer))block; 16 | 17 | + (NSTimer *)br_timerWithTimeInterval:(NSTimeInterval)seconds repeats:(BOOL)repeats block:(void (^)(NSTimer *timer))block; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/Foundation/NSTimer+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSTimer+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "NSTimer+BRAdd.h" 10 | #import "BRKitMacro.h" 11 | 12 | BRSYNTH_DUMMY_CLASS(NSTimer_BRAdd) 13 | 14 | @implementation NSTimer (BRAdd) 15 | 16 | + (void)br_executeBlock:(NSTimer *)timer { 17 | if ([timer userInfo]) { 18 | void (^block)(NSTimer *timer) = (void (^)(NSTimer *timer))[timer userInfo]; 19 | block(timer); 20 | } 21 | } 22 | 23 | + (NSTimer *)br_scheduledTimerWithTimeInterval:(NSTimeInterval)seconds repeats:(BOOL)repeats block:(void (^)(NSTimer *timer))block { 24 | return [NSTimer scheduledTimerWithTimeInterval:seconds target:self selector:@selector(br_executeBlock:) userInfo:[block copy] repeats:repeats]; 25 | } 26 | 27 | + (NSTimer *)br_timerWithTimeInterval:(NSTimeInterval)seconds repeats:(BOOL)repeats block:(void (^)(NSTimer *timer))block { 28 | return [NSTimer timerWithTimeInterval:seconds target:self selector:@selector(br_executeBlock:) userInfo:[block copy] repeats:repeats]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UIButton+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | typedef NS_ENUM(NSUInteger, BRButtonEdgeInsetsStyle) { 14 | /** image在上,label在下 */ 15 | BRButtonEdgeInsetsStyleTop, 16 | /** image在左,label在右 */ 17 | BRButtonEdgeInsetsStyleLeft, 18 | /** image在下,label在上 */ 19 | BRButtonEdgeInsetsStyleBottom, 20 | /** image在右,label在左 */ 21 | BRButtonEdgeInsetsStyleRight 22 | }; 23 | 24 | @interface UIButton (BRAdd) 25 | 26 | /** 27 | * 设置button的文字和图片的布局样式,及间距 28 | * 29 | * @param style 文字和图片的布局样式 30 | * @param space 文字和图片的间距 31 | */ 32 | - (void)br_layoutButtonWithEdgeInsetsStyle:(BRButtonEdgeInsetsStyle)style 33 | imageTitleSpace:(CGFloat)space; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UIButton+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "UIButton+BRAdd.h" 10 | #import "BRKitMacro.h" 11 | 12 | BRSYNTH_DUMMY_CLASS(UIButton_BRAdd) 13 | 14 | @implementation UIButton (BRAdd) 15 | 16 | - (void)br_layoutButtonWithEdgeInsetsStyle:(BRButtonEdgeInsetsStyle)style 17 | imageTitleSpace:(CGFloat)space { 18 | /** 19 | * 前置知识点:titleEdgeInsets是title相对于其上下左右的inset,跟tableView的contentInset是类似的, 20 | * 如果只有title,那它上下左右都是相对于button的,image也是一样; 21 | * 如果同时有image和label,那这时候image的上左下是相对于button,右边是相对于label的;title的上右下是相对于button,左边是相对于image的。 22 | */ 23 | 24 | // 1. 得到imageView和titleLabel的宽、高 25 | CGFloat imageWith = self.imageView.frame.size.width; 26 | CGFloat imageHeight = self.imageView.frame.size.height; 27 | 28 | CGFloat labelWidth = 0.0; 29 | CGFloat labelHeight = 0.0; 30 | if ([UIDevice currentDevice].systemVersion.floatValue >= 8.0) { 31 | // 由于iOS8中titleLabel的size为0,用下面的这种设置 32 | labelWidth = self.titleLabel.intrinsicContentSize.width; 33 | labelHeight = self.titleLabel.intrinsicContentSize.height; 34 | } else { 35 | labelWidth = self.titleLabel.frame.size.width; 36 | labelHeight = self.titleLabel.frame.size.height; 37 | } 38 | 39 | // 2. 声明全局的imageEdgeInsets和labelEdgeInsets 40 | UIEdgeInsets imageEdgeInsets = UIEdgeInsetsZero; 41 | UIEdgeInsets labelEdgeInsets = UIEdgeInsetsZero; 42 | 43 | // 3. 根据style和space得到imageEdgeInsets和labelEdgeInsets的值 44 | switch (style) { 45 | case BRButtonEdgeInsetsStyleTop: 46 | { 47 | imageEdgeInsets = UIEdgeInsetsMake(-labelHeight - space / 2.0, 0, 0, -labelWidth); 48 | labelEdgeInsets = UIEdgeInsetsMake(0, -imageWith, -imageHeight - space / 2.0, 0); 49 | } 50 | break; 51 | case BRButtonEdgeInsetsStyleLeft: 52 | { 53 | imageEdgeInsets = UIEdgeInsetsMake(0, -space / 2.0, 0, space / 2.0); 54 | labelEdgeInsets = UIEdgeInsetsMake(0, space / 2.0, 0, -space / 2.0); 55 | } 56 | break; 57 | case BRButtonEdgeInsetsStyleBottom: 58 | { 59 | imageEdgeInsets = UIEdgeInsetsMake(0, 0, -labelHeight - space / 2.0, -labelWidth); 60 | labelEdgeInsets = UIEdgeInsetsMake(-imageHeight - space / 2.0, -imageWith, 0, 0); 61 | } 62 | break; 63 | case BRButtonEdgeInsetsStyleRight: 64 | { 65 | imageEdgeInsets = UIEdgeInsetsMake(0, labelWidth + space / 2.0, 0, -labelWidth - space / 2.0); 66 | labelEdgeInsets = UIEdgeInsetsMake(0, -imageWith - space / 2.0, 0, imageWith + space / 2.0); 67 | } 68 | break; 69 | default: 70 | break; 71 | } 72 | 73 | // 4. 赋值 74 | self.titleEdgeInsets = labelEdgeInsets; 75 | self.imageEdgeInsets = imageEdgeInsets; 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UIColor+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | #ifndef UIColorHex 14 | #define UIColorHex(_hex_) [UIColor br_colorWithHexString:((__bridge NSString *)CFSTR(#_hex_))] 15 | #endif 16 | 17 | @interface UIColor (BRAdd) 18 | 19 | /** 20 | * 创建颜色对象 21 | * 22 | * @param rgbValue 16进制的RGB值(如:0x66ccff) 23 | * 24 | * @return 颜色对象 25 | */ 26 | + (UIColor *)br_colorWithRGB:(uint32_t)rgbValue; 27 | 28 | /** 29 | * 创建颜色对象 30 | * 31 | * @param rgbValue 16进制的RGB值(如:0x66ccff) 32 | * @param alpha 不透明度值(值范围:0.0 ~ 1.0) 33 | * 34 | * @return 颜色对象 35 | */ 36 | + (UIColor *)br_colorWithRGB:(uint32_t)rgbValue alpha:(CGFloat)alpha; 37 | 38 | /** 39 | * 创建颜色对象 40 | * 41 | * @param hexStr 颜色的16进制字符串值(格式如:@"#66ccff", @"#6cf", @"#66ccff88", @"#6cf8", @"0x66ccff", @"66ccff"...) 42 | * 43 | * @return 颜色对象 44 | */ 45 | + (nullable UIColor *)br_colorWithHexString:(NSString *)hexStr; 46 | 47 | /** 48 | * @brief 渐变颜色 49 | * 50 | * @param fromColor 开始颜色 51 | * @param toColor 结束颜色 52 | * @param height 渐变高度 53 | * 54 | * @return 渐变颜色 55 | */ 56 | + (UIColor*)br_gradientFromColor:(UIColor*)fromColor toColor:(UIColor*)toColor withHeight:(CGFloat)height; 57 | 58 | @end 59 | 60 | NS_ASSUME_NONNULL_END 61 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UIColor+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "UIColor+BRAdd.h" 10 | #import "NSString+BRAdd.h" 11 | #import "BRKitMacro.h" 12 | 13 | BRSYNTH_DUMMY_CLASS(UIColor_BRAdd) 14 | 15 | @implementation UIColor (BRAdd) 16 | 17 | #pragma mark - 创建颜色对象(16进制的RGB值) 18 | + (UIColor *)br_colorWithRGB:(uint32_t)rgbValue { 19 | return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16) / 255.0f 20 | green:((rgbValue & 0xFF00) >> 8) / 255.0f 21 | blue:(rgbValue & 0xFF) / 255.0f 22 | alpha:1]; 23 | } 24 | 25 | #pragma mark - 创建颜色对象(16进制的RGB值 + 不透明度值) 26 | + (UIColor *)br_colorWithRGB:(uint32_t)rgbValue alpha:(CGFloat)alpha { 27 | return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16) / 255.0f 28 | green:((rgbValue & 0xFF00) >> 8) / 255.0f 29 | blue:(rgbValue & 0xFF) / 255.0f 30 | alpha:alpha]; 31 | } 32 | 33 | #pragma mark - 创建颜色对象(颜色的16进制字符串值) 34 | // 有效格式:#RRGGBB、#RGB、#RRGGBBAA、#RGBA、0xRGB、RRGGBB ...("#"和"0x"前缀可以省略不写) 35 | + (instancetype)br_colorWithHexString:(NSString *)hexStr { 36 | CGFloat r, g, b, a; 37 | if (br_hexStrToRGBA(hexStr, &r, &g, &b, &a)) { 38 | return [UIColor colorWithRed:r green:g blue:b alpha:a]; 39 | } 40 | return nil; 41 | } 42 | 43 | static BOOL br_hexStrToRGBA(NSString *str, CGFloat *r, CGFloat *g, CGFloat *b, CGFloat *a) { 44 | str = [[str br_stringByTrim] uppercaseString]; 45 | if ([str hasPrefix:@"#"]) { 46 | str = [str substringFromIndex:1]; 47 | } else if ([str hasPrefix:@"0X"]) { 48 | str = [str substringFromIndex:2]; 49 | } 50 | 51 | NSUInteger length = [str length]; 52 | // RGB RGBA RRGGBB RRGGBBAA 53 | if (length != 3 && length != 4 && length != 6 && length != 8) { 54 | return NO; 55 | } 56 | 57 | // RGB, RGBA, RRGGBB, RRGGBBAA 58 | if (length < 5) { 59 | *r = br_hexStrToInt([str substringWithRange:NSMakeRange(0, 1)]) / 255.0f; 60 | *g = br_hexStrToInt([str substringWithRange:NSMakeRange(1, 1)]) / 255.0f; 61 | *b = br_hexStrToInt([str substringWithRange:NSMakeRange(2, 1)]) / 255.0f; 62 | if (length == 4) *a = br_hexStrToInt([str substringWithRange:NSMakeRange(3, 1)]) / 255.0f; 63 | else *a = 1; 64 | } else { 65 | *r = br_hexStrToInt([str substringWithRange:NSMakeRange(0, 2)]) / 255.0f; 66 | *g = br_hexStrToInt([str substringWithRange:NSMakeRange(2, 2)]) / 255.0f; 67 | *b = br_hexStrToInt([str substringWithRange:NSMakeRange(4, 2)]) / 255.0f; 68 | if (length == 8) *a = br_hexStrToInt([str substringWithRange:NSMakeRange(6, 2)]) / 255.0f; 69 | else *a = 1; 70 | } 71 | return YES; 72 | } 73 | 74 | static inline NSUInteger br_hexStrToInt(NSString *str) { 75 | uint32_t result = 0; 76 | sscanf([str UTF8String], "%X", &result); 77 | return result; 78 | } 79 | 80 | + (UIColor *)br_gradientFromColor:(UIColor *)fromColor toColor:(UIColor *)toColor withHeight:(CGFloat)height { 81 | CGSize size = CGSizeMake(1, height); 82 | UIGraphicsBeginImageContextWithOptions(size, NO, 0); 83 | CGContextRef context = UIGraphicsGetCurrentContext(); 84 | CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); 85 | 86 | NSArray* colors = [NSArray arrayWithObjects:(id)fromColor.CGColor, (id)toColor.CGColor, nil]; 87 | CGGradientRef gradient = CGGradientCreateWithColors(colorspace, (__bridge CFArrayRef)colors, NULL); 88 | CGContextDrawLinearGradient(context, gradient, CGPointMake(0, 0), CGPointMake(0, size.height), 0); 89 | 90 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 91 | 92 | CGGradientRelease(gradient); 93 | CGColorSpaceRelease(colorspace); 94 | UIGraphicsEndImageContext(); 95 | 96 | return [UIColor colorWithPatternImage:image]; 97 | } 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UIControl+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIControl+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/17. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIControl (BRAdd) 12 | /** 多少秒后可以继续响应事件(防止UI控件短时间多次激活事件) */ 13 | @property (nonatomic, assign) NSTimeInterval acceptEventInterval; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UIControl+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIControl+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/17. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "UIControl+BRAdd.h" 10 | #import "BRKitMacro.h" 11 | #import 12 | 13 | BRSYNTH_DUMMY_CLASS(UIControl_BRAdd) 14 | 15 | static const char *UIControl_acceptEventInterval="UIControl_acceptEventInterval"; 16 | static const char *UIControl_ignoreEvent="UIControl_ignoreEvent"; 17 | 18 | @implementation UIControl (BRAdd) 19 | #pragma mark - Swizzling 20 | + (void)load { 21 | Method a = class_getInstanceMethod(self, @selector(sendAction:to:forEvent:)); 22 | Method b = class_getInstanceMethod(self, @selector(swizzled_sendAction:to:forEvent:)); 23 | method_exchangeImplementations(a, b);//交换方法 24 | } 25 | 26 | - (void)swizzled_sendAction:(SEL)action to:(id)target forEvent:(UIEvent *)event { 27 | if (self.ignoreEvent) { 28 | NSLog(@"btnAction is intercepted"); 29 | return; 30 | } 31 | if (self.acceptEventInterval > 0) { 32 | self.ignoreEvent = YES; 33 | [self performSelector:@selector(setIgnoreEventWithNo) withObject:nil afterDelay:self.acceptEventInterval]; 34 | } 35 | // 调用系统的 sendAction:to:forEvent: 方法 36 | [self swizzled_sendAction:action to:target forEvent:event]; 37 | } 38 | 39 | - (void)setIgnoreEventWithNo { 40 | self.ignoreEvent = NO; 41 | } 42 | 43 | #pragma mark - setter方法 44 | - (void)setAcceptEventInterval:(NSTimeInterval)acceptEventInterval { 45 | objc_setAssociatedObject(self, UIControl_acceptEventInterval, @(acceptEventInterval), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 46 | } 47 | 48 | - (void)setIgnoreEvent:(BOOL)ignoreEvent { 49 | objc_setAssociatedObject(self, UIControl_ignoreEvent, @(ignoreEvent), OBJC_ASSOCIATION_ASSIGN); 50 | } 51 | 52 | #pragma mark - getter方法 53 | - (NSTimeInterval)acceptEventInterval { 54 | return [objc_getAssociatedObject(self, UIControl_acceptEventInterval) doubleValue]; 55 | } 56 | 57 | - (BOOL)ignoreEvent { 58 | return [objc_getAssociatedObject(self, UIControl_ignoreEvent) boolValue]; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UIImage+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIImage (BRAdd) 14 | /** 显示原图(避免被系统渲染成蓝色) */ 15 | + (nullable UIImage *)br_originalImage:(NSString *)imageName; 16 | /** 用颜色返回一张图片 */ 17 | + (nullable UIImage *)br_imageWithColor:(UIColor *)color; 18 | /** 用颜色返回一张图片(指定图片大小) */ 19 | + (nullable UIImage *)br_imageWithColor:(UIColor *)color size:(CGSize)size; 20 | /** 为UIImage添加滤镜效果 */ 21 | - (nullable UIImage *)br_addFilter:(NSString *)filter; 22 | /** 设置图片的透明度 */ 23 | - (nullable UIImage *)br_alpha:(CGFloat)alpha; 24 | /** 25 | * 设置圆角图片 26 | * 27 | * @param radius 圆角半径 28 | */ 29 | - (nullable UIImage *)br_imageByRoundCornerRadius:(CGFloat)radius; 30 | 31 | /** 32 | * 设置圆角图片 33 | * 34 | * @param radius 圆角半径 35 | * @param borderWidth 边框宽度 36 | * @param borderColor 边框颜色 37 | */ 38 | - (nullable UIImage *)br_imageByRoundCornerRadius:(CGFloat)radius 39 | borderWidth:(CGFloat)borderWidth 40 | borderColor:(nullable UIColor *)borderColor; 41 | 42 | @end 43 | 44 | NS_ASSUME_NONNULL_END 45 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UIImage+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "UIImage+BRAdd.h" 10 | #import "BRKitMacro.h" 11 | 12 | BRSYNTH_DUMMY_CLASS(UIImage_BRAdd) 13 | 14 | @implementation UIImage (BRAdd) 15 | 16 | #pragma mark - 显示原图(避免被系统渲染成蓝色) 17 | + (UIImage *)br_originalImage:(NSString *)imageName { 18 | return [[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 19 | } 20 | 21 | #pragma mark - 用颜色返回一张图片 22 | + (UIImage *)br_imageWithColor:(UIColor *)color { 23 | return [self br_imageWithColor:color size:CGSizeMake(1, 1)]; 24 | } 25 | 26 | #pragma mark - 用颜色返回一张图片 27 | + (UIImage *)br_imageWithColor:(UIColor *)color size:(CGSize)size { 28 | if (!color || size.width <= 0 || size.height <= 0) return nil; 29 | CGRect rect = CGRectMake(0.0f, 0.0f, size.width, size.height); 30 | UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0); 31 | CGContextRef context = UIGraphicsGetCurrentContext(); 32 | CGContextSetFillColorWithColor(context, color.CGColor); 33 | CGContextFillRect(context, rect); 34 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 35 | UIGraphicsEndImageContext(); 36 | return image; 37 | } 38 | 39 | /** 40 | * 滤镜名字:OriginImage(原图)、CIPhotoEffectNoir(黑白)、CIPhotoEffectInstant(怀旧)、CIPhotoEffectProcess(冲印)、CIPhotoEffectFade(褪色)、CIPhotoEffectTonal(色调)、CIPhotoEffectMono(单色)、CIPhotoEffectChrome(铬黄) 41 | * 42 | * 灰色:CIPhotoEffectNoir //黑白 43 | */ 44 | #pragma mark - 为UIImage添加滤镜效果 45 | - (UIImage *)br_addFilter:(NSString *)filterName { 46 | if ([filterName isEqualToString:@"OriginImage"]) { 47 | return self; 48 | } 49 | //将UIImage转换成CIImage 50 | CIImage *ciImage = [[CIImage alloc] initWithImage:self]; 51 | //创建滤镜 52 | CIFilter *filter = [CIFilter filterWithName:filterName keysAndValues:kCIInputImageKey, ciImage, nil]; 53 | //已有的值不变,其他的设为默认值 54 | [filter setDefaults]; 55 | //获取绘制上下文 56 | CIContext *context = [CIContext contextWithOptions:nil]; 57 | //渲染并输出CIImage 58 | CIImage *outputImage = [filter outputImage]; 59 | //创建CGImage句柄 60 | CGImageRef cgImage = [context createCGImage:outputImage fromRect:[outputImage extent]]; 61 | //获取图片 62 | UIImage *image = [UIImage imageWithCGImage:cgImage]; 63 | //释放CGImage句柄 64 | CGImageRelease(cgImage); 65 | return image; 66 | } 67 | 68 | #pragma mark - 设置图片的透明度 69 | - (UIImage *)br_alpha:(CGFloat)alpha { 70 | UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0f); 71 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 72 | CGRect area = CGRectMake(0, 0, self.size.width, self.size.height); 73 | CGContextScaleCTM(ctx, 1, -1); 74 | CGContextTranslateCTM(ctx, 0, -area.size.height); 75 | CGContextSetBlendMode(ctx, kCGBlendModeMultiply); 76 | CGContextSetAlpha(ctx, alpha); 77 | CGContextDrawImage(ctx, area, self.CGImage); 78 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 79 | UIGraphicsEndImageContext(); 80 | return newImage; 81 | } 82 | 83 | #pragma mark - 设置圆角图片 84 | - (UIImage *)br_imageByRoundCornerRadius:(CGFloat)radius { 85 | return [self br_imageByRoundCornerRadius:radius borderWidth:0 borderColor:nil]; 86 | } 87 | 88 | #pragma mark - 设置圆角图片 89 | - (UIImage *)br_imageByRoundCornerRadius:(CGFloat)radius 90 | borderWidth:(CGFloat)borderWidth 91 | borderColor:(UIColor *)borderColor { 92 | return [self br_imageByRoundCornerRadius:radius 93 | corners:UIRectCornerAllCorners 94 | borderWidth:borderWidth 95 | borderColor:borderColor 96 | borderLineJoin:kCGLineJoinMiter]; 97 | } 98 | 99 | #pragma mark - 设置圆角图片 100 | // corners:需要设置为圆角的角 UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners 101 | - (UIImage *)br_imageByRoundCornerRadius:(CGFloat)radius 102 | corners:(UIRectCorner)corners 103 | borderWidth:(CGFloat)borderWidth 104 | borderColor:(UIColor *)borderColor 105 | borderLineJoin:(CGLineJoin)borderLineJoin { 106 | 107 | if (corners != UIRectCornerAllCorners) { 108 | UIRectCorner tmp = 0; 109 | if (corners & UIRectCornerTopLeft) tmp |= UIRectCornerBottomLeft; 110 | if (corners & UIRectCornerTopRight) tmp |= UIRectCornerBottomRight; 111 | if (corners & UIRectCornerBottomLeft) tmp |= UIRectCornerTopLeft; 112 | if (corners & UIRectCornerBottomRight) tmp |= UIRectCornerTopRight; 113 | corners = tmp; 114 | } 115 | 116 | UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale); 117 | CGContextRef context = UIGraphicsGetCurrentContext(); 118 | CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height); 119 | CGContextScaleCTM(context, 1, -1); 120 | CGContextTranslateCTM(context, 0, -rect.size.height); 121 | 122 | CGFloat minSize = MIN(self.size.width, self.size.height); 123 | if (borderWidth < minSize / 2) { 124 | UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectInset(rect, borderWidth, borderWidth) byRoundingCorners:corners cornerRadii:CGSizeMake(radius, borderWidth)]; 125 | [path closePath]; 126 | 127 | CGContextSaveGState(context); 128 | [path addClip]; 129 | CGContextDrawImage(context, rect, self.CGImage); 130 | CGContextRestoreGState(context); 131 | } 132 | 133 | if (borderColor && borderWidth < minSize / 2 && borderWidth > 0) { 134 | CGFloat strokeInset = (floor(borderWidth * self.scale) + 0.5) / self.scale; 135 | CGRect strokeRect = CGRectInset(rect, strokeInset, strokeInset); 136 | CGFloat strokeRadius = radius > self.scale / 2 ? radius - self.scale / 2 : 0; 137 | UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:strokeRect byRoundingCorners:corners cornerRadii:CGSizeMake(strokeRadius, borderWidth)]; 138 | [path closePath]; 139 | 140 | path.lineWidth = borderWidth; 141 | path.lineJoinStyle = borderLineJoin; 142 | [borderColor setStroke]; 143 | [path stroke]; 144 | } 145 | 146 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 147 | UIGraphicsEndImageContext(); 148 | return image; 149 | } 150 | 151 | @end 152 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UIImageView+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIImageView (BRAdd) 14 | 15 | /** 使用 CAShapeLayer 和 UIBezierPath 设置圆角 */ 16 | - (void)br_setBezierPathCornerRadius:(CGFloat)radius; 17 | 18 | /** 通过 Graphics 和 BezierPath 设置圆角(推荐用这个)*/ 19 | - (void)br_setGraphicsCornerRadius:(CGFloat)radius; 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UIImageView+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "UIImageView+BRAdd.h" 10 | #import "BRKitMacro.h" 11 | 12 | BRSYNTH_DUMMY_CLASS(UIImageView_BRAdd) 13 | 14 | @implementation UIImageView (BRAdd) 15 | 16 | #pragma mark - 使用 CAShapeLayer 和 UIBezierPath 设置圆角 17 | - (void)br_setBezierPathCornerRadius:(CGFloat)radius { 18 | // 创建BezierPath 并设置角 和 半径 这里只设置了 左上 和 右上 19 | UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bounds cornerRadius:radius]; 20 | CAShapeLayer *layer = [[CAShapeLayer alloc] init]; 21 | layer.frame = self.bounds; 22 | layer.path = path.CGPath; 23 | self.layer.mask = layer; 24 | } 25 | 26 | #pragma mark - 通过 Graphics 和 BezierPath 设置圆角(推荐用这个) 27 | - (void)br_setGraphicsCornerRadius:(CGFloat)radius { 28 | UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, 1.0); 29 | [[UIBezierPath bezierPathWithRoundedRect:self.bounds cornerRadius:radius] addClip]; 30 | [self drawRect:self.bounds]; 31 | self.image = UIGraphicsGetImageFromCurrentImageContext(); 32 | // 结束 33 | UIGraphicsEndImageContext(); 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UITextField+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITextField+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/11. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UITextField (BRAdd) 12 | /** UITextField 的最大输入长度 */ 13 | @property (nonatomic, assign) NSInteger inputLimit; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UITextField+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITextField+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/11. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "UITextField+BRAdd.h" 10 | #import "BRKitMacro.h" 11 | #import 12 | 13 | BRSYNTH_DUMMY_CLASS(UITextField_BRAdd) 14 | 15 | const char *kTextFieldInputLimitKey = "kTextFieldInputLimit"; 16 | 17 | @implementation UITextField (BRAdd) 18 | 19 | + (void)load { 20 | // 添加监听(监听文本的变化) 21 | [[NSNotificationCenter defaultCenter] addObserver:[self class] selector:@selector(textFieldTextDidChange:) name:UITextFieldTextDidChangeNotification object:nil]; 22 | } 23 | 24 | #pragma mark - 通知事件 25 | - (void)textFieldTextDidChange:(NSNotification *)notification { 26 | UITextField *textField = (UITextField *)notification.object; 27 | if (self.inputLimit > 0 && textField.text.length > self.inputLimit && textField.markedTextRange == nil) { 28 | textField.text = [textField.text substringFromIndex:self.inputLimit - 1]; 29 | } 30 | } 31 | 32 | #pragma mark - setter方法 33 | - (void)setInputLimit:(NSInteger)inputLimit { 34 | objc_setAssociatedObject(self, kTextFieldInputLimitKey, @(inputLimit), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 35 | } 36 | 37 | #pragma mark - getter方法 38 | - (NSInteger)inputLimit { 39 | NSNumber *limit = objc_getAssociatedObject(self, kTextFieldInputLimitKey); 40 | return [limit integerValue]; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UITextView+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITextView+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/11. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UITextView (BRAdd) 12 | /** UITextView 的最大输入长度 */ 13 | @property (nonatomic, assign) NSInteger inputLimit; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UITextView+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITextView+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/11. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "UITextView+BRAdd.h" 10 | #import "BRKitMacro.h" 11 | #import 12 | 13 | BRSYNTH_DUMMY_CLASS(UITextView_BRAdd) 14 | 15 | const char *kTextViewInputLimitKey = "kTextViewInputLimit"; 16 | 17 | @implementation UITextView (BRAdd) 18 | 19 | + (void)load { 20 | // 添加监听(监听文本的变化) 21 | [[NSNotificationCenter defaultCenter] addObserver:[self class] selector:@selector(textViewTextDidChange:) name:UITextViewTextDidChangeNotification object:nil]; 22 | } 23 | 24 | #pragma mark - 通知事件 25 | - (void)textViewTextDidChange:(NSNotification *)notification { 26 | UITextView *textView = (UITextView *)notification.object; 27 | if (self.inputLimit > 0 && textView.text.length > self.inputLimit && textView.markedTextRange == nil) { 28 | textView.text = [textView.text substringFromIndex:self.inputLimit - 1]; 29 | } 30 | } 31 | 32 | #pragma mark - setter方法 33 | - (void)setInputLimit:(NSInteger)inputLimit { 34 | objc_setAssociatedObject(self, kTextViewInputLimitKey, @(inputLimit), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 35 | } 36 | 37 | #pragma mark - getter方法 38 | - (NSInteger)inputLimit { 39 | NSNumber *limit = objc_getAssociatedObject(self, kTextViewInputLimitKey); 40 | return [limit integerValue]; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UIView+BRAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+BRAdd.h 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIView (BRAdd) 14 | /** 返回视图的视图控制器(可能为nil) */ 15 | @property (nullable, nonatomic, readonly) UIViewController *viewController; 16 | /** left: frame.origin.x */ 17 | @property (nonatomic) CGFloat left; 18 | /** top: frame.origin.y */ 19 | @property (nonatomic) CGFloat top; 20 | /** right: frame.origin.x + frame.size.width */ 21 | @property (nonatomic) CGFloat right; 22 | /** bottom: frame.origin.y + frame.size.height */ 23 | @property (nonatomic) CGFloat bottom; 24 | /** width: frame.size.width */ 25 | @property (nonatomic) CGFloat width; 26 | /** height: frame.size.height */ 27 | @property (nonatomic) CGFloat height; 28 | /** centerX: center.x */ 29 | @property (nonatomic) CGFloat centerX; 30 | /** centerY: center.y */ 31 | @property (nonatomic) CGFloat centerY; 32 | /** origin: frame.origin */ 33 | @property (nonatomic) CGPoint origin; 34 | /** size: frame.size */ 35 | @property (nonatomic) CGSize size; 36 | 37 | /** 38 | * 设置视图view的部分圆角(绝对布局) 39 | * 40 | * @param corners 需要设置为圆角的角(枚举类型) 41 | * @param radius 需要设置的圆角大小 42 | */ 43 | - (void)br_setRoundedCorners:(UIRectCorner)corners 44 | withRadius:(CGSize)radius; 45 | 46 | /** 47 | * 设置视图view的部分圆角(相对布局) 48 | * 49 | * @param corners 需要设置为圆角的角(枚举类型) 50 | * @param radius 需要设置的圆角大小 51 | * @param rect 需要设置的圆角view的rect 52 | */ 53 | - (void)br_setRoundedCorners:(UIRectCorner)corners 54 | withRadius:(CGSize)radius 55 | viewRect:(CGRect)rect; 56 | 57 | /** 58 | * 设置视图view的阴影 59 | * 60 | * @param color 阴影颜色 61 | * @param offset 阴影偏移量 62 | * @param radius 阴影半径 63 | */ 64 | - (void)br_setLayerShadow:(nullable UIColor*)color offset:(CGSize)offset radius:(CGFloat)radius; 65 | 66 | /** 删除所有子视图 */ 67 | - (void)br_removeAllSubviews; 68 | 69 | /** 创建屏幕快照 */ 70 | - (nullable UIImage *)br_snapshotImage; 71 | 72 | /** 创建屏幕快照pdf */ 73 | - (nullable NSData *)br_snapshotPDF; 74 | 75 | @end 76 | 77 | NS_ASSUME_NONNULL_END 78 | -------------------------------------------------------------------------------- /MyBaseProject/Utils/BRKit/UIKit/UIView+BRAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+BRAdd.m 3 | // BRKitDemo 4 | // 5 | // Created by 任波 on 2018/5/2. 6 | // Copyright © 2018年 91renb. All rights reserved. 7 | // 8 | 9 | #import "UIView+BRAdd.h" 10 | #import "BRKitMacro.h" 11 | 12 | BRSYNTH_DUMMY_CLASS(UIView_BRAdd) 13 | 14 | @implementation UIView (BRAdd) 15 | /// frame 快捷访问 16 | - (CGFloat)left { 17 | return self.frame.origin.x; 18 | } 19 | 20 | - (void)setLeft:(CGFloat)x { 21 | CGRect frame = self.frame; 22 | frame.origin.x = x; 23 | self.frame = frame; 24 | } 25 | 26 | - (CGFloat)top { 27 | return self.frame.origin.y; 28 | } 29 | 30 | - (void)setTop:(CGFloat)y { 31 | CGRect frame = self.frame; 32 | frame.origin.y = y; 33 | self.frame = frame; 34 | } 35 | 36 | - (CGFloat)right { 37 | return self.frame.origin.x + self.frame.size.width; 38 | } 39 | 40 | - (void)setRight:(CGFloat)right { 41 | CGRect frame = self.frame; 42 | frame.origin.x = right - frame.size.width; 43 | self.frame = frame; 44 | } 45 | 46 | - (CGFloat)bottom { 47 | return self.frame.origin.y + self.frame.size.height; 48 | } 49 | 50 | - (void)setBottom:(CGFloat)bottom { 51 | CGRect frame = self.frame; 52 | frame.origin.y = bottom - frame.size.height; 53 | self.frame = frame; 54 | } 55 | 56 | - (CGFloat)width { 57 | return self.frame.size.width; 58 | } 59 | 60 | - (void)setWidth:(CGFloat)width { 61 | CGRect frame = self.frame; 62 | frame.size.width = width; 63 | self.frame = frame; 64 | } 65 | 66 | - (CGFloat)height { 67 | return self.frame.size.height; 68 | } 69 | 70 | - (void)setHeight:(CGFloat)height { 71 | CGRect frame = self.frame; 72 | frame.size.height = height; 73 | self.frame = frame; 74 | } 75 | 76 | - (CGFloat)centerX { 77 | return self.center.x; 78 | } 79 | 80 | - (void)setCenterX:(CGFloat)centerX { 81 | self.center = CGPointMake(centerX, self.center.y); 82 | } 83 | 84 | - (CGFloat)centerY { 85 | return self.center.y; 86 | } 87 | 88 | - (void)setCenterY:(CGFloat)centerY { 89 | self.center = CGPointMake(self.center.x, centerY); 90 | } 91 | 92 | - (CGPoint)origin { 93 | return self.frame.origin; 94 | } 95 | 96 | - (void)setOrigin:(CGPoint)origin { 97 | CGRect frame = self.frame; 98 | frame.origin = origin; 99 | self.frame = frame; 100 | } 101 | 102 | - (CGSize)size { 103 | return self.frame.size; 104 | } 105 | 106 | - (void)setSize:(CGSize)size { 107 | CGRect frame = self.frame; 108 | frame.size = size; 109 | self.frame = frame; 110 | } 111 | 112 | #pragma mark - 设置视图view的部分圆角(绝对布局) 113 | // corners(枚举类型,可组合使用):UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners 114 | - (void)br_setRoundedCorners:(UIRectCorner)corners 115 | withRadius:(CGSize)radius { 116 | UIBezierPath *rounded = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:corners cornerRadii:radius]; 117 | CAShapeLayer* shape = [[CAShapeLayer alloc] init]; 118 | [shape setPath:rounded.CGPath]; 119 | self.layer.mask = shape; 120 | } 121 | 122 | #pragma mark - 设置视图view的部分圆角(相对布局) 123 | // corners(枚举类型,可组合使用):UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners 124 | - (void)br_setRoundedCorners:(UIRectCorner)corners 125 | withRadius:(CGSize)radius 126 | viewRect:(CGRect)rect { 127 | UIBezierPath *rounded = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:corners cornerRadii:radius]; 128 | CAShapeLayer *shape = [[CAShapeLayer alloc] init]; 129 | [shape setPath:rounded.CGPath]; 130 | self.layer.mask = shape; 131 | } 132 | 133 | #pragma mark - 设置视图view的阴影 134 | - (void)br_setLayerShadow:(nullable UIColor*)color offset:(CGSize)offset radius:(CGFloat)radius { 135 | self.layer.shadowColor = color.CGColor; 136 | self.layer.shadowOffset = offset; 137 | self.layer.shadowRadius = radius; 138 | self.layer.shadowOpacity = 1; 139 | self.layer.shouldRasterize = YES; 140 | self.layer.rasterizationScale = [UIScreen mainScreen].scale; 141 | } 142 | 143 | #pragma mark - 删除所有子视图 144 | - (void)br_removeAllSubviews { 145 | while (self.subviews.count) { 146 | [self.subviews.lastObject removeFromSuperview]; 147 | } 148 | } 149 | 150 | #pragma mark - 返回视图的视图控制器 151 | - (UIViewController *)viewController { 152 | for (UIView *view = self; view; view = view.superview) { 153 | UIResponder *nextResponder = [view nextResponder]; 154 | if ([nextResponder isKindOfClass:[UIViewController class]]) { 155 | return (UIViewController *)nextResponder; 156 | } 157 | } 158 | return nil; 159 | } 160 | 161 | #pragma mark - 创建屏幕快照 162 | - (UIImage *)br_snapshotImage { 163 | UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, 0); 164 | [self.layer renderInContext:UIGraphicsGetCurrentContext()]; 165 | UIImage *snap = UIGraphicsGetImageFromCurrentImageContext(); 166 | UIGraphicsEndImageContext(); 167 | return snap; 168 | } 169 | 170 | #pragma mark - 创建屏幕快照pdf 171 | - (NSData *)br_snapshotPDF { 172 | CGRect bounds = self.bounds; 173 | NSMutableData* data = [NSMutableData data]; 174 | CGDataConsumerRef consumer = CGDataConsumerCreateWithCFData((__bridge CFMutableDataRef)data); 175 | CGContextRef context = CGPDFContextCreate(consumer, &bounds, NULL); 176 | CGDataConsumerRelease(consumer); 177 | if (!context) return nil; 178 | CGPDFContextBeginPage(context, NULL); 179 | CGContextTranslateCTM(context, 0, bounds.size.height); 180 | CGContextScaleCTM(context, 1.0, -1.0); 181 | [self.layer renderInContext:context]; 182 | CGPDFContextEndPage(context); 183 | CGPDFContextClose(context); 184 | CGContextRelease(context); 185 | return data; 186 | } 187 | 188 | @end 189 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'MyBaseProject' do 5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 6 | # use_frameworks! 7 | pod 'Masonry', '~> 1.1.0' 8 | pod 'AFNetworking', '~> 3.2.0' 9 | 10 | 11 | # Pods for MyBaseProject 12 | 13 | end 14 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.2.1): 3 | - AFNetworking/NSURLSession (= 3.2.1) 4 | - AFNetworking/Reachability (= 3.2.1) 5 | - AFNetworking/Security (= 3.2.1) 6 | - AFNetworking/Serialization (= 3.2.1) 7 | - AFNetworking/UIKit (= 3.2.1) 8 | - AFNetworking/NSURLSession (3.2.1): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.2.1) 13 | - AFNetworking/Security (3.2.1) 14 | - AFNetworking/Serialization (3.2.1) 15 | - AFNetworking/UIKit (3.2.1): 16 | - AFNetworking/NSURLSession 17 | - Masonry (1.1.0) 18 | 19 | DEPENDENCIES: 20 | - AFNetworking (~> 3.2.0) 21 | - Masonry (~> 1.1.0) 22 | 23 | SPEC REPOS: 24 | https://github.com/cocoapods/specs.git: 25 | - AFNetworking 26 | - Masonry 27 | 28 | SPEC CHECKSUMS: 29 | AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057 30 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 31 | 32 | PODFILE CHECKSUM: 9d4eb8b62259a654a4040d419ac0f6507cabc1f8 33 | 34 | COCOAPODS: 1.5.3 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MyBaseProject 2 | 我的基本工程 3 | --------------------------------------------------------------------------------