|
|
@ -14,8 +14,10 @@ struct SideMenuNavigationNotifications { |
|
|
|
static let aboutGme = "aboutGme" |
|
|
|
static let support = "support" |
|
|
|
static let setting = "setting" |
|
|
|
static let availableBalance = "Available_Balance" |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class SideMenuViewController: UIViewController { |
|
|
|
|
|
|
|
@IBOutlet weak var imageViewProfileSetting: UIImageView! |
|
|
@ -53,6 +55,13 @@ class SideMenuViewController: UIViewController { |
|
|
|
private func setup() { |
|
|
|
self.view.backgroundColor = AppConstants.themeRedColor |
|
|
|
self.roundedBgView.layer.cornerRadius = 20 |
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(self.updateBalance(sender:)), name: self.getAvailableBalanceNotificationName(), object: nil) |
|
|
|
} |
|
|
|
|
|
|
|
@objc private func updateBalance(sender: Notification) { |
|
|
|
let balance = sender.userInfo?[SideMenuNavigationNotifications.availableBalance] as? String |
|
|
|
self.labelBalance.text = balance |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private func setupBlueBackGroundTheme() { |
|
|
@ -86,20 +95,6 @@ class SideMenuViewController: UIViewController { |
|
|
|
NotificationCenter.default.post(name: self.getSettingNotificationName(), object: nil, userInfo: nil) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Notification Names |
|
|
|
func getAboutGmeNotificationName() -> Notification.Name { |
|
|
|
return Notification.Name.init(SideMenuNavigationNotifications.aboutGme) |
|
|
|
} |
|
|
|
|
|
|
|
func getSupportNotificationName() -> Notification.Name { |
|
|
|
return Notification.Name.init(SideMenuNavigationNotifications.support) |
|
|
|
} |
|
|
|
|
|
|
|
func getSettingNotificationName() -> Notification.Name { |
|
|
|
return Notification.Name.init(SideMenuNavigationNotifications.setting) |
|
|
|
} |
|
|
|
|
|
|
|
@IBAction func withDraw(_ sender: Any) { |
|
|
|
let storyboard = UIStoryboard.init(name: "Profile", bundle: Bundle.main) |
|
|
|
if let withDrawViewController = storyboard.instantiateViewController(withIdentifier: "withdraw") as? WithdrawViewController { |
|
|
@ -184,5 +179,27 @@ class SideMenuViewController: UIViewController { |
|
|
|
imageViewProfileSetting.layer.cornerRadius = imageViewProfileSetting.frame.height / 2 |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Notification Names |
|
|
|
func getAboutGmeNotificationName() -> Notification.Name { |
|
|
|
return Notification.Name.init(SideMenuNavigationNotifications.aboutGme) |
|
|
|
} |
|
|
|
|
|
|
|
func getSupportNotificationName() -> Notification.Name { |
|
|
|
return Notification.Name.init(SideMenuNavigationNotifications.support) |
|
|
|
} |
|
|
|
|
|
|
|
func getSettingNotificationName() -> Notification.Name { |
|
|
|
return Notification.Name.init(SideMenuNavigationNotifications.setting) |
|
|
|
} |
|
|
|
|
|
|
|
func getAvailableBalanceNotificationName() -> Notification.Name { |
|
|
|
return Notification.Name.init(SideMenuNavigationNotifications.availableBalance) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|