diff --git a/HanziPinyin.xcodeproj/project.pbxproj b/HanziPinyin.xcodeproj/project.pbxproj index 9845901..d01e828 100644 --- a/HanziPinyin.xcodeproj/project.pbxproj +++ b/HanziPinyin.xcodeproj/project.pbxproj @@ -122,7 +122,7 @@ D395A11C1CC244BB00B76FB7 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = Teambition; TargetAttributes = { D395A1241CC244BB00B76FB7 = { @@ -188,12 +188,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -245,12 +247,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/HanziPinyin.xcodeproj/xcshareddata/xcschemes/HanziPinyin.xcscheme b/HanziPinyin.xcodeproj/xcshareddata/xcschemes/HanziPinyin.xcscheme index 6701ec0..90d572c 100644 --- a/HanziPinyin.xcodeproj/xcshareddata/xcschemes/HanziPinyin.xcscheme +++ b/HanziPinyin.xcodeproj/xcshareddata/xcschemes/HanziPinyin.xcscheme @@ -1,6 +1,6 @@ @@ -37,7 +36,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/HanziPinyin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/HanziPinyin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/HanziPinyin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/HanziPinyin/String+HanziPinyin.swift b/HanziPinyin/String+HanziPinyin.swift index fd77a42..f48cc2b 100644 --- a/HanziPinyin/String+HanziPinyin.swift +++ b/HanziPinyin/String+HanziPinyin.swift @@ -23,8 +23,8 @@ public extension String { } var pinyin = pinyinStrings.joined(separator: "") - if !pinyin.isEmpty && String(pinyin.suffix(from: pinyin.characters.index(pinyin.endIndex, offsetBy: -1))) == separator { - pinyin.remove(at: pinyin.characters.index(pinyin.endIndex, offsetBy: -1)) + if !pinyin.isEmpty && String(pinyin.suffix(from: pinyin.index(pinyin.endIndex, offsetBy: -1))) == separator { + pinyin.remove(at: pinyin.index(pinyin.endIndex, offsetBy: -1)) } return pinyin @@ -46,7 +46,7 @@ public extension String { let pinyinArray = HanziPinyin.pinyinArray(withCharCodePoint: charCodePoint, outputFormat: outputFormat) if pinyinArray.count > 0 { - let acronym = pinyinArray.first!.characters.first! + let acronym = pinyinArray.first!.first! pinyinStrings.append(String(acronym) + separator) } else { pinyinStrings.append(String(unicodeScalar)) @@ -54,8 +54,8 @@ public extension String { } var pinyinAcronym = pinyinStrings.joined(separator: "") - if !pinyinAcronym.isEmpty && String(pinyinAcronym.suffix(from: pinyinAcronym.characters.index(pinyinAcronym.endIndex, offsetBy: -1))) == separator { - pinyinAcronym.remove(at: pinyinAcronym.characters.index(pinyinAcronym.endIndex, offsetBy: -1)) + if !pinyinAcronym.isEmpty && String(pinyinAcronym.suffix(from: pinyinAcronym.index(pinyinAcronym.endIndex, offsetBy: -1))) == separator { + pinyinAcronym.remove(at: pinyinAcronym.index(pinyinAcronym.endIndex, offsetBy: -1)) } return pinyinAcronym diff --git a/HanziPinyin/Supporting Files/Info.plist b/HanziPinyin/Supporting Files/Info.plist index 2a44702..2730238 100644 --- a/HanziPinyin/Supporting Files/Info.plist +++ b/HanziPinyin/Supporting Files/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.0.5 + 0.0.6 CFBundleSignature ???? CFBundleVersion diff --git a/HanziPinyinExample.xcodeproj/project.pbxproj b/HanziPinyinExample.xcodeproj/project.pbxproj index 0e8edc8..57713fc 100644 --- a/HanziPinyinExample.xcodeproj/project.pbxproj +++ b/HanziPinyinExample.xcodeproj/project.pbxproj @@ -111,7 +111,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = Teambition; TargetAttributes = { D395A1051CC243DB00B76FB7 = { @@ -188,12 +188,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -242,12 +244,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/HanziPinyinExample.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/HanziPinyinExample.xcscheme b/HanziPinyinExample.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/HanziPinyinExample.xcscheme index f9d2854..105d801 100644 --- a/HanziPinyinExample.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/HanziPinyinExample.xcscheme +++ b/HanziPinyinExample.xcodeproj/xcuserdata/hongxin.xcuserdatad/xcschemes/HanziPinyinExample.xcscheme @@ -1,6 +1,6 @@ @@ -46,7 +45,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/HanziPinyinExample/HanziPinyinExampleViewController.swift b/HanziPinyinExample/HanziPinyinExampleViewController.swift index b89a88b..078098f 100644 --- a/HanziPinyinExample/HanziPinyinExampleViewController.swift +++ b/HanziPinyinExample/HanziPinyinExampleViewController.swift @@ -58,7 +58,7 @@ class HanziPinyinExampleViewController: UIViewController { } @objc func inputTextFieldTextChanged(_ notification: Notification) { - pinyinButton.isEnabled = (inputTextField.text?.characters.count ?? 0) > 0 + pinyinButton.isEnabled = (inputTextField.text?.count ?? 0) > 0 } } diff --git a/HanziPinyinExample/Info.plist b/HanziPinyinExample/Info.plist index cd3eff8..492f5e4 100644 --- a/HanziPinyinExample/Info.plist +++ b/HanziPinyinExample/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.0.5 + 0.0.6 CFBundleSignature ???? CFBundleVersion - 5 + 6 LSRequiresIPhoneOS UILaunchStoryboardName