- Completed the blogs detail screen, also handled the language change. - added a nsnotification to handle the sidebar only on home an my list - Added api for like , unlike , fav remove, with data models. - handled the like unlike realtime, without the extra network call. - added realtime language change will update the fav cells.
37 lines
632 B
Swift
37 lines
632 B
Swift
//
|
|
// BaseResponseModel.swift
|
|
// WOKA
|
|
//
|
|
// Created by MacBook Pro on 06/05/24.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
// MARK: - BaseResponseModel
|
|
protocol ResponseProtocol {
|
|
var success: Int? { get }
|
|
}
|
|
|
|
class BaseResponseModel<T: Codable> : Codable, ResponseProtocol{
|
|
let success: Int?
|
|
let message: String?
|
|
let data: T?
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case success
|
|
case message
|
|
case data
|
|
}
|
|
}
|
|
|
|
|
|
struct CommonResponseModel : Codable ,ResponseProtocol{
|
|
let success: Int?
|
|
let message: String?
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case success
|
|
case message
|
|
}
|
|
}
|