generated from StanfordBDHG/TemplateApplication
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
241 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// This source file is part of the CS342 2023 Application project | ||
// | ||
// SPDX-FileCopyrightText: 2023 Stanford University | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
|
||
import XCTest | ||
|
||
|
||
class KatieLiu: XCTestCase { | ||
override func setUpWithError() throws { | ||
try super.setUpWithError() | ||
continueAfterFailure = false | ||
} | ||
|
||
func testKatieLiu() throws { | ||
let app = XCUIApplication() | ||
app.launch() | ||
|
||
app.collectionViews.buttons["Katie Liu"].tap() | ||
XCTAssert(app.staticTexts["Katie Liu"].waitForExistence(timeout: 0.5)) | ||
|
||
app.buttons["More About Me"].tap() | ||
XCTAssert(app.staticTexts["Some Favorites"].waitForExistence(timeout: 0.5)) | ||
|
||
XCTAssert(app.buttons["Morning Drink"].waitForExistence(timeout: 0.5)) | ||
XCTAssert(app.buttons["Pittsburgh"].waitForExistence(timeout: 0.5)) | ||
XCTAssert(app.buttons["Evening Snack"].waitForExistence(timeout: 0.5)) | ||
|
||
app.buttons["Morning Drink"].tap() | ||
|
||
app.buttons["Pittsburgh"].tap() | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Katie Liu on 1/24/23. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
enum KatieLiuDests: String, Identifiable { | ||
case moreinfo | ||
|
||
|
||
var id: String { | ||
rawValue | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Katie Liu on 1/24/23. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
struct KatieLiuView: View { | ||
init() { | ||
UISegmentedControl.appearance().selectedSegmentTintColor = .brown | ||
UISegmentedControl.appearance().setTitleTextAttributes([.foregroundColor: UIColor.white], for: .selected) | ||
} | ||
|
||
@State private var selectedSide: WhichFact = .tofu | ||
|
||
var body: some View { | ||
NavigationView { | ||
VStack { | ||
Picker("Food and Fall", selection: $selectedSide) { | ||
ForEach(WhichFact.allCases, id: \.self) { | ||
Text($0.rawValue) | ||
} | ||
} | ||
.pickerStyle(SegmentedPickerStyle()) | ||
.padding() | ||
|
||
Spacer() | ||
CappucinoView(selectedSide: selectedSide) | ||
Spacer() | ||
} | ||
.navigationTitle("Some Favorites") | ||
} | ||
} | ||
} | ||
|
||
enum WhichFact: String, CaseIterable { | ||
case tofu = "Evening Snack" | ||
case place = "Home" | ||
case cappucino = "Morning Drink" | ||
var id: String { | ||
rawValue | ||
} | ||
} | ||
|
||
struct CappucinoView: View { | ||
var selectedSide: WhichFact | ||
var body: some View { | ||
switch selectedSide { | ||
case .tofu: | ||
Bundle.module.image(fromFileNamed: "Tofu", type: "jpg") | ||
case .place: | ||
Bundle.module.image(fromFileNamed: "Pittsburgh", type: "jpg") | ||
case .cappucino: | ||
Bundle.module.image(fromFileNamed: "Cappucino", type: "jpg") | ||
} | ||
} | ||
} | ||
|
||
struct TofuImageView: View { | ||
var body: some View { | ||
Bundle.module.image(fromFileNamed: "Tofu", type: "jpg") | ||
.resizable() | ||
.frame(width: 250, height: 400) | ||
.shadow(color: .white, radius: 100) | ||
} | ||
} | ||
|
||
struct MoreInfoView: PreviewProvider { | ||
static var previews: some View { | ||
KatieLiuView() | ||
.preferredColorScheme(.light) | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
CS342MemberViews/Sources/KatieLiu/Media.xcassets/Cappucino.imageset/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "how-to-make-cappuccino-005.jpg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+84.6 KB
...urces/KatieLiu/Media.xcassets/Cappucino.imageset/how-to-make-cappuccino-005.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions
6
CS342MemberViews/Sources/KatieLiu/Media.xcassets/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
CS342MemberViews/Sources/KatieLiu/Media.xcassets/Pittsburgh.imageset/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "pittsburgh-fall-foliage.jpg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+659 KB
...Sources/KatieLiu/Media.xcassets/Pittsburgh.imageset/pittsburgh-fall-foliage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
CS342MemberViews/Sources/KatieLiu/Media.xcassets/Tofu.imageset/Contents.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "MapoTofu_RECIPE_033122_31225.jpg", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+638 KB
.../Sources/KatieLiu/Media.xcassets/Tofu.imageset/MapoTofu_RECIPE_033122_31225.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.