├── .gitignore ├── FFChineseSort Demo ├── FFChineseSort Demo.xcodeproj │ └── project.pbxproj ├── FFChineseSort Demo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── Person.h │ ├── Person.m │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── FFChineseSort DemoTests │ ├── FFChineseSort_DemoTests.m │ └── Info.plist ├── FFChineseSort.podspec ├── FFChineseSort.xcworkspace └── contents.xcworkspacedata ├── FFChineseSort ├── FFChineseSort.xcodeproj │ ├── FFChineseSort.xcworkspace │ │ └── contents.xcworkspacedata │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── FFChineseSort │ ├── FFChineseSort.h │ └── Info.plist ├── FFChineseSortTests │ ├── FFChineseSortTests.m │ └── Info.plist └── Source │ ├── NSArray+Chinese.h │ ├── NSArray+Chinese.m │ ├── NSString+Chinese.h │ └── NSString+Chinese.m ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C2F5AF911B84E1690011FC43 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C2F5AF901B84E1690011FC43 /* main.m */; }; 11 | C2F5AF941B84E1690011FC43 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C2F5AF931B84E1690011FC43 /* AppDelegate.m */; }; 12 | C2F5AF971B84E1690011FC43 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C2F5AF961B84E1690011FC43 /* ViewController.m */; }; 13 | C2F5AF9A1B84E1690011FC43 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C2F5AF981B84E1690011FC43 /* Main.storyboard */; }; 14 | C2F5AF9C1B84E1690011FC43 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C2F5AF9B1B84E1690011FC43 /* Assets.xcassets */; }; 15 | C2F5AF9F1B84E1690011FC43 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C2F5AF9D1B84E1690011FC43 /* LaunchScreen.storyboard */; }; 16 | C2F5AFAA1B84E1690011FC43 /* FFChineseSort_DemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C2F5AFA91B84E1690011FC43 /* FFChineseSort_DemoTests.m */; }; 17 | C2F5AFB61B84E17D0011FC43 /* Person.m in Sources */ = {isa = PBXBuildFile; fileRef = C2F5AFB51B84E17D0011FC43 /* Person.m */; }; 18 | C2F5AFD01B84E3460011FC43 /* FFChineseSort.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2F5AFCD1B84E29F0011FC43 /* FFChineseSort.framework */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | C2F5AFA61B84E1690011FC43 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = C2F5AF841B84E1690011FC43 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = C2F5AF8B1B84E1690011FC43; 27 | remoteInfo = "FFChineseSort Demo"; 28 | }; 29 | C2F5AFCC1B84E29F0011FC43 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = C2F5AFBF1B84E29F0011FC43 /* FFChineseSort.xcodeproj */; 32 | proxyType = 2; 33 | remoteGlobalIDString = C2F5AF241B84DCAA0011FC43; 34 | remoteInfo = FFChineseSort; 35 | }; 36 | C2F5AFCE1B84E29F0011FC43 /* PBXContainerItemProxy */ = { 37 | isa = PBXContainerItemProxy; 38 | containerPortal = C2F5AFBF1B84E29F0011FC43 /* FFChineseSort.xcodeproj */; 39 | proxyType = 2; 40 | remoteGlobalIDString = C2F5AF2E1B84DCAA0011FC43; 41 | remoteInfo = FFChineseSortTests; 42 | }; 43 | /* End PBXContainerItemProxy section */ 44 | 45 | /* Begin PBXCopyFilesBuildPhase section */ 46 | C2F5AFB91B84E2320011FC43 /* CopyFiles */ = { 47 | isa = PBXCopyFilesBuildPhase; 48 | buildActionMask = 2147483647; 49 | dstPath = ""; 50 | dstSubfolderSpec = 10; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXCopyFilesBuildPhase section */ 56 | 57 | /* Begin PBXFileReference section */ 58 | C2F5AF8C1B84E1690011FC43 /* FFChineseSort Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "FFChineseSort Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | C2F5AF901B84E1690011FC43 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 60 | C2F5AF921B84E1690011FC43 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 61 | C2F5AF931B84E1690011FC43 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 62 | C2F5AF951B84E1690011FC43 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 63 | C2F5AF961B84E1690011FC43 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 64 | C2F5AF991B84E1690011FC43 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 65 | C2F5AF9B1B84E1690011FC43 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 66 | C2F5AF9E1B84E1690011FC43 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 67 | C2F5AFA01B84E1690011FC43 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 68 | C2F5AFA51B84E1690011FC43 /* FFChineseSort DemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "FFChineseSort DemoTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 69 | C2F5AFA91B84E1690011FC43 /* FFChineseSort_DemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FFChineseSort_DemoTests.m; sourceTree = ""; }; 70 | C2F5AFAB1B84E1690011FC43 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 71 | C2F5AFB41B84E17D0011FC43 /* Person.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Person.h; sourceTree = ""; }; 72 | C2F5AFB51B84E17D0011FC43 /* Person.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Person.m; sourceTree = ""; }; 73 | C2F5AFBD1B84E29F0011FC43 /* FFChineseSort.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FFChineseSort.h; sourceTree = ""; }; 74 | C2F5AFBE1B84E29F0011FC43 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 75 | C2F5AFBF1B84E29F0011FC43 /* FFChineseSort.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = FFChineseSort.xcodeproj; sourceTree = ""; }; 76 | C2F5AFC31B84E29F0011FC43 /* FFChineseSortTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FFChineseSortTests.m; sourceTree = ""; }; 77 | C2F5AFC41B84E29F0011FC43 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 78 | C2F5AFC61B84E29F0011FC43 /* NSArray+Chinese.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSArray+Chinese.h"; sourceTree = ""; }; 79 | C2F5AFC71B84E29F0011FC43 /* NSArray+Chinese.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Chinese.m"; sourceTree = ""; }; 80 | C2F5AFC81B84E29F0011FC43 /* NSString+Chinese.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+Chinese.h"; sourceTree = ""; }; 81 | C2F5AFC91B84E29F0011FC43 /* NSString+Chinese.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+Chinese.m"; sourceTree = ""; }; 82 | /* End PBXFileReference section */ 83 | 84 | /* Begin PBXFrameworksBuildPhase section */ 85 | C2F5AF891B84E1690011FC43 /* Frameworks */ = { 86 | isa = PBXFrameworksBuildPhase; 87 | buildActionMask = 2147483647; 88 | files = ( 89 | C2F5AFD01B84E3460011FC43 /* FFChineseSort.framework in Frameworks */, 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | C2F5AFA21B84E1690011FC43 /* Frameworks */ = { 94 | isa = PBXFrameworksBuildPhase; 95 | buildActionMask = 2147483647; 96 | files = ( 97 | ); 98 | runOnlyForDeploymentPostprocessing = 0; 99 | }; 100 | /* End PBXFrameworksBuildPhase section */ 101 | 102 | /* Begin PBXGroup section */ 103 | C2F5AF831B84E1690011FC43 = { 104 | isa = PBXGroup; 105 | children = ( 106 | C2F5AFBB1B84E29F0011FC43 /* FFChineseSort */, 107 | C2F5AF8E1B84E1690011FC43 /* FFChineseSort Demo */, 108 | C2F5AFA81B84E1690011FC43 /* FFChineseSort DemoTests */, 109 | C2F5AF8D1B84E1690011FC43 /* Products */, 110 | ); 111 | sourceTree = ""; 112 | }; 113 | C2F5AF8D1B84E1690011FC43 /* Products */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | C2F5AF8C1B84E1690011FC43 /* FFChineseSort Demo.app */, 117 | C2F5AFA51B84E1690011FC43 /* FFChineseSort DemoTests.xctest */, 118 | ); 119 | name = Products; 120 | sourceTree = ""; 121 | }; 122 | C2F5AF8E1B84E1690011FC43 /* FFChineseSort Demo */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | C2F5AF921B84E1690011FC43 /* AppDelegate.h */, 126 | C2F5AF931B84E1690011FC43 /* AppDelegate.m */, 127 | C2F5AF951B84E1690011FC43 /* ViewController.h */, 128 | C2F5AF961B84E1690011FC43 /* ViewController.m */, 129 | C2F5AFB41B84E17D0011FC43 /* Person.h */, 130 | C2F5AFB51B84E17D0011FC43 /* Person.m */, 131 | C2F5AF981B84E1690011FC43 /* Main.storyboard */, 132 | C2F5AF9B1B84E1690011FC43 /* Assets.xcassets */, 133 | C2F5AF9D1B84E1690011FC43 /* LaunchScreen.storyboard */, 134 | C2F5AFA01B84E1690011FC43 /* Info.plist */, 135 | C2F5AF8F1B84E1690011FC43 /* Supporting Files */, 136 | ); 137 | path = "FFChineseSort Demo"; 138 | sourceTree = ""; 139 | }; 140 | C2F5AF8F1B84E1690011FC43 /* Supporting Files */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | C2F5AF901B84E1690011FC43 /* main.m */, 144 | ); 145 | name = "Supporting Files"; 146 | sourceTree = ""; 147 | }; 148 | C2F5AFA81B84E1690011FC43 /* FFChineseSort DemoTests */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | C2F5AFA91B84E1690011FC43 /* FFChineseSort_DemoTests.m */, 152 | C2F5AFAB1B84E1690011FC43 /* Info.plist */, 153 | ); 154 | path = "FFChineseSort DemoTests"; 155 | sourceTree = ""; 156 | }; 157 | C2F5AFBB1B84E29F0011FC43 /* FFChineseSort */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | C2F5AFBC1B84E29F0011FC43 /* FFChineseSort */, 161 | C2F5AFBF1B84E29F0011FC43 /* FFChineseSort.xcodeproj */, 162 | C2F5AFC21B84E29F0011FC43 /* FFChineseSortTests */, 163 | C2F5AFC51B84E29F0011FC43 /* Source */, 164 | ); 165 | name = FFChineseSort; 166 | path = ../FFChineseSort; 167 | sourceTree = ""; 168 | }; 169 | C2F5AFBC1B84E29F0011FC43 /* FFChineseSort */ = { 170 | isa = PBXGroup; 171 | children = ( 172 | C2F5AFBD1B84E29F0011FC43 /* FFChineseSort.h */, 173 | C2F5AFBE1B84E29F0011FC43 /* Info.plist */, 174 | ); 175 | path = FFChineseSort; 176 | sourceTree = ""; 177 | }; 178 | C2F5AFC01B84E29F0011FC43 /* Products */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | C2F5AFCD1B84E29F0011FC43 /* FFChineseSort.framework */, 182 | C2F5AFCF1B84E29F0011FC43 /* FFChineseSortTests.xctest */, 183 | ); 184 | name = Products; 185 | sourceTree = ""; 186 | }; 187 | C2F5AFC21B84E29F0011FC43 /* FFChineseSortTests */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | C2F5AFC31B84E29F0011FC43 /* FFChineseSortTests.m */, 191 | C2F5AFC41B84E29F0011FC43 /* Info.plist */, 192 | ); 193 | path = FFChineseSortTests; 194 | sourceTree = ""; 195 | }; 196 | C2F5AFC51B84E29F0011FC43 /* Source */ = { 197 | isa = PBXGroup; 198 | children = ( 199 | C2F5AFC61B84E29F0011FC43 /* NSArray+Chinese.h */, 200 | C2F5AFC71B84E29F0011FC43 /* NSArray+Chinese.m */, 201 | C2F5AFC81B84E29F0011FC43 /* NSString+Chinese.h */, 202 | C2F5AFC91B84E29F0011FC43 /* NSString+Chinese.m */, 203 | ); 204 | path = Source; 205 | sourceTree = ""; 206 | }; 207 | /* End PBXGroup section */ 208 | 209 | /* Begin PBXNativeTarget section */ 210 | C2F5AF8B1B84E1690011FC43 /* FFChineseSort Demo */ = { 211 | isa = PBXNativeTarget; 212 | buildConfigurationList = C2F5AFAE1B84E1690011FC43 /* Build configuration list for PBXNativeTarget "FFChineseSort Demo" */; 213 | buildPhases = ( 214 | C2F5AF881B84E1690011FC43 /* Sources */, 215 | C2F5AF891B84E1690011FC43 /* Frameworks */, 216 | C2F5AF8A1B84E1690011FC43 /* Resources */, 217 | C2F5AFB91B84E2320011FC43 /* CopyFiles */, 218 | ); 219 | buildRules = ( 220 | ); 221 | dependencies = ( 222 | ); 223 | name = "FFChineseSort Demo"; 224 | productName = "FFChineseSort Demo"; 225 | productReference = C2F5AF8C1B84E1690011FC43 /* FFChineseSort Demo.app */; 226 | productType = "com.apple.product-type.application"; 227 | }; 228 | C2F5AFA41B84E1690011FC43 /* FFChineseSort DemoTests */ = { 229 | isa = PBXNativeTarget; 230 | buildConfigurationList = C2F5AFB11B84E1690011FC43 /* Build configuration list for PBXNativeTarget "FFChineseSort DemoTests" */; 231 | buildPhases = ( 232 | C2F5AFA11B84E1690011FC43 /* Sources */, 233 | C2F5AFA21B84E1690011FC43 /* Frameworks */, 234 | C2F5AFA31B84E1690011FC43 /* Resources */, 235 | ); 236 | buildRules = ( 237 | ); 238 | dependencies = ( 239 | C2F5AFA71B84E1690011FC43 /* PBXTargetDependency */, 240 | ); 241 | name = "FFChineseSort DemoTests"; 242 | productName = "FFChineseSort DemoTests"; 243 | productReference = C2F5AFA51B84E1690011FC43 /* FFChineseSort DemoTests.xctest */; 244 | productType = "com.apple.product-type.bundle.unit-test"; 245 | }; 246 | /* End PBXNativeTarget section */ 247 | 248 | /* Begin PBXProject section */ 249 | C2F5AF841B84E1690011FC43 /* Project object */ = { 250 | isa = PBXProject; 251 | attributes = { 252 | LastUpgradeCheck = 0700; 253 | ORGANIZATIONNAME = joyios; 254 | TargetAttributes = { 255 | C2F5AF8B1B84E1690011FC43 = { 256 | CreatedOnToolsVersion = 7.0; 257 | }; 258 | C2F5AFA41B84E1690011FC43 = { 259 | CreatedOnToolsVersion = 7.0; 260 | TestTargetID = C2F5AF8B1B84E1690011FC43; 261 | }; 262 | }; 263 | }; 264 | buildConfigurationList = C2F5AF871B84E1690011FC43 /* Build configuration list for PBXProject "FFChineseSort Demo" */; 265 | compatibilityVersion = "Xcode 3.2"; 266 | developmentRegion = English; 267 | hasScannedForEncodings = 0; 268 | knownRegions = ( 269 | en, 270 | Base, 271 | ); 272 | mainGroup = C2F5AF831B84E1690011FC43; 273 | productRefGroup = C2F5AF8D1B84E1690011FC43 /* Products */; 274 | projectDirPath = ""; 275 | projectReferences = ( 276 | { 277 | ProductGroup = C2F5AFC01B84E29F0011FC43 /* Products */; 278 | ProjectRef = C2F5AFBF1B84E29F0011FC43 /* FFChineseSort.xcodeproj */; 279 | }, 280 | ); 281 | projectRoot = ""; 282 | targets = ( 283 | C2F5AF8B1B84E1690011FC43 /* FFChineseSort Demo */, 284 | C2F5AFA41B84E1690011FC43 /* FFChineseSort DemoTests */, 285 | ); 286 | }; 287 | /* End PBXProject section */ 288 | 289 | /* Begin PBXReferenceProxy section */ 290 | C2F5AFCD1B84E29F0011FC43 /* FFChineseSort.framework */ = { 291 | isa = PBXReferenceProxy; 292 | fileType = wrapper.framework; 293 | path = FFChineseSort.framework; 294 | remoteRef = C2F5AFCC1B84E29F0011FC43 /* PBXContainerItemProxy */; 295 | sourceTree = BUILT_PRODUCTS_DIR; 296 | }; 297 | C2F5AFCF1B84E29F0011FC43 /* FFChineseSortTests.xctest */ = { 298 | isa = PBXReferenceProxy; 299 | fileType = wrapper.cfbundle; 300 | path = FFChineseSortTests.xctest; 301 | remoteRef = C2F5AFCE1B84E29F0011FC43 /* PBXContainerItemProxy */; 302 | sourceTree = BUILT_PRODUCTS_DIR; 303 | }; 304 | /* End PBXReferenceProxy section */ 305 | 306 | /* Begin PBXResourcesBuildPhase section */ 307 | C2F5AF8A1B84E1690011FC43 /* Resources */ = { 308 | isa = PBXResourcesBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | C2F5AF9F1B84E1690011FC43 /* LaunchScreen.storyboard in Resources */, 312 | C2F5AF9C1B84E1690011FC43 /* Assets.xcassets in Resources */, 313 | C2F5AF9A1B84E1690011FC43 /* Main.storyboard in Resources */, 314 | ); 315 | runOnlyForDeploymentPostprocessing = 0; 316 | }; 317 | C2F5AFA31B84E1690011FC43 /* Resources */ = { 318 | isa = PBXResourcesBuildPhase; 319 | buildActionMask = 2147483647; 320 | files = ( 321 | ); 322 | runOnlyForDeploymentPostprocessing = 0; 323 | }; 324 | /* End PBXResourcesBuildPhase section */ 325 | 326 | /* Begin PBXSourcesBuildPhase section */ 327 | C2F5AF881B84E1690011FC43 /* Sources */ = { 328 | isa = PBXSourcesBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | C2F5AF971B84E1690011FC43 /* ViewController.m in Sources */, 332 | C2F5AF941B84E1690011FC43 /* AppDelegate.m in Sources */, 333 | C2F5AFB61B84E17D0011FC43 /* Person.m in Sources */, 334 | C2F5AF911B84E1690011FC43 /* main.m in Sources */, 335 | ); 336 | runOnlyForDeploymentPostprocessing = 0; 337 | }; 338 | C2F5AFA11B84E1690011FC43 /* Sources */ = { 339 | isa = PBXSourcesBuildPhase; 340 | buildActionMask = 2147483647; 341 | files = ( 342 | C2F5AFAA1B84E1690011FC43 /* FFChineseSort_DemoTests.m in Sources */, 343 | ); 344 | runOnlyForDeploymentPostprocessing = 0; 345 | }; 346 | /* End PBXSourcesBuildPhase section */ 347 | 348 | /* Begin PBXTargetDependency section */ 349 | C2F5AFA71B84E1690011FC43 /* PBXTargetDependency */ = { 350 | isa = PBXTargetDependency; 351 | target = C2F5AF8B1B84E1690011FC43 /* FFChineseSort Demo */; 352 | targetProxy = C2F5AFA61B84E1690011FC43 /* PBXContainerItemProxy */; 353 | }; 354 | /* End PBXTargetDependency section */ 355 | 356 | /* Begin PBXVariantGroup section */ 357 | C2F5AF981B84E1690011FC43 /* Main.storyboard */ = { 358 | isa = PBXVariantGroup; 359 | children = ( 360 | C2F5AF991B84E1690011FC43 /* Base */, 361 | ); 362 | name = Main.storyboard; 363 | sourceTree = ""; 364 | }; 365 | C2F5AF9D1B84E1690011FC43 /* LaunchScreen.storyboard */ = { 366 | isa = PBXVariantGroup; 367 | children = ( 368 | C2F5AF9E1B84E1690011FC43 /* Base */, 369 | ); 370 | name = LaunchScreen.storyboard; 371 | sourceTree = ""; 372 | }; 373 | /* End PBXVariantGroup section */ 374 | 375 | /* Begin XCBuildConfiguration section */ 376 | C2F5AFAC1B84E1690011FC43 /* Debug */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | ALWAYS_SEARCH_USER_PATHS = NO; 380 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 381 | CLANG_CXX_LIBRARY = "libc++"; 382 | CLANG_ENABLE_MODULES = YES; 383 | CLANG_ENABLE_OBJC_ARC = YES; 384 | CLANG_WARN_BOOL_CONVERSION = YES; 385 | CLANG_WARN_CONSTANT_CONVERSION = YES; 386 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 387 | CLANG_WARN_EMPTY_BODY = YES; 388 | CLANG_WARN_ENUM_CONVERSION = YES; 389 | CLANG_WARN_INT_CONVERSION = YES; 390 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = dwarf; 396 | ENABLE_STRICT_OBJC_MSGSEND = YES; 397 | ENABLE_TESTABILITY = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_DYNAMIC_NO_PIC = NO; 400 | GCC_NO_COMMON_BLOCKS = YES; 401 | GCC_OPTIMIZATION_LEVEL = 0; 402 | GCC_PREPROCESSOR_DEFINITIONS = ( 403 | "DEBUG=1", 404 | "$(inherited)", 405 | ); 406 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 407 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 408 | GCC_WARN_UNDECLARED_SELECTOR = YES; 409 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 410 | GCC_WARN_UNUSED_FUNCTION = YES; 411 | GCC_WARN_UNUSED_VARIABLE = YES; 412 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 413 | MTL_ENABLE_DEBUG_INFO = YES; 414 | ONLY_ACTIVE_ARCH = YES; 415 | SDKROOT = iphoneos; 416 | }; 417 | name = Debug; 418 | }; 419 | C2F5AFAD1B84E1690011FC43 /* Release */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | ALWAYS_SEARCH_USER_PATHS = NO; 423 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 424 | CLANG_CXX_LIBRARY = "libc++"; 425 | CLANG_ENABLE_MODULES = YES; 426 | CLANG_ENABLE_OBJC_ARC = YES; 427 | CLANG_WARN_BOOL_CONVERSION = YES; 428 | CLANG_WARN_CONSTANT_CONVERSION = YES; 429 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 430 | CLANG_WARN_EMPTY_BODY = YES; 431 | CLANG_WARN_ENUM_CONVERSION = YES; 432 | CLANG_WARN_INT_CONVERSION = YES; 433 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 434 | CLANG_WARN_UNREACHABLE_CODE = YES; 435 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 436 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 437 | COPY_PHASE_STRIP = NO; 438 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 439 | ENABLE_NS_ASSERTIONS = NO; 440 | ENABLE_STRICT_OBJC_MSGSEND = YES; 441 | GCC_C_LANGUAGE_STANDARD = gnu99; 442 | GCC_NO_COMMON_BLOCKS = YES; 443 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 444 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 445 | GCC_WARN_UNDECLARED_SELECTOR = YES; 446 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 447 | GCC_WARN_UNUSED_FUNCTION = YES; 448 | GCC_WARN_UNUSED_VARIABLE = YES; 449 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 450 | MTL_ENABLE_DEBUG_INFO = NO; 451 | SDKROOT = iphoneos; 452 | VALIDATE_PRODUCT = YES; 453 | }; 454 | name = Release; 455 | }; 456 | C2F5AFAF1B84E1690011FC43 /* Debug */ = { 457 | isa = XCBuildConfiguration; 458 | buildSettings = { 459 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 460 | INFOPLIST_FILE = "FFChineseSort Demo/Info.plist"; 461 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 462 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 463 | OTHER_LDFLAGS = ""; 464 | PRODUCT_BUNDLE_IDENTIFIER = "com.joyios.FFChineseSort-Demo"; 465 | PRODUCT_NAME = "$(TARGET_NAME)"; 466 | }; 467 | name = Debug; 468 | }; 469 | C2F5AFB01B84E1690011FC43 /* Release */ = { 470 | isa = XCBuildConfiguration; 471 | buildSettings = { 472 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 473 | INFOPLIST_FILE = "FFChineseSort Demo/Info.plist"; 474 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 475 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 476 | OTHER_LDFLAGS = ""; 477 | PRODUCT_BUNDLE_IDENTIFIER = "com.joyios.FFChineseSort-Demo"; 478 | PRODUCT_NAME = "$(TARGET_NAME)"; 479 | }; 480 | name = Release; 481 | }; 482 | C2F5AFB21B84E1690011FC43 /* Debug */ = { 483 | isa = XCBuildConfiguration; 484 | buildSettings = { 485 | BUNDLE_LOADER = "$(TEST_HOST)"; 486 | INFOPLIST_FILE = "FFChineseSort DemoTests/Info.plist"; 487 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 488 | PRODUCT_BUNDLE_IDENTIFIER = "com.joyios.FFChineseSort-DemoTests"; 489 | PRODUCT_NAME = "$(TARGET_NAME)"; 490 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FFChineseSort Demo.app/FFChineseSort Demo"; 491 | }; 492 | name = Debug; 493 | }; 494 | C2F5AFB31B84E1690011FC43 /* Release */ = { 495 | isa = XCBuildConfiguration; 496 | buildSettings = { 497 | BUNDLE_LOADER = "$(TEST_HOST)"; 498 | INFOPLIST_FILE = "FFChineseSort DemoTests/Info.plist"; 499 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 500 | PRODUCT_BUNDLE_IDENTIFIER = "com.joyios.FFChineseSort-DemoTests"; 501 | PRODUCT_NAME = "$(TARGET_NAME)"; 502 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FFChineseSort Demo.app/FFChineseSort Demo"; 503 | }; 504 | name = Release; 505 | }; 506 | /* End XCBuildConfiguration section */ 507 | 508 | /* Begin XCConfigurationList section */ 509 | C2F5AF871B84E1690011FC43 /* Build configuration list for PBXProject "FFChineseSort Demo" */ = { 510 | isa = XCConfigurationList; 511 | buildConfigurations = ( 512 | C2F5AFAC1B84E1690011FC43 /* Debug */, 513 | C2F5AFAD1B84E1690011FC43 /* Release */, 514 | ); 515 | defaultConfigurationIsVisible = 0; 516 | defaultConfigurationName = Release; 517 | }; 518 | C2F5AFAE1B84E1690011FC43 /* Build configuration list for PBXNativeTarget "FFChineseSort Demo" */ = { 519 | isa = XCConfigurationList; 520 | buildConfigurations = ( 521 | C2F5AFAF1B84E1690011FC43 /* Debug */, 522 | C2F5AFB01B84E1690011FC43 /* Release */, 523 | ); 524 | defaultConfigurationIsVisible = 0; 525 | defaultConfigurationName = Release; 526 | }; 527 | C2F5AFB11B84E1690011FC43 /* Build configuration list for PBXNativeTarget "FFChineseSort DemoTests" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | C2F5AFB21B84E1690011FC43 /* Debug */, 531 | C2F5AFB31B84E1690011FC43 /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | /* End XCConfigurationList section */ 537 | }; 538 | rootObject = C2F5AF841B84E1690011FC43 /* Project object */; 539 | } 540 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort Demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // FFChineseSort Demo 4 | // 5 | // Created by 刘凡 on 15/8/20. 6 | // Copyright © 2015年 joyios. 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 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort Demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // FFChineseSort Demo 4 | // 5 | // Created by 刘凡 on 15/8/20. 6 | // Copyright © 2015年 joyios. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort Demo/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 | } -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort Demo/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 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort Demo/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 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort Demo/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 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort Demo/Person.h: -------------------------------------------------------------------------------- 1 | // 2 | // Person.h 3 | // ChineseSort 4 | // 5 | // Created by 刘凡 on 15/8/19. 6 | // Copyright © 2015年 joyios. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Person : NSObject 12 | @property (nonatomic, copy) NSString *name; 13 | @property (nonatomic, copy) NSString *title; 14 | @property (nonatomic, assign) NSInteger age; 15 | @property (nonatomic, assign) double height; 16 | 17 | + (instancetype)personWithDict:(NSDictionary *)dict; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort Demo/Person.m: -------------------------------------------------------------------------------- 1 | // 2 | // Person.m 3 | // ChineseSort 4 | // 5 | // Created by 刘凡 on 15/8/19. 6 | // Copyright © 2015年 joyios. All rights reserved. 7 | // 8 | 9 | #import "Person.h" 10 | 11 | @implementation Person 12 | 13 | + (instancetype)personWithDict:(NSDictionary *)dict { 14 | id obj = [[self alloc] init]; 15 | 16 | [obj setValuesForKeysWithDictionary:dict]; 17 | 18 | return obj; 19 | } 20 | 21 | - (NSString *)description { 22 | return [NSString stringWithFormat:@"%@ - %@ - %zd -%.02f", _name, _title, _age, _height]; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort Demo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // FFChineseSort Demo 4 | // 5 | // Created by 刘凡 on 15/8/20. 6 | // Copyright © 2015年 joyios. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort Demo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // FFChineseSort Demo 4 | // 5 | // Created by 刘凡 on 15/8/20. 6 | // Copyright © 2015年 joyios. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "Person.h" 11 | #import "NSArray+Chinese.h" 12 | #import "NSString+Chinese.h" 13 | 14 | @interface ViewController () 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | 23 | NSMutableArray *persons = [NSMutableArray array]; 24 | 25 | Person *p = [Person personWithDict:@{@"name": @"张三", @"title": @"经理", @"age": @20, @"height": @1.7}]; 26 | [persons addObject:p]; 27 | p = [Person personWithDict:@{@"name": @"李四", @"title": @"老板", @"age": @18, @"height": @1.6}]; 28 | [persons addObject:p]; 29 | 30 | // 按照 name 排序 31 | NSLog(@"--- 按照 name 排序 ---"); 32 | NSArray *result = [persons sortedWithChineseKey:@"name"]; 33 | [result enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 34 | NSLog(@"%@", obj); 35 | }]; 36 | 37 | // 按照 title 排序 38 | NSLog(@"--- 按照 title 排序 ---"); 39 | result = [persons sortedWithChineseKey:@"title"]; 40 | [result enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 41 | NSLog(@"%@", obj); 42 | }]; 43 | 44 | // 排序字典数组 45 | NSMutableArray *arrayM = [NSMutableArray array]; 46 | NSDictionary *dict1 = @{@"name": @"张三", @"title": @"经理", @"age": @20, @"height": @1.7}; 47 | [arrayM addObject:dict1]; 48 | NSDictionary *dict2 = @{@"name": @"李四", @"title": @"老板", @"age": @18, @"height": @1.6}; 49 | [arrayM addObject:dict2]; 50 | 51 | NSLog(@"--- 排序字典数组 ---"); 52 | result = [arrayM sortedWithChineseKey:@"name"]; 53 | [result enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 54 | NSLog(@"%@ - %@ - %@ - %@", obj[@"name"], obj[@"title"], obj[@"age"], obj[@"height"]); 55 | }]; 56 | 57 | // 排序字符串数组 58 | NSArray *strings = @[@"198914", @"JLD", @"吊儿郎当", @"李四", @"王五", @"赵六", @"安娜"]; 59 | NSLog(@"--- 排序字符串数组 ---"); 60 | result = [strings sortedWithChineseKey:nil]; 61 | [result enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 62 | NSLog(@"%@", obj); 63 | }]; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // FFChineseSort Demo 4 | // 5 | // Created by 刘凡 on 15/8/20. 6 | // Copyright © 2015年 joyios. 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 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort DemoTests/FFChineseSort_DemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // FFChineseSort_DemoTests.m 3 | // FFChineseSort DemoTests 4 | // 5 | // Created by 刘凡 on 15/8/20. 6 | // Copyright © 2015年 joyios. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FFChineseSort_DemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation FFChineseSort_DemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /FFChineseSort Demo/FFChineseSort DemoTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /FFChineseSort.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "FFChineseSort" 3 | s.version = "0.0.2" 4 | s.summary = "中文数组排序" 5 | s.homepage = "https://github.com/liufan321/FFChineseSort" 6 | s.license = "MIT" 7 | s.author = { "Fan Liu" => "liufan321@gmail.com" } 8 | s.platform = :ios, "8.0" 9 | s.source = { :git => "https://github.com/liufan321/FFChineseSort.git", :tag => s.version } 10 | s.source_files = "FFChineseSort", "FFChineseSort/Source/*.{h,m}" 11 | s.requires_arc = true 12 | end 13 | -------------------------------------------------------------------------------- /FFChineseSort.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /FFChineseSort/FFChineseSort.xcodeproj/FFChineseSort.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /FFChineseSort/FFChineseSort.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C2F5AF281B84DCAA0011FC43 /* FFChineseSort.h in Headers */ = {isa = PBXBuildFile; fileRef = C2F5AF271B84DCAA0011FC43 /* FFChineseSort.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | C2F5AF2F1B84DCAA0011FC43 /* FFChineseSort.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C2F5AF241B84DCAA0011FC43 /* FFChineseSort.framework */; }; 12 | C2F5AF341B84DCAA0011FC43 /* FFChineseSortTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C2F5AF331B84DCAA0011FC43 /* FFChineseSortTests.m */; }; 13 | C2F5AF411B84DCCF0011FC43 /* NSString+Chinese.h in Headers */ = {isa = PBXBuildFile; fileRef = C2F5AF3F1B84DCCF0011FC43 /* NSString+Chinese.h */; }; 14 | C2F5AF421B84DCCF0011FC43 /* NSString+Chinese.m in Sources */ = {isa = PBXBuildFile; fileRef = C2F5AF401B84DCCF0011FC43 /* NSString+Chinese.m */; }; 15 | C2F5AF431B84DD680011FC43 /* NSString+Chinese.m in Sources */ = {isa = PBXBuildFile; fileRef = C2F5AF401B84DCCF0011FC43 /* NSString+Chinese.m */; }; 16 | C2F5AF461B84DE840011FC43 /* NSArray+Chinese.h in Headers */ = {isa = PBXBuildFile; fileRef = C2F5AF441B84DE840011FC43 /* NSArray+Chinese.h */; }; 17 | C2F5AF471B84DE840011FC43 /* NSArray+Chinese.m in Sources */ = {isa = PBXBuildFile; fileRef = C2F5AF451B84DE840011FC43 /* NSArray+Chinese.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | C2F5AF301B84DCAA0011FC43 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = C2F5AF1B1B84DCAA0011FC43 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = C2F5AF231B84DCAA0011FC43; 26 | remoteInfo = FFChineseSort; 27 | }; 28 | C2F5AF7E1B84E05F0011FC43 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = C2F5AF791B84E05E0011FC43 /* FFChineseSort Demo.xcodeproj */; 31 | proxyType = 2; 32 | remoteGlobalIDString = C2F5AF511B84E05E0011FC43; 33 | remoteInfo = "FFChineseSort Demo"; 34 | }; 35 | C2F5AF801B84E05F0011FC43 /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = C2F5AF791B84E05E0011FC43 /* FFChineseSort Demo.xcodeproj */; 38 | proxyType = 2; 39 | remoteGlobalIDString = C2F5AF6A1B84E05E0011FC43; 40 | remoteInfo = "FFChineseSort DemoTests"; 41 | }; 42 | /* End PBXContainerItemProxy section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | C2F5AF241B84DCAA0011FC43 /* FFChineseSort.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FFChineseSort.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | C2F5AF271B84DCAA0011FC43 /* FFChineseSort.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FFChineseSort.h; sourceTree = ""; }; 47 | C2F5AF291B84DCAA0011FC43 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | C2F5AF2E1B84DCAA0011FC43 /* FFChineseSortTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FFChineseSortTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | C2F5AF331B84DCAA0011FC43 /* FFChineseSortTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FFChineseSortTests.m; sourceTree = ""; }; 50 | C2F5AF351B84DCAA0011FC43 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | C2F5AF3F1B84DCCF0011FC43 /* NSString+Chinese.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+Chinese.h"; sourceTree = ""; }; 52 | C2F5AF401B84DCCF0011FC43 /* NSString+Chinese.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+Chinese.m"; sourceTree = ""; }; 53 | C2F5AF441B84DE840011FC43 /* NSArray+Chinese.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Chinese.h"; sourceTree = ""; }; 54 | C2F5AF451B84DE840011FC43 /* NSArray+Chinese.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Chinese.m"; sourceTree = ""; }; 55 | C2F5AF791B84E05E0011FC43 /* FFChineseSort Demo.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "FFChineseSort Demo.xcodeproj"; path = "../FFChineseSort Demo/FFChineseSort Demo.xcodeproj"; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | C2F5AF201B84DCAA0011FC43 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | C2F5AF2B1B84DCAA0011FC43 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | C2F5AF2F1B84DCAA0011FC43 /* FFChineseSort.framework in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | C2F5AF1A1B84DCAA0011FC43 = { 78 | isa = PBXGroup; 79 | children = ( 80 | C2F5AF261B84DCAA0011FC43 /* FFChineseSort */, 81 | C2F5AF321B84DCAA0011FC43 /* FFChineseSortTests */, 82 | C2F5AF251B84DCAA0011FC43 /* Products */, 83 | C2F5AF791B84E05E0011FC43 /* FFChineseSort Demo.xcodeproj */, 84 | ); 85 | sourceTree = ""; 86 | }; 87 | C2F5AF251B84DCAA0011FC43 /* Products */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | C2F5AF241B84DCAA0011FC43 /* FFChineseSort.framework */, 91 | C2F5AF2E1B84DCAA0011FC43 /* FFChineseSortTests.xctest */, 92 | ); 93 | name = Products; 94 | sourceTree = ""; 95 | }; 96 | C2F5AF261B84DCAA0011FC43 /* FFChineseSort */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | C2F5AF3E1B84DCBE0011FC43 /* Source */, 100 | C2F5AF271B84DCAA0011FC43 /* FFChineseSort.h */, 101 | C2F5AF291B84DCAA0011FC43 /* Info.plist */, 102 | ); 103 | path = FFChineseSort; 104 | sourceTree = ""; 105 | }; 106 | C2F5AF321B84DCAA0011FC43 /* FFChineseSortTests */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | C2F5AF331B84DCAA0011FC43 /* FFChineseSortTests.m */, 110 | C2F5AF351B84DCAA0011FC43 /* Info.plist */, 111 | ); 112 | path = FFChineseSortTests; 113 | sourceTree = ""; 114 | }; 115 | C2F5AF3E1B84DCBE0011FC43 /* Source */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | C2F5AF3F1B84DCCF0011FC43 /* NSString+Chinese.h */, 119 | C2F5AF401B84DCCF0011FC43 /* NSString+Chinese.m */, 120 | C2F5AF441B84DE840011FC43 /* NSArray+Chinese.h */, 121 | C2F5AF451B84DE840011FC43 /* NSArray+Chinese.m */, 122 | ); 123 | path = Source; 124 | sourceTree = SOURCE_ROOT; 125 | }; 126 | C2F5AF7A1B84E05E0011FC43 /* Products */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | C2F5AF7F1B84E05F0011FC43 /* FFChineseSort Demo.app */, 130 | C2F5AF811B84E05F0011FC43 /* FFChineseSort DemoTests.xctest */, 131 | ); 132 | name = Products; 133 | sourceTree = ""; 134 | }; 135 | /* End PBXGroup section */ 136 | 137 | /* Begin PBXHeadersBuildPhase section */ 138 | C2F5AF211B84DCAA0011FC43 /* Headers */ = { 139 | isa = PBXHeadersBuildPhase; 140 | buildActionMask = 2147483647; 141 | files = ( 142 | C2F5AF411B84DCCF0011FC43 /* NSString+Chinese.h in Headers */, 143 | C2F5AF461B84DE840011FC43 /* NSArray+Chinese.h in Headers */, 144 | C2F5AF281B84DCAA0011FC43 /* FFChineseSort.h in Headers */, 145 | ); 146 | runOnlyForDeploymentPostprocessing = 0; 147 | }; 148 | /* End PBXHeadersBuildPhase section */ 149 | 150 | /* Begin PBXNativeTarget section */ 151 | C2F5AF231B84DCAA0011FC43 /* FFChineseSort */ = { 152 | isa = PBXNativeTarget; 153 | buildConfigurationList = C2F5AF381B84DCAA0011FC43 /* Build configuration list for PBXNativeTarget "FFChineseSort" */; 154 | buildPhases = ( 155 | C2F5AF1F1B84DCAA0011FC43 /* Sources */, 156 | C2F5AF201B84DCAA0011FC43 /* Frameworks */, 157 | C2F5AF211B84DCAA0011FC43 /* Headers */, 158 | C2F5AF221B84DCAA0011FC43 /* Resources */, 159 | ); 160 | buildRules = ( 161 | ); 162 | dependencies = ( 163 | ); 164 | name = FFChineseSort; 165 | productName = FFChineseSort; 166 | productReference = C2F5AF241B84DCAA0011FC43 /* FFChineseSort.framework */; 167 | productType = "com.apple.product-type.framework"; 168 | }; 169 | C2F5AF2D1B84DCAA0011FC43 /* FFChineseSortTests */ = { 170 | isa = PBXNativeTarget; 171 | buildConfigurationList = C2F5AF3B1B84DCAA0011FC43 /* Build configuration list for PBXNativeTarget "FFChineseSortTests" */; 172 | buildPhases = ( 173 | C2F5AF2A1B84DCAA0011FC43 /* Sources */, 174 | C2F5AF2B1B84DCAA0011FC43 /* Frameworks */, 175 | C2F5AF2C1B84DCAA0011FC43 /* Resources */, 176 | ); 177 | buildRules = ( 178 | ); 179 | dependencies = ( 180 | C2F5AF311B84DCAA0011FC43 /* PBXTargetDependency */, 181 | ); 182 | name = FFChineseSortTests; 183 | productName = FFChineseSortTests; 184 | productReference = C2F5AF2E1B84DCAA0011FC43 /* FFChineseSortTests.xctest */; 185 | productType = "com.apple.product-type.bundle.unit-test"; 186 | }; 187 | /* End PBXNativeTarget section */ 188 | 189 | /* Begin PBXProject section */ 190 | C2F5AF1B1B84DCAA0011FC43 /* Project object */ = { 191 | isa = PBXProject; 192 | attributes = { 193 | LastUpgradeCheck = 0700; 194 | ORGANIZATIONNAME = joyios; 195 | TargetAttributes = { 196 | C2F5AF231B84DCAA0011FC43 = { 197 | CreatedOnToolsVersion = 7.0; 198 | }; 199 | C2F5AF2D1B84DCAA0011FC43 = { 200 | CreatedOnToolsVersion = 7.0; 201 | }; 202 | }; 203 | }; 204 | buildConfigurationList = C2F5AF1E1B84DCAA0011FC43 /* Build configuration list for PBXProject "FFChineseSort" */; 205 | compatibilityVersion = "Xcode 3.2"; 206 | developmentRegion = English; 207 | hasScannedForEncodings = 0; 208 | knownRegions = ( 209 | en, 210 | ); 211 | mainGroup = C2F5AF1A1B84DCAA0011FC43; 212 | productRefGroup = C2F5AF251B84DCAA0011FC43 /* Products */; 213 | projectDirPath = ""; 214 | projectReferences = ( 215 | { 216 | ProductGroup = C2F5AF7A1B84E05E0011FC43 /* Products */; 217 | ProjectRef = C2F5AF791B84E05E0011FC43 /* FFChineseSort Demo.xcodeproj */; 218 | }, 219 | ); 220 | projectRoot = ""; 221 | targets = ( 222 | C2F5AF231B84DCAA0011FC43 /* FFChineseSort */, 223 | C2F5AF2D1B84DCAA0011FC43 /* FFChineseSortTests */, 224 | ); 225 | }; 226 | /* End PBXProject section */ 227 | 228 | /* Begin PBXReferenceProxy section */ 229 | C2F5AF7F1B84E05F0011FC43 /* FFChineseSort Demo.app */ = { 230 | isa = PBXReferenceProxy; 231 | fileType = wrapper.application; 232 | path = "FFChineseSort Demo.app"; 233 | remoteRef = C2F5AF7E1B84E05F0011FC43 /* PBXContainerItemProxy */; 234 | sourceTree = BUILT_PRODUCTS_DIR; 235 | }; 236 | C2F5AF811B84E05F0011FC43 /* FFChineseSort DemoTests.xctest */ = { 237 | isa = PBXReferenceProxy; 238 | fileType = wrapper.cfbundle; 239 | path = "FFChineseSort DemoTests.xctest"; 240 | remoteRef = C2F5AF801B84E05F0011FC43 /* PBXContainerItemProxy */; 241 | sourceTree = BUILT_PRODUCTS_DIR; 242 | }; 243 | /* End PBXReferenceProxy section */ 244 | 245 | /* Begin PBXResourcesBuildPhase section */ 246 | C2F5AF221B84DCAA0011FC43 /* Resources */ = { 247 | isa = PBXResourcesBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | C2F5AF2C1B84DCAA0011FC43 /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | /* End PBXResourcesBuildPhase section */ 261 | 262 | /* Begin PBXSourcesBuildPhase section */ 263 | C2F5AF1F1B84DCAA0011FC43 /* Sources */ = { 264 | isa = PBXSourcesBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | C2F5AF471B84DE840011FC43 /* NSArray+Chinese.m in Sources */, 268 | C2F5AF421B84DCCF0011FC43 /* NSString+Chinese.m in Sources */, 269 | ); 270 | runOnlyForDeploymentPostprocessing = 0; 271 | }; 272 | C2F5AF2A1B84DCAA0011FC43 /* Sources */ = { 273 | isa = PBXSourcesBuildPhase; 274 | buildActionMask = 2147483647; 275 | files = ( 276 | C2F5AF341B84DCAA0011FC43 /* FFChineseSortTests.m in Sources */, 277 | C2F5AF431B84DD680011FC43 /* NSString+Chinese.m in Sources */, 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | /* End PBXSourcesBuildPhase section */ 282 | 283 | /* Begin PBXTargetDependency section */ 284 | C2F5AF311B84DCAA0011FC43 /* PBXTargetDependency */ = { 285 | isa = PBXTargetDependency; 286 | target = C2F5AF231B84DCAA0011FC43 /* FFChineseSort */; 287 | targetProxy = C2F5AF301B84DCAA0011FC43 /* PBXContainerItemProxy */; 288 | }; 289 | /* End PBXTargetDependency section */ 290 | 291 | /* Begin XCBuildConfiguration section */ 292 | C2F5AF361B84DCAA0011FC43 /* Debug */ = { 293 | isa = XCBuildConfiguration; 294 | buildSettings = { 295 | ALWAYS_SEARCH_USER_PATHS = NO; 296 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 297 | CLANG_CXX_LIBRARY = "libc++"; 298 | CLANG_ENABLE_MODULES = YES; 299 | CLANG_ENABLE_OBJC_ARC = YES; 300 | CLANG_WARN_BOOL_CONVERSION = YES; 301 | CLANG_WARN_CONSTANT_CONVERSION = YES; 302 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 303 | CLANG_WARN_EMPTY_BODY = YES; 304 | CLANG_WARN_ENUM_CONVERSION = YES; 305 | CLANG_WARN_INT_CONVERSION = YES; 306 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 307 | CLANG_WARN_UNREACHABLE_CODE = YES; 308 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 309 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 310 | COPY_PHASE_STRIP = NO; 311 | CURRENT_PROJECT_VERSION = 1; 312 | DEBUG_INFORMATION_FORMAT = dwarf; 313 | ENABLE_STRICT_OBJC_MSGSEND = YES; 314 | ENABLE_TESTABILITY = YES; 315 | GCC_C_LANGUAGE_STANDARD = gnu99; 316 | GCC_DYNAMIC_NO_PIC = NO; 317 | GCC_NO_COMMON_BLOCKS = YES; 318 | GCC_OPTIMIZATION_LEVEL = 0; 319 | GCC_PREPROCESSOR_DEFINITIONS = ( 320 | "DEBUG=1", 321 | "$(inherited)", 322 | ); 323 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 324 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 325 | GCC_WARN_UNDECLARED_SELECTOR = YES; 326 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 327 | GCC_WARN_UNUSED_FUNCTION = YES; 328 | GCC_WARN_UNUSED_VARIABLE = YES; 329 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 330 | MTL_ENABLE_DEBUG_INFO = YES; 331 | ONLY_ACTIVE_ARCH = YES; 332 | SDKROOT = iphoneos; 333 | TARGETED_DEVICE_FAMILY = "1,2"; 334 | VERSIONING_SYSTEM = "apple-generic"; 335 | VERSION_INFO_PREFIX = ""; 336 | }; 337 | name = Debug; 338 | }; 339 | C2F5AF371B84DCAA0011FC43 /* Release */ = { 340 | isa = XCBuildConfiguration; 341 | buildSettings = { 342 | ALWAYS_SEARCH_USER_PATHS = NO; 343 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 344 | CLANG_CXX_LIBRARY = "libc++"; 345 | CLANG_ENABLE_MODULES = YES; 346 | CLANG_ENABLE_OBJC_ARC = YES; 347 | CLANG_WARN_BOOL_CONVERSION = YES; 348 | CLANG_WARN_CONSTANT_CONVERSION = YES; 349 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 350 | CLANG_WARN_EMPTY_BODY = YES; 351 | CLANG_WARN_ENUM_CONVERSION = YES; 352 | CLANG_WARN_INT_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_UNREACHABLE_CODE = YES; 355 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 356 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 357 | COPY_PHASE_STRIP = NO; 358 | CURRENT_PROJECT_VERSION = 1; 359 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 360 | ENABLE_NS_ASSERTIONS = NO; 361 | ENABLE_STRICT_OBJC_MSGSEND = YES; 362 | GCC_C_LANGUAGE_STANDARD = gnu99; 363 | GCC_NO_COMMON_BLOCKS = YES; 364 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 365 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 366 | GCC_WARN_UNDECLARED_SELECTOR = YES; 367 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 368 | GCC_WARN_UNUSED_FUNCTION = YES; 369 | GCC_WARN_UNUSED_VARIABLE = YES; 370 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 371 | MTL_ENABLE_DEBUG_INFO = NO; 372 | SDKROOT = iphoneos; 373 | TARGETED_DEVICE_FAMILY = "1,2"; 374 | VALIDATE_PRODUCT = YES; 375 | VERSIONING_SYSTEM = "apple-generic"; 376 | VERSION_INFO_PREFIX = ""; 377 | }; 378 | name = Release; 379 | }; 380 | C2F5AF391B84DCAA0011FC43 /* Debug */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | DEFINES_MODULE = YES; 384 | DYLIB_COMPATIBILITY_VERSION = 1; 385 | DYLIB_CURRENT_VERSION = 1; 386 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 387 | INFOPLIST_FILE = FFChineseSort/Info.plist; 388 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 389 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 390 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 391 | PRODUCT_BUNDLE_IDENTIFIER = com.joyios.FFChineseSort; 392 | PRODUCT_NAME = "$(TARGET_NAME)"; 393 | SKIP_INSTALL = YES; 394 | }; 395 | name = Debug; 396 | }; 397 | C2F5AF3A1B84DCAA0011FC43 /* Release */ = { 398 | isa = XCBuildConfiguration; 399 | buildSettings = { 400 | DEFINES_MODULE = YES; 401 | DYLIB_COMPATIBILITY_VERSION = 1; 402 | DYLIB_CURRENT_VERSION = 1; 403 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 404 | INFOPLIST_FILE = FFChineseSort/Info.plist; 405 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 406 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 407 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 408 | PRODUCT_BUNDLE_IDENTIFIER = com.joyios.FFChineseSort; 409 | PRODUCT_NAME = "$(TARGET_NAME)"; 410 | SKIP_INSTALL = YES; 411 | }; 412 | name = Release; 413 | }; 414 | C2F5AF3C1B84DCAA0011FC43 /* Debug */ = { 415 | isa = XCBuildConfiguration; 416 | buildSettings = { 417 | INFOPLIST_FILE = FFChineseSortTests/Info.plist; 418 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 419 | PRODUCT_BUNDLE_IDENTIFIER = com.joyios.FFChineseSortTests; 420 | PRODUCT_NAME = "$(TARGET_NAME)"; 421 | }; 422 | name = Debug; 423 | }; 424 | C2F5AF3D1B84DCAA0011FC43 /* Release */ = { 425 | isa = XCBuildConfiguration; 426 | buildSettings = { 427 | INFOPLIST_FILE = FFChineseSortTests/Info.plist; 428 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 429 | PRODUCT_BUNDLE_IDENTIFIER = com.joyios.FFChineseSortTests; 430 | PRODUCT_NAME = "$(TARGET_NAME)"; 431 | }; 432 | name = Release; 433 | }; 434 | /* End XCBuildConfiguration section */ 435 | 436 | /* Begin XCConfigurationList section */ 437 | C2F5AF1E1B84DCAA0011FC43 /* Build configuration list for PBXProject "FFChineseSort" */ = { 438 | isa = XCConfigurationList; 439 | buildConfigurations = ( 440 | C2F5AF361B84DCAA0011FC43 /* Debug */, 441 | C2F5AF371B84DCAA0011FC43 /* Release */, 442 | ); 443 | defaultConfigurationIsVisible = 0; 444 | defaultConfigurationName = Release; 445 | }; 446 | C2F5AF381B84DCAA0011FC43 /* Build configuration list for PBXNativeTarget "FFChineseSort" */ = { 447 | isa = XCConfigurationList; 448 | buildConfigurations = ( 449 | C2F5AF391B84DCAA0011FC43 /* Debug */, 450 | C2F5AF3A1B84DCAA0011FC43 /* Release */, 451 | ); 452 | defaultConfigurationIsVisible = 0; 453 | defaultConfigurationName = Release; 454 | }; 455 | C2F5AF3B1B84DCAA0011FC43 /* Build configuration list for PBXNativeTarget "FFChineseSortTests" */ = { 456 | isa = XCConfigurationList; 457 | buildConfigurations = ( 458 | C2F5AF3C1B84DCAA0011FC43 /* Debug */, 459 | C2F5AF3D1B84DCAA0011FC43 /* Release */, 460 | ); 461 | defaultConfigurationIsVisible = 0; 462 | defaultConfigurationName = Release; 463 | }; 464 | /* End XCConfigurationList section */ 465 | }; 466 | rootObject = C2F5AF1B1B84DCAA0011FC43 /* Project object */; 467 | } 468 | -------------------------------------------------------------------------------- /FFChineseSort/FFChineseSort.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FFChineseSort/FFChineseSort/FFChineseSort.h: -------------------------------------------------------------------------------- 1 | // 2 | // FFChineseSort.h 3 | // FFChineseSort 4 | // 5 | // Created by 刘凡 on 15/8/19. 6 | // Copyright © 2015年 joyios. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for FFChineseSort. 12 | FOUNDATION_EXPORT double FFChineseSortVersionNumber; 13 | 14 | //! Project version string for FFChineseSort. 15 | FOUNDATION_EXPORT const unsigned char FFChineseSortVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /FFChineseSort/FFChineseSort/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /FFChineseSort/FFChineseSortTests/FFChineseSortTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // FFChineseSortTests.m 3 | // FFChineseSortTests 4 | // 5 | // Created by 刘凡 on 15/8/19. 6 | // Copyright © 2015年 joyios. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NSString+Chinese.h" 11 | 12 | @interface FFChineseSortTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation FFChineseSortTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | XCTAssertEqualObjects(@"张三".pinyinString, @"zhang san"); 30 | XCTAssertEqualObjects(@"李四".pinyinString, @"li si"); 31 | XCTAssertEqualObjects(@"重庆".pinyinString, @"chong qing"); 32 | XCTAssertEqualObjects(@"重量".pinyinString, @"zhong liang"); 33 | XCTAssertEqualObjects(@"".pinyinString, @""); 34 | XCTAssertEqualObjects(@"lisi".pinyinString, @"lisi"); 35 | XCTAssertEqualObjects(@"123456张三".pinyinString, @"123456zhang san"); 36 | XCTAssertEqualObjects(@"😄".pinyinString, @"😄"); 37 | } 38 | 39 | - (void)testPerformanceExample { 40 | // This is an example of a performance test case. 41 | [self measureBlock:^{ 42 | // Put the code you want to measure the time of here. 43 | }]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /FFChineseSort/FFChineseSortTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /FFChineseSort/Source/NSArray+Chinese.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+Chinese.h 3 | // FFChineseSort 4 | // 5 | // Created by 刘凡 on 15/8/19. 6 | // Copyright © 2015年 joyios. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSArray (Chinese) 12 | 13 | /// 使用指定 key 的属性对数组进行排序 14 | /// 15 | /// @param chineseKey 要排序属性的名称 16 | /// 17 | /// @return 排序后的数组 18 | - (NSArray *)sortedWithChineseKey:(NSString *)chineseKey; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /FFChineseSort/Source/NSArray+Chinese.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+Chinese.m 3 | // FFChineseSort 4 | // 5 | // Created by 刘凡 on 15/8/19. 6 | // Copyright © 2015年 joyios. All rights reserved. 7 | // 8 | 9 | #import "NSArray+Chinese.h" 10 | #import "NSString+Chinese.h" 11 | 12 | @implementation NSArray (Chinese) 13 | 14 | - (NSArray *)sortedWithChineseKey:(NSString *)chineseKey { 15 | 16 | NSMutableArray *tmpArray = [NSMutableArray arrayWithCapacity:self.count]; 17 | 18 | for (int i = 0; i < self.count; ++i) { 19 | NSString *chineseString = (chineseKey == nil) ? self[i] : [self[i] valueForKeyPath:chineseKey]; 20 | [tmpArray addObject:@{@"obj": self[i], @"pinyin": chineseString.pinyinString.lowercaseString}]; 21 | } 22 | 23 | [tmpArray sortUsingComparator:^NSComparisonResult(NSDictionary *obj1, NSDictionary *obj2) { 24 | return [obj1[@"pinyin"] compare:obj2[@"pinyin"]]; 25 | }]; 26 | 27 | return [tmpArray valueForKey:@"obj"];; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /FFChineseSort/Source/NSString+Chinese.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Chinese.h 3 | // FFChineseSort 4 | // 5 | // Created by 刘凡 on 15/8/19. 6 | // Copyright © 2015年 joyios. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (Chinese) 12 | 13 | /// 拼音字符串 14 | @property (nonatomic, copy, readonly) NSString *pinyinString; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FFChineseSort/Source/NSString+Chinese.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Chinese.m 3 | // FFChineseSort 4 | // 5 | // Created by 刘凡 on 15/8/19. 6 | // Copyright © 2015年 joyios. All rights reserved. 7 | // 8 | 9 | #import "NSString+Chinese.h" 10 | 11 | @implementation NSString (Chinese) 12 | 13 | - (NSString *)pinyinString { 14 | NSAssert([self isKindOfClass:[NSString class]], @"必须是字符串"); 15 | 16 | if (self == nil) { 17 | return nil; 18 | } 19 | 20 | NSMutableString *pinyin = [self mutableCopy]; 21 | 22 | CFStringTransform((__bridge CFMutableStringRef)pinyin, NULL, kCFStringTransformMandarinLatin, NO); 23 | CFStringTransform((__bridge CFMutableStringRef)pinyin, NULL, kCFStringTransformStripDiacritics, NO); 24 | 25 | return pinyin; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Fan Liu 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 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FFChineseSort 2 | 3 | 中文数组排序分类 & 汉字转拼音分类 4 | 5 | ## 语言 6 | 7 | * Objective-C 8 | 9 | ## 安装 10 | 11 | ### CocoaPods 12 | 13 | 在终端输入以下命令安装 cocoapods 14 | 15 | ```bash 16 | $ gem install cocoapods 17 | ``` 18 | 19 | * 在 `Podfile` 中添加以下内容 20 | 21 | ``` 22 | pod 'FFChineseSort' 23 | ``` 24 | 25 | * 如果还没有 Podfile,可以直接输入以下命令: 26 | 27 | ```bash 28 | $ echo "pod 'FFChineseSort'" > Podfile 29 | ``` 30 | 31 | * 在终端之行以下命令安装 Pod 32 | 33 | ```bash 34 | $ pod install 35 | ``` 36 | 37 | ## 使用 38 | 39 | ### 排序数组 40 | 41 | * 导入头文件 42 | 43 | ```objc 44 | #import 45 | ``` 46 | 47 | * 排序字符串数组 48 | 49 | ```objc 50 | NSArray *strings = @[@"张三", @"李四", @"王五", @"赵六", @"安娜"]; 51 | 52 | NSArray *result = [strings sortedWithChineseKey:nil]; 53 | ``` 54 | 55 | * 排序字典数组 56 | 57 | ```objc 58 | NSMutableArray *arrayM = [NSMutableArray array]; 59 | NSDictionary *dict1 = @{@"name": @"张三", @"title": @"经理", @"age": @20, @"height": @1.7}; 60 | [arrayM addObject:dict1]; 61 | NSDictionary *dict2 = @{@"name": @"李四", @"title": @"老板", @"age": @18, @"height": @1.6}; 62 | [arrayM addObject:dict2]; 63 | 64 | NSArray *result = [arrayM sortedWithChineseKey:@"name"]; 65 | ``` 66 | 67 | * 排序对象数组 68 | 69 | ```objc 70 | Person *p = [Person personWithDict:@{@"name": @"张三", @"title": @"经理", @"age": @20, @"height": @1.7}]; 71 | [persons addObject:p]; 72 | p = [Person personWithDict:@{@"name": @"李四", @"title": @"老板", @"age": @18, @"height": @1.6}]; 73 | [persons addObject:p]; 74 | 75 | // 按照 name 排序 76 | NSArray *result1 = [persons sortedWithChineseKey:@"name"]; 77 | 78 | // 按照 title 排序 79 | NSArray *result2 = [persons sortedWithChineseKey:@"title"]; 80 | 81 | ``` 82 | 83 | 84 | ### 中文转拼音 85 | 86 | * 导入头文件 87 | 88 | ```objc 89 | #import 90 | ``` 91 | 92 | * 生成拼音字符串 93 | 94 | ```objc 95 | NSLog(@"%@", @"张三".pinyinString); 96 | NSLog(@"%@", @"重庆".pinyinString); 97 | NSLog(@"%@", @"重量".pinyinString); 98 | NSLog(@"%@", @"".pinyinString); 99 | NSLog(@"%@", @"123456张三654abc".pinyinString); 100 | NSLog(@"%@", @"😄张三😄".pinyinString); 101 | ``` --------------------------------------------------------------------------------