Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Swift version 4 2 update #250

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1
4.2
3 changes: 1 addition & 2 deletions LayoutKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'LayoutKit'
spec.version = '10.1.0'
spec.version = '10.1.1'
spec.license = { :type => 'Apache License, Version 2.0' }
spec.homepage = 'http://layoutkit.org'
spec.authors = 'LinkedIn'
Expand Down Expand Up @@ -42,4 +42,3 @@ Pod::Spec.new do |spec|
]

end

44 changes: 35 additions & 9 deletions LayoutKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@
7EEA2AC7201D18F20077A088 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
7EEA2ACC201D1FE90077A088 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
7EECD0612053916C003DC4B1 /* LayoutKitObjC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LayoutKitObjC.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7EECD0622053916C003DC4B1 /* LayoutKit-iOS copy-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "LayoutKit-iOS copy-Info.plist"; path = "/Users/staguer/ws/lk0/LayoutKit-iOS copy-Info.plist"; sourceTree = "<absolute>"; };
A189721021B8BB3B00DDA616 /* EmbeddedLayoutTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmbeddedLayoutTests.swift; sourceTree = "<group>"; };
AD2C36421EA5AF9500550A03 /* ReloadableViewLayoutAdapterCollectionViewOverrideTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReloadableViewLayoutAdapterCollectionViewOverrideTests.swift; sourceTree = "<group>"; };
ADE5FCBF1EA5B5C8006A3DC2 /* ReloadableViewLayoutAdapterTableViewOverrideTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReloadableViewLayoutAdapterTableViewOverrideTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -672,7 +671,6 @@
7EEA2AB7201D18F20077A088 /* LayoutKitObjCSampleApp */,
0BCB75601D8720110065E02A /* Products */,
7EEA2ACE201D24530077A088 /* Frameworks */,
7EECD0622053916C003DC4B1 /* LayoutKit-iOS copy-Info.plist */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -1156,52 +1154,60 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
TargetAttributes = {
0B2D09AF1D8735E1007E487C = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0800;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
0BCB755E1D8720110065E02A = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0800;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
0BCB75671D8720110065E02A = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
0BCB757B1D8721370065E02A = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
0BCB75831D8721370065E02A = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
0BCB75971D8722370065E02A = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
0BCB759F1D8722370065E02A = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
0BCB75B51D8723B30065E02A = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0800;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
7EEA2AB5201D18F20077A088 = {
CreatedOnToolsVersion = 9.2;
ProvisioningStyle = Automatic;
};
7EECD00E2053916C003DC4B1 = {
LastSwiftMigration = 1020;
};
};
};
buildConfigurationList = 0BCB75571D871FC40065E02A /* Build configuration list for PBXProject "LayoutKit" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -1730,6 +1736,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand Down Expand Up @@ -1777,6 +1784,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand All @@ -1785,6 +1793,7 @@
0BCB75581D871FC40065E02A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
Expand Down Expand Up @@ -1812,13 +1821,14 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
SWIFT_VERSION = 4.1;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
0BCB75591D871FC40065E02A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
Expand All @@ -1845,7 +1855,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_VERSION = 4.1;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down Expand Up @@ -1908,6 +1918,7 @@
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -1965,6 +1976,7 @@
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -2023,6 +2035,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand Down Expand Up @@ -2069,6 +2082,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down Expand Up @@ -2130,6 +2144,7 @@
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -2186,6 +2201,7 @@
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES;
Expand Down Expand Up @@ -2243,6 +2259,7 @@
SDKROOT = appletvos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 9.2;
};
name = Debug;
Expand Down Expand Up @@ -2288,6 +2305,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TVOS_DEPLOYMENT_TARGET = 9.2;
VALIDATE_PRODUCT = YES;
};
Expand Down Expand Up @@ -2353,6 +2371,7 @@
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -2410,6 +2429,7 @@
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -2467,6 +2487,7 @@
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand Down Expand Up @@ -2514,6 +2535,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down Expand Up @@ -2575,6 +2597,7 @@
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -2631,6 +2654,7 @@
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -2773,6 +2797,7 @@
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -2830,6 +2855,7 @@
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
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 = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
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 = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
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 = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
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 = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
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 = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
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 = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
5 changes: 2 additions & 3 deletions LayoutKitObjC.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'LayoutKitObjC'
spec.version = '10.1.0'
spec.version = '10.1.1'
spec.license = { :type => 'Apache License, Version 2.0' }
spec.homepage = 'http://layoutkit.org'
spec.authors = 'LinkedIn'
Expand Down Expand Up @@ -45,8 +45,7 @@ Pod::Spec.new do |spec|

# Excluded due to "'systemFontSize' is unavailable"
'Sources/ObjCSupport/Builders/LOKLabelLayoutBuilder.*',
'Sources/ObjCSupport/LOKLabelLayout.swift'
'Sources/ObjCSupport/LOKLabelLayout.swift'
]

end

2 changes: 1 addition & 1 deletion LayoutKitSampleApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = UINavigationController(rootViewController: MenuViewController())
window?.makeKeyAndVisible()
Expand Down
4 changes: 2 additions & 2 deletions LayoutKitSampleApp/Benchmarks/TableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class TableViewController<ContentViewType: UIView>: UITableViewController where

init(data: [CellType.DataType]) {
self.data = data
super.init(style: UITableViewStyle.grouped)
super.init(style: UITableView.Style.grouped)
}

required init?(coder aDecoder: NSCoder) {
Expand All @@ -52,7 +52,7 @@ class TableViewController<ContentViewType: UIView>: UITableViewController where
}

override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableViewAutomaticDimension
return UITableView.automaticDimension
}
}

Expand Down
6 changes: 3 additions & 3 deletions LayoutKitTests/LabelLayoutTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class LabelLayoutTests: XCTestCase {
}

func testAttributedLabel() {
let attributedText = NSAttributedString(string: "Hi", attributes: [NSAttributedStringKey.font: UIFont.helvetica(size: 42)])
let attributedText = NSAttributedString(string: "Hi", attributes: [NSAttributedString.Key.font: UIFont.helvetica(size: 42)])
let font = UIFont.helvetica(size: 99)

let arrangement = LabelLayout(attributedText: attributedText, font: font).arrangement()
Expand Down Expand Up @@ -122,7 +122,7 @@ class LabelLayoutTests: XCTestCase {
func testAttributedTextCustomFont() {
#if !os(tvOS) // tvOS doesn't currently support custom fonts
let font = UIFont(name: "Papyrus", size: 20)!
let attributes = [NSAttributedStringKey.font: font]
let attributes = [NSAttributedString.Key.font: font]
let text = NSAttributedString(string: "Hello! 😄😄😄", attributes: attributes)

let arrangement = LabelLayout(attributedText: text).arrangement()
Expand All @@ -136,7 +136,7 @@ class LabelLayoutTests: XCTestCase {
#if !os(tvOS) // tvOS doesn't currently support custom fonts
let font = UIFont(name: "Papyrus", size: 20)!
let text = NSMutableAttributedString(string: "Hello world! 😄😄😄")
text.addAttribute(NSAttributedStringKey.font, value: font, range: NSMakeRange(6, 6))
text.addAttribute(NSAttributedString.Key.font, value: font, range: NSMakeRange(6, 6))

let arrangement = LabelLayout(attributedText: text).arrangement()
let label = UILabel(attributedText: text)
Expand Down
Loading