Skip to content

Commit

Permalink
Update to Swift 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Limbach committed Sep 18, 2018
1 parent 369ada2 commit 6b44c09
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github "SnapKit/SnapKit" "4.0.0"
github "SwiftKickMobile/SwiftMessages" "4.1.2"
github "SnapKit/SnapKit" "4.0.1"
github "SwiftKickMobile/SwiftMessages" "4.1.4"
github "SwipeCellKit/SwipeCellKit" "1.9.1"
github "eggswift/ESTabBarController" "2.6.2"
github "fahlout/PasswordExtension" "4.1.2"
Expand Down
15 changes: 8 additions & 7 deletions Timeu.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -435,16 +435,18 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0930;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Sebastian Limbach";
TargetAttributes = {
FD8D548120853DCC004F1C85 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
TestTargetID = FDD678651F7D9051002F4D33;
};
FDD678651F7D9051002F4D33 = {
CreatedOnToolsVersion = 9.0;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -617,7 +619,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.sebastianlimbach.TimeuUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = Timeu;
};
Expand All @@ -634,7 +636,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.sebastianlimbach.TimeuUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = Timeu;
};
Expand Down Expand Up @@ -768,8 +770,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.sebastianlimbach.Timeu;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_WHOLE_MODULE_OPTIMIZATION = YES;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -788,8 +789,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.sebastianlimbach.Timeu;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_WHOLE_MODULE_OPTIMIZATION = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion Timeu.xcodeproj/xcshareddata/xcschemes/Timeu.xcscheme
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 = "1000"
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 = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Timeu/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
resetStateForUITesting()
UIApplication.shared.isStatusBarHidden = false
window = UIWindow(frame: UIScreen.main.bounds)
Expand Down
6 changes: 3 additions & 3 deletions Timeu/Login/Controller/LoginViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ class LoginViewController: UIViewController {
NotificationCenter.default.addObserver(
self,
selector: #selector(keyboardWillShow),
name: NSNotification.Name.UIKeyboardWillShow,
name: UIResponder.keyboardWillShowNotification,
object: nil
)
NotificationCenter.default.addObserver(
self,
selector: #selector(keyboardWillHide),
name: NSNotification.Name.UIKeyboardWillHide,
name: UIResponder.keyboardWillHideNotification,
object: nil
)
}

@objc private func keyboardWillShow(notification: NSNotification) {
if let keyboardSize = (notification.userInfo?[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue {
if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue {
let keyboardHeight = keyboardSize.height
var newContentInset = loginView.scrollViewInset
newContentInset.bottom = keyboardHeight
Expand Down
4 changes: 2 additions & 2 deletions Timeu/Login/View/LoginButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import UIKit
class LoginButton: UIButton {

struct ButtonState {
var state: UIControlState
var state: UIControl.State
var title: String?
var image: UIImage?
}
Expand Down Expand Up @@ -75,7 +75,7 @@ class LoginButton: UIButton {
func showLoading() {
activityIndicator.startAnimating()
var buttonStates: [ButtonState] = []
for state in [UIControlState.disabled] {
for state in [UIControl.State.disabled] {
let buttonState = ButtonState(state: state, title: title(for: state), image: image(for: state))
buttonStates.append(buttonState)
setTitle("", for: state)
Expand Down
2 changes: 1 addition & 1 deletion Timeu/Login/View/LoginView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class LoginView: UIView {
addSubview(backgroundImageView)
addSubview(appLogoView)
addSubview(scrollView)
bringSubview(toFront: appLogoView)
bringSubviewToFront(appLogoView)
scrollView.addSubview(contentView)
contentView.addSubview(kimaiURLInput)
contentView.addSubview(usernameInput)
Expand Down
2 changes: 1 addition & 1 deletion Timeu/TabBar/Views/TabBarAddItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TabBarAddItemView: ESTabBarItemContentView {

let transform = CGAffineTransform.identity
imageView.transform = transform
superview?.bringSubview(toFront: self)
superview?.bringSubviewToFront(self)

insets = UIEdgeInsets(top: -22, left: 0, bottom: 0, right: 0)
iconColor = UIColor.init(white: 255.0 / 255.0, alpha: 1.0)
Expand Down
2 changes: 1 addition & 1 deletion Timeu/Timesheet/Controller/ActivityTableViewDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ActivityTableViewDelegate: NSObject, UITableViewDelegate {
if section == 0 {
return CGFloat.leastNonzeroMagnitude
}
return UITableViewAutomaticDimension
return UITableView.automaticDimension
}

func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
Expand Down
4 changes: 2 additions & 2 deletions Timeu/Timesheet/View/ActivityStatsTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ActivityStatsTableViewCell: UITableViewCell {
let collectionView: UICollectionView = {
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .horizontal
layout.estimatedItemSize = UICollectionViewFlowLayoutAutomaticSize
layout.estimatedItemSize = UICollectionViewFlowLayout.automaticSize
layout.sectionInset = UIEdgeInsets.init(top: 0, left: 20, bottom: 0, right: 20)
layout.minimumInteritemSpacing = 20
layout.minimumLineSpacing = 20
Expand All @@ -29,7 +29,7 @@ class ActivityStatsTableViewCell: UITableViewCell {
return collectionView
}()

override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
backgroundColor = .clear
selectionStyle = .none
Expand Down
4 changes: 2 additions & 2 deletions Timeu/Timesheet/View/ActivityTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ class ActivityTableView: UITableView {
case activityStatsCell = "tableViewCellWithCollectionView"
}

override init(frame: CGRect, style: UITableViewStyle) {
override init(frame: CGRect, style: UITableView.Style) {
super.init(frame: frame, style: style)
backgroundColor = .timeuGray
separatorStyle = .none
estimatedRowHeight = 50
rowHeight = UITableViewAutomaticDimension
rowHeight = UITableView.automaticDimension
estimatedSectionHeaderHeight = 50
refreshControl = UIRefreshControl()

Expand Down
2 changes: 1 addition & 1 deletion Timeu/Timesheet/View/ActivityTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class ActivityTableViewCell: SwipeTableViewCell {
super.init(coder: aDecoder)
}

override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)

backgroundColor = UIColor.clear
Expand Down

0 comments on commit 6b44c09

Please sign in to comment.