From 59a6641ca6bd9c3803bf36430f6d7e67746bded6 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 4 Mar 2019 18:30:04 -0500 Subject: [PATCH] Fix for top alert pointer. --- MVMCoreUI/TopAlert/MVMCoreUITopAlertView.h | 3 +++ MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.h b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.h index 05943ee8..46d56cb6 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.h +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.h @@ -31,6 +31,9 @@ // Returns the top alert view + (nullable instancetype)sharedGlobal; +// Returns a TopAlertView with the mvm styling. Also sets the property in the session. ++ (nullable instancetype)setupTopAlertView; + // Pins the status bar view at the top of the passed in view controller. - (void)pinATopViewController:(nonnull UIViewController *)viewController; diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m index 88d73cbd..735f28d9 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m @@ -54,6 +54,13 @@ NSString * const MFAccTopAlertClosed = @"Top alert notification is closed."; return [MVMCoreUISession sharedGlobal].topAlertView; } ++ (nullable instancetype)setupTopAlertView { + MVMCoreUITopAlertView *topAlertView = [[self alloc] init]; + topAlertView.translatesAutoresizingMaskIntoConstraints = NO; + [MVMCoreUISession sharedGlobal].topAlertView = topAlertView; + return topAlertView; +} + - (void)setupView { [super setupView]; if (!self.statusBarView) {