How to use Dropbox Sync API enumerations in Swift? -
given dbfile object, kept getting compiler errors if tried compare dbfilestate enumerated values, e.g.
var file : dbfile = <some file> var state = file.status.state if state == dbfilestateuploading { } the compiler error '==' cannot compare (dbfilestate, dbfilestate)
the answer turned out quite simple:
if state.value == dbfilestateuploading.value { } this has fact the dropbox enumerations imported c-style enumerations, wasn't easy find.
just thought i'd share else might struggling this.
Comments
Post a Comment