Skip to content

Instantly share code, notes, and snippets.

View max6363's full-sized avatar

Minhaz Panara max6363

View GitHub Profile
{
"basics": {
"name": "Minhaz Panara",
"label": "iOS Software Engineer at Proximity Works",
"picture": "",
"email": "minhaz.p@proximity.tech",
"phone": "+918460374441",
"website": "",
"summary": "10 years of experience as an iOS Software Development Engineer with diff domains like Fitness Tracking, FinTech, Health Monitoring, OTT platforms, Games, etc. \n\nI am currently working as a Senior Software Engineer - iOS at Proximity Works.",
"location": {
class AgreementFormVC: UIViewController {
@Published var isNextEnabled: Bool = false
// private var switchSubscriber: AnyCancellable?
private var subscribers = Set<AnyCancellable>() // ← set of all subscriptions
@IBOutlet private weak var acceptAgreementSwitch: UISwitch!
@IBOutlet private weak var nextButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
class AgreementFormVC: UIViewController {
@Published var isNextEnabled: Bool = false
private var switchSubscriber: AnyCancellable?
@IBOutlet private weak var acceptAgreementSwitch: UISwitch!
@IBOutlet private weak var nextButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
class AgreementFormVC: UIViewController {
@Published var isNextEnabled: Bool = false
@IBOutlet private weak var acceptAgreementSwitch: UISwitch!
@IBOutlet private weak var nextButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
$isNextEnabled
import Combine
import Foundation
import PlaygroundSupport
var subscription: Cancellable? = Timer.publish(every: 1, on: .main, in: .common)
.autoconnect()
.print("data stream")
.sink { output in
print("finished stream with : \(output)")
} receiveValue: { value in
import Combine
import Foundation
import PlaygroundSupport
let subscription = Timer.publish(every: 1, on: .main, in: .common)
.autoconnect()
.print("data stream")
.sink { output in
print("finished stream with : \(output)")
} receiveValue: { value in
import Combine
import Foundation
import PlaygroundSupport
let subscription = Timer.publish(every: 1, on: .main, in: .common)
.autoconnect()
.sink { output in
print("finished stream with : \(output)")
} receiveValue: { value in
print("receive value: \(value)")
let theEventTitleLabel = UILabel()
/*
let newEventLabelSubscriber = Subscribers.Assign(object: theEventTitleLabel, keyPath: \.text)
eventPublisher.subscribe(newEventLabelSubscriber)
*/
eventPublisher.assign(to: \.text, on: theEventTitleLabel) // <-- [new code line]
import UIKit
import Combine
extension Notification.Name {
static let newEvent = Notification.Name("new_event")
}
struct Event {
let title: String
let scheduledOn: Date
let eventPublisher = NotificationCenter.Publisher(center: .default, name: .newEvent, object: nil)
.map { (notification) -> String? in
return (notification.object as? Event)?.title ?? ""
}