├── README.md └── YCDefine ├── YCDefine.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── liyuechun.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── liyuechun.xcuserdatad │ └── xcschemes │ ├── YCDefine.xcscheme │ └── xcschememanagement.plist └── YCDefine ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m ├── YCDefine ├── YCDefine.h ├── YCDefine_Device.h └── YCDefine_UI.h └── main.m /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ###iOS项目中常用到的宏整理,使用方便快捷。 4 | 5 | ###使用方法 6 | 7 | * 下载demo 8 | 9 | * 将demo中的YCDefine文件夹拖拽到工程中,在您工程里面的pch文件直接导入 YCDefine.h文件即可 10 | 11 | ##有问题反馈 12 | 在使用中有任何问题,欢迎反馈给我,可以用以下联系方式跟我交流 13 | 14 | * 邮件:(liyuechun2009@163.com) 15 | * QQ群: 343640780 16 | * weibo: [@千锋教育黎跃春](http://weibo.com/mobiledevelopment) 17 | 18 | ##您的鼓励是我前进的动力 19 | 在兴趣的驱动下,写一个`免费`的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。有钱的捧个钱场,没钱的回家拿钱捧个钱场,star一下。 20 | 21 | 22 | ##项目贡献者 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
项目贡献者联系QQ
黎跃春[笑傲人生]939442932
王广威524968369
39 | -------------------------------------------------------------------------------- /YCDefine/YCDefine.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4804D1711C0E7CC70076821E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4804D1701C0E7CC70076821E /* main.m */; }; 11 | 4804D1741C0E7CC70076821E /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4804D1731C0E7CC70076821E /* AppDelegate.m */; }; 12 | 4804D1771C0E7CC70076821E /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4804D1761C0E7CC70076821E /* ViewController.m */; }; 13 | 4804D17A1C0E7CC70076821E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4804D1781C0E7CC70076821E /* Main.storyboard */; }; 14 | 4804D17C1C0E7CC70076821E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4804D17B1C0E7CC70076821E /* Assets.xcassets */; }; 15 | 4804D17F1C0E7CC70076821E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4804D17D1C0E7CC70076821E /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 4804D16C1C0E7CC70076821E /* YCDefine.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YCDefine.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 4804D1701C0E7CC70076821E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 21 | 4804D1721C0E7CC70076821E /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 22 | 4804D1731C0E7CC70076821E /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 23 | 4804D1751C0E7CC70076821E /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 24 | 4804D1761C0E7CC70076821E /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 25 | 4804D1791C0E7CC70076821E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 26 | 4804D17B1C0E7CC70076821E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | 4804D17E1C0E7CC70076821E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 28 | 4804D1801C0E7CC70076821E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | 4804D1871C0E7D140076821E /* YCDefine_Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YCDefine_Device.h; sourceTree = ""; }; 30 | 4804D1881C0E7D280076821E /* YCDefine_UI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YCDefine_UI.h; sourceTree = ""; }; 31 | 4804D1891C0E7D320076821E /* YCDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YCDefine.h; sourceTree = ""; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | 4804D1691C0E7CC70076821E /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | 4804D1631C0E7CC70076821E = { 46 | isa = PBXGroup; 47 | children = ( 48 | 4804D16E1C0E7CC70076821E /* YCDefine */, 49 | 4804D16D1C0E7CC70076821E /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | 4804D16D1C0E7CC70076821E /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 4804D16C1C0E7CC70076821E /* YCDefine.app */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | 4804D16E1C0E7CC70076821E /* YCDefine */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 4804D1861C0E7CFC0076821E /* YCDefine */, 65 | 4804D1721C0E7CC70076821E /* AppDelegate.h */, 66 | 4804D1731C0E7CC70076821E /* AppDelegate.m */, 67 | 4804D1751C0E7CC70076821E /* ViewController.h */, 68 | 4804D1761C0E7CC70076821E /* ViewController.m */, 69 | 4804D1781C0E7CC70076821E /* Main.storyboard */, 70 | 4804D17B1C0E7CC70076821E /* Assets.xcassets */, 71 | 4804D17D1C0E7CC70076821E /* LaunchScreen.storyboard */, 72 | 4804D1801C0E7CC70076821E /* Info.plist */, 73 | 4804D16F1C0E7CC70076821E /* Supporting Files */, 74 | ); 75 | path = YCDefine; 76 | sourceTree = ""; 77 | }; 78 | 4804D16F1C0E7CC70076821E /* Supporting Files */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 4804D1701C0E7CC70076821E /* main.m */, 82 | ); 83 | name = "Supporting Files"; 84 | sourceTree = ""; 85 | }; 86 | 4804D1861C0E7CFC0076821E /* YCDefine */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 4804D1871C0E7D140076821E /* YCDefine_Device.h */, 90 | 4804D1881C0E7D280076821E /* YCDefine_UI.h */, 91 | 4804D1891C0E7D320076821E /* YCDefine.h */, 92 | ); 93 | path = YCDefine; 94 | sourceTree = ""; 95 | }; 96 | /* End PBXGroup section */ 97 | 98 | /* Begin PBXNativeTarget section */ 99 | 4804D16B1C0E7CC70076821E /* YCDefine */ = { 100 | isa = PBXNativeTarget; 101 | buildConfigurationList = 4804D1831C0E7CC70076821E /* Build configuration list for PBXNativeTarget "YCDefine" */; 102 | buildPhases = ( 103 | 4804D1681C0E7CC70076821E /* Sources */, 104 | 4804D1691C0E7CC70076821E /* Frameworks */, 105 | 4804D16A1C0E7CC70076821E /* Resources */, 106 | ); 107 | buildRules = ( 108 | ); 109 | dependencies = ( 110 | ); 111 | name = YCDefine; 112 | productName = YCDefine; 113 | productReference = 4804D16C1C0E7CC70076821E /* YCDefine.app */; 114 | productType = "com.apple.product-type.application"; 115 | }; 116 | /* End PBXNativeTarget section */ 117 | 118 | /* Begin PBXProject section */ 119 | 4804D1641C0E7CC70076821E /* Project object */ = { 120 | isa = PBXProject; 121 | attributes = { 122 | LastUpgradeCheck = 0710; 123 | ORGANIZATIONNAME = "黎跃春"; 124 | TargetAttributes = { 125 | 4804D16B1C0E7CC70076821E = { 126 | CreatedOnToolsVersion = 7.1; 127 | }; 128 | }; 129 | }; 130 | buildConfigurationList = 4804D1671C0E7CC70076821E /* Build configuration list for PBXProject "YCDefine" */; 131 | compatibilityVersion = "Xcode 3.2"; 132 | developmentRegion = English; 133 | hasScannedForEncodings = 0; 134 | knownRegions = ( 135 | en, 136 | Base, 137 | ); 138 | mainGroup = 4804D1631C0E7CC70076821E; 139 | productRefGroup = 4804D16D1C0E7CC70076821E /* Products */; 140 | projectDirPath = ""; 141 | projectRoot = ""; 142 | targets = ( 143 | 4804D16B1C0E7CC70076821E /* YCDefine */, 144 | ); 145 | }; 146 | /* End PBXProject section */ 147 | 148 | /* Begin PBXResourcesBuildPhase section */ 149 | 4804D16A1C0E7CC70076821E /* Resources */ = { 150 | isa = PBXResourcesBuildPhase; 151 | buildActionMask = 2147483647; 152 | files = ( 153 | 4804D17F1C0E7CC70076821E /* LaunchScreen.storyboard in Resources */, 154 | 4804D17C1C0E7CC70076821E /* Assets.xcassets in Resources */, 155 | 4804D17A1C0E7CC70076821E /* Main.storyboard in Resources */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | /* End PBXResourcesBuildPhase section */ 160 | 161 | /* Begin PBXSourcesBuildPhase section */ 162 | 4804D1681C0E7CC70076821E /* Sources */ = { 163 | isa = PBXSourcesBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | 4804D1771C0E7CC70076821E /* ViewController.m in Sources */, 167 | 4804D1741C0E7CC70076821E /* AppDelegate.m in Sources */, 168 | 4804D1711C0E7CC70076821E /* main.m in Sources */, 169 | ); 170 | runOnlyForDeploymentPostprocessing = 0; 171 | }; 172 | /* End PBXSourcesBuildPhase section */ 173 | 174 | /* Begin PBXVariantGroup section */ 175 | 4804D1781C0E7CC70076821E /* Main.storyboard */ = { 176 | isa = PBXVariantGroup; 177 | children = ( 178 | 4804D1791C0E7CC70076821E /* Base */, 179 | ); 180 | name = Main.storyboard; 181 | sourceTree = ""; 182 | }; 183 | 4804D17D1C0E7CC70076821E /* LaunchScreen.storyboard */ = { 184 | isa = PBXVariantGroup; 185 | children = ( 186 | 4804D17E1C0E7CC70076821E /* Base */, 187 | ); 188 | name = LaunchScreen.storyboard; 189 | sourceTree = ""; 190 | }; 191 | /* End PBXVariantGroup section */ 192 | 193 | /* Begin XCBuildConfiguration section */ 194 | 4804D1811C0E7CC70076821E /* Debug */ = { 195 | isa = XCBuildConfiguration; 196 | buildSettings = { 197 | ALWAYS_SEARCH_USER_PATHS = NO; 198 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 199 | CLANG_CXX_LIBRARY = "libc++"; 200 | CLANG_ENABLE_MODULES = YES; 201 | CLANG_ENABLE_OBJC_ARC = YES; 202 | CLANG_WARN_BOOL_CONVERSION = YES; 203 | CLANG_WARN_CONSTANT_CONVERSION = YES; 204 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 205 | CLANG_WARN_EMPTY_BODY = YES; 206 | CLANG_WARN_ENUM_CONVERSION = YES; 207 | CLANG_WARN_INT_CONVERSION = YES; 208 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 209 | CLANG_WARN_UNREACHABLE_CODE = YES; 210 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 211 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 212 | COPY_PHASE_STRIP = NO; 213 | DEBUG_INFORMATION_FORMAT = dwarf; 214 | ENABLE_STRICT_OBJC_MSGSEND = YES; 215 | ENABLE_TESTABILITY = YES; 216 | GCC_C_LANGUAGE_STANDARD = gnu99; 217 | GCC_DYNAMIC_NO_PIC = NO; 218 | GCC_NO_COMMON_BLOCKS = YES; 219 | GCC_OPTIMIZATION_LEVEL = 0; 220 | GCC_PREPROCESSOR_DEFINITIONS = ( 221 | "DEBUG=1", 222 | "$(inherited)", 223 | ); 224 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 225 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 226 | GCC_WARN_UNDECLARED_SELECTOR = YES; 227 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 228 | GCC_WARN_UNUSED_FUNCTION = YES; 229 | GCC_WARN_UNUSED_VARIABLE = YES; 230 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 231 | MTL_ENABLE_DEBUG_INFO = YES; 232 | ONLY_ACTIVE_ARCH = YES; 233 | SDKROOT = iphoneos; 234 | }; 235 | name = Debug; 236 | }; 237 | 4804D1821C0E7CC70076821E /* Release */ = { 238 | isa = XCBuildConfiguration; 239 | buildSettings = { 240 | ALWAYS_SEARCH_USER_PATHS = NO; 241 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 242 | CLANG_CXX_LIBRARY = "libc++"; 243 | CLANG_ENABLE_MODULES = YES; 244 | CLANG_ENABLE_OBJC_ARC = YES; 245 | CLANG_WARN_BOOL_CONVERSION = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 248 | CLANG_WARN_EMPTY_BODY = YES; 249 | CLANG_WARN_ENUM_CONVERSION = YES; 250 | CLANG_WARN_INT_CONVERSION = YES; 251 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 252 | CLANG_WARN_UNREACHABLE_CODE = YES; 253 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 254 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 255 | COPY_PHASE_STRIP = NO; 256 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 257 | ENABLE_NS_ASSERTIONS = NO; 258 | ENABLE_STRICT_OBJC_MSGSEND = YES; 259 | GCC_C_LANGUAGE_STANDARD = gnu99; 260 | GCC_NO_COMMON_BLOCKS = YES; 261 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 262 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 263 | GCC_WARN_UNDECLARED_SELECTOR = YES; 264 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 265 | GCC_WARN_UNUSED_FUNCTION = YES; 266 | GCC_WARN_UNUSED_VARIABLE = YES; 267 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 268 | MTL_ENABLE_DEBUG_INFO = NO; 269 | SDKROOT = iphoneos; 270 | VALIDATE_PRODUCT = YES; 271 | }; 272 | name = Release; 273 | }; 274 | 4804D1841C0E7CC70076821E /* Debug */ = { 275 | isa = XCBuildConfiguration; 276 | buildSettings = { 277 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 278 | INFOPLIST_FILE = YCDefine/Info.plist; 279 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 280 | PRODUCT_BUNDLE_IDENTIFIER = "---.YCDefine"; 281 | PRODUCT_NAME = "$(TARGET_NAME)"; 282 | }; 283 | name = Debug; 284 | }; 285 | 4804D1851C0E7CC70076821E /* Release */ = { 286 | isa = XCBuildConfiguration; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | INFOPLIST_FILE = YCDefine/Info.plist; 290 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 291 | PRODUCT_BUNDLE_IDENTIFIER = "---.YCDefine"; 292 | PRODUCT_NAME = "$(TARGET_NAME)"; 293 | }; 294 | name = Release; 295 | }; 296 | /* End XCBuildConfiguration section */ 297 | 298 | /* Begin XCConfigurationList section */ 299 | 4804D1671C0E7CC70076821E /* Build configuration list for PBXProject "YCDefine" */ = { 300 | isa = XCConfigurationList; 301 | buildConfigurations = ( 302 | 4804D1811C0E7CC70076821E /* Debug */, 303 | 4804D1821C0E7CC70076821E /* Release */, 304 | ); 305 | defaultConfigurationIsVisible = 0; 306 | defaultConfigurationName = Release; 307 | }; 308 | 4804D1831C0E7CC70076821E /* Build configuration list for PBXNativeTarget "YCDefine" */ = { 309 | isa = XCConfigurationList; 310 | buildConfigurations = ( 311 | 4804D1841C0E7CC70076821E /* Debug */, 312 | 4804D1851C0E7CC70076821E /* Release */, 313 | ); 314 | defaultConfigurationIsVisible = 0; 315 | }; 316 | /* End XCConfigurationList section */ 317 | }; 318 | rootObject = 4804D1641C0E7CC70076821E /* Project object */; 319 | } 320 | -------------------------------------------------------------------------------- /YCDefine/YCDefine.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /YCDefine/YCDefine.xcodeproj/project.xcworkspace/xcuserdata/liyuechun.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liyuechun/YCDefine/2b99463e793e85d366bd7a05c1ef47e84b77cb5a/YCDefine/YCDefine.xcodeproj/project.xcworkspace/xcuserdata/liyuechun.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /YCDefine/YCDefine.xcodeproj/xcuserdata/liyuechun.xcuserdatad/xcschemes/YCDefine.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /YCDefine/YCDefine.xcodeproj/xcuserdata/liyuechun.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | YCDefine.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 4804D16B1C0E7CC70076821E 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /YCDefine/YCDefine/AppDelegate.h: -------------------------------------------------------------------------------- 1 | //=============================================================== 2 | // ___ __ 3 | // / (_)_ ____ _____ ____/ / __ _____ 4 | // / / / // / // / -_) __/ _ \/ // / _ \ 5 | // /_/_/\_, /\_,_/\__/\__/_//_/\_,_/_//_/ 6 | // /___/ 7 | // 8 | //=================== = ==================== 9 | // Created by 黎跃春 on 1314/05/20. 10 | // Copyright (c) 2015年 黎跃春. All rights reserved. 11 | //=================== = ==================== 12 | // 《iOS编程之美》技术讨论群:343640780 13 | // 电子邮件:liyuechun2009@163.com 14 | // 微信:Liyuechun2012 15 | // QQ:939442932[春哥] 1244357005[广威] 16 | // github:https://github.com/LiYueChun 17 | // 简书地址:http://www.jianshu.com/users/336468483205/latest_articles 18 | // 新浪微博:http://weibo.com/mobiledevelopment 19 | // 新浪博客:http://blog.sina.com.cn/technicalarticle 20 | //================================================================ 21 | 22 | #import 23 | 24 | @interface AppDelegate : UIResponder 25 | 26 | @property (strong, nonatomic) UIWindow *window; 27 | 28 | 29 | @end 30 | 31 | -------------------------------------------------------------------------------- /YCDefine/YCDefine/AppDelegate.m: -------------------------------------------------------------------------------- 1 | //=============================================================== 2 | // ___ __ 3 | // / (_)_ ____ _____ ____/ / __ _____ 4 | // / / / // / // / -_) __/ _ \/ // / _ \ 5 | // /_/_/\_, /\_,_/\__/\__/_//_/\_,_/_//_/ 6 | // /___/ 7 | // 8 | //=================== = ==================== 9 | // Created by 黎跃春 on 1314/05/20. 10 | // Copyright (c) 2015年 黎跃春. All rights reserved. 11 | //=================== = ==================== 12 | // 《iOS编程之美》技术讨论群:343640780 13 | // 电子邮件:liyuechun2009@163.com 14 | // 微信:Liyuechun2012 15 | // QQ:939442932[春哥] 1244357005[广威] 16 | // github:https://github.com/LiYueChun 17 | // 简书地址:http://www.jianshu.com/users/336468483205/latest_articles 18 | // 新浪微博:http://weibo.com/mobiledevelopment 19 | // 新浪博客:http://blog.sina.com.cn/technicalarticle 20 | //================================================================ 21 | 22 | #import "AppDelegate.h" 23 | 24 | @interface AppDelegate () 25 | 26 | @end 27 | 28 | @implementation AppDelegate 29 | 30 | 31 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 32 | // Override point for customization after application launch. 33 | return YES; 34 | } 35 | 36 | - (void)applicationWillResignActive:(UIApplication *)application { 37 | // 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. 38 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 39 | } 40 | 41 | - (void)applicationDidEnterBackground:(UIApplication *)application { 42 | // 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. 43 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 44 | } 45 | 46 | - (void)applicationWillEnterForeground:(UIApplication *)application { 47 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 48 | } 49 | 50 | - (void)applicationDidBecomeActive:(UIApplication *)application { 51 | // 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. 52 | } 53 | 54 | - (void)applicationWillTerminate:(UIApplication *)application { 55 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /YCDefine/YCDefine/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /YCDefine/YCDefine/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 | -------------------------------------------------------------------------------- /YCDefine/YCDefine/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 | -------------------------------------------------------------------------------- /YCDefine/YCDefine/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /YCDefine/YCDefine/ViewController.h: -------------------------------------------------------------------------------- 1 | //=============================================================== 2 | // ___ __ 3 | // / (_)_ ____ _____ ____/ / __ _____ 4 | // / / / // / // / -_) __/ _ \/ // / _ \ 5 | // /_/_/\_, /\_,_/\__/\__/_//_/\_,_/_//_/ 6 | // /___/ 7 | // 8 | //=================== = ==================== 9 | // Created by 黎跃春 on 1314/05/20. 10 | // Copyright (c) 2015年 黎跃春. All rights reserved. 11 | //=================== = ==================== 12 | // 《iOS编程之美》技术讨论群:343640780 13 | // 电子邮件:liyuechun2009@163.com 14 | // 微信:Liyuechun2012 15 | // QQ:939442932[春哥] 1244357005[广威] 16 | // github:https://github.com/LiYueChun 17 | // 简书地址:http://www.jianshu.com/users/336468483205/latest_articles 18 | // 新浪微博:http://weibo.com/mobiledevelopment 19 | // 新浪博客:http://blog.sina.com.cn/technicalarticle 20 | //================================================================ 21 | 22 | #import 23 | 24 | @interface ViewController : UIViewController 25 | 26 | 27 | @end 28 | 29 | -------------------------------------------------------------------------------- /YCDefine/YCDefine/ViewController.m: -------------------------------------------------------------------------------- 1 | //=============================================================== 2 | // ___ __ 3 | // / (_)_ ____ _____ ____/ / __ _____ 4 | // / / / // / // / -_) __/ _ \/ // / _ \ 5 | // /_/_/\_, /\_,_/\__/\__/_//_/\_,_/_//_/ 6 | // /___/ 7 | // 8 | //=================== = ==================== 9 | // Created by 黎跃春 on 1314/05/20. 10 | // Copyright (c) 2015年 黎跃春. All rights reserved. 11 | //=================== = ==================== 12 | // 《iOS编程之美》技术讨论群:343640780 13 | // 电子邮件:liyuechun2009@163.com 14 | // 微信:Liyuechun2012 15 | // QQ:939442932[春哥] 1244357005[广威] 16 | // github:https://github.com/LiYueChun 17 | // 简书地址:http://www.jianshu.com/users/336468483205/latest_articles 18 | // 新浪微博:http://weibo.com/mobiledevelopment 19 | // 新浪博客:http://blog.sina.com.cn/technicalarticle 20 | //================================================================ 21 | 22 | #import "ViewController.h" 23 | 24 | @interface ViewController () 25 | 26 | @end 27 | 28 | @implementation ViewController 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | // Do any additional setup after loading the view, typically from a nib. 33 | } 34 | 35 | - (void)didReceiveMemoryWarning { 36 | [super didReceiveMemoryWarning]; 37 | // Dispose of any resources that can be recreated. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /YCDefine/YCDefine/YCDefine/YCDefine.h: -------------------------------------------------------------------------------- 1 | //=============================================================== 2 | // ___ __ 3 | // / (_)_ ____ _____ ____/ / __ _____ 4 | // / / / // / // / -_) __/ _ \/ // / _ \ 5 | // /_/_/\_, /\_,_/\__/\__/_//_/\_,_/_//_/ 6 | // /___/ 7 | // 8 | //=================== = ==================== 9 | // Created by 黎跃春 on 1314/05/20. 10 | // Copyright (c) 2015年 黎跃春. All rights reserved. 11 | //=================== = ==================== 12 | // 《iOS编程之美》技术讨论群:343640780 13 | // 电子邮件:liyuechun2009@163.com 14 | // 微信:Liyuechun2012 15 | // QQ:939442932[春哥] 1244357005[广威] 16 | // github:https://github.com/LiYueChun 17 | // 简书地址:http://www.jianshu.com/users/336468483205/latest_articles 18 | // 新浪微博:http://weibo.com/mobiledevelopment 19 | // 新浪博客:http://blog.sina.com.cn/technicalarticle 20 | //================================================================ 21 | 22 | #ifndef YCDefine_h 23 | #define YCDefine_h 24 | 25 | 26 | #import "YCDefine_Device.h" 27 | #import "YCDefine_UI.h" 28 | 29 | 30 | #endif /* YCDefine_h */ 31 | -------------------------------------------------------------------------------- /YCDefine/YCDefine/YCDefine/YCDefine_Device.h: -------------------------------------------------------------------------------- 1 | //=============================================================== 2 | // ___ __ 3 | // / (_)_ ____ _____ ____/ / __ _____ 4 | // / / / // / // / -_) __/ _ \/ // / _ \ 5 | // /_/_/\_, /\_,_/\__/\__/_//_/\_,_/_//_/ 6 | // /___/ 7 | // 8 | //=================== = ==================== 9 | // Created by 黎跃春 on 1314/05/20. 10 | // Copyright (c) 2015年 黎跃春. All rights reserved. 11 | //=================== = ==================== 12 | // 《iOS编程之美》技术讨论群:343640780 13 | // 电子邮件:liyuechun2009@163.com 14 | // 微信:Liyuechun2012 15 | // QQ:939442932[春哥] 1244357005[广威] 16 | // github:https://github.com/LiYueChun 17 | // 简书地址:http://www.jianshu.com/users/336468483205/latest_articles 18 | // 新浪微博:http://weibo.com/mobiledevelopment 19 | // 新浪博客:http://blog.sina.com.cn/technicalarticle 20 | //================================================================ 21 | 22 | #ifndef YCDefine_Device_h 23 | #define YCDefine_Device_h 24 | 25 | 26 | /** 27 | iPad Air {{0, 0}, {768, 1024}} 28 | iphone4s {{0, 0}, {320, 480}} 960*640 29 | iphone5 5s {{0, 0}, {320, 568}} 1136*640 30 | iphone6 6s {{0, 0}, {375, 667}} 1334*750 31 | iphone6Plus 6sPlus {{0, 0}, {414, 736}} 1920*1080 32 | Apple Watch 1.65英寸 320*640 33 | */ 34 | 35 | /** 主屏幕的高度 */ 36 | #define YC_M_SCREEN_H [[UIScreen mainScreen] bounds].size.height 37 | /** 主屏幕的宽度 */ 38 | #define YC_M_SCREEN_W [[UIScreen mainScreen] bounds].size.width 39 | 40 | /** 主屏幕的高度比例 */ 41 | #define YC_M_SCREEN_H_SCALE (M_SCREEN_H/640) 42 | /** 主屏幕的宽度比例 */ 43 | #define YC_M_SCREEN_W_SCALE (M_SCREEN_W/320) 44 | 45 | 46 | /** 屏幕的分辨率 当结果为1时,显示的是普通屏幕,结果为2时,显示的是Retian屏幕 */ 47 | #define YC_M_SCREEN_SCALE [[UIScreen mainScreen] scale] 48 | 49 | /** 除去信号区的屏幕的frame */ 50 | #define YC_APP_FRAME [[UIScreen mainScreen] applicationFrame] 51 | /** 应用程序的屏幕高度 */ 52 | #define YC_APP_FRAME_H [[UIScreen mainScreen] applicationFrame].size.height 53 | /** 应用程序的屏幕宽度 */ 54 | #define YC_APP_FRAME_W [[UIScreen mainScreen] applicationFrame].size.width 55 | 56 | 57 | /** 系统控件的默认高度 */ 58 | #define YC_D_STATUS_BAR_H (20.f) 59 | #define YC_D_TOP_BAR_H (44.f) 60 | #define YC_D_BOTTOM_BAR_H (49.f) 61 | #define YC_D_CELL_H (44.f) 62 | 63 | /** 中英状态下键盘的高度 */ 64 | #define YC_ENG_KEY_BOARD_H (216.f) 65 | #define YC_CHN_KEY_BOARD_H (252.f) 66 | 67 | 68 | #define YC_IS_IOS6 (SYSTEM_VERSION >= 6.0 && SYSTEM_VERSION < 7) 69 | #define YC_IS_IOS7 (SYSTEM_VERSION >= 7.0 && SYSTEM_VERSION < 8.0) 70 | #define YC_IS_IOS8 (SYSTEM_VERSION >= 8.0 && SYSTEM_VERSION < 9.0) 71 | #define YC_IS_IOS9 (SYSTEM_VERSION >= 9.0 && SYSTEM_VERSION < 10.0) 72 | 73 | /** 设备判断 */ 74 | #define YC_IS_IPHONE [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone 75 | #define YC_IS_PAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 76 | 77 | /** iPhone的型号 */ 78 | #define YC_IS_IPHONE4 ([[UIScreen mainScreen] bounds].size.height == 480) 79 | #define YC_IS_IPHONE5 ([[UIScreen mainScreen] bounds].size.height == 568) 80 | #define YC_IS_IPHONE6 ([[UIScreen mainScreen] bounds].size.height == 667) 81 | #define YC_IS_IPHONE6_PLUS ([[UIScreen mainScreen] bounds].size.height == 736) 82 | 83 | /** 系统的版本号 */ 84 | #define YC_SYSTEM_VERSION [[[UIDevice currentDevice] systemVersion] floatValue] 85 | 86 | /** APP版本号 */ 87 | #define YC_APP_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] 88 | 89 | /** APP BUILD 版本号 */ 90 | #define YC_APP_BUILD_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] 91 | 92 | /** APP名字 */ 93 | #define YC_APP_DISPLAY_NAME [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] 94 | 95 | /** 当前语言 */ 96 | #define YC_LOCAL_LANGUAGE [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode] 97 | 98 | /** 当前国家 */ 99 | #define YC_LOCAL_COUNTRY [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode] 100 | 101 | /** 当前使用Xcode iPhone OS SDK 的版本 */ 102 | #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_8_0 103 | NSLog(@"当前使用Xcode iPhone OS SDK 8.0 以后版本的处理"); 104 | #else 105 | NSLog(@"当前使用Xcode iPhone OS SDK 8.0 之前版本的处理"); 106 | #endif 107 | 108 | 109 | /** 判断设备室真机还是模拟器 */ 110 | #if TARGET_OS_IPHONE 111 | #endif 112 | 113 | #if TARGET_IPHONE_SIMULATOR 114 | #endif 115 | 116 | /** 判断系统为64位还是32位 */ 117 | #if __LP64__ 118 | NSLog(@"64"); 119 | #else 120 | NSLog(@"32"); 121 | #endif 122 | 123 | 124 | #endif /* YCDefine_Device_h */ 125 | -------------------------------------------------------------------------------- /YCDefine/YCDefine/YCDefine/YCDefine_UI.h: -------------------------------------------------------------------------------- 1 | //=============================================================== 2 | // ___ __ 3 | // / (_)_ ____ _____ ____/ / __ _____ 4 | // / / / // / // / -_) __/ _ \/ // / _ \ 5 | // /_/_/\_, /\_,_/\__/\__/_//_/\_,_/_//_/ 6 | // /___/ 7 | // 8 | //=================== = ==================== 9 | // Created by 黎跃春 on 1314/05/20. 10 | // Copyright (c) 2015年 黎跃春. All rights reserved. 11 | //=================== = ==================== 12 | // 《iOS编程之美》技术讨论群:343640780 13 | // 电子邮件:liyuechun2009@163.com 14 | // 微信:Liyuechun2012 15 | // QQ:939442932[春哥] 1244357005[广威] 16 | // github:https://github.com/LiYueChun 17 | // 简书地址:http://www.jianshu.com/users/336468483205/latest_articles 18 | // 新浪微博:http://weibo.com/mobiledevelopment 19 | // 新浪博客:http://blog.sina.com.cn/technicalarticle 20 | //================================================================ 21 | 22 | #ifndef YCDefine_UI_h 23 | #define YCDefine_UI_h 24 | 25 | 26 | /** 字体大小 */ 27 | #define YC_FONT(NAME,FONTSIZE) [UIFont fontWithName:(NAME) size:(FONTSIZE)] 28 | #define YC_S_FONT(FONTSIZE) [UIFont systemFontOfSize:FONTSIZE] 29 | #define YC_S_BOLD_FONT(FONTSIZE) [UIFont boldSystemFontOfSize:FONTSIZE] 30 | 31 | 32 | /** 颜色(RGB) */ 33 | #define YC_RGB(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]; 34 | #define YC_RGBA(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)] 35 | 36 | /** 颜色(0xFFFFFF) */ 37 | #define YC_HEX_RGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] 38 | #define YC_HEX_RGBA(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)] 39 | 40 | 41 | /** 资源路径 */ 42 | #define YC_PNG_PATH(NAME) [[NSBundle mainBundle] pathForResource:[NSString stringWithUTF8String:NAME] ofType:@"png"] 43 | #define YC_JPG_PATH(NAME) [[NSBundle mainBundle] pathForResource:[NSString stringWithUTF8String:NAME] ofType:@"jpg"] 44 | #define YC_PATH(NAME,EXT) [[NSBundle mainBundle] pathForResource:(NAME) ofType:(EXT)] 45 | 46 | /** 加载图片 */ 47 | #define YC_PNG_IMAGE_FILE(NAME) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:(NAME) ofType:@"png"]] 48 | #define YC_JPG_IMAGE_FILE(NAME) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:(NAME) ofType:@"jpg"]] 49 | #define YC_IMAGE_FILE(NAME,EXT) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:(NAME) ofType:(EXT)]] 50 | #define YC_IMAGE_NAMED(NAME) [UIImage imageNamed:NAME] 51 | 52 | 53 | #endif /* YCDefine_UI_h */ 54 | -------------------------------------------------------------------------------- /YCDefine/YCDefine/main.m: -------------------------------------------------------------------------------- 1 | //=============================================================== 2 | // ___ __ 3 | // / (_)_ ____ _____ ____/ / __ _____ 4 | // / / / // / // / -_) __/ _ \/ // / _ \ 5 | // /_/_/\_, /\_,_/\__/\__/_//_/\_,_/_//_/ 6 | // /___/ 7 | // 8 | //=================== = ==================== 9 | // Created by 黎跃春 on 1314/05/20. 10 | // Copyright (c) 2015年 黎跃春. All rights reserved. 11 | //=================== = ==================== 12 | // 《iOS编程之美》技术讨论群:343640780 13 | // 电子邮件:liyuechun2009@163.com 14 | // 微信:Liyuechun2012 15 | // QQ:939442932[春哥] 1244357005[广威] 16 | // github:https://github.com/LiYueChun 17 | // 简书地址:http://www.jianshu.com/users/336468483205/latest_articles 18 | // 新浪微博:http://weibo.com/mobiledevelopment 19 | // 新浪博客:http://blog.sina.com.cn/technicalarticle 20 | //================================================================ 21 | 22 | #import 23 | #import "AppDelegate.h" 24 | 25 | int main(int argc, char * argv[]) { 26 | @autoreleasepool { 27 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 28 | } 29 | } 30 | --------------------------------------------------------------------------------