rubymotion-community / ib

IB Outlets for rubymotion
MIT License
253 stars 33 forks source link

Can't Ctrl+drag to Exit #82

Closed ivdma closed 9 years ago

ivdma commented 9 years ago

ib generates IBActions as follows: - (IBAction)someMethodName:(id) sender;, but Interface Builder's Exit expects it to be - (IBAction)someMethodName:(UIStoryBoard *) sender; in order it to be draggable to Exit.

I ended up editing stubs.h manually, but it would be nice to have it done by ib gem.

yury commented 9 years ago

@ivdma

Can you check if - (IBAction)someMethodName:(UIStoryBoard *) storyBoard; also work? If so, we can check for parameter name.

ivdma commented 9 years ago

@yury

Yes, storyBoard parameter works too.

colinta commented 9 years ago

Please test this new feature! Available in 0.8.0. Thanks, @yury!

KCErb commented 9 years ago

Hey there,

Three things:

  1. You have a little typo: it should be UIStoryboard not UIStoryBoard (source).
  2. I noticed the above because Xcode was giving me an error, but even after I fixed it I still had to change the type to UIStoryboardSegue in order to hook up the exit button! I'm confused because others seem to not have run into these problems. Suggestions?
  3. Am I right to say that this is a totally new feature? It doesn't seem like you do parameter name checking anywhere else, but I'm not confident about that.

To be clear to anyone else coming here to solve this problem: in order to get ib to give a UIStoryboard type you have to use the keyword storyboard or story_board as a parameter name in your method definition like so:

def exit_method_name(storyboard)
end

and that will produce

-(IBAction) unwind_to_list:(UIStoryBoard *) storyboard;