Skip to content

Instantly share code, notes, and snippets.

View hendyevan's full-sized avatar
🏠
Working from home

Hendy Evan hendyevan

🏠
Working from home
View GitHub Profile
@jmarkstar
jmarkstar / AlamofireCodable.swift
Last active June 6, 2023 16:45
Decode Alamofire response to a Generic codable type but if we get http code 400, I decode different json which is a error message.
@discardableResult
private func performRequest<T:Decodable>(route: APIRouter, decoder: JSONDecoder = JSONDecoder(), completion:@escaping (Int, Result<T>)->Void) -> DataRequest {
return Alamofire.request(route).responseData() { responseData in
guard let response = responseData.response else {
completion(APIClient.responseErrorCode, .failure(ApiError.internalServerError(NSLocalizedString("service_error", comment: AppConstant.EMPTY))))
return
}
@alexathylane
alexathylane / iOS Universal Links Support Checklist.md
Last active August 8, 2024 09:35
iOS Universal Links Support Checklist