I model the data I got from a haber site and transferred it to the application with Alamofire. I created a detail page for the news and showed the pictures by downloading them with Kingfisher. I made the auto layout of the application programmatically with Snapkit. In addition, i made the page transitions with Hero. I hope you like.
- MVVM Architecture β
- Programmatically β
- Hero β
- Lottie β
- Kingfisher β
- Alamofire β
- Snapkit β
- SparkUI β
Ekran.Kaydi.2022-06-29.13.30.20.mov
{
final class ServiceManager {
public static let shared: ServiceManager = ServiceManager()
}
extension ServiceManager {
func fetch<T>(path: String, onSuccess: @escaping (T) -> (), onError: (AFError) ->()) where T: Codable {
AF.request(path, encoding: JSONEncoding.default).validate().responseDecodable(of: T.self) { response in
guard let model = response.value else { print( response.error as Any ); return }
onSuccess(model)
}
}
}
}