You need 3 things:
(1) Well-formed subfile
platform :ios, '8.0' target 'GoogleDrive' do pod 'Google-API-Client/Drive', '~> 1.0' end
(2) Open the Google API through bridging headers
#import "GTMOAuth2ViewControllerTouch.h" #import "GTLDrive.h"
(3) GTL reference is not required in the Swift class; DRive
override func viewDidLoad() { super.viewDidLoad() // ... let service:GTLServiceDrive = GTLServiceDrive() service.authorizer = GTMOAuth2ViewControllerTouch.authForGoogleFromKeychainForName("Drive API", clientID: "YOUR_CLIENT_ID_HERE", clientSecret: "YOUR_CLIENT_SECRET_HERE") // ... }
SwiftArchitect
source share