简体   繁体   中英

How to share existing main app source code with ShareExtension iOS?

I am working on building a ShareExtension for my app. I have replaced custom view[SLComposeServiceViewController] with main app's ViewController.

Well in this scenario, I have to set target of main ViewController with the share extension. The problem I faced doing this is, my main app's view controller is heavy and has lot of code inside it. I am getting many build time errors and I am solving it manually by adding all the dependency class target to my share extension.

My question here is, Is there any better way to do this? Is there any better way to share all the code with extension by adding entire main app code to extension target ?

Thanks in advance.

Its better to keep seperate UI and class for share extension . As Apple suggest Extensions should be kept light weight .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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