在swift 2中自定义共享扩展设计

时间:2016-01-02 09:56:30

标签: ios iphone swift swift2

我想在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
    }

1 个答案:

答案 0 :(得分:-1)

您可以基于UIViewController创建自定义共享扩展程序:

  

使用Xcode共享模板

     

Xcode Share模板提供默认标头和实现   主视图控制器类的文件(调用   SharingViewController),Info.plist文件和接口文件   (即故事板或xib文件)。

     

注意:   要提供自定义撰写视图而不是标准视图,请取消选择   在Xcode目标添加中使用“标准社交撰写界面”   窗格。取消选中此复选框后,将显示默认值   SharingViewController类基于NSViewController或   UIViewController,取决于您选择的平台。