This file contains hidden or 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
@objcMembers | |
class DummyTypes: NSObject { | |
@NSManaged var bool: Bool | |
@NSManaged var decimal: Decimal | |
@NSManaged var int: Int | |
@NSManaged var double: Double | |
@NSManaged var url: URL | |
@NSManaged var uuid: UUID | |
@NSManaged var date: Date | |
@NSManaged var string: String |
This file contains hidden or 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 UIImage { | |
var fixOrientationTransform: CGAffineTransform { | |
let angle = CGFloat((imageOrientation.rawValue & 2) >> 1 - ((imageOrientation.rawValue & 1) << 1)) * .pi / 2 | |
let flipX = CGFloat(1 - ((imageOrientation.rawValue & 4) >> 1)) | |
return CGAffineTransform(scaleX: flipX, y: 1).rotated(by: angle) | |
} | |
} |
This file contains hidden or 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
import SwiftUI | |
extension Binding { | |
static func boolify<T: Any>(_ binding: Binding<T?>) -> Binding<Bool> { | |
Binding<Bool> { | |
binding.wrappedValue != nil | |
} set: { newValue in | |
guard !newValue else { | |
assertionFailure() | |
return |
OlderNewer