class NotificationStore: ObservableObject {@Published var notification: [NotificationModel] = []
@EnvironmentObject var people: PeopleStore
init() {
getNotifyDetails()
}
/// API for news list wilth information
func getNotifyDetails() {
Api().getNotification {(notify) in
self.notification = [notify]
switch self.notification[0].serviceCallStatus {
case 23:
self.people.isLogged = true
case 56: // 400 Error Response
print("NOTIFICATION Error: Validation error On data")
case 57: // 500 Error Response
print("NOTIFICATION Error: Internal Servcer error")
default:
print("default Error")
}
}
}
}
// Ошибка. Неустранимая ошибка: не найден ObservableObject типа PeopleStore. View.environmentObject (_ :) для PeopleStore может отсутствовать в качестве предка этого представления: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/Monoceros_Sim/Monoceros-39.4.3/Core/EnvironmentObject.swift , строка 55
2020-05-06 09: 47: 50.422921 + 0530 StayHome [1509: 70499] Неустранимая ошибка: не найден ObservableObject типа PeopleStore. View.environmentObject (_ :) для PeopleStore может отсутствовать в качестве предка этого представления: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/Monoceros_Sim/Monoceros-39.4.3/Core/EnvironmentObject.swift , строка 55 (lldb)