How do I create a standard iOS Share button?

后端 未结 7 482
情话喂你
情话喂你 2020-12-30 19:13

The iOS Human Interface Guidelines say:

Use the system-provided Share button. Users are familiar with the meaning and behavior of thi

相关标签:
7条回答
  • 2020-12-30 19:43

    Here is the code. I am assuming you are inside ViewController so self has navigationItem property.

    UIBarButtonItem *shareButton = [[UIBarButtonItem alloc]
    initWithBarButtonSystemItem:UIBarButtonSystemItemAction
                         target:self
                         action:@selector(shareAction:)];
    self.navigationItem.rightBarButtonItem = shareButton;
    
    0 讨论(0)
提交回复
热议问题