-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathAccountUI.swift
35 lines (28 loc) · 1.21 KB
/
AccountUI.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// AccountUI.swift
// Lockdown
//
// Created by Oleg Dreyman on 06.10.2020.
// Copyright © 2020 Confirmed Inc. All rights reserved.
//
import UIKit
enum AccountUI {
static let accountStateDidChange = Notification.Name("AccountUIAccountStateDidChangeNotification")
static let subscritionTypeChanged =
Notification.Name("AccountSubscritionTypeDidChanged")
static func presentCreateAccount(on vc: UIViewController) {
let storyboard = UIStoryboard.main
let viewController = storyboard.instantiateViewController(withIdentifier: "emailSignUpViewController") as! EmailSignUpViewController
viewController.delegate.showSignIn = { [weak vc] in
if let strongVC = vc {
AccountUI.presentSignInToAccount(on: strongVC)
}
}
vc.present(viewController, animated: true, completion: nil)
}
static func presentSignInToAccount(on vc: UIViewController) {
let storyboard = UIStoryboard.main
let viewController = storyboard.instantiateViewController(withIdentifier: "emailSignInViewController") as! EmailSignInViewController
vc.present(viewController, animated: true, completion: nil)
}
}