OdyseeTeam / odysee-ios

The Odysee iOS app with wallet functionality.
MIT License
67 stars 22 forks source link

Cleanup lots of duplication with the AppDelegate.shared helper #247

Closed tsheaff closed 2 years ago

tsheaff commented 2 years ago

Instead of doing this in ~165 places:

let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.foo = bar
appDelegate.baz()

instead do

AppDelegate.shared.foo = bar
AppDelegate.shared.baz()

The AppDelegate.shared is a lot safer, more readable, and easier to debug than repeating let appDelegate = UIApplication.shared.delegate as! AppDelegate

tsheaff commented 2 years ago

Yes the merge conflicts come from the SwiftFormat change, I'll pull back and reformat. Thanks!

tsheaff commented 2 years ago

OK @akinwale I've fixed the merge conflicts, and this branch is now passing lint and unit tests.

tsheaff commented 2 years ago

Looks like the GH lint job is having an issue installing Mint, I'll fix that, but the code itself does pass swiftformat --lint . locally

tsheaff commented 2 years ago

@akinwale I got lint passing – the action only takes ~20s to run 😄 . Feel free to merge this now, and then require the lint step on all master merges going forward.

akinwale commented 2 years ago

@tysheaff It looks like the root cause of the error is still the "treat warnings as errors" directive. The warning gets raised from the Firebase Swift package.

akinwale commented 2 years ago

Closing this. Please reopen as a new PR if you wish to fix the outstanding issues. Thanks.