Skip to content
Permalink
Browse files

add an else to work around compile, remove reference to bundle

  • Loading branch information...
zhuowei committed Jun 8, 2019
1 parent 077c6f1 commit 2c493a166cc36c0f1ff575ca8b9df499408e80cc
Showing with 5 additions and 2 deletions.
  1. +3 −0 Landmarks/Landmarks/Models/Data.swift
  2. +2 −2 Landmarks/Landmarks/Supporting Views/LandmarkRow.swift
@@ -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)
@@ -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
}
}
}

0 comments on commit 2c493a1

Please sign in to comment.
You can’t perform that action at this time.