The technique to separate API keys in a xcconfig file described in this answer doesn't work with Swift 2.2 due to a bug (SR-909).
Is there any workaround?
Thanks for pointing to the bug, would not have figured this one out in a while. If it's any help I ended up adding an additional objc constants bridge to Swift and using the bridge constants from swift:
// Constants.h
extern NSString *const kDropBoxAPIKey;
// Constants.m
NSString *const kDropBoxAPIKey = DROPBOX_API_KEY;
// xxx-Bridging-Header.h
#import "Constants.h"
Then use the bridged key in Swift
// xx.swift
...
// let auth = DropboxAuth(appKey: DROPBOX_API_KEY)
let auth = DropboxAuth(appKey: kDropBoxAPIKey)
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With