Files
SwiftUI/Examples/Interfacing With UIKit/Complete/Landmarks/Landmarks/Models/Profile.swift
2019-06-06 22:24:34 +03:00

31 lines
819 B
Swift
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
See LICENSE folder for this samples licensing information.
Abstract:
An object that models a user profile.
*/
import Foundation
struct Profile {
var username: String
var prefersNotifications: Bool
var seasonalPhoto: Season
var goalDate: Date
static let `default` = Self(username: "g_kumar", prefersNotifications: true, seasonalPhoto: .winter)
init(username: String, prefersNotifications: Bool = true, seasonalPhoto: Season = .winter) {
self.username = username
self.prefersNotifications = prefersNotifications
self.seasonalPhoto = seasonalPhoto
self.goalDate = Date()
}
enum Season: String, CaseIterable {
case spring = "🌷"
case summer = "🌞"
case autumn = "🍂"
case winter = "☃️"
}
}