Closed ashfurrow closed 8 years ago
This PR: https://github.com/artsy/eidolon/pull/496
Ran the converter, which failed shortly after beginning.
Further ideas:
isEmpty
could have a corresponding isNotEmpty
. (Done)isEmpty
should be able to be used on optional strings. (Done)text
property. Quick/Nimble update was painless :star2:
Great!! Feedback always appreciated on other sore spots, feature requests, etc.
:bow: Thanks Brian!
As for the isNotEmpty
on (optional?) strings, the solution isn't that complex:
public protocol Occupiable {
var isEmpty: Bool { get }
var isNotEmpty: Bool { get }
}
public extension Occupiable {
public var isNotEmpty: Bool {
return !isEmpty
}
}
extension String: Occupiable { }
public extension Optional where Wrapped: Occupiable {
var isNilOrEmpty: Bool {
return self?.isEmpty ?? false
}
var isNotNilNotEmpty: Bool {
return !isNilOrEmpty
}
}
I just don't know if this is a good idea. I mean, why not, eh? But it doesn't seem very idiomatic.
Also, need to remove public
everywhere. We have @testable
now.
Expectations vs reality, sore spots, easy wins, ways to avoid hard times migrating to Swift 2.1, reasons why to/to not migrate now, lessons learnt.