mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			414 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			414 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
enum ServerResponse {
 | 
						|
    case Result(String, String)
 | 
						|
    case Error(String)
 | 
						|
}
 | 
						|
 | 
						|
let success = ServerResponse.Result("6:00 am", "8:09 pm")
 | 
						|
let failure = ServerResponse.Error("Out of cheese.")
 | 
						|
 | 
						|
switch success {
 | 
						|
    case let .Result(sunrise, sunset):
 | 
						|
        let serverResponse = "Sunrise is at \(sunrise) and sunset is at \(sunset)."
 | 
						|
    case let .Error(error):
 | 
						|
        let serverResponse = "Failure...  \(error)"
 | 
						|
}
 |