From 72b1d3662653b84c878a7453b90fa7e98aa02ffc Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Thu, 11 Sep 2014 20:31:23 -0400 Subject: [PATCH] Fix sizing issues with avatars on different size devices. [FIXED] Avatar cells badly sized on some size devices. --- .../ObjC/iOS/MPCombinedViewController.m | 2 +- .../ObjC/iOS/MPUsersViewController.m | 26 +++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/MasterPassword/ObjC/iOS/MPCombinedViewController.m b/MasterPassword/ObjC/iOS/MPCombinedViewController.m index abaeb6c9..e53fcb35 100644 --- a/MasterPassword/ObjC/iOS/MPCombinedViewController.m +++ b/MasterPassword/ObjC/iOS/MPCombinedViewController.m @@ -38,7 +38,7 @@ [super viewDidLoad]; - [self setMode:MPCombinedModeUserSelection animated:NO]; + _mode = MPCombinedModeUserSelection; } - (void)viewWillAppear:(BOOL)animated { diff --git a/MasterPassword/ObjC/iOS/MPUsersViewController.m b/MasterPassword/ObjC/iOS/MPUsersViewController.m index c146822d..c787751b 100644 --- a/MasterPassword/ObjC/iOS/MPUsersViewController.m +++ b/MasterPassword/ObjC/iOS/MPUsersViewController.m @@ -74,8 +74,6 @@ typedef NS_ENUM( NSUInteger, MPActiveUserState ) { self.view.backgroundColor = [UIColor clearColor]; self.avatarCollectionView.allowsMultipleSelection = YES; [self.entryField addTarget:self action:@selector( textFieldEditingChanged: ) forControlEvents:UIControlEventEditingChanged]; - - [self setActive:YES animated:NO]; } - (void)viewWillAppear:(BOOL)animated { @@ -83,15 +81,7 @@ typedef NS_ENUM( NSUInteger, MPActiveUserState ) { [super viewWillAppear:animated]; self.userSelectionContainer.alpha = 0; - - [self observeStore]; - [self registerObservers]; - [self reloadUsers]; - - [self.marqueeTipTimer invalidate]; - self.marqueeTipTimer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector( firedMarqueeTimer: ) - userInfo:nil repeats:YES]; - [self firedMarqueeTimer:nil]; + [self setActive:YES animated:NO]; } - (void)viewWillDisappear:(BOOL)animated { @@ -104,6 +94,20 @@ typedef NS_ENUM( NSUInteger, MPActiveUserState ) { [self.marqueeTipTimer invalidate]; } +- (void)viewDidAppear:(BOOL)animated { + + [super viewDidAppear:animated]; + + [self observeStore]; + [self registerObservers]; + [self reloadUsers]; + + [self.marqueeTipTimer invalidate]; + self.marqueeTipTimer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector( firedMarqueeTimer: ) + userInfo:nil repeats:YES]; + [self firedMarqueeTimer:nil]; +} + - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews];