diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc2c2ca --- /dev/null +++ b/.gitignore @@ -0,0 +1,69 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData/ +Carthage/ + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata/ + +## Other +*.moved-aside +*.xccheckout +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output + diff --git a/HanziPinyin.xcodeproj/project.pbxproj b/HanziPinyin.xcodeproj/project.pbxproj index d01e828..d8525bd 100644 --- a/HanziPinyin.xcodeproj/project.pbxproj +++ b/HanziPinyin.xcodeproj/project.pbxproj @@ -305,7 +305,7 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -326,7 +326,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/HanziPinyin/Supporting Files/Info.plist b/HanziPinyin/Supporting Files/Info.plist index 2730238..587b5df 100644 --- a/HanziPinyin/Supporting Files/Info.plist +++ b/HanziPinyin/Supporting Files/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.0.6 + 0.0.7 CFBundleSignature ???? CFBundleVersion diff --git a/HanziPinyinExample.xcodeproj/project.pbxproj b/HanziPinyinExample.xcodeproj/project.pbxproj index 57713fc..a50fa02 100644 --- a/HanziPinyinExample.xcodeproj/project.pbxproj +++ b/HanziPinyinExample.xcodeproj/project.pbxproj @@ -290,7 +290,7 @@ PRODUCT_BUNDLE_IDENTIFIER = Teambition.HanziPinyinExample; PRODUCT_NAME = HanziPinyinExample; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -303,7 +303,7 @@ PRODUCT_BUNDLE_IDENTIFIER = Teambition.HanziPinyinExample; PRODUCT_NAME = HanziPinyinExample; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/HanziPinyinExample/ActivityButton.swift b/HanziPinyinExample/ActivityButton.swift index eb5d443..ab127b8 100644 --- a/HanziPinyinExample/ActivityButton.swift +++ b/HanziPinyinExample/ActivityButton.swift @@ -10,7 +10,7 @@ import UIKit class ActivityButton: UIButton { fileprivate lazy var activityIndicator: UIActivityIndicatorView = { [unowned self] in - let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .white) + let activityIndicator = UIActivityIndicatorView(style: .white) return activityIndicator }() fileprivate var title: String? diff --git a/HanziPinyinExample/AppDelegate.swift b/HanziPinyinExample/AppDelegate.swift index 8dce163..1756b39 100644 --- a/HanziPinyinExample/AppDelegate.swift +++ b/HanziPinyinExample/AppDelegate.swift @@ -10,37 +10,29 @@ import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { return true } func applicationWillResignActive(_ application: UIApplication) { - // 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. - // 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. + } func applicationDidEnterBackground(_ application: UIApplication) { - // 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. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } func applicationWillEnterForeground(_ application: UIApplication) { - // 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. + } func applicationDidBecomeActive(_ application: UIApplication) { - // 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. - } - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } + func applicationWillTerminate(_ application: UIApplication) { + } } - diff --git a/HanziPinyinExample/Base.lproj/Main.storyboard b/HanziPinyinExample/Base.lproj/Main.storyboard index 6fd0791..7a82f6f 100644 --- a/HanziPinyinExample/Base.lproj/Main.storyboard +++ b/HanziPinyinExample/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -14,11 +18,11 @@ - + - + @@ -26,15 +30,15 @@ - - + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. - + @@ -59,7 +63,7 @@ - + @@ -92,7 +96,7 @@ - + diff --git a/HanziPinyinExample/HanziPinyinExampleViewController.swift b/HanziPinyinExample/HanziPinyinExampleViewController.swift index 078098f..1078471 100644 --- a/HanziPinyinExample/HanziPinyinExampleViewController.swift +++ b/HanziPinyinExample/HanziPinyinExampleViewController.swift @@ -32,7 +32,7 @@ class HanziPinyinExampleViewController: UIViewController { outputTextView.text = nil inputTextField.delegate = self pinyinButton.isEnabled = false - NotificationCenter.default.addObserver(self, selector: #selector(inputTextFieldTextChanged(_:)), name: .UITextFieldTextDidChange, object: inputTextField) + NotificationCenter.default.addObserver(self, selector: #selector(inputTextFieldTextChanged(_:)), name: UITextField.textDidChangeNotification, object: inputTextField) } // MARK: - Actions diff --git a/HanziPinyinExample/Info.plist b/HanziPinyinExample/Info.plist index 492f5e4..a052c5a 100644 --- a/HanziPinyinExample/Info.plist +++ b/HanziPinyinExample/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.0.6 + 0.0.7 CFBundleSignature ???? CFBundleVersion - 6 + 7 LSRequiresIPhoneOS UILaunchStoryboardName