Commit 9f09736d authored by Ravi Lonberg's avatar Ravi Lonberg

final version, lunch fully functional

parent e3401f1b
......@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
412FE4271CD6D0E000A6BF7B /* LunchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 412FE4261CD6D0E000A6BF7B /* LunchViewController.swift */; };
412FE4291CD6F8B300A6BF7B /* LunchTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 412FE4281CD6F8B300A6BF7B /* LunchTableViewController.swift */; };
41B6F8841CD03FB200914B6E /* BreakfastConfirmViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41B6F8831CD03FB200914B6E /* BreakfastConfirmViewController.swift */; };
41E42F911CB6E3B000E4B733 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41E42F901CB6E3B000E4B733 /* AppDelegate.swift */; };
41E42F931CB6E3B000E4B733 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41E42F921CB6E3B000E4B733 /* ViewController.swift */; };
......@@ -37,6 +39,8 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
412FE4261CD6D0E000A6BF7B /* LunchViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LunchViewController.swift; sourceTree = "<group>"; };
412FE4281CD6F8B300A6BF7B /* LunchTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LunchTableViewController.swift; sourceTree = "<group>"; };
41B6F8831CD03FB200914B6E /* BreakfastConfirmViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BreakfastConfirmViewController.swift; sourceTree = "<group>"; };
41E42F8D1CB6E3B000E4B733 /* BOSios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BOSios.app; sourceTree = BUILT_PRODUCTS_DIR; };
41E42F901CB6E3B000E4B733 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
......@@ -106,6 +110,8 @@
41E42F901CB6E3B000E4B733 /* AppDelegate.swift */,
41E42F921CB6E3B000E4B733 /* ViewController.swift */,
41E42F941CB6E3B000E4B733 /* Main.storyboard */,
412FE4281CD6F8B300A6BF7B /* LunchTableViewController.swift */,
412FE4261CD6D0E000A6BF7B /* LunchViewController.swift */,
41B6F8831CD03FB200914B6E /* BreakfastConfirmViewController.swift */,
41E42F971CB6E3B000E4B733 /* Assets.xcassets */,
41E42F991CB6E3B000E4B733 /* LaunchScreen.storyboard */,
......@@ -268,9 +274,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
412FE4291CD6F8B300A6BF7B /* LunchTableViewController.swift in Sources */,
41E42F931CB6E3B000E4B733 /* ViewController.swift in Sources */,
41E42F911CB6E3B000E4B733 /* AppDelegate.swift in Sources */,
41E93BC01CD007B000A7DC6C /* BreakfastViewController.swift in Sources */,
412FE4271CD6D0E000A6BF7B /* LunchViewController.swift in Sources */,
41B6F8841CD03FB200914B6E /* BreakfastConfirmViewController.swift in Sources */,
41E93BC21CD00D9700A7DC6C /* BreakfastTableViewController.swift in Sources */,
);
......
......@@ -29,6 +29,11 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "ALaCarte.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "AppetizersSides.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "Hamburger:BreakfastSandwich.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "Omelette.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "Sandwich.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -45,7 +45,8 @@ class BreakfastViewController: UIViewController {
if OMLTswitch.on {
item += "\n in a " + OMLTwrap.currentTitle! + " wrap\n"
}
orderStatus.text.appendContentsOf("\n")
orderStatus.text.appendContentsOf(OMSI.text)
orderStatus.text.appendContentsOf(item)
}
......@@ -112,10 +113,13 @@ class BreakfastViewController: UIViewController {
if Int(ALAotherCount.currentTitle!) > 0 {
item += "\n " + ALAotherCount.currentTitle! + " " + ALAotherChoices.currentTitle!
}
orderStatus.text.appendContentsOf("\n")
orderStatus.text.appendContentsOf(ALAspecialInstructions.text)
orderStatus.text.appendContentsOf(item + "\n")
}
@IBOutlet weak var omeletSI: UITextView!
@IBOutlet weak var OMSI: UITextView!
// outlets
......@@ -187,7 +191,8 @@ class BreakfastViewController: UIViewController {
if additionalEgg.on {
item += "\n with additional egg\n"
}
orderStatus.text.appendContentsOf("\n")
orderStatus.text.appendContentsOf(omeletSI.text)
orderStatus.text.appendContentsOf(item)
}
......
//
// LunchTableViewController.swift
// BOSios
//
// Created by Ravi Lonberg on 5/1/16.
// Copyright © 2016 Ravi Lonberg. All rights reserved.
//
import UIKit
class LunchTableViewController: UITableViewController {
let breads:[String] = ["White","Wheat","Rye","Croissant","Biscuit","Bagel", "English Muffin"]
let cheeses:[String] = ["American", "Cheddar", "Pepperjack", "Swiss", "Provolone"]
let proteins:[String] = ["Bacon", "Ham", "Turkey", "Turkey", "Tofu", "No Protein"]
let alaToast:[String] = ["White","Rye","Wheat","Whole Wheat","English Muffin", "Biscuit", "Bagel", "Croissant", "Whole Wheat English Muffin"]
let alaEgg:[String] = ["Scrambled", "Sunny Side Up", "Over Easy", "Over Medium", "Over Hard"]
let alaOther:[String] = ["Breakfast Potatoes", "French Toast", "Pancakes", "Choc. Chip Pancakes"]
let omltVeggies:[String] = ["Onions", "Peppers", "Spinach", "Broccoli", "Tomatoes", "Mushrooms"]
let omltWrap:[String] = ["White", "Wheat"]
let defaults:[String] = ["option1", "option2", "option3"]
var viaSegue = ""
var workingOptions:[String] = []
override func viewDidLoad() {
super.viewDidLoad()
switch viaSegue {
case "Breads":
workingOptions = breads
case "Cheeses":
workingOptions = cheeses
default:
workingOptions = defaults
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Table view data source
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return workingOptions.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("reuse", forIndexPath: indexPath)
cell.textLabel?.text = workingOptions[indexPath.row]
return cell
}
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
optionPass.setTitle(workingOptions[indexPath.row], forState: UIControlState.Normal)
}
/*
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("reuseIdentifier", forIndexPath: indexPath)
// Configure the cell...
return cell
}
*/
/*
// Override to support conditional editing of the table view.
override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
// Return false if you do not want the specified item to be editable.
return true
}
*/
/*
// Override to support editing the table view.
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if editingStyle == .Delete {
// Delete the row from the data source
tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade)
} else if editingStyle == .Insert {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
override func tableView(tableView: UITableView, moveRowAtIndexPath fromIndexPath: NSIndexPath, toIndexPath: NSIndexPath) {
}
*/
/*
// Override to support conditional rearranging of the table view.
override func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool {
// Return false if you do not want the item to be re-orderable.
return true
}
*/
}
//
// LunchViewController.swift
// BOSios
//
// Created by Ravi Lonberg on 5/1/16.
// Copyright © 2016 Ravi Lonberg. All rights reserved.
//
import UIKit
class LunchViewController: UIViewController {
@IBOutlet weak var SandwhichesView: UIView!
@IBOutlet weak var AppetizersView: UIView!
@IBOutlet weak var BurgersView: UIView!
@IBAction func showAppetizers(sender: UIButton) {
AppetizersView.hidden = false
BurgersView.hidden = true
SandwhichesView.hidden = true
}
@IBAction func showSandwhiches(sender: UIButton) {
AppetizersView.hidden = true
SandwhichesView.hidden = false
BurgersView.hidden = true
}
@IBAction func showLunch(sender: UIButton) {
AppetizersView.hidden = true
BurgersView.hidden = false
SandwhichesView.hidden = true
}
/// outlets for Sandwhiches
@IBOutlet weak var SANDgrilledHamAndCheese: UISwitch!
@IBOutlet weak var SANDgrilledTurkeyAndCheese: UISwitch!
@IBOutlet weak var SANDgrilledTofuAndCheese: UISwitch!
@IBOutlet weak var SANDtunaMelt: UISwitch!
@IBOutlet weak var SANDgrilledCheese: UISwitch!
@IBOutlet weak var SANDcheeseOptions: UIButton!
@IBOutlet weak var SANDbreadOptions: UIButton!
@IBOutlet weak var SANDspecialInstructions: UITextView!
@IBAction func SANDaddToOrder(sender: UIButton) {
var ao = ""
if SANDgrilledHamAndCheese.on {
ao.appendContentsOf("\n - Grilled Ham & Cheese")
}
if SANDgrilledTurkeyAndCheese.on {
ao.appendContentsOf("\n - Grilled Turkey & Cheese")
}
if SANDgrilledTofuAndCheese.on {
ao.appendContentsOf("\n - Grilled Tofu & Cheese")
}
if SANDtunaMelt.on {
ao.appendContentsOf("\n - Tuna Melt")
}
if SANDgrilledCheese.on {
ao.appendContentsOf("\n - Grilled Cheese")
}
if ao != "" {
ao.appendContentsOf(" with ")
ao.appendContentsOf(SANDcheeseOptions.currentTitle!)
ao.appendContentsOf(" on ")
ao.appendContentsOf(SANDbreadOptions.currentTitle!)
}
ao.appendContentsOf(BURGspecialInstructions.text)
orderStatus.text.appendContentsOf(ao)
}
/// outlets for Burgers
@IBOutlet weak var BURGburger: UISwitch!
@IBOutlet weak var BURGveggieBurger: UISwitch!
@IBOutlet weak var BURGportabella: UISwitch!
@IBOutlet weak var BURGturkey: UISwitch!
@IBOutlet weak var BURGgrilledChicken: UISwitch!
@IBOutlet weak var BURGcrispyChicken: UISwitch!
@IBOutlet weak var BURGcheeseOptions: UIButton!
@IBOutlet weak var BURGbreadOptions: UIButton!
@IBOutlet weak var BURGspecialInstructions: UITextView!
@IBOutlet weak var BURGphilly: UISwitch!
@IBAction func BURGaddToOrder(sender: UIButton) {
var ao = ""
if BURGburger.on {
ao.appendContentsOf("\n - Hand Pressed Burger")
}
if BURGveggieBurger.on {
ao.appendContentsOf("\n - Veggie Burger")
}
if BURGportabella.on {
ao.appendContentsOf("\n - Portabella Sandwhich")
}
if BURGturkey.on {
ao.appendContentsOf("\n - Turkey Burger")
}
if BURGgrilledChicken.on {
ao.appendContentsOf("\n - Grilled Chicken Sandwhich")
}
if BURGcrispyChicken.on {
ao.appendContentsOf("\n - Crispy Chicken Sandwhich")
}
if BURGphilly.on {
ao.appendContentsOf("\n - Philly Cheesesteak")
}
if ao != "" {
ao.appendContentsOf(" with ")
ao.appendContentsOf(BURGcheeseOptions.currentTitle!)
ao.appendContentsOf(" on ")
ao.appendContentsOf(BURGbreadOptions.currentTitle!)
}
ao.appendContentsOf(BURGspecialInstructions.text)
orderStatus.text.appendContentsOf(ao)
}
/// outlets for Apps
@IBOutlet weak var APPStenders: UISwitch!
@IBOutlet weak var APPSfries: UISwitch!
@IBOutlet weak var APPSspecialfries: UISwitch!
@IBOutlet weak var APPSonionRings: UISwitch!
@IBOutlet weak var APPShotWings: UISwitch!
@IBOutlet weak var APPSmotzSticks: UISwitch!
@IBOutlet weak var APPSpoppers: UISwitch!
@IBOutlet weak var APPSvegOfDay: UISwitch!
@IBOutlet weak var APPSgrilledChickenBreast: UISwitch!
@IBOutlet weak var APPSspecialInstructions: UITextView!
@IBAction func APPSaddToOrder(sender: UIButton) {
var ao = ""
if APPStenders.on {
ao.appendContentsOf("\n - Chicken Tenders")
}
if APPSfries.on {
ao.appendContentsOf("\n - Fries")
}
if APPSspecialfries.on {
ao.appendContentsOf("\n - Special Fries")
}
if APPSonionRings.on {
ao.appendContentsOf("\n - Onion Rings")
}
if APPShotWings.on {
ao.appendContentsOf("\n - Boneless Hot Wings")
}
if APPSmotzSticks.on {
ao.appendContentsOf("\n - Mozarella Sticks")
}
if APPSpoppers.on {
ao.appendContentsOf("\n - Jalapeno Poppers")
}
if APPSvegOfDay.on {
ao.appendContentsOf("\n - Vegetable of the Day")
}
if APPSgrilledChickenBreast.on {
ao.appendContentsOf("\n - Grilled Chicken Breast")
}
ao.appendContentsOf(APPSspecialInstructions.text)
orderStatus.text.appendContentsOf(ao)
}
@IBAction func confirmOrder(sender: UIButton) {
order = orderStatus.text
}
/// order confirm slide
@IBOutlet weak var orderStatus: UITextView!
@IBAction func clearOrder(sender: UIButton) {
orderStatus.text.removeAll()
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
print("prepping segue")
print(segue.identifier)
if segue.identifier == "BurgerBread" {
let destination = segue.destinationViewController as? LunchTableViewController
destination?.viaSegue = "Breads"
optionPass = BURGbreadOptions
}
if segue.identifier == "BurgerCheese" {
let destination = segue.destinationViewController as? LunchTableViewController
destination?.viaSegue = "Cheeses"
optionPass = BURGcheeseOptions
}
if segue.identifier == "SandBread" {
let destination = segue.destinationViewController as? LunchTableViewController
destination?.viaSegue = "Breads"
optionPass = SANDbreadOptions
}
if segue.identifier == "SandCheese" {
let destination = segue.destinationViewController as? LunchTableViewController
destination?.viaSegue = "Cheeses"
optionPass = SANDcheeseOptions
}
}
}
......@@ -29,6 +29,10 @@ class ViewController: UIViewController {
// Dispose of any resources that can be recreated.
}
@IBAction func lunchSelect(sender: UIButton) {
name = nameField.text!
takeout = takeoutSwitch.on
}
@IBAction func breakfastSelect() {
name = nameField.text!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment