We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.

Forum Discussion

jem5519's avatar
jem5519
Helpful | Level 6
7 years ago

ObjectiveDropboxOfficial & SwiftyDropbox in same application

I have a third-party objc package that uses ObjectiveDropboxOfficial. I need to add some swift code that interacts with that package. The swift code would need to interact with the same dropbox manager that the objc (through ObjectiveDropboxOfficial) is using. Can I install both ObjectiveDropboxOfficial & SwiftyDropbox in the same project using cocoapods and have my swift code interact with the same underlying dropbox connection that ObjectiveDropboxOfficial is using. Say - set up the connection with the SwiftyDropbox and have the ObjectiveDropboxOfficial library see and use the same dropbox connection?

  • The SwiftyDropbox and ObjectiveDropboxOfficial SDKs aren't really meant to be used together. If you already have ObjectiveDropboxOfficial though, you can access and use that directly in Swift using a bridging header, containing the Objective-C import:

     

    #import <ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h>

    Then you can access DBClientsManager, DBUserClient, etc, from Swift.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    The SwiftyDropbox and ObjectiveDropboxOfficial SDKs aren't really meant to be used together. If you already have ObjectiveDropboxOfficial though, you can access and use that directly in Swift using a bridging header, containing the Objective-C import:

     

    #import <ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h>

    Then you can access DBClientsManager, DBUserClient, etc, from Swift.

    • jem5519's avatar
      jem5519
      Helpful | Level 6

      Thanks for your reply. I am currently doing just that. The reason for the question is that I find working with the swiftydropbox library much more logical and enjoyable than making the swift version of the calls for the ObjectiveDropboxOfficial library. All of my addon dev for this library is all in Swift ;-)

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,875 PostsLatest Activity: 5 hours ago
325 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!