简体   繁体   English

快速定制共享扩展设计

[英]customizing the share extension design in swift 2

I want to customize the design for share extension in swift 2. how can I do the customizations 我想在swift 2中自定义共享扩展的设计。如何进行自定义

class ShareViewController: SLComposeServiceViewController,NetworkSelectionViewControllerDelegate, PublishSelectionViewControllerDelegate{

    var selectedNetworkName = "Default"
    var selectedPublishName = "Select"

    override func isContentValid() -> Bool {
        // Do validation of contentText and/or NSExtensionContext attachments here
        return true
    }

You can create a custom Share Extension based on UIViewController: 您可以基于UIViewController创建自定义共享扩展:

Use the Xcode Share Template 使用Xcode共享模板

The Xcode Share template provides default header and implementation files for the principal view controller class (called SharingViewController), an Info.plist file, and an interface file (that is, a storyboard or xib file). Xcode Share模板为主体视图控制器类(称为SharingViewController),Info.plist文件和接口文件(即情节提要或xib文件)提供默认的标头和实现文件。

NOTE: To provide a custom compose view instead of the standard one, deselect “Use standard social compose interface” in the Xcode target-adding pane. 注意:要提供自定义撰写视图而不是标准撰写视图,请在“添加Xcode目标”窗格中取消选择“使用标准社交撰写界面”。 When this checkbox is deselected, the default SharingViewController class is based on NSViewController or UIViewController, depending on the platform you chose. 取消选中此复选框后,默认的SharingViewController类基于NSViewController或UIViewController,具体取决于您选择的平台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM