{"id":39653,"date":"2023-06-08T20:31:09","date_gmt":"2023-06-09T00:31:09","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=39653"},"modified":"2023-11-06T09:55:21","modified_gmt":"2023-11-06T14:55:21","slug":"network-path-monitoring","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2023\/06\/08\/network-path-monitoring\/","title":{"rendered":"Network Path Monitoring"},"content":{"rendered":"<p><a href=\"https:\/\/useyourloaf.com\/blog\/network-path-monitoring\/\">Keith Harrison<\/a>:<\/p>\n<blockquote cite=\"https:\/\/useyourloaf.com\/blog\/network-path-monitoring\/\"><p>In iOS 11, Apple recommended you stop using the reachability API to check network availability before attempting a connection. Instead you configure a <code>URLSession<\/code> to <a href=\"https:\/\/useyourloaf.com\/blog\/urlsession-waiting-for-connectivity\/\">wait for connectivity<\/a>.<\/p><p>The wait for connectivity model works better for creating connections but I still sometimes want to show the user a network status indicator.<\/p><p>[&#8230;]<\/p><p>Apple released the <code>Network<\/code> framework in iOS 12, macOS 10.14. It includes a <code>NWPathMonitor<\/code> that is now the preferred way to monitor changes to network status. The three steps to monitor network changes[&#8230;]<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Keith Harrison: In iOS 11, Apple recommended you stop using the reachability API to check network availability before attempting a connection. Instead you configure a URLSession to wait for connectivity.The wait for connectivity model works better for creating connections but I still sometimes want to show the user a network status indicator.[&#8230;]Apple released the Network [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2023-06-09T00:31:11Z","apple_news_api_id":"0c784ade-a3fb-4758-9f85-d5e80e35d8c4","apple_news_api_modified_at":"2023-11-06T14:55:23Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/ADHhK3qP7R1ifhdXoDjXYxA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[31,2185,30,2223,476,71],"class_list":["post-39653","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-ios","tag-ios-16","tag-mac","tag-macos-13-ventura","tag-networking","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=39653"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39653\/revisions"}],"predecessor-version":[{"id":41006,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39653\/revisions\/41006"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=39653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=39653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=39653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}