Skip to content

Commit

Permalink
add an else to work around compile, remove reference to bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuowei committed Jun 8, 2019
1 parent 077c6f1 commit 2c493a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Landmarks/Landmarks/Models/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ let landmarkData: [Landmark] = load("landmarkData.json")
func load<T: Decodable>(_ filename: String, as type: T.Type = T.self) -> T {
let data: Data

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

do {
data = try Data(contentsOf: file)
Expand Down
4 changes: 2 additions & 2 deletions Landmarks/Landmarks/Supporting Views/LandmarkRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ struct LandmarkRow: View {
Text(verbatim: landmark.name)
Spacer()

/*if landmark.isFavorite {
if landmark.isFavorite {
Image(systemName: "star.fill")
.imageScale(.medium)
.foregroundColor(.yellow)
}*/
} else {} // what
}
}
}
Expand Down

0 comments on commit 2c493a1

Please sign in to comment.