diff --git a/HanziPinyin.xcodeproj/project.pbxproj b/HanziPinyin.xcodeproj/project.pbxproj index d8525bd..1d15d6f 100644 --- a/HanziPinyin.xcodeproj/project.pbxproj +++ b/HanziPinyin.xcodeproj/project.pbxproj @@ -122,21 +122,22 @@ D395A11C1CC244BB00B76FB7 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = Teambition; TargetAttributes = { D395A1241CC244BB00B76FB7 = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; }; }; buildConfigurationList = D395A11F1CC244BB00B76FB7 /* Build configuration list for PBXProject "HanziPinyin" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = D395A11B1CC244BB00B76FB7; productRefGroup = D395A1261CC244BB00B76FB7 /* Products */; @@ -179,6 +180,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -238,6 +240,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -304,8 +307,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -325,8 +327,7 @@ PRODUCT_BUNDLE_IDENTIFIER = Teambition.HanziPinyin; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/HanziPinyin.xcodeproj/xcshareddata/xcschemes/HanziPinyin.xcscheme b/HanziPinyin.xcodeproj/xcshareddata/xcschemes/HanziPinyin.xcscheme index 90d572c..90ddbe7 100644 --- a/HanziPinyin.xcodeproj/xcshareddata/xcschemes/HanziPinyin.xcscheme +++ b/HanziPinyin.xcodeproj/xcshareddata/xcschemes/HanziPinyin.xcscheme @@ -1,6 +1,6 @@ [String: String] { + func initializeResource() -> [String: String] { if let cachedPinyinTable = HanziPinyin.cachedObject(forKey: CacheKeys.unicodeToPinyin) as? [String: String] { return cachedPinyinTable } else { diff --git a/HanziPinyin/String+HanziPinyin.swift b/HanziPinyin/String+HanziPinyin.swift index f48cc2b..4f9a536 100644 --- a/HanziPinyin/String+HanziPinyin.swift +++ b/HanziPinyin/String+HanziPinyin.swift @@ -9,7 +9,7 @@ import Foundation public extension String { - public func toPinyin(withFormat outputFormat: PinyinOutputFormat = .default, separator: String = " ") -> String { + func toPinyin(withFormat outputFormat: PinyinOutputFormat = .default, separator: String = " ") -> String { var pinyinStrings = [String]() for unicodeScalar in unicodeScalars { let charCodePoint = unicodeScalar.value @@ -30,7 +30,7 @@ public extension String { return pinyin } - public func toPinyin(withFormat outputFormat: PinyinOutputFormat = .default, separator: String = " ", completion: @escaping ((_ pinyin: String) -> ())) { + func toPinyin(withFormat outputFormat: PinyinOutputFormat = .default, separator: String = " ", completion: @escaping ((_ pinyin: String) -> ())) { DispatchQueue.global(qos: .default).async { let pinyin = self.toPinyin(withFormat: outputFormat, separator: separator) DispatchQueue.main.async { @@ -39,7 +39,7 @@ public extension String { } } - public func toPinyinAcronym(withFormat outputFormat: PinyinOutputFormat = .default, separator: String = "") -> String { + func toPinyinAcronym(withFormat outputFormat: PinyinOutputFormat = .default, separator: String = "") -> String { var pinyinStrings = [String]() for unicodeScalar in unicodeScalars { let charCodePoint = unicodeScalar.value @@ -61,7 +61,7 @@ public extension String { return pinyinAcronym } - public func toPinyinAcronym(withFormat outputFormat: PinyinOutputFormat = .default, separator: String = "", completion: @escaping ((_ pinyinAcronym: String) -> ())) { + func toPinyinAcronym(withFormat outputFormat: PinyinOutputFormat = .default, separator: String = "", completion: @escaping ((_ pinyinAcronym: String) -> ())) { DispatchQueue.global(qos: .default).async { let pinyinAcronym = self.toPinyinAcronym(withFormat: outputFormat, separator: separator) DispatchQueue.main.async { @@ -70,7 +70,7 @@ public extension String { } } - public var hasChineseCharacter: Bool { + var hasChineseCharacter: Bool { for unicodeScalar in unicodeScalars { let charCodePoint = unicodeScalar.value if HanziPinyin.isHanzi(ofCharCodePoint: charCodePoint) { diff --git a/HanziPinyin/Supporting Files/Info.plist b/HanziPinyin/Supporting Files/Info.plist index 587b5df..bc568f7 100644 --- a/HanziPinyin/Supporting Files/Info.plist +++ b/HanziPinyin/Supporting Files/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.0.7 + 0.0.8 CFBundleSignature ???? CFBundleVersion diff --git a/HanziPinyinExample.xcodeproj/project.pbxproj b/HanziPinyinExample.xcodeproj/project.pbxproj index a50fa02..d043854 100644 --- a/HanziPinyinExample.xcodeproj/project.pbxproj +++ b/HanziPinyinExample.xcodeproj/project.pbxproj @@ -111,7 +111,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = Teambition; TargetAttributes = { D395A1051CC243DB00B76FB7 = { @@ -122,7 +122,7 @@ }; buildConfigurationList = D395A1011CC243DB00B76FB7 /* Build configuration list for PBXProject "HanziPinyinExample" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -179,6 +179,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -235,6 +236,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -290,7 +292,7 @@ PRODUCT_BUNDLE_IDENTIFIER = Teambition.HanziPinyinExample; PRODUCT_NAME = HanziPinyinExample; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -303,7 +305,7 @@ PRODUCT_BUNDLE_IDENTIFIER = Teambition.HanziPinyinExample; PRODUCT_NAME = HanziPinyinExample; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/HanziPinyinExample.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/HanziPinyinExample.xcscheme b/HanziPinyinExample.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/HanziPinyinExample.xcscheme index 105d801..bd25550 100644 --- a/HanziPinyinExample.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/HanziPinyinExample.xcscheme +++ b/HanziPinyinExample.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/HanziPinyinExample.xcscheme @@ -1,6 +1,6 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.0.7 + 0.0.8 CFBundleSignature ???? CFBundleVersion - 7 + 8 LSRequiresIPhoneOS UILaunchStoryboardName