forem / DEV-ios

DEV Community iOS App
GNU General Public License v3.0
359 stars 97 forks source link

Network Reachability #109

Closed chickdan closed 5 years ago

chickdan commented 5 years ago

Had some code laying around and plugged it in to get network detection going and added the NotificationBanner library for displaying a banner. Currently the only banner being displayed is when there is no network connection at all, but I plan on expanding the logic to display for various situations with corresponding messages.

This code is kind of old so I'm looking at using the Reachability.swift library which looks pretty similar but more refined.

Closes #103

benhalpern commented 5 years ago

This looks great. I'll take a look within the next day. @StriderHND wanna play around with this and offer some thoughts?

StriderHND commented 5 years ago

Sure I'll checkout this @benhalpern , and give my comments.

chickdan commented 5 years ago

In 8681c0c I added an error banner as a lazy var, this is to provide access the banner to dismiss it since autoDismiss = false (a little more info here on how the library works in this case). Along with that there are two new banners that will conditionally display if moving from no connection to being connected to either cellular or WiFi.

I'll be tackling the code climate issues soon.

StriderHND commented 5 years ago

@chickdan the changes are looking good! I was gonna mention the issue with the autoDismiss but already looked into that!

Just fix the code climate issues and it's good to go. @benhalpern

benhalpern commented 5 years ago

Having finally given it a full inspection, this is a fabulous first pass.

This is an area we are going to want to keep improving on as a strength and this is an awesome start to iterate off. Amazing work @chickdan.