From 1181190aa3e70d1b88db828baaca6b4a5018e068 Mon Sep 17 00:00:00 2001 From: Ivan Ostafiichuk Date: Thu, 3 Jul 2014 11:43:22 +0300 Subject: [PATCH] Make CRToast support autorotation by default. It fixes subtle issue when a notification is displayed from landscape or upside-down orientation. --- CRToast/CRToast.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CRToast/CRToast.m b/CRToast/CRToast.m index 933a7522..17b203c0 100644 --- a/CRToast/CRToast.m +++ b/CRToast/CRToast.m @@ -1070,6 +1070,14 @@ @implementation CRToastViewController UIStatusBarStyle statusBarStyle; +- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + _autorotate = YES; + } + return self; +} + - (BOOL)prefersStatusBarHidden { return [UIApplication sharedApplication].statusBarHidden; }