Created
July 26, 2015 08:01
-
-
Save GE-N/e72fbb4867135c3eafbf to your computer and use it in GitHub Desktop.
Configure hosting by Swift's enum
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
enum Host { | |
case Staging = “http://staging.myblog.com/api” | |
case Production = “https://myblog.com/api” | |
} | |
class API { | |
class var host: Host | |
func blog(…) -> (…) { | |
let apiPath = “\(API.host.rawValue)/blog” | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment