summaryrefslogtreecommitdiff
path: root/Juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-11-23 01:10:40 +0300
committerGravatar Vitaly Takmazov2017-11-23 01:10:40 +0300
commit56ae98114db624dc748cc74d706e14181b22e55d (patch)
tree043ef103940f66b4a06305e2ddb609193239e08b /Juick
parent78bcc152dadae837af41ab4e42fe9c95342c119e (diff)
drop some pods
Diffstat (limited to 'Juick')
-rw-r--r--Juick/AppDelegate.h3
-rw-r--r--Juick/AppDelegate.m2
-rw-r--r--Juick/Model/User.h9
-rw-r--r--Juick/Model/User.m14
-rw-r--r--Juick/ViewControllers/LoginViewController.m3
-rw-r--r--Juick/ViewControllers/MessagesViewController.m3
-rw-r--r--Juick/Views/MessageCell.m2
7 files changed, 19 insertions, 17 deletions
diff --git a/Juick/AppDelegate.h b/Juick/AppDelegate.h
index 64cc01a..092fa20 100644
--- a/Juick/AppDelegate.h
+++ b/Juick/AppDelegate.h
@@ -6,8 +6,7 @@
// Copyright (c) 2013 com.juick. All rights reserved.
//
-#import <UIKit/UIKit.h>
-#import "User.h"
+@import UIKit;
@interface AppDelegate : UIResponder <UIApplicationDelegate, UNUserNotificationCenterDelegate>
diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m
index 1989de2..049e42e 100644
--- a/Juick/AppDelegate.m
+++ b/Juick/AppDelegate.m
@@ -11,7 +11,9 @@
#import "LoginViewController.h"
#import "ColorScheme.h"
+#import "APIClient.h"
#import "Message.h"
+#import "User.h"
#import "DeviceRegistration.h"
#import "NewPostViewController.h"
diff --git a/Juick/Model/User.h b/Juick/Model/User.h
index ca84d50..1d4897e 100644
--- a/Juick/Model/User.h
+++ b/Juick/Model/User.h
@@ -6,11 +6,8 @@
// Copyright (c) 2014 com.juick. All rights reserved.
//
-#import <Foundation/Foundation.h>
-@import PDKeychainBindingsController;
-#import "SIAlertView.h"
-#import "APIClient.h"
-#import "YYModel.h"
+@import Foundation;
+@import YYModel;
@interface User : NSObject
@property (nonatomic, strong) NSString *uname;
@@ -22,6 +19,6 @@
+ (void) checkIsValid:(void(^)(BOOL))callback;
-+ (void) throwUnableToLogin;
++ (void) throwUnableToLogin:(UIViewController *)view;
@end
diff --git a/Juick/Model/User.m b/Juick/Model/User.m
index 3f860d7..38e4269 100644
--- a/Juick/Model/User.m
+++ b/Juick/Model/User.m
@@ -8,6 +8,8 @@
#import "User.h"
+@import PDKeychainBindingsController;
+#import "APIClient.h"
@implementation User
@@ -15,12 +17,12 @@
return [[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] != nil;
}
-+(void) throwUnableToLogin {
- SIAlertView *alert = [[SIAlertView alloc] initWithTitle:@"Error" andMessage:@"Unable to login, check username/password, or network connectivity"];
- [alert addButtonWithTitle:@"OK" type:SIAlertViewButtonTypeCancel handler:^(SIAlertView *alertView) {
- // <#code#>
- }];
- [alert show];
++(void) throwUnableToLogin:(UIViewController *)view {
+ UIAlertController *alert = [UIAlertController new];
+ [alert setTitle:@"Error"];
+ [alert setMessage:@"Unable to login, check username/password, or network connectivity"];
+ [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]];
+ [view presentViewController:alert animated:YES completion:nil];
}
+(void) checkIsValid:(void (^)(BOOL))callback {
diff --git a/Juick/ViewControllers/LoginViewController.m b/Juick/ViewControllers/LoginViewController.m
index d3d1edc..640cd10 100644
--- a/Juick/ViewControllers/LoginViewController.m
+++ b/Juick/ViewControllers/LoginViewController.m
@@ -10,6 +10,7 @@
#import "User.h"
#import "ColorScheme.h"
#import "AppDelegate.h"
+#import "APIClient.h"
@implementation LoginViewController
@@ -70,7 +71,7 @@
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController popToRootViewControllerAnimated:NO];
} else {
- [User throwUnableToLogin];
+ [User throwUnableToLogin:self];
}
}];
diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m
index e4d0e1c..b91f056 100644
--- a/Juick/ViewControllers/MessagesViewController.m
+++ b/Juick/ViewControllers/MessagesViewController.m
@@ -9,6 +9,7 @@
#import "MessagesViewController.h"
#import "MessageCell.h"
+#import "APIClient.h"
#import "Message.h"
#import "ColorScheme.h"
@@ -80,7 +81,7 @@
self.path = [APIClient feedUrl];
[self refreshData];
} else {
- [User throwUnableToLogin];
+ [User throwUnableToLogin:self];
}
}];
diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m
index 77d54cd..236b4a3 100644
--- a/Juick/Views/MessageCell.m
+++ b/Juick/Views/MessageCell.m
@@ -31,7 +31,7 @@
}
- (void) configureWithMessage:(Message *)msg {
- [self.avatar setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [msg.user.uid intValue]]]];
+ [self.avatar yy_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [msg.user.uid intValue]]] options:YYWebImageOptionProgressiveBlur|YYWebImageOptionSetImageWithFadeAnimation];
if ([msg.attach length] > 0) {
CGFloat imageHeight = [msg.attachment.small.height floatValue] / [[UIScreen mainScreen] scale];
self.attachmentHeight.constant = imageHeight;