From 02a5d48ce4e762c41e9b5d5f5820f24f2c35460e Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sat, 22 Sep 2012 10:14:41 +0200 Subject: [PATCH] Added a news view. [ADDED] A news view on the unlock screen. --- MasterPassword/iOS/MPUnlockViewController.h | 3 +- MasterPassword/iOS/MPUnlockViewController.m | 19 +++ .../iOS/MainStoryboard_iPhone.storyboard | 154 ++---------------- 3 files changed, 37 insertions(+), 139 deletions(-) diff --git a/MasterPassword/iOS/MPUnlockViewController.h b/MasterPassword/iOS/MPUnlockViewController.h index 6828d19b..8ac11fdf 100644 --- a/MasterPassword/iOS/MPUnlockViewController.h +++ b/MasterPassword/iOS/MPUnlockViewController.h @@ -8,7 +8,7 @@ #import -@interface MPUnlockViewController : UIViewController +@interface MPUnlockViewController : UIViewController @property (weak, nonatomic) IBOutlet UIImageView *spinner; @property (weak, nonatomic) IBOutlet UILabel *passwordFieldLabel; @@ -26,6 +26,7 @@ @property (strong, nonatomic) IBOutlet UILongPressGestureRecognizer *targetedUserActionGesture; @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *loadingUsersIndicator; @property (weak, nonatomic) IBOutlet UIView *uiContainer; +@property (weak, nonatomic) IBOutlet UIWebView *newsView; @property (nonatomic, strong) UIColor *avatarShadowColor; diff --git a/MasterPassword/iOS/MPUnlockViewController.m b/MasterPassword/iOS/MPUnlockViewController.m index 57de935a..c323f240 100644 --- a/MasterPassword/iOS/MPUnlockViewController.m +++ b/MasterPassword/iOS/MPUnlockViewController.m @@ -134,6 +134,8 @@ } - (void)viewDidLoad { + + [self.newsView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"file://localhost/Users/lhunath/Documents/workspace/lyndir/MasterPassword/Site/news.html"]]]; self.avatarToUser = [NSMutableDictionary dictionaryWithCapacity:3]; self.fbOperationQueue = [NSOperationQueue new]; @@ -751,6 +753,19 @@ [self updateLayoutAnimated:NO allowScroll:NO completion:nil]; } +#pragma mark - UIWebViewDelegate + +- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request + navigationType:(UIWebViewNavigationType)navigationType { + + if (navigationType == UIWebViewNavigationTypeLinkClicked) { + [[UIApplication sharedApplication] openURL:[request URL]]; + return NO; + } + + return YES; +} + #pragma mark - IBActions - (IBAction)targetedUserAction:(UILongPressGestureRecognizer *)sender { @@ -926,4 +941,8 @@ }]; } +- (void)viewDidUnload { + [self setNewsView:nil]; + [super viewDidUnload]; +} @end diff --git a/MasterPassword/iOS/MainStoryboard_iPhone.storyboard b/MasterPassword/iOS/MainStoryboard_iPhone.storyboard index 6474e8c4..79bdd589 100644 --- a/MasterPassword/iOS/MainStoryboard_iPhone.storyboard +++ b/MasterPassword/iOS/MainStoryboard_iPhone.storyboard @@ -1228,6 +1228,10 @@ Pink fluffy door frame. + + + + @@ -1402,7 +1406,7 @@ Pink fluffy door frame. + + + + + + + + + @@ -1596,6 +1605,7 @@ You could use the word wall for inspiration in finding a memorable master passw + @@ -2111,144 +2121,12 @@ You could use the word wall for inspiration in finding a memorable master passw - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file