Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component Action #62

Open
freesuraj opened this issue Jun 2, 2016 · 3 comments
Open

Component Action #62

freesuraj opened this issue Jun 2, 2016 · 3 comments

Comments

@freesuraj
Copy link

Hi Wang,

Congrats on the great tool, nicely done !! I was wondering what's your plan for providing actions for components, like Button, swipe, tap, or anything? Blockable actions?

@wangshengjia
Copy link
Owner

Thanks a lot for the kind words, really glad to hear. 😀

For the moment, LeeGo support such kind of Action as IB files. Which means you can find and link the instance of component directly with lg_viewForOutletKey method, just as IBOutlet do.

// Retrieve target view from hierarchy based on a configured key in `Brick`, 
// then either manipulate object directly or keep it into a class property with 
// weak reference, just as `IBOutlet`
let likeButton = tweetView.lg_viewForOutletKey("likeButton")
likeButton.addTarget(...)

Since this approach let people manipulate directly instance which could introduce easily more mutable states and complexity, which isn't encouraged by LeeGo's philosophy, so we may use declarative blockable actions to replace it in the future release.

What you think?

@freesuraj
Copy link
Author

Exactly. I would think declarative blocks should be the way to go. I and my colleague would be happy to contribute some as we love the work and the concept you've done so far. I believe we could make this one of the best componentKit out there.

Sent from my iPhone

On 2 Jun 2016, at 6:52 PM, WANG Shengjia notifications@github.com wrote:

Thanks a lot for the kind words, really glad to hear. 😀

For the moment, LeeGo support such kind of Action as IB files. Which means you can find and link the instance of component directly with lg_viewForOutletKey method, just as IBOutlet do.

// Retrieve target view from hierarchy based on a configured key in Brick,
// then either manipulate object directly or keep it into a class property with
// weak reference, just as IBOutlet
let likeButton = tweetView.lg_viewForOutletKey("likeButton")
likeButton.addTarget(...)
Since this approach let people manipulate directly instance which could introduce easily more mutable states and complexity, which isn't encouraged by LeeGo's philosophy, so we may use declarative blockable actions to replace it in the future release.

What you think?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@wangshengjia
Copy link
Owner

Yeah, totally cool. It would be great if you'd like to contribute, PR is always welcomed. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants