This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Optional { | |
var isNotNil: Bool { | |
return self != nil | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MVVM.swift | |
// ios-app | |
// | |
// Created by xue qi liao on 9/28/23. | |
// | |
// FIXME: this entire protocol stack needs to be related, as in ONE set of MVVM should be | |
// related and we shouldn't be passing unrelated Models to unrelated ViewModels or Views | |
// but that is beyond the scope of MVP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension ComparisonResult { | |
func reversed() -> ComparisonResult { | |
switch self { | |
case .orderedAscending: | |
return .orderedDescending | |
case .orderedDescending: | |
return .orderedAscending | |
case .orderedSame: | |
return .orderedSame | |
} |