{"identifier":{"url":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/CoreDataManager\/fetchData()","interfaceLanguage":"swift"},"metadata":{"role":"symbol","title":"fetchData()","symbolKind":"method","roleHeading":"Instance Method","externalID":"s:7Fueling15CoreDataManagerC05fetchC0yyF","modules":[{"name":"Fueling"}],"fragments":[{"kind":"keyword","text":"func"},{"text":" ","kind":"text"},{"kind":"identifier","text":"fetchData"},{"kind":"text","text":"()"}]},"abstract":[{"text":"Fetches all fueling data from Core Data.","type":"text"}],"variants":[{"paths":["\/documentation\/fueling\/coredatamanager\/fetchdata()"],"traits":[{"interfaceLanguage":"swift"}]}],"sections":[],"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["iOS"],"languages":["swift"],"tokens":[{"text":"@","kind":"attribute"},{"text":"MainActor","preciseIdentifier":"s:ScM","kind":"attribute"},{"kind":"text","text":" "},{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"text":"fetchData","kind":"identifier"},{"text":"()","kind":"text"}]}]},{"content":[{"anchor":"discussion","type":"heading","text":"Discussion","level":2},{"syntax":"swift","type":"codeListing","code":["func fetchData() {"," let context = container.viewContext"," let request: NSFetchRequest = FuelingTest.fetchRequest()"," "," do {"," let results = try context.fetch(request)"," print(\"Successfully fetched data.\")"," DispatchQueue.main.async {"," self.fuelingsArray = results"," NotificationManager.instance.fuelingsCount = self.fuelingsArray.count"," }"," } catch let error as NSError {"," print(\"ERROR FETCHING CORE DATA: \\(error.localizedDescription)\")"," DispatchQueue.main.async {"," self.fuelingsArray = []"," }"," }","}"]}],"kind":"content"}],"kind":"symbol","schemaVersion":{"patch":0,"minor":3,"major":0},"hierarchy":{"paths":[["doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling","doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/CoreDataManager"]]},"references":{"doc://rpm.com.production.Scanner/documentation/Fueling/CoreDataManager/fetchData()":{"kind":"symbol","title":"fetchData()","type":"topic","role":"symbol","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/CoreDataManager\/fetchData()","fragments":[{"text":"func","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"fetchData"},{"text":"()","kind":"text"}],"url":"\/documentation\/fueling\/coredatamanager\/fetchdata()","abstract":[{"type":"text","text":"Fetches all fueling data from Core Data."}]},"doc://rpm.com.production.Scanner/documentation/Fueling":{"kind":"symbol","url":"\/documentation\/fueling","title":"Fueling","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling","abstract":[{"type":"text","text":"The Scanner app is designed to facilitate secure and efficient fuel management operations, primarily focusing on user authentication, fuel data collection, and network communication. The app includes several key features to ensure seamless and reliable interactions between users and the backend systems, leveraging technologies like WebSockets, Core Data, and biometric authentication."}],"type":"topic","role":"collection"},"doc://rpm.com.production.Scanner/documentation/Fueling/CoreDataManager":{"fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"text":"CoreDataManager","kind":"identifier"}],"type":"topic","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/CoreDataManager","kind":"symbol","title":"CoreDataManager","abstract":[],"navigatorTitle":[{"text":"CoreDataManager","kind":"identifier"}],"url":"\/documentation\/fueling\/coredatamanager","role":"symbol"}}}