Skip to content

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bcylin committed Feb 4, 2017
2 parents 34ca6dd + 62c5f09 commit 716d0fb
Show file tree
Hide file tree
Showing 46 changed files with 399 additions and 255 deletions.
4 changes: 2 additions & 2 deletions .jazzy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ author: polydice
author_url: https://github.com/polydice
github_url: https://github.com/polydice/ICInputAccessory
github_file_prefix: https://github.com/polydice/ICInputAccessory/blob/develop
xcodebuild_arguments: [-scheme, ICInputAccessory-iOS]
xcodebuild_arguments: [-project, ICInputAccessory.xcodeproj, -scheme, ICInputAccessory-iOS]
module: ICInputAccessory
module_version: 1.2.1
module_version: 1.3.0
output: docs/output
theme: fullwidth
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.0
1 change: 1 addition & 0 deletions .swiftlint-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.16.1
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ disabled_rules:
- file_length
- line_length
- type_body_length
- vertical_whitespace
excluded:
- Carthage
- Pods
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v1.3.0

* Swift 3.0
* Support `pod try ICInputAccessory`

## v1.2.1

* Update to Xcode 8.2
Expand All @@ -8,10 +13,9 @@

## v1.1.0

* Swift 2.2
* Support storyboard
* Support subspecs
* Upgrade to Swift 2.2
* Use CocoaPods (1.0.1)

## v1.0.0

Expand Down
24 changes: 24 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env ruby

# Sometimes it's a README fix, or something like that - which isn't relevant for
# including in a project's CHANGELOG for example
declared_trivial = (github.pr_title + github.pr_body).include? "#trivial"

# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
warn "PR is classed as Work in Progress" if github.pr_title.include? "[WIP]"

# Warn when there is a big PR
warn "Big PR" if git.lines_of_code > 500

# Ensure there is a summary for a PR
fail "Please provide a summary in the Pull Request description" if github.pr_body.length < 5

# Add a CHANGELOG entry for app changes
if git.lines_of_code > 50 && !git.modified_files.include?("CHANGELOG.md") && !declared_trivial
fail "Please update [CHANGELOG.md](https://github.com/polydice/ICInputAccessory/blob/develop/CHANGELOG.md).", sticky: true
end

# Ensure a clean commits history
if git.commits.any? { |c| c.message =~ /^Merge branch/ }
fail "Please rebase to get rid of the merge commits in this PR", sticky: true
end
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
B5E9F9081C8D3B6E00443DC7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
B5E9F90A1C8D3B6E00443DC7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
B5F62A5C1C9ECBCB003A1231 /* ICKeyboardDismissTextFieldUITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ICKeyboardDismissTextFieldUITests.swift; sourceTree = "<group>"; };
CA708B7D49E7D80A75ED81E3 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
CA708B7D49E7D80A75ED81E3 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
D0DB1D3E89AB75183DB104E0 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FE1A89C8A77ED0438A206A24 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "../Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = "<group>"; };
FE1A89C8A77ED0438A206A24 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -254,7 +254,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
96705876C946719953BCD0C6 /* [CP] Check Pods Manifest.lock */ = {
Expand Down Expand Up @@ -284,7 +284,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then swiftlint; fi";
shellScript = "sh ${SRCROOT}/scripts/swiftlint.sh";
};
CAB3B20531AAE2438C48D751 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -298,7 +298,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -359,11 +359,12 @@
B548C5C91C8E91B0009D5AEE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
INFOPLIST_FILE = ICInputAccessoryUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.polydice.ICInputAccessoryUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
TEST_TARGET_NAME = Example;
USES_XCTRUNNER = YES;
};
Expand All @@ -372,11 +373,13 @@
B548C5CA1C8E91B0009D5AEE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
INFOPLIST_FILE = ICInputAccessoryUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.polydice.ICInputAccessoryUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
TEST_TARGET_NAME = Example;
USES_XCTRUNNER = YES;
};
Expand Down Expand Up @@ -426,7 +429,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand Down Expand Up @@ -467,7 +470,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -483,7 +486,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.polydice.ICInputAccessoryExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -499,7 +502,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.polydice.ICInputAccessoryExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 2.3;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
6 changes: 0 additions & 6 deletions Example/.swiftlint.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window?.backgroundColor = UIColor.whiteColor()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window?.backgroundColor = UIColor.white
window?.rootViewController = UINavigationController(rootViewController: ExampleViewController())
window?.makeKeyAndVisible()
return true
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,31 @@ extension ICTokenField {

layer.cornerRadius = 5
layer.shouldRasterize = true
layer.rasterizationScale = UIScreen.mainScreen().scale
layer.rasterizationScale = UIScreen.main.scale
backgroundColor = UIColor(red:0.8, green:0.32, blue:0.24, alpha:1)

textField.textColor = UIColor.whiteColor()
textField.tintColor = UIColor.whiteColor()
textField.font = UIFont.boldSystemFontOfSize(14)
textField.textColor = UIColor.white
textField.tintColor = UIColor.white
textField.font = UIFont.boldSystemFont(ofSize: 14)

attributedPlaceholder = NSAttributedString(
string: String(self.dynamicType),
string: String(describing: type(of: self)),
attributes: [
NSForegroundColorAttributeName: UIColor.whiteColor().colorWithAlphaComponent(0.5),
NSFontAttributeName: UIFont.boldSystemFontOfSize(14)
NSForegroundColorAttributeName: UIColor.white.withAlphaComponent(0.5),
NSFontAttributeName: UIFont.boldSystemFont(ofSize: 14)
]
)

normalTokenAttributes = [
NSForegroundColorAttributeName: UIColor.whiteColor(),
NSBackgroundColorAttributeName: UIColor.whiteColor().colorWithAlphaComponent(0.25),
NSFontAttributeName: UIFont.boldSystemFontOfSize(14)
NSForegroundColorAttributeName: UIColor.white,
NSBackgroundColorAttributeName: UIColor.white.withAlphaComponent(0.25),
NSFontAttributeName: UIFont.boldSystemFont(ofSize: 14)
]

highlightedTokenAttributes = [
NSForegroundColorAttributeName: UIColor(red:0.8, green:0.32, blue:0.24, alpha:1),
NSBackgroundColorAttributeName: UIColor.whiteColor(),
NSFontAttributeName: UIFont.boldSystemFontOfSize(14)
NSBackgroundColorAttributeName: UIColor.white,
NSFontAttributeName: UIFont.boldSystemFont(ofSize: 14)
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,73 +36,74 @@ class CustomizedTokenViewController: UIViewController, ICTokenFieldDelegate {

override func loadView() {
super.loadView()
view.backgroundColor = UIColor.whiteColor()
textView.text = "[\n\n]";
textView.font = UIFont.preferredFontForTextStyle(UIFontTextStyleSubheadline)
view.backgroundColor = UIColor.white
textView.text = "[\n\n]"
textView.font = UIFont.preferredFont(forTextStyle: .subheadline)
textView.frame = view.bounds.insetBy(dx: 10, dy: 10)
textView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
textView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.addSubview(textView)
}

override func viewDidLoad() {
super.viewDidLoad()
navigationController?.navigationBar.barTintColor = UIColor(red:0.96, green:0.48, blue:0.4, alpha:1)
navigationController?.navigationBar.translucent = false
navigationController?.navigationBar.barStyle = .Black
navigationController?.navigationBar.isTranslucent = false
navigationController?.navigationBar.barStyle = .black

let cancelBarButton = UIBarButtonItem(barButtonSystemItem: .Cancel, target: self, action: .dismiss)
cancelBarButton.tintColor = UIColor.whiteColor()
let cancelBarButton = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: .dismiss)
cancelBarButton.tintColor = UIColor.white
navigationItem.rightBarButtonItem = cancelBarButton

navigationItem.titleView = tokenField
tokenField.delegate = self
}

override func viewWillAppear(animated: Bool) {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
tokenField.becomeFirstResponder()
_ = tokenField.becomeFirstResponder()
}

override func viewWillDisappear(animated: Bool) {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillAppear(animated)
tokenField.resignFirstResponder()
_ = tokenField.resignFirstResponder()
textView.endEditing(true)
}

// MARK: - ICTokenFieldDelegate

func tokenFieldDidBeginEditing(tokenField: ICTokenField) {
func tokenFieldDidBeginEditing(_ tokenField: ICTokenField) {
print(#function)
}

func tokenFieldDidEndEditing(tokenField: ICTokenField) {
func tokenFieldDidEndEditing(_ tokenField: ICTokenField) {
print(#function)
}

func tokenFieldWillReturn(tokenField: ICTokenField) {
func tokenFieldWillReturn(_ tokenField: ICTokenField) {
print(#function)
}

func tokenField(tokenField: ICTokenField, didEnterText text: String) {
func tokenField(_ tokenField: ICTokenField, didEnterText text: String) {
print("Add: \"\(text)\"")
updateTexts()
}

func tokenField(tokenField: ICTokenField, didDeleteText text: String, atIndex index: Int) {
func tokenField(_ tokenField: ICTokenField, didDeleteText text: String, atIndex index: Int) {
print("Delete: \"\(text)\"")
updateTexts()
}

// MARK: - UIResponder Callbacks

@objc private func dismiss(sender: UIBarButtonItem) {
presentingViewController?.dismissViewControllerAnimated(true, completion: nil)
@objc fileprivate func dismiss(_ sender: UIBarButtonItem) {
presentingViewController?.dismiss(animated: true, completion: nil)
}

// MARK: - Private Methods

private func updateTexts() {
textView.text = "[\n " + tokenField.texts.map { "\"" + $0 + "\"" } .joinWithSeparator(",\n ") + "\n]"
let tokens = tokenField.texts.map { "\"" + $0 + "\"" } .joined(separator: ",\n ")
textView.text = "[\n " + tokens + "\n]"
}

}
Expand Down
14 changes: 7 additions & 7 deletions Example/Example/ExampleCell.swift → Example/ExampleCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class ExampleCell: UITableViewCell {
displayingView.translatesAutoresizingMaskIntoConstraints = false

if #available(iOS 9.0, *) {
displayingView.topAnchor.constraintEqualToAnchor(contentView.topAnchor).active = true
displayingView.leftAnchor.constraintEqualToAnchor(contentView.leftAnchor).active = true
displayingView.bottomAnchor.constraintEqualToAnchor(contentView.bottomAnchor).active = true
displayingView.rightAnchor.constraintEqualToAnchor(contentView.rightAnchor).active = true
displayingView.topAnchor.constraint(equalTo: contentView.topAnchor).isActive = true
displayingView.leftAnchor.constraint(equalTo: contentView.leftAnchor).isActive = true
displayingView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor).isActive = true
displayingView.rightAnchor.constraint(equalTo: contentView.rightAnchor).isActive = true
} else {
let views = ["view": displayingView]
contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[view]|", options: [], metrics: nil, views: views))
contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[view]|", options: [], metrics: nil, views: views))
contentView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[view]|", options: [], metrics: nil, views: views))
contentView.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[view]|", options: [], metrics: nil, views: views))
}
}
}
Expand All @@ -56,7 +56,7 @@ class ExampleCell: UITableViewCell {
showcase?.removeFromSuperview()
showcase = nil
textLabel?.text = nil
accessoryType = .None
accessoryType = .none
}

}
Loading

0 comments on commit 716d0fb

Please sign in to comment.