Conversation
keith
left a comment
There was a problem hiding this comment.
Did a first pass, this looks great! I’ll look at the key path stuff soon
Brisk/AppDelegate.swift
Outdated
|
|
||
| private func setupStatusItem() { | ||
| let image = NSImage(named: "StatusItemIcon")! | ||
| let image = NSImage(named: NSImage.Name(rawValue: "StatusItemIcon"))! |
There was a problem hiding this comment.
Haha, super weird this isn’t the same as UIKit
There was a problem hiding this comment.
could use an image literal, but I think it's not supported on older macs
There was a problem hiding this comment.
the docs say this type is 10.13+, but I assume that's not actually true
| extension NSStatusItem { | ||
| static func create(image: NSImage, menu: NSMenu) -> NSStatusItem { | ||
| let statusItem = NSStatusBar.system().statusItem(withLength: NSVariableStatusItemLength) | ||
| let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength) |
There was a problem hiding this comment.
Can you omit the enum or is this just a constant?
There was a problem hiding this comment.
.variableLength seems to be a CGFloat, so NSStatusItem can't be omitted
| import AppKit | ||
|
|
||
| private let kMainStoryboard = NSStoryboard(name: "Main", bundle: nil) | ||
| private let kMainStoryboard = NSStoryboard(name: NSStoryboard.Name(rawValue: "Main"), bundle: nil) |
There was a problem hiding this comment.
So there’s no string one for this either?
There was a problem hiding this comment.
I couldn't find anyhing simpler…
There was a problem hiding this comment.
You can change NSStoryboard.Name to .init and that'll also solve the line length here
| extension NSTextView { | ||
| var stringValue: String { | ||
| return self.string ?? "" | ||
| return self.string |
There was a problem hiding this comment.
Nice. I wonder if we can remove this property now
| extension NSTextView: Validatable { | ||
| var isValid: Bool { | ||
| return self.string?.isEmpty == false | ||
| return self.string.isEmpty == false |
There was a problem hiding this comment.
We can use ! Here instead of == false now
|
Thanks @keith! I did the little string things |
Brisk/Models/OpenRadar.swift
Outdated
| public var steps: String? | ||
| public var version: String? | ||
| fileprivate var appendingToActual: String? { | ||
| get { return actual } |
Brisk/Models/OpenRadar.swift
Outdated
| public var version: String? | ||
| fileprivate var appendingToActual: String? { | ||
| get { return actual } | ||
| set { actual = appendOrReturn(actual, newValue) } |
| private var files: [String] { | ||
| return self.draggingPasteboard().propertyList(forType: NSFilenamesPboardType) as? [String] ?? [] | ||
| private var files: [URL] { | ||
| let asStrings = self.draggingPasteboard().propertyList(forType: makeFileNameType()) as? [String] ?? [] |
There was a problem hiding this comment.
You can replace makeFileNameType inline with .init(rawValue: "foo") for this case IMO
There was a problem hiding this comment.
I left the makeFileNameType() in place as it is used twice and gives room for the explainatory comment. Maybe in the future somebody with more thorough macOS SDK knowledge than me could find a way to use the enum and not stringy version.
|
I think the build is failing here because of SWIFT_VERSION + Pods, you can apply this patch: diff --git i/Podfile w/Podfile
index 66fb2ac..9066034 100644
--- i/Podfile
+++ w/Podfile
@@ -13,4 +13,10 @@ end
post_install do |installer|
installer.pods_project.root_object.attributes["LastUpgradeCheck"] = "9999"
+
+ installer.pods_project.targets.each do |target|
+ target.build_configurations.each do |config|
+ config.build_settings["SWIFT_VERSION"] = "4.0"
+ end
+ end
endAnd it should fix that |
|
Lint is failing here too, I think there's a false positive because I haven't updated it in a while, trying it locally. There's also some long lines, currently we require a max of 110 columns, see the log for where |
Brisk/Models/OpenRadar.swift
Outdated
| "observed results": \.appendingToActual, | ||
| "steps to reproduce": \.steps, | ||
| "summary": \.description, | ||
| "version": \.version |
There was a problem hiding this comment.
please add a trailing comma so the diff if we add another field will be smaller
|
Also please add a changelog entry here under enhancements |
|
I don't see that lint failure locally with either version, I'll land #130 and you can rebase and hopefully it'll pass |
|
I rebased, then did the other things, starting d4d28ae. |
| ## Enhancements | ||
|
|
||
| - None. | ||
| - Update project to Swift 4.0 and Xcode 9.2 |
There was a problem hiding this comment.
Please include the URL here like below
There was a problem hiding this comment.
oh sure, I overlooked that
- Swift seems just a nicer named alias for objective-c
|
Travis was still set to xcode8.3, which doesn't support swift 4… |
|
Ah can you update it to 9.2 in this PR?
…--
Keith Smiley
On Jan 18, 2018, at 00:18, Hannes Oud ***@***.***> wrote:
Travis was still set to xcode8.3, which doesn't support swift 4…
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
Yep, did that. |
|
Ah the problem now is we need to upgrade Sonar once I merge this PR br1sk/Sonar#33 I'm just waiting on CI |
|
That's merged so you can |
|
Yay, the checks have passed, @keith I think we could merge this now? |
|
Thanks for doing this! |
|
🎉 |
What this contains
Tests