Skip to content

Instantly share code, notes, and snippets.

@rorodriguez116
Last active October 22, 2020 15:22
Show Gist options
  • Save rorodriguez116/02c642fc4ef4a502346438bf13c352be to your computer and use it in GitHub Desktop.
Save rorodriguez116/02c642fc4ef4a502346438bf13c352be to your computer and use it in GitHub Desktop.
AlertError and Photo struct declarations.
public struct Photo: Identifiable, Equatable {
// The ID of the captured photo
public var id: String
// Data representation of the captured photo
public var originalData: Data
public init(id: String = UUID().uuidString, originalData: Data) {
self.id = id
self.originalData = originalData
}
}
public struct AlertError {
public var title: String = ""
public var message: String = ""
public var primaryButtonTitle = "Accept"
public var secondaryButtonTitle: String?
public var primaryAction: (() -> ())?
public var secondaryAction: (() -> ())?
public init(title: String = "", message: String = "", primaryButtonTitle: String = "Accept", secondaryButtonTitle: String? = nil, primaryAction: (() -> ())? = nil, secondaryAction: (() -> ())? = nil) {
self.title = title
self.message = message
self.primaryAction = primaryAction
self.primaryButtonTitle = primaryButtonTitle
self.secondaryAction = secondaryAction
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment