This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Home.swift in uHome | |
import UIKit | |
import uCore | |
public class Home { | |
let client: Client | |
public init(client: Client) { | |
self.client = client | |
} | |
public func makeViewController(delegate: HomeDelegate) -> UIViewController { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AppDelegate.swift | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
func applicationDidBecomeActive(_ application: UIApplication) { | |
Services.playback.restoreState() | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Services.swift in the main application | |
import uCore | |
import uPlayback | |
class Services { | |
static let playback = PlaybackService() // From uPlayback | |
static let client = Client(baseUrl: "https://api.shakira.io") // From uCore | |
static let analytics = Analytics(firebaseKey: "xxx") // From uCore | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xctools build-settings export --project MyProject.xcodeproj --output MyProject.xcconfig | |
xctools build-settings export --project MyProject.xcodeproj --target --output Target.xcconfig | |
// It can merge the project and target settings into a single .xcconfig file | |
xctools build-settings export --project MyProject.xcodeproj --target --output Target.xcconfig --merge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xctools build-settings clean --project MyProject.xcodeproj | |
xctools build-settings clean --project MyProject.xcodeproj --target MyTarget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read a project | |
let project = try! XcodeProj(path: "myproject.xcodeproj") | |
let buildFiles = project.pbxproj.objects.buildFiles | |
let buildConfigurations = project.pbxproj.objects.buildConfigurations | |
// Read a workspace | |
let workspace = try! XCWorkspace(path: "myworkspace.workspace") | |
let projects = workspace.data.references.map { $0.project } | |
// Read a config file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/carambalabs/xcodeproj.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let package = Package( | |
name: "myproject", | |
dependencies: [ | |
.Package(url: "https://github.com/carambalabs/xcodeproj.git", majorVersion: 0, minor: 0) | |
] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/swift | |
import Foundation | |
print("Ensuring Swift-Package-Manager compatibility") | |
let fileManager = FileManager.default | |
let currentPath = fileManager.currentDirectoryPath | |
let podURL = URL(fileURLWithPath: currentPath).appendingPathComponent("${POD_NAME}/Classes") | |
print("Pod path: \(podURL.path)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let provider = SoundCloudProvider(clientId: "xxx", clientSecret: "yyy", redirectUri: "test://test") | |
let webview = OAuth2WebView(frame: self.view.frame, provider: provider) { (session, error) | |
if let session = session { | |
print("User access token: \(session.accessToken)") | |
} else if let error = error { | |
print("Something went wrong during the authentication: \(error)") | |
} | |
} |