Skip to content

Commit

Permalink
Merge pull request #93 from wendyliga/master
Browse files Browse the repository at this point in the history
remove deprecated stuff and migrate to swift 5
RobertGummesson authored Jun 3, 2019
2 parents e792b34 + ca8b9fa commit 101e567
Showing 4 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions BuildTimeAnalyzer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -257,18 +257,18 @@
TargetAttributes = {
2AF8213F1D21D6B900D65186 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
2AF8214E1D21D6B900D65186 = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
TestTargetID = 2AF8213F1D21D6B900D65186;
};
};
};
buildConfigurationList = 2AF8213B1D21D6B900D65186 /* Build configuration list for PBXProject "BuildTimeAnalyzer" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -462,7 +462,7 @@
PRODUCT_BUNDLE_IDENTIFIER = uk.co.canemedia.BuildTimeAnalyzer;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "BuildTimeAnalyzerTests-Bridging-Header.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -476,7 +476,7 @@
PRODUCT_BUNDLE_IDENTIFIER = uk.co.canemedia.BuildTimeAnalyzer;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "BuildTimeAnalyzerTests-Bridging-Header.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -492,7 +492,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "BuildTimeAnalyzerTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BuildTimeAnalyzer.app/Contents/MacOS/BuildTimeAnalyzer";
};
name = Debug;
@@ -508,7 +508,7 @@
PRODUCT_BUNDLE_IDENTIFIER = uk.co.canemedia.BuildTimeAnalyzerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "BuildTimeAnalyzerTests-Bridging-Header.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BuildTimeAnalyzer.app/Contents/MacOS/BuildTimeAnalyzer";
};
name = Release;
2 changes: 1 addition & 1 deletion BuildTimeAnalyzer/ProjectSelection.swift
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ extension ProjectSelection: NSTableViewDataSource {
extension ProjectSelection: NSTableViewDelegate {

func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
guard let tableColumn = tableColumn, let columnIndex = tableView.tableColumns.index(of: tableColumn) else { return nil }
guard let tableColumn = tableColumn, let columnIndex = tableView.tableColumns.firstIndex(of: tableColumn) else { return nil }

let cellView = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "Cell\(columnIndex)"), owner: self) as? NSTableCellView

4 changes: 2 additions & 2 deletions BuildTimeAnalyzer/RawMeasure.swift
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ func ==(lhs: RawMeasure, rhs: RawMeasure) -> Bool {
// MARK: Hashable

extension RawMeasure: Hashable {
var hashValue: Int {
return time.hashValue ^ text.hashValue
func hash(into hasher: inout Hasher) {
hasher.combine(time.hashValue ^ text.hashValue)
}
}
4 changes: 2 additions & 2 deletions BuildTimeAnalyzer/ViewController.swift
Original file line number Diff line number Diff line change
@@ -162,7 +162,7 @@ class ViewController: NSViewController {
projectSelection.listFolders()
}

override func controlTextDidChange(_ obj: Notification) {
func controlTextDidChange(_ obj: Notification) {
if let field = obj.object as? NSSearchField, field == searchField {
dataSource.filter = searchField.stringValue
tableView.reloadData()
@@ -288,7 +288,7 @@ extension ViewController: NSTableViewDataSource {

extension ViewController: NSTableViewDelegate {
func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
guard let tableColumn = tableColumn, let columnIndex = tableView.tableColumns.index(of: tableColumn) else { return nil }
guard let tableColumn = tableColumn, let columnIndex = tableView.tableColumns.firstIndex(of: tableColumn) else { return nil }
guard let item = dataSource.measure(index: row) else { return nil }

let result = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "Cell\(columnIndex)"), owner: self) as? NSTableCellView

0 comments on commit 101e567

Please sign in to comment.