hyperoslo / Sugar

:coffee: Something sweet that goes great with your Cocoa
https://github.com/hyperoslo
Other
1.07k stars 69 forks source link

Handling gesture the easy way #78

Closed onmyway133 closed 7 years ago

onmyway133 commented 8 years ago

This make handling gesture more easily, with block

It works this way

let sense = GestureSense()
let view = UIView()

sense.tap(view) { gr in

}

sense.pan(view) { gr in

}

sense.pan(view) { gr in

}
mention-bot commented 8 years ago

By analyzing the blame information on this pull request, we identified @zenangst, @vadymmarkov and @aashishdhawan to be potential reviewers

vadymmarkov commented 8 years ago

This is great @onmyway133, but what I'm kinda afraid of is that Sugar getting bigger and bigger as being mentioned by @zenangst.

zenangst commented 8 years ago

I think we need to adress this is a good way, maybe splitting it out in to separate repos where it makes sense and then starting to mark things as deprecated and then remove extract and remove bits and pieces from the Sugar core.

Arguably, we need to find a good middle ground to what goes into Sugar and what does not.

I think this could be merge into master and then discuss this further in an issue on the repo, what do you guys think? @hyperoslo/ios @aashishdhawan.

vadymmarkov commented 8 years ago

@zenangst Sounds like a plan.

RamonGilabert commented 8 years ago

Kind of agree. Problem is that I think we are starting to confuse convenience with just a sugar, in my opinion where the latter one is something that fixes some tedious work you have to do over and over (dispatch, localize, iPhone size, etc.), the first one is just something that is nifty and looks better than what Apple provides. That one I think should go to another pod. And this PR kind of goes into that one.

zenangst commented 8 years ago

Made an issue for discussion here -> https://github.com/hyperoslo/Sugar/issues/79

vadymmarkov commented 8 years ago

@zenangst @RamonGilabert We haven't agreed on something there https://github.com/hyperoslo/Sugar/issues/79 but @onmyway133 has done an awesome job, so it's worth merging anyway I guess.

onmyway133 commented 8 years ago

@vadymmarkov I think we can move this, and/or the KeyboardObserver to another repo?

vadymmarkov commented 8 years ago

@onmyway133 It's what I would do, yes. But depends on what we decide with Sugar future.

RamonGilabert commented 8 years ago

Sugar might turn its direction now with the sugars that  has already put in Swift 3. Maybe now the solution is do more stuff like this and not sugars?

Vaberer commented 8 years ago

The idea of using gestures like this is more than super convenient. I would extend Sugar as much as possible also with String, Array etc convenient methods and it's only up to the developer if he uses some of the functions.

For me, the most safe approach is to fork a repo and add methods to the library which are useful for me and everything in one place

onmyway133 commented 7 years ago

Happy new year. I think I will close this for now 😄