├── .clang-format.zip ├── .gitignore ├── LICENSE └── README.md /.clang-format.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisongrc/clang-format/1b3c6688a216fb811ff02612f54e5e42f89b6fbd/.clang-format.zip -------------------------------------------------------------------------------- /.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 | MIT License 2 | 3 | Copyright (c) 2016 lisong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # .clang-format 2 | .clang-format文件,Xcode自定义代码格式化样式文件。 3 | 4 | 文件内容如下,也可以自己修改。具体讲解可以看我在简书上写的[这篇文章](http://www.jianshu.com/p/a725e24d7835)。 5 | ``` 6 | # 基于LLVM样式 7 | BasedOnStyle: LLVM 8 | 9 | # 连续的赋值操作按=对齐,看自己喜好打开。 10 | #AlignConsecutiveAssignments: true 11 | 12 | # 把连续行的变量名对齐,看自己喜好打开。 13 | #AlignConsecutiveDeclarations: true 14 | 15 | # 对齐尾部注释 16 | AlignTrailingComments: true 17 | 18 | # 大括号前面是否换行 19 | BreakBeforeBraces: Allman 20 | 21 | # 每行字符的宽度不限制 22 | ColumnLimit: 0 23 | 24 | # 缩进宽度设置为4 25 | IndentWidth: 4 26 | 27 | # switch的case缩进宽度 28 | IndentCaseLabels: true 29 | 30 | # 不保留block里面开始的空行们 31 | KeepEmptyLinesAtTheStartOfBlocks: false 32 | 33 | # 最多只能有连续1行空行 34 | MaxEmptyLinesToKeep: 1 35 | 36 | # 在@property后加空格 37 | ObjCSpaceAfterProperty: true 38 | 39 | # 尾部//注释前面加1个空格 40 | SpacesBeforeTrailingComments: 1 41 | 42 | # 在<后边和>前边插入空格 43 | SpacesInAngles: true 44 | ``` 45 | --------------------------------------------------------------------------------