ElaWorkshop / TagListView

Simple and highly customizable iOS tag list view, in Swift.
MIT License
2.64k stars 492 forks source link

Make code Swifty and functional #201

Closed JoeFerrucci closed 5 years ago

JoeFerrucci commented 5 years ago
JoeFerrucci commented 5 years ago

@matsoftware You approved this PR, now what?

matsoftware commented 5 years ago

It’s just to push the maintainer to merge it (and tag a new version so we can use the Swift 4.2 upgrade as well).

On Wed, 3 Oct 2018 at 16:18, Joe Ferrucci notifications@github.com wrote:

@matsoftware https://github.com/matsoftware You approved this PR, now what?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ElaWorkshop/TagListView/pull/201#issuecomment-426676578, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJClsT3AOArnLvNCHwsA4dUwzXq5euHks5uhNU_gaJpZM4Wy6py .

--

Mattia Campolese www.matsoftware.it

Cee commented 5 years ago

Code LGTM. One question is that using defer makes code less readable. I'd prefer using defer in the error handling functions.

JoeFerrucci commented 5 years ago

I used defer in these places, because they ensure no matter what happens in the block, things that need to be run at the end of the block are done so at the end, and not accidentally out of order. Example is the rearrangeViews: call rearrange after adjusting the padding.