Skip to content

Commit

Permalink
Support iOS 12 and Swift 4.2 #12
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanhuang13 committed Sep 21, 2018
1 parent 50b4dde commit f428fc7
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Added
- Support iOS 12 and Swift 4.2 #12

### Fixed
- Universal Links plural
- Link composer use form sheet for iPad #7
Expand Down
20 changes: 12 additions & 8 deletions Knil.xcodeproj/project.pbxproj
Expand Up @@ -625,19 +625,23 @@
TargetAttributes = {
6C0D218E20E0F2A600FBFA86 = {
CreatedOnToolsVersion = 9.4.1;
LastSwiftMigration = 1000;
};
6C0D21DC20E0F6B000FBFA86 = {
CreatedOnToolsVersion = 9.4.1;
LastSwiftMigration = 1000;
};
6C0D21E420E0F6B000FBFA86 = {
CreatedOnToolsVersion = 9.4.1;
TestTargetID = 6C0D218E20E0F2A600FBFA86;
};
6C0D21FF20E0F6B900FBFA86 = {
CreatedOnToolsVersion = 9.4.1;
LastSwiftMigration = 1000;
};
6C0D220720E0F6B900FBFA86 = {
CreatedOnToolsVersion = 9.4.1;
LastSwiftMigration = 1000;
TestTargetID = 6C0D218E20E0F2A600FBFA86;
};
};
Expand Down Expand Up @@ -971,7 +975,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.elaborapp.Knil;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -990,7 +994,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.elaborapp.Knil;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand All @@ -1017,7 +1021,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.elaborapp.KnilUIKit;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -1046,7 +1050,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.elaborapp.KnilUIKit;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -1115,7 +1119,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.elaborapp.KnilKit;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -1144,7 +1148,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.elaborapp.KnilKit;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -1165,7 +1169,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.elaborapp.KnilKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Knil.app/Knil";
};
Expand All @@ -1185,7 +1189,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.elaborapp.KnilKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Knil.app/Knil";
};
Expand Down
4 changes: 2 additions & 2 deletions Knil/App/AppDelegate.swift
Expand Up @@ -19,7 +19,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return UIPasteboard.general.string
}()

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

UIView.appearance().tintColor = .tint
Expand Down Expand Up @@ -51,7 +51,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

if let pasteboardString = UIPasteboard.general.string,
pasteboardString != currentPasteboardString {
NotificationCenter.default.post(name: .UIPasteboardChanged, object: nil)
NotificationCenter.default.post(name: UIPasteboard.changedNotification, object: nil)
currentPasteboardString = pasteboardString
}
}
Expand Down
2 changes: 1 addition & 1 deletion KnilUIKit/DetailViewController/DetailViewController.swift
Expand Up @@ -46,7 +46,7 @@ class DetailViewController: UITableViewController {
self.reloadData()
})

NotificationCenter.default.addObserver(self, selector: #selector(pasteboardDidChange), name: .UIPasteboardChanged, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(pasteboardDidChange), name: UIPasteboard.changedNotification, object: nil)

reloadData()
}
Expand Down
2 changes: 1 addition & 1 deletion KnilUIKit/ListViewController/ListViewController.swift
Expand Up @@ -39,7 +39,7 @@ public class ListViewController: UITableViewController {
navigationItem.title = "AASA".localized()
navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(presentAddingAASAAlertController))

NotificationCenter.default.addObserver(self, selector: #selector(appWillResignActive), name: .UIApplicationWillResignActive, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(appWillResignActive), name: UIApplication.willResignActiveNotification, object: nil)

reloadData()
}
Expand Down
12 changes: 6 additions & 6 deletions KnilUIKit/ViewModels/TableViewCellViewModel.swift
Expand Up @@ -16,19 +16,19 @@ public struct TableViewCellViewModel {
let subtitle: String?
let image: UIImage?
let reuseIdentifier: String
let cellStyle: UITableViewCellStyle
let selectionStyle: UITableViewCellSelectionStyle
let accessoryType: UITableViewCellAccessoryType
let cellStyle: UITableViewCell.CellStyle
let selectionStyle: UITableViewCell.SelectionStyle
let accessoryType: UITableViewCell.AccessoryType
let editActions: [UITableViewRowAction]
var selectAction: Closure
var detailAction: Closure

public init(title: String,
subtitle: String? = nil,
image: UIImage? = nil,
cellStyle: UITableViewCellStyle = .default,
selectionStyle: UITableViewCellSelectionStyle = .default,
accessoryType: UITableViewCellAccessoryType = .disclosureIndicator,
cellStyle: UITableViewCell.CellStyle = .default,
selectionStyle: UITableViewCell.SelectionStyle = .default,
accessoryType: UITableViewCell.AccessoryType = .disclosureIndicator,
editActions: [UITableViewRowAction] = [],
selectAction: @escaping Closure = {},
detailAction: @escaping Closure = {}
Expand Down
2 changes: 1 addition & 1 deletion KnilUIKit/ViewModels/TableViewViewModel.swift
Expand Up @@ -60,7 +60,7 @@ public class TableViewViewModel: NSObject, UITableViewDataSource, UITableViewDel
cellViewModel.detailAction()
}

public func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCellEditingStyle {
public func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle {
return .none
}

Expand Down

0 comments on commit f428fc7

Please sign in to comment.