mirror of
https://github.com/wahyd4/FoodTracker.git
synced 2026-08-09 04:46:38 +10:00
32 lines
519 B
Swift
32 lines
519 B
Swift
//
|
|
// Meal.swift
|
|
// ChineseFoodTracker
|
|
//
|
|
// Created by Junv on 7/1/15.
|
|
// Copyright © 2015 goldendata. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class Meal {
|
|
|
|
//MARK: properties
|
|
var name: String
|
|
var rating: Int
|
|
var photo: UIImage?
|
|
|
|
//MARK: initialization
|
|
init?(name: String, rating: Int, photo: UIImage?){
|
|
self.name = name
|
|
self.rating = rating
|
|
self.photo = photo
|
|
|
|
if name.isEmpty || rating < 0 {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|