Skip to content

Commit

Permalink
- upgrade to Swift 5
Browse files Browse the repository at this point in the history
  • Loading branch information
hai committed Aug 20, 2019
1 parent b429883 commit 586edb9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Source/WSTagView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ open class WSTagView: UIView {
}
}

internal var onDidRequestDelete: Optional<(_ tagView: WSTagView, _ replacementText: String?)->()>
internal var onDidRequestSelection: Optional<(_ tagView: WSTagView)->()>
internal var onDidInputText: Optional<(_ tagView: WSTagView, _ text: String)->()>
internal var onDidRequestDelete: Optional<(_ tagView: WSTagView, _ replacementText: String?)->()> = nil
internal var onDidRequestSelection: Optional<(_ tagView: WSTagView)->()> = nil
internal var onDidInputText: Optional<(_ tagView: WSTagView, _ text: String)->()> = nil

open var selected: Bool = false {
didSet {
Expand Down Expand Up @@ -207,7 +207,7 @@ open class WSTagView: UIView {

// MARK: - Gesture Recognizers

func handleTapGestureRecognizer(_ sender: UITapGestureRecognizer) {
@objc func handleTapGestureRecognizer(_ sender: UITapGestureRecognizer) {
if let didRequestSelectionEvent = onDidRequestSelection {
didRequestSelectionEvent(self)
}
Expand Down
6 changes: 3 additions & 3 deletions Source/WSTagsField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ open class WSTagsField: UIView, UITextDropDelegate{
}
}

textField.addTarget(self, action: #selector(onTextFieldDidChange(_:)), for:UIControlEvents.editingChanged)
textField.addTarget(self, action: #selector(onTextFieldDidChange(_:)), for:UIControl.Event.editingChanged)

intrinsicContentHeight = WSTagsField.STANDARD_ROW_HEIGHT
repositionViews()
Expand Down Expand Up @@ -537,7 +537,7 @@ open class WSTagsField: UIView, UITextDropDelegate{

// MARK: - Actions

open func onTextFieldDidChange(_ sender: AnyObject) {
@objc open func onTextFieldDidChange(_ sender: AnyObject) {
if let didChangeTextEvent = onDidChangeText {
didChangeTextEvent(self, textField.text)
}
Expand Down Expand Up @@ -633,7 +633,7 @@ private protocol BackspaceDetectingTextFieldDelegate: UITextFieldDelegate {

private class BackspaceDetectingTextField: UITextField {

var onDeleteBackwards: Optional<()->()>
var onDeleteBackwards: Optional<()->()> = nil

init() {
super.init(frame: CGRect.zero)
Expand Down
29 changes: 25 additions & 4 deletions WSTagsField.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 1030;
ORGANIZATIONNAME = Whitesmith;
TargetAttributes = {
D78C9FEE1D2A6AFD004F4BFF = {
Expand All @@ -167,10 +167,11 @@
};
buildConfigurationList = D78C9FE91D2A6AFD004F4BFF /* Build configuration list for PBXProject "WSTagsField" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = D78C9FE51D2A6AFD004F4BFF;
productRefGroup = D78C9FF01D2A6AFD004F4BFF /* Products */;
Expand Down Expand Up @@ -234,19 +235,28 @@
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++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
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;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -275,6 +285,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -285,19 +296,28 @@
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++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
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;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -319,6 +339,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -345,7 +366,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -367,7 +388,7 @@
PRODUCT_BUNDLE_IDENTIFIER = co.whitesmith.WSTagsField;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "1030"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

0 comments on commit 586edb9

Please sign in to comment.