Skip to content

Commit 2c493a1

Browse files
committed
add an else to work around compile, remove reference to bundle
1 parent 077c6f1 commit 2c493a1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Landmarks/Landmarks/Models/Data.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ let landmarkData: [Landmark] = load("landmarkData.json")
1414
func load<T: Decodable>(_ filename: String, as type: T.Type = T.self) -> T {
1515
let data: Data
1616

17+
/*
1718
guard let file = Bundle.main.url(forResource: filename, withExtension: nil)
1819
else {
1920
fatalError("Couldn't find \(filename) in main bundle.")
2021
}
22+
*/
23+
let file = URL(fileURLWithPath: "LandmarkTutorial3Complete/Landmarks/Landmarks/Resources/" + filename)
2124

2225
do {
2326
data = try Data(contentsOf: file)

Landmarks/Landmarks/Supporting Views/LandmarkRow.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ struct LandmarkRow: View {
1616
Text(verbatim: landmark.name)
1717
Spacer()
1818

19-
/*if landmark.isFavorite {
19+
if landmark.isFavorite {
2020
Image(systemName: "star.fill")
2121
.imageScale(.medium)
2222
.foregroundColor(.yellow)
23-
}*/
23+
} else {} // what
2424
}
2525
}
2626
}

0 commit comments

Comments
 (0)