Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
C. Tim
11 years agoNew member | Level 2
To use API v2 in iOS platform, we need an objective-C version
We didn't use swift in our app development for iOS devices.
To use API v2 in iOS platform, we need an objective-C version!!!
Please kindly provide an objective-C version!
53 Replies
Replies have been turned off for this discussion
- C. Tim11 years agoNew member | Level 2
Without obj-c support, we will skip Dropbox support in any of our new app developments and use iCloud for our initial version.
This is also a trade-off for Dropbox.
The more limit set by Dropbox, the less scope of the app users in iOS platform.
- Steve M.11 years ago
Dropbox Staff
As I said, we plan to add support for Objective-C users. I don't have an ETA yet, but once we finish up the Swift SDK and take it out of beta, it's going to be the next thing we work on in the library.
- RTS S.11 years agoHelpful | Level 6
If this comes in phases .. it would be good to get the Files.Metadata classes available in Objective-C. I find it convenient to keep meta associated with a Dropbox path in my App. I need to handle all the various Files.Metadata sub classes.
The Users.Account class would also be useful, but sine any app only has one to a few accounts ... this is less needed (i.e. it can be easily wrapped)
- Dal R.11 years agoNew member | Level 2
Deriving from NSObject would be the first, then adding @objc to all protocols. + You're still limited only to apps that support dynamic frameworks, so iOS8+. And if you use CocoaPods (which many of us do), you cannot really mix and match dynamic frameworks and static libs. If you are using static libs, you'll have to manually integrate this framework.
- Nicholas C.511 years agoNew member | Level 1
I usually read "no ETA" as in "1-2 years". Looks like I'm sticking with iCloud.
- Ari W.11 years agoNew member | Level 1
@Steve, my team and I make the Workflow app and we disappointed in your decision to write the Dropbox v2 SDK in Swift. We are not able to adopt Swift yet because:
- Including Swift code in an app causes the entire Swift runtime to be included in the app, which substantially increases the size of the app, the amount of time it takes for the user to download it, and the amount of space it takes on the user's phone.
- Additionally, the Swift programming language is still rapidly evolving, and Swift code you write today may not compile tomorrow. This makes Swift a bad choice for large codebases like ours.
- New versions of Swift are tied to new versions of Xcode and iOS. When iOS 10 enters beta, it will come alongside a new version of Swift that will not compile with the production, shipping version of Xcode (which you must use to submit apps to the App Store). Therefore we'd have to fork our codebase between the two versions of Swift.
For the reasons I outlined above, we will not be able to adopt Swift until the language is more stable and the runtime is included in iOS. This means that even if you add Objective-C support to the framework, we will not be able to use it and will have to write our own version of the SDK from scratch.
This has not been a problem with other SDKs, as it is standard practice for vendors to write their SDKs in Objective-C. Most major iOS apps (and indeed, the iOS frameworks and apps themselves) are still written in Objective-C and I believe you are making a sizable mistake by writing the new Dropbox SDK in Swift, let alone not including Objective-C compatibility. A lot of developers will be unable to use this SDK. The correct way of doing this would be to distribute an Objective-C SDK that works with both Objective-C and Swift apps, and perhaps an additional Swift wrapper if you want to provide a more Swift-native interface.
- Enea G.11 years agoNew member | Level 1
Completely agree with @ari can someone provide some kind of rational as to why this decision was made? It will be quite a while before swift is included with iOS and the extra app size is substantial. if written in Obj-C this library could easily be used in swift
- RTS S.11 years agoHelpful | Level 6
I think it's unlikely that this will change soon ... Swifty is bootstrapped from Alamofire which is also a Swift base framework However Alamofire is derived from an Open Source Objective-C library.
In general I like the style of the new interface ... passing blocks/closures for the completion of a request as opposed to the delegate model of the previous objective-c API. But this can still be done in Objective-C ... In fact I wrapped the previous API in a layer that looks a lot like the new API. I still need the wrapper layer now ... because I need to call it from Objective-C ... but the wrapper is pretty trivial.
- Oliver M.1311 years agoNew member | Level 1
Just adding a note to the great arguments @Ari mentioned: for agencies supporting multiple customers at once with projects of different size and probably not updated code bases for months/years but still in heavy use, it is already hard to argue to update APPs for such simple things as outdated APIs. Putting even more pressure into this situation is definitely not ending in an switch-to-swift decision but rather a drop of DropBox support in the first place.
As an API/SDK provider going swift only is definitely too far stretched.
- Steve M.11 years ago
Dropbox Staff
Thanks for all the detailed feedback! As requested, let me explain some of our thinking. I'm just one person who worked on this, but I'll do my best to explain the thought process.
When we first started work on SDKs for API v2, we looked at a few options for how to support iOS developers:
- We could write an Objective-C SDK and encourage Swift developers to use that too.
- We could write a Swift SDK and encourage Objective-C developers to use that too.
- We could write both an Objective-C SDK and a Swift SDK and encourage developers to use the SDK in the language of their choice.
#3 is somewhat appealing in that it allows for building SDKs very specifically tailored to the features of each language. But it has the downside of doubling the support/maintenance cost.
#1 is possible, but the experience of using an Objective-C library from Swift is not great, and then the SDK can't take advantage of great Swift features like enums.
We ultimately decided to take the approach in #2 and build only a Swift SDK. The runtime size is indeed a concern, but we expect Swift development to become more and more popular over time. We'll eventually deprecate API v1, but we haven't set a timeline for that yet. I suspect that by the time API v1 is fully deprecated, this won't be much of a concern anymore.
It turns out that making a Swift SDK easily accessible from Objective-C code is harder than we anticipated! When we came to this realization, we considered a few options for how to make the SDK work better for all iOS developers:
- We could rework the Swift SDK to be more Objective-C-friendly. (As an example, we'd have to drop our use of non-numeric enums.) We rejected this on the grounds that this "least-common denominator" approach would make the SDK worse overall. We recently took the Swift SDK out of beta, and we now intend to keep its interface stable.
- We could write a separate Objective-C SDK. This has a somewhat high maintenance cost, so for now we're trying to avoid doing this.
- We could write a compatibility layer into the Swift SDK that made calling it from Objective-C easy. This is our current plan of record. It lets us keep the nice features of Swift for Swift developers, but it should make it easy for Objective-C developers to adopt the SDK and not have to do work themselves writing a wrapper.
Because we're not that deep into our investigation of #3 yet, it's possible we'll discover things that make us want to revisit the decision.
For those of you (RTS?) who built your own wrappers on top of the Swift SDK, would you mind sharing what worked well/poorly?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!