Skip to content

Commit

Permalink
Merge pull request #26 from EurekaCommunity/release
Browse files Browse the repository at this point in the history
Release version 2.1.0
  • Loading branch information
mats-claassen authored Jul 12, 2018
2 parents cfdd6d7 + 97499ff commit 73d46d4
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 38 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Change Log
All notable changes to SuggestionRow will be documented in this file.

### [1.0.0](https://github.com/EurekaCommunity/SuggestionRow/releases/tag/1.0.0)
## [2.1.0](https://github.com/EurekaCommunity/SuggestionRow/releases/tag/2.1.0)

* This is the initial version. It supports Eureka 3.0 and Swift 3
* Support for Swift 4
* Support loading suggestions asynchronously

## [1.0.0](https://github.com/EurekaCommunity/SuggestionRow/releases/tag/1.0.0)

* This is the initial version. It supports Eureka 3.0 and Swift 3
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "xmartlabs/Eureka" "9678ff95edd7b217ecb73c02938ce47d206cb03d"
github "xmartlabs/Eureka" "4.2.0"
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DEPENDENCIES:
- Eureka (~> 4.0)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
https://github.com/cocoapods/specs:
- Eureka

SPEC CHECKSUMS:
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<img src="https://img.shields.io/badge/platform-iOS-blue.svg?style=flat" alt="Platform iOS" />
<a href="https://developer.apple.com/swift"><img src="https://img.shields.io/badge/swift3-compatible-4BC51D.svg?style=flat" alt="Swift 3 compatible" /></a>
<a href="https://cocoapods.org/pods/SuggestionRow"><img src="https://img.shields.io/cocoapods/v/SuggestionRow.svg" alt="CocoaPods compatible" /></a>
<a href="https://raw.githubusercontent.com/EurekaCommunity/SuggestionRow/master/LICENSE"><img src="http://img.shields.io/badge/license-MIT-blue.svg?style=flat" alt="License: MIT" /></a>
</p>
Expand All @@ -8,6 +7,7 @@
* [Introduction](#introduction)
* [Installation](#installation)
* [Usage](#usage)
* [Running the examples](#running-the-examples)
* [Customization](#customization)
* [Dependencies](#dependencies)
* [Requirements](#requirements)
Expand Down Expand Up @@ -54,7 +54,7 @@ First, the type that you want to provide completion suggestions for must conform
self.firstName = firstName
self.lastName = lastName
}
}
}

To conform to the `SuggestionValue` protocol, add a `suggestionString` method that specifies how `Scientist`s should be displayed as suggestions. This is the text that will either go in a tag in the `inputAccessoryView` or in a row in the suggestions `UITableView`. For `Scientist`s, displaying the full name is a good option, as shown below. `Scientist` must also conform to `Equatable` and `InputTypeInitiable` as required by `SuggestionValue`. `InputTypeInitiable` is a protocol defined by `Eureka` which requires an optional initializer that takes in a `String`. It's used to determine how to instatiate a value from the contents of a `UITextField`. In this case, the text that the user types in is used to filter existing values but not create new ones so the initializer can return nil.

Expand All @@ -63,7 +63,7 @@ To conform to the `SuggestionValue` protocol, add a `suggestionString` method th
init?(string stringValue: String) {
return nil
}

// Text that is displayed as a completion suggestion.
var suggestionString: String {
return "\(firstName) \(lastName)"
Expand All @@ -74,7 +74,7 @@ To conform to the [`Equatable`](https://developer.apple.com/reference/swift/equa

func == (lhs: Scientist, rhs: Scientist) -> Bool {
return lhs.id == rhs.id
}
}

### Instantiate the row
In your form, add a row of type `SuggestionAccessoryRow<Scientist>` or `SuggestionTableRow<Scientist>`. You must define the row's `filterFunction` to determine where completion suggestions come from and how they are selected based on the user's input. The function you set as `filterFunction` must take in a `String` parameter (what the user has typed in) and return an array of `Scientist` (the valid suggestions). This function is called each time the user input field changes. The following example is also in `SuggestionExampleViewController`:
Expand All @@ -90,6 +90,13 @@ In your form, add a row of type `SuggestionAccessoryRow<Scientist>` or `Suggesti
$0.placeholder = "Search for a famous scientist"
}

## Running the examples
To run the examples follow these steps:

* Clone or download this repo
* Run `carthage update` in the root folder
* Run the project

## Customization

### `SuggestionAccessoryRow<T>`
Expand All @@ -99,7 +106,7 @@ In your form, add a row of type `SuggestionAccessoryRow<Scientist>` or `Suggesti

* If you want to change the **layout of the collectionView** then you can use/modify/override the `collectionViewLayout` attribute in the `cellSetup` method when declaring the row.

* If you want to change something about the **collectionView** (e.g. its height, backgroundColor) then you can also do that in the `cellSetup` method.
* If you want to change something about the **collectionView** (e.g. its height, backgroundColor) then you can also do that in the `cellSetup` method.

* If you want to **change the collection view cell of the inputAccessoryView** drastically, create your own row (`MySuggestionAccessoryRow`) with your own cell class which conforms to `EurekaSuggestionCollectionViewCell`.

Expand All @@ -113,7 +120,7 @@ In your form, add a row of type `SuggestionAccessoryRow<Scientist>` or `Suggesti
* If you want to change these cells drastically, create your own row with your own cell class which conforms to `EurekaSuggestionTableViewCell`.

## Dependencies
* Eureka
* Eureka

## Requirements
* iOS 8.0+
Expand All @@ -124,4 +131,3 @@ In your form, add a row of type `SuggestionAccessoryRow<Scientist>` or `Suggesti
* If you **want to contribute** please feel free to **submit pull requests**.
* If you **have a feature request** please **open an issue**.
* If you **found a bug** or **need help** please **check older issues before submitting an issue.**.

2 changes: 1 addition & 1 deletion SuggestionRow.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SuggestionRow"
s.version = "2.0.0"
s.version = "2.1.0"
s.summary = "Eureka row that displays completion suggestions either below the row in a table view or in the input accessory view above the keyboard."
s.homepage = "https://github.com/EurekaCommunity/SuggestionRow"
s.license = { type: 'MIT', file: 'LICENSE' }
Expand Down
42 changes: 16 additions & 26 deletions SuggestionRow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@
491BA285AFA32862390D7431 /* Pods_SuggestionRow.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E382FC4170AC6A8094CA8BB2 /* Pods_SuggestionRow.framework */; };
6A9D202F2BA6E4BFA39C5B05 /* Pods_SuggestionRowUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AB6675C27F04324EC0932A6 /* Pods_SuggestionRowUITests.framework */; };
79E4A8291FD82BF50023D6B6 /* SuggestionRow.h in Headers */ = {isa = PBXBuildFile; fileRef = 79E4A8271FD82BF50023D6B6 /* SuggestionRow.h */; settings = {ATTRIBUTES = (Public, ); }; };
79E4A82C1FD82BF50023D6B6 /* SuggestionRow.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79E4A8251FD82BF50023D6B6 /* SuggestionRow.framework */; };
79E4A82D1FD82BF50023D6B6 /* SuggestionRow.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 79E4A8251FD82BF50023D6B6 /* SuggestionRow.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
79E4A8391FD82C320023D6B6 /* SuggestionRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA81DD741D64F824002F17F9 /* SuggestionRow.swift */; };
79E4A83A1FD82C320023D6B6 /* SuggestionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA81DD751D64F824002F17F9 /* SuggestionCell.swift */; };
79E4A83B1FD82C320023D6B6 /* SuggestionCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA81DD761D64F824002F17F9 /* SuggestionCollectionCell.swift */; };
79E4A83C1FD82C320023D6B6 /* SuggestionCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA81DD771D64F824002F17F9 /* SuggestionCollectionViewCell.swift */; };
79E4A83D1FD82C320023D6B6 /* SuggestionTableCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA81DD7C1D64FB78002F17F9 /* SuggestionTableCell.swift */; };
79E4A83E1FD82C320023D6B6 /* SuggestionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA81DD7D1D64FB78002F17F9 /* SuggestionTableViewCell.swift */; };
79E4A83F1FD82C320023D6B6 /* String+SuggestionValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FA74BC81D831E2100571A0C /* String+SuggestionValue.swift */; };
79E4A8411FD82DB50023D6B6 /* Eureka.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 79E4A8401FD82DB50023D6B6 /* Eureka.framework */; };
8FA74BC91D831E2100571A0C /* String+SuggestionValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FA74BC81D831E2100571A0C /* String+SuggestionValue.swift */; };
8FDDC60320F7988B00468068 /* Eureka.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8FDDC60120F7988300468068 /* Eureka.framework */; };
8FDDC60420F7988B00468068 /* Eureka.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8FDDC60120F7988300468068 /* Eureka.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
AA81DD461D64F706002F17F9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA81DD451D64F706002F17F9 /* AppDelegate.swift */; };
AA81DD481D64F707002F17F9 /* SuggestionExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA81DD471D64F707002F17F9 /* SuggestionExampleViewController.swift */; };
AA81DD4B1D64F707002F17F9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA81DD491D64F707002F17F9 /* Main.storyboard */; };
Expand All @@ -38,13 +37,6 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
79E4A82A1FD82BF50023D6B6 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = AA81DD3A1D64F706002F17F9 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 79E4A8241FD82BF50023D6B6;
remoteInfo = SuggestionRow;
};
AA81DD571D64F707002F17F9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = AA81DD3A1D64F706002F17F9 /* Project object */;
Expand All @@ -68,7 +60,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
79E4A82D1FD82BF50023D6B6 /* SuggestionRow.framework in Embed Frameworks */,
8FDDC60420F7988B00468068 /* Eureka.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -81,9 +73,9 @@
79E4A8251FD82BF50023D6B6 /* SuggestionRow.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SuggestionRow.framework; sourceTree = BUILT_PRODUCTS_DIR; };
79E4A8271FD82BF50023D6B6 /* SuggestionRow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SuggestionRow.h; sourceTree = "<group>"; };
79E4A8281FD82BF50023D6B6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
79E4A8401FD82DB50023D6B6 /* Eureka.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Eureka.framework; path = Carthage/Build/iOS/Eureka.framework; sourceTree = "<group>"; };
7CD7B18C2AB9C6EBA7388C89 /* Pods-SuggestionRowUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SuggestionRowUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SuggestionRowUITests/Pods-SuggestionRowUITests.debug.xcconfig"; sourceTree = "<group>"; };
8FA74BC81D831E2100571A0C /* String+SuggestionValue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+SuggestionValue.swift"; sourceTree = "<group>"; };
8FDDC60120F7988300468068 /* Eureka.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Eureka.framework; path = Carthage/Build/iOS/Eureka.framework; sourceTree = "<group>"; };
92D8B188ED3E2B0E4F9C4557 /* Pods_SuggestionRowTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SuggestionRowTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9AB6675C27F04324EC0932A6 /* Pods_SuggestionRowUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SuggestionRowUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AA81DD421D64F706002F17F9 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -116,7 +108,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
79E4A8411FD82DB50023D6B6 /* Eureka.framework in Frameworks */,
491BA285AFA32862390D7431 /* Pods_SuggestionRow.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -125,7 +116,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
79E4A82C1FD82BF50023D6B6 /* SuggestionRow.framework in Frameworks */,
8FDDC60320F7988B00468068 /* Eureka.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -244,7 +235,7 @@
B49C487EB6DD1EF9AA014DDC /* Frameworks */ = {
isa = PBXGroup;
children = (
79E4A8401FD82DB50023D6B6 /* Eureka.framework */,
8FDDC60120F7988300468068 /* Eureka.framework */,
E382FC4170AC6A8094CA8BB2 /* Pods_SuggestionRow.framework */,
92D8B188ED3E2B0E4F9C4557 /* Pods_SuggestionRowTests.framework */,
9AB6675C27F04324EC0932A6 /* Pods_SuggestionRowUITests.framework */,
Expand Down Expand Up @@ -297,7 +288,6 @@
buildRules = (
);
dependencies = (
79E4A82B1FD82BF50023D6B6 /* PBXTargetDependency */,
);
name = Example;
productName = SuggestionRow;
Expand Down Expand Up @@ -359,7 +349,6 @@
};
AA81DD411D64F706002F17F9 = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 6F2G55XL63;
LastSwiftMigration = 0800;
};
AA81DD551D64F707002F17F9 = {
Expand Down Expand Up @@ -536,11 +525,6 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
79E4A82B1FD82BF50023D6B6 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 79E4A8241FD82BF50023D6B6 /* SuggestionRow */;
targetProxy = 79E4A82A1FD82BF50023D6B6 /* PBXContainerItemProxy */;
};
AA81DD581D64F707002F17F9 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = AA81DD411D64F706002F17F9 /* Example */;
Expand Down Expand Up @@ -765,10 +749,13 @@
AA81DD6B1D64F707002F17F9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = 6F2G55XL63;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "Helene-Martin.SuggestionRow";
Expand All @@ -779,10 +766,13 @@
AA81DD6C1D64F707002F17F9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = 6F2G55XL63;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "Helene-Martin.SuggestionRow";
Expand Down

0 comments on commit 73d46d4

Please sign in to comment.