mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
9 lines
328 B
Swift
9 lines
328 B
Swift
import Foundation
|
|
|
|
extension Optional {
|
|
/// Note that this is lossy when setting, so you can really only set it to nil, but this is sufficient for mapping `Binding<Item?>` to `Binding<Bool>` for Alerts, Popovers, etc.
|
|
var isNotNil: Bool {
|
|
get { self != nil }
|
|
set { self = newValue ? self : nil }
|
|
}
|
|
}
|