How do I create a standard iOS Share button?

后端 未结 7 544
情话喂你
情话喂你 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:36

    only my two cents for swift 4 / Xcode 10:

    1) action has initial char changed:

    let shareButton = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(shareButtonPressed))
    

    2) add @obj:

    @objc func shareButtonPressed() {
        //Do something now!
    }
    

提交回复
热议问题