good morning community,
I have a very good question that I try to implement in a project but I am something new to combine I want to do a function to check some permissions, but I want to return an AnyPublisher with a tuple inside, could someone help me who has already done it or know how to do it?
I put my code below.
func returnedPermisionReminderAuthorizationStatus(reminderPermission:EKAuthorizationStatus,calendarPermission:EKAuthorizationStatus) -> AnyPublisher<(EKAuthorizationStatus,EKAuthorizationStatus),Never>{
var reminderPermissionToPass:EKAuthorizationStatus = .notDetermined
var calendarPermissionToPass:EKAuthorizationStatus = .notDetermined
switch (reminderPermission){
case .notDetermined:
return Just(reminderPermissionToPass).eraseToAnyPublisher()
case .restricted:
reminderPermissionToPass = .restricted
return Just(reminderPermissionToPass).eraseToAnyPublisher()
case .denied:
reminderPermissionToPass = .denied
return Just(reminderPermissionToPass).eraseToAnyPublisher()
case .authorized:
reminderPermissionToPass = .authorized
return Just(reminderPermissionToPass).eraseToAnyPublisher()
@unknown default:
reminderPermissionToPass = .notDetermined
return Just(reminderPermissionToPass).eraseToAnyPublisher()
}
}
Is it possible to send a tuple in a just?