π―
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ZoomAndSnapFlowLayout: UICollectionViewFlowLayout { | |
let activeDistance: CGFloat = 200 | |
let zoomFactor: CGFloat = 0.3 | |
override init() { | |
super.init() | |
scrollDirection = .horizontal | |
minimumLineSpacing = 8 | |
minimumInteritemSpacing = 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// The Debouncer will delay work items until time limit for the preceding call is over. | |
public final class Debouncer { | |
// MARK: - Properties | |
private let limit: TimeInterval | |
private let queue: DispatchQueue | |
private var workItem: DispatchWorkItem? | |
private let syncQueue = DispatchQueue(label: "com.stackexchange.debounce", attributes: []) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import RxSwift | |
import RxCocoa | |
import MobileCoreServices | |
class FileListController: UITableViewController { | |
private lazy var segmentedControl: UISegmentedControl = { | |
let segmentedControl = UISegmentedControl(items: ["GAMBAR", "DOKUMEN"]) | |
segmentedControl.selectedSegmentIndex = 0 | |
segmentedControl.tintColor = UIColor.white |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import CoreLocation | |
import RxSwift | |
import RxCocoa | |
class CLLocationManagerDelegateProxy: DelegateProxy<CLLocationManager, CLLocationManagerDelegate>, DelegateProxyType, CLLocationManagerDelegate { | |
public weak private(set) var locationManager: CLLocationManager? | |
public init(locationManager: CLLocationManager) { | |
self.locationManager = locationManager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -i -H 'Content-type: application/json' -H 'Authorization: key=API_KEY' -XPOST https://fcm.googleapis.com/fcm/send -d '{ | |
"registration_ids":["FCM_TOKEN"], | |
"notification": { | |
"title":"Title of your notification", | |
"body":"content of your notification" | |
}, | |
"mutable_content": true, | |
"data": { | |
"paylod_type": "paylod_type", | |
"event_type": "event_type", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class LoginViewController: UIViewController { | |
var viewModel: UserViewModel | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct LoginModel { | |
let username: String | |
let password: String | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Singleton { | |
static var shared: Singleton = { | |
return Singleton() | |
} | |
private init() {} | |
} |