I have another project with almost identical code and it runs with no issues i'm not sure why it crashes. It build successfully then it crashes with Fatal error on the if statement line.
if sharedData.likedAwards.isEmpty {
Group {
Image("NoAwards")
.resizable()
.aspectRatio(contentMode: .fit)
.padding()
.padding(.top,35)
Text("No awards yet")
.font(.custom(customFont, size: 25))
.fontWeight(.semibold)
}
The Following Code is in SharedDataModel:
import SwiftUI
class SharedDataModel: ObservableObject {
// Detail Award Data....
@Published var detailAward: Award?
@Published var showDetailAward: Bool = false
// matched Geoemtry Effect from Search page...
@Published var fromSearchPage: Bool = false
// Liked Awards...
@Published var likedAwards: [Award] = []
}