Skip to content

Commit

Permalink
3.1.0 (#17)
Browse files Browse the repository at this point in the history
* Convert to Swift 4.2

* Update podspec

* Update README

* Update Travis yml

* Update Xcode version on readme

* Update Podspec
  • Loading branch information
dylanshine authored Sep 20, 2018
1 parent d3ad75e commit 0e5a70c
Show file tree
Hide file tree
Showing 21 changed files with 88 additions and 84 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
# * http://www.objc.io/issue-6/travis-ci.html
# * https://github.com/supermarin/xcpretty#usage

osx_image: xcode9.4
osx_image: xcode10
language: objective-c

env:
- DESTINATION='platform=iOS Simulator,name=iPhone 6S,OS=9.3'
- DESTINATION='platform=iOS Simulator,name=iPhone 7,OS=10.3.1'
- DESTINATION='platform=iOS Simulator,name=iPhone 8,OS=11.4'
- DESTINATION='platform=iOS Simulator,name=iPhone X,OS=11.4'
- DESTINATION='platform=iOS Simulator,name=iPhone X,OS=12.0'

script:
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/OKTableViewLiaison.xcworkspace -scheme OKTableViewLiaison-Example -destination "$DESTINATION" | xcpretty
12 changes: 5 additions & 7 deletions Example/OKTableViewLiaison.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = 886ZPWDXTP;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
TestTargetID = 607FACCF1AFB9204008FA782;
};
};
Expand Down Expand Up @@ -661,7 +661,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -677,7 +677,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -695,8 +695,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -710,8 +709,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
4 changes: 2 additions & 2 deletions Example/OKTableViewLiaison/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
return true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ enum TextTableViewRowFactory {
cell.contentTextLabel.numberOfLines = 0
cell.selectionStyle = .none

let mediumAttributes: [NSAttributedStringKey: Any] = [
let mediumAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.systemFont(ofSize: 13, weight: .medium),
.foregroundColor: UIColor.black
]

let regularAttributes: [NSAttributedStringKey: Any] = [
let regularAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.systemFont(ofSize: 13),
.foregroundColor: UIColor.black
]
Expand Down
23 changes: 14 additions & 9 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Example/Tests/OKTableViewLiaison+UnitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ final class OKTableViewLiaison_UnitTests: XCTestCase {

XCTAssertEqual(row1Height, 100)
XCTAssertEqual(row2Height, 200)
XCTAssertEqual(row3Height, UITableViewAutomaticDimension)
XCTAssertEqual(row3Height, UITableView.automaticDimension)
}

func test_estimatedHeightForRow_properlySetsEstimatedHeightsForRows() {
Expand All @@ -1162,7 +1162,7 @@ final class OKTableViewLiaison_UnitTests: XCTestCase {

XCTAssertEqual(row1Height, 100)
XCTAssertEqual(row2Height, 200)
XCTAssertEqual(row3Height, UITableViewAutomaticDimension)
XCTAssertEqual(row3Height, UITableView.automaticDimension)
}

func test_shouldIndentWhileEditingRow_correctlyReturnsIfRowShouldIndentWhileBeingEdited() {
Expand Down Expand Up @@ -1277,7 +1277,7 @@ final class OKTableViewLiaison_UnitTests: XCTestCase {

XCTAssertEqual(section1Height, 100)
XCTAssertEqual(section2Height, 200)
XCTAssertEqual(section3Height, UITableViewAutomaticDimension)
XCTAssertEqual(section3Height, UITableView.automaticDimension)
}

func test_estimatedHeightForHeader_properlySetsEstimatedHeightsForSectionHeaders() {
Expand Down Expand Up @@ -1335,7 +1335,7 @@ final class OKTableViewLiaison_UnitTests: XCTestCase {

XCTAssertEqual(section1Height, 100)
XCTAssertEqual(section2Height, 200)
XCTAssertEqual(section3Height, UITableViewAutomaticDimension)
XCTAssertEqual(section3Height, UITableView.automaticDimension)
}

func test_estimatedHeightForFooter_properlySetsEstimatedHeightsForSectionFooters() {
Expand Down
8 changes: 4 additions & 4 deletions Example/Tests/OKTableViewRow+UnitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ final class OKTableViewRow_UnitTests: XCTestCase {

func test_setHeight_returnsAutomaticDimensionForSelfSizingRow() {
let row = TestTableViewRow()
XCTAssertEqual(row.height, UITableViewAutomaticDimension)
XCTAssertEqual(row.estimatedHeight, UITableViewAutomaticDimension)
XCTAssertEqual(row.height, UITableView.automaticDimension)
XCTAssertEqual(row.estimatedHeight, UITableView.automaticDimension)
}

func test_removeHeight_removesAPreviouslySetHeight() {
Expand All @@ -71,8 +71,8 @@ final class OKTableViewRow_UnitTests: XCTestCase {
row.remove(height: .height)
row.remove(height: .estimatedHeight)

XCTAssertEqual(row.height, UITableViewAutomaticDimension)
XCTAssertEqual(row.estimatedHeight, UITableViewAutomaticDimension)
XCTAssertEqual(row.height, UITableView.automaticDimension)
XCTAssertEqual(row.estimatedHeight, UITableView.automaticDimension)
}

func test_setPrefetchCommand_setPrefetchCommandClosure() {
Expand Down
8 changes: 4 additions & 4 deletions Example/Tests/OKTableViewSection+UnitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ final class OKTableViewSection_UnitTests: XCTestCase {
let section = OKTableViewSection(componentDisplayOption: .both(headerComponent: TestTableViewSectionComponent(),
footerComponent: TestTableViewSectionComponent()))

XCTAssertEqual(section.calculate(height: .height, for: .header), UITableViewAutomaticDimension)
XCTAssertEqual(section.calculate(height: .height, for: .footer), UITableViewAutomaticDimension)
XCTAssertEqual(section.calculate(height: .height, for: .header), UITableView.automaticDimension)
XCTAssertEqual(section.calculate(height: .height, for: .footer), UITableView.automaticDimension)
}

func test_calculateHeight_returnsZeroForNonSetEstimatedSupplementaryViewsHeights() {
Expand Down Expand Up @@ -130,8 +130,8 @@ final class OKTableViewSection_UnitTests: XCTestCase {
header.remove(height: .estimatedHeight)
footer.remove(height: .estimatedHeight)

XCTAssertEqual(section.calculate(height: .height, for: .header), UITableViewAutomaticDimension)
XCTAssertEqual(section.calculate(height: .height, for: .footer), UITableViewAutomaticDimension)
XCTAssertEqual(section.calculate(height: .height, for: .header), UITableView.automaticDimension)
XCTAssertEqual(section.calculate(height: .height, for: .footer), UITableView.automaticDimension)
XCTAssertEqual(section.calculate(height: .estimatedHeight, for: .header), 0)
XCTAssertEqual(section.calculate(height: .estimatedHeight, for: .footer), 0)
}
Expand Down
Loading

0 comments on commit 0e5a70c

Please sign in to comment.