Skip to content

Instantly share code, notes, and snippets.

@EnesKaraosman
Last active January 26, 2020 14:11
Show Gist options
  • Save EnesKaraosman/0a50832ad5aa06851909b7e8055943f7 to your computer and use it in GitHub Desktop.
Save EnesKaraosman/0a50832ad5aa06851909b7e8055943f7 to your computer and use it in GitHub Desktop.
Environment enum usage in AppDelegate
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
// ..
self.setupNetworkEnvironment()
return true
}
private func setupNetworkEnvironment() {
let baseUrl = Environment.selected.url
print(baseUrl)
// Burada network instance'ınızı besleyebilirsiniz.
// APIClient.instance.environment = NetworkEnvironment(baseUrl: baseUrl)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment