Skip to content

Instantly share code, notes, and snippets.

View alperen23230's full-sized avatar
🎯
Focusing

Alperen alperen23230

🎯
Focusing
View GitHub Profile
@alperen23230
alperen23230 / APIService.Swift
Last active July 10, 2020 22:46
SwiftUI and Combine Codes
import Foundation
import Combine
enum ErrorType {
case badRequest, authError, outdatedError, undefined
}
struct APIError: Error {
let statusCode: Int
var errorDescription: ErrorType {
switch statusCode {