You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1 regel
4.5 KiB

  1. {"kind":"symbol","variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/fueling\/coredatamanager\/checkinternetconnectivity()"]}],"hierarchy":{"paths":[["doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling","doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/CoreDataManager"]]},"abstract":[{"type":"text","text":"Checks internet connectivity."}],"sections":[],"metadata":{"externalID":"s:7Fueling15CoreDataManagerC25checkInternetConnectivitySbyYaF","symbolKind":"method","role":"symbol","modules":[{"name":"Fueling"}],"roleHeading":"Instance Method","title":"checkInternetConnectivity()","fragments":[{"kind":"keyword","text":"func"},{"text":" ","kind":"text"},{"kind":"identifier","text":"checkInternetConnectivity"},{"text":"() ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" -> ","kind":"text"},{"kind":"typeIdentifier","text":"Bool","preciseIdentifier":"s:Sb"}]},"primaryContentSections":[{"declarations":[{"languages":["swift"],"platforms":["iOS"],"tokens":[{"kind":"attribute","text":"@"},{"kind":"attribute","preciseIdentifier":"s:ScM","text":"MainActor"},{"text":" ","kind":"text"},{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"checkInternetConnectivity","kind":"identifier"},{"kind":"text","text":"() "},{"text":"async","kind":"keyword"},{"text":" -> ","kind":"text"},{"kind":"typeIdentifier","preciseIdentifier":"s:Sb","text":"Bool"}]}],"kind":"declarations"},{"kind":"content","content":[{"text":"Return Value","anchor":"return-value","type":"heading","level":2},{"inlineContent":[{"text":"A boolean indicating whether the internet is reachable.","type":"text"}],"type":"paragraph"}]},{"content":[{"anchor":"discussion","level":2,"text":"Discussion","type":"heading"},{"code":["func checkInternetConnectivity() async -> Bool {"," guard let url = URL(string: \"https:\/\/www.google.com\") else {"," return false"," }",""," var request = URLRequest(url: url)"," request.httpMethod = \"GET\""," request.cachePolicy = .reloadIgnoringLocalAndRemoteCacheData"," request.timeoutInterval = 3.0",""," do {"," let (_, response) = try await URLSession.shared.data(for: request)"," "," guard let httpResponse = response as? HTTPURLResponse, httpResponse.statusCode == 200 else {"," return false"," }",""," return true"," } catch {"," return false"," }","}"],"type":"codeListing","syntax":"swift"}],"kind":"content"}],"schemaVersion":{"major":0,"minor":3,"patch":0},"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/CoreDataManager\/checkInternetConnectivity()"},"references":{"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"},"doc://rpm.com.production.Scanner/documentation/Fueling/CoreDataManager/checkInternetConnectivity()":{"type":"topic","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/CoreDataManager\/checkInternetConnectivity()","abstract":[{"text":"Checks internet connectivity.","type":"text"}],"kind":"symbol","url":"\/documentation\/fueling\/coredatamanager\/checkinternetconnectivity()","title":"checkInternetConnectivity()","role":"symbol","fragments":[{"text":"func","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"checkInternetConnectivity"},{"text":"() ","kind":"text"},{"kind":"keyword","text":"async"},{"text":" -> ","kind":"text"},{"kind":"typeIdentifier","preciseIdentifier":"s:Sb","text":"Bool"}]},"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"}}}