Install Sharekit button with UIButton, not UIBarButton

In the ShareKit installation instructions: http://getsharekit.com/install/

say to create a share button by putting it in .m

[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction
 target:self
 action:@selector(share)]

      

How can I customize the share button with only UIButton and not UIBarButton?

+3


source to share


1 answer


Create your UIBUtton

normall. Then for the method addTarget

useshare

So



UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn.frame = CGRectMake(.....
[btn addTarget:self action:@selector(share) forControlEvents:UIControlEventTouchUpInside];

      

0


source







All Articles