diff options
Diffstat (limited to 'Juick')
91 files changed, 844 insertions, 631 deletions
diff --git a/Juick/APIClient.h b/Juick/APIClient.h index 8546d4d..8c6e024 100644 --- a/Juick/APIClient.h +++ b/Juick/APIClient.h @@ -6,8 +6,17 @@ // Copyright © 2016 com.juick. All rights reserved. // #import <Foundation/Foundation.h> +@import AFNetworking; @interface APIClient : NSObject - @property (nonatomic, retain) AFHTTPSessionManager *manager; - +(APIClient *) sharedClient; -@end
\ No newline at end of file + +@property (nonatomic, retain) AFHTTPSessionManager *manager; ++(APIClient *) sharedClient; + +-(void) pullNextFromPath:(NSString *)path params:(NSDictionary *)params callback:(void(^)(NSArray *, NSError *))callback; + ++(NSString *) messagesUrl; ++(NSString *) threadUrl; ++(NSString *) feedUrl; + +@end diff --git a/Juick/APIClient.m b/Juick/APIClient.m index 1fc2743..d2356b5 100644 --- a/Juick/APIClient.m +++ b/Juick/APIClient.m @@ -6,6 +6,8 @@ // Copyright © 2016 com.juick. All rights reserved. // #import "APIClient.h" +#import "PDKeychainBindings.h" +#import "Message.h" @implementation APIClient @@ -25,4 +27,45 @@ return self; } +-(void) pullNextFromPath:(NSString *)path params:(NSDictionary *) params callback:(void(^)(NSArray *, NSError *))callback { + AFHTTPSessionManager *manager = [APIClient sharedClient].manager; + if ([[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] != nil) { + manager.requestSerializer = [AFJSONRequestSerializer serializer]; + [manager.requestSerializer setAuthorizationHeaderFieldWithUsername:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] password:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.password"]]; + } + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + [manager GET:path parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { + NSMutableArray *messages = [NSMutableArray new]; + [((NSArray *)responseObject) enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + [messages addObject:[Message yy_modelWithJSON:obj]]; + }]; + dispatch_async(dispatch_get_main_queue(), ^{ + callback(messages, nil); + }); + + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { + NSLog(@"REST Error: %@", error); + NSInteger statusCode = ((NSHTTPURLResponse *)task.response).statusCode; + if (statusCode == 401) { + dispatch_async(dispatch_get_main_queue(), ^{ + callback(nil, [[NSError alloc] initWithDomain:@"JuickErrorDomain" code:401 userInfo:nil]); + }); + } + }]; + }); +} + + ++(NSString *) messagesUrl { + return @"/messages"; +} + ++(NSString *) threadUrl { + return @"/thread"; +} + ++(NSString *) feedUrl { + return @"/home"; +} + @end diff --git a/Juick/AppDelegate.h b/Juick/AppDelegate.h index 04a8bb2..6753fd7 100644 --- a/Juick/AppDelegate.h +++ b/Juick/AppDelegate.h @@ -9,13 +9,8 @@ #import <UIKit/UIKit.h> #import "User.h" -@class SWRevealViewController; - @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; -@property (strong, nonatomic) UIViewController *viewController; - -- (void) pushLoginForm; @end diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m index 1ba0ccf..b5c4e27 100644 --- a/Juick/AppDelegate.m +++ b/Juick/AppDelegate.m @@ -8,68 +8,25 @@ #import "AppDelegate.h" #import "MessagesViewController.h" -#import "RevealPanelViewController.h" -#import "SWRevealViewController.h" #import "LoginViewController.h" #import "ColorScheme.h" #import "Message.h" #import "TokensList.h" +#import "NewPostViewController.h" @implementation AppDelegate -SWRevealViewController *reveal; - - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[UINavigationBar appearance] setTintColor:[ColorScheme linkColor]]; [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [ColorScheme linkColor]}]; [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault; - - MessagesViewController *messages = [[MessagesViewController alloc] init]; - RevealPanelViewController *rear = [[RevealPanelViewController alloc] init]; - - UINavigationController *main = [[UINavigationController alloc] initWithRootViewController:messages]; - UINavigationController *rearNav = [[UINavigationController alloc] initWithRootViewController:rear]; - reveal = [[SWRevealViewController alloc] initWithRearViewController:rearNav frontViewController:main]; - self.viewController = reveal; - [messages.navigationController.navigationBar addGestureRecognizer:reveal.panGestureRecognizer]; - UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] - style:UIBarButtonItemStylePlain target:reveal action:@selector(revealToggle:)]; - messages.navigationItem.leftBarButtonItem = revealButtonItem; - UIBarButtonItem *compose = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose - target:messages action:@selector(composePressed)]; - messages.navigationItem.rightBarButtonItem = compose; - - if ([User isAuthenticated]) { - [User checkIsValid:^(BOOL success) { - if (success) { - [messages loadFromPath:[Message feedUrl] withParams:nil withTitle:@"My feed"]; - [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeAlert|UIUserNotificationTypeSound|UIUserNotificationTypeBadge) categories:nil]]; - } else { - [User throwUnableToLogin]; - } - }]; - - } else { - [messages loadFromPath:[Message messagesUrl] withParams:nil withTitle:@"Discover"]; - } - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.rootViewController = self.viewController; - [self.window makeKeyAndVisible]; - + return YES; } - -- (void) pushLoginForm { - if ([reveal isBeingPresented]) { - [reveal revealToggle:self]; - } - UIViewController *loginView = [[LoginViewController alloc] init]; - UINavigationController *messages = (UINavigationController *)reveal.frontViewController; - [messages pushViewController:loginView animated:YES]; -} + -(void) application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings { [[UIApplication sharedApplication] registerForRemoteNotifications]; diff --git a/Juick/Images.xcassets/AppIcon.appiconset/Contents.json b/Juick/Images.xcassets/AppIcon.appiconset/Contents.json index dbd6347..520a8bf 100644 --- a/Juick/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Juick/Images.xcassets/AppIcon.appiconset/Contents.json @@ -127,6 +127,11 @@ "idiom" : "ipad", "filename" : "Icon-83.5@2x.png", "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/Juick/Images.xcassets/LaunchImage.launchimage/Contents.json b/Juick/Images.xcassets/LaunchImage.launchimage/Contents.json index c79ebd3..fadb823 100644 --- a/Juick/Images.xcassets/LaunchImage.launchimage/Contents.json +++ b/Juick/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -10,9 +10,9 @@ { "orientation" : "portrait", "idiom" : "iphone", - "subtype" : "retina4", "extent" : "full-screen", "minimum-system-version" : "7.0", + "subtype" : "retina4", "scale" : "2x" } ], diff --git a/Juick/Images.xcassets/res/Contents.json b/Juick/Images.xcassets/res/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Juick/Images.xcassets/res/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/active_dot.imageset/Contents.json b/Juick/Images.xcassets/res/active_dot.imageset/Contents.json new file mode 100644 index 0000000..f1493b4 --- /dev/null +++ b/Juick/Images.xcassets/res/active_dot.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "active_dot.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "active_dot@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "active_dot@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/active_dot.imageset/active_dot.png b/Juick/Images.xcassets/res/active_dot.imageset/active_dot.png Binary files differnew file mode 100644 index 0000000..4182bc1 --- /dev/null +++ b/Juick/Images.xcassets/res/active_dot.imageset/active_dot.png diff --git a/Juick/Images.xcassets/res/active_dot.imageset/active_dot@2x.png b/Juick/Images.xcassets/res/active_dot.imageset/active_dot@2x.png Binary files differnew file mode 100644 index 0000000..1427060 --- /dev/null +++ b/Juick/Images.xcassets/res/active_dot.imageset/active_dot@2x.png diff --git a/Juick/Images.xcassets/res/active_dot.imageset/active_dot@3x.png b/Juick/Images.xcassets/res/active_dot.imageset/active_dot@3x.png Binary files differnew file mode 100644 index 0000000..4f7ce87 --- /dev/null +++ b/Juick/Images.xcassets/res/active_dot.imageset/active_dot@3x.png diff --git a/Juick/Images.xcassets/res/chats_icon.imageset/Contents.json b/Juick/Images.xcassets/res/chats_icon.imageset/Contents.json new file mode 100644 index 0000000..e666842 --- /dev/null +++ b/Juick/Images.xcassets/res/chats_icon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "chats_icon.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "chats_icon@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "chats_icon@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/chats_icon.imageset/chats_icon.png b/Juick/Images.xcassets/res/chats_icon.imageset/chats_icon.png Binary files differnew file mode 100644 index 0000000..9161afa --- /dev/null +++ b/Juick/Images.xcassets/res/chats_icon.imageset/chats_icon.png diff --git a/Juick/Images.xcassets/res/chats_icon.imageset/chats_icon@2x.png b/Juick/Images.xcassets/res/chats_icon.imageset/chats_icon@2x.png Binary files differnew file mode 100644 index 0000000..2811b24 --- /dev/null +++ b/Juick/Images.xcassets/res/chats_icon.imageset/chats_icon@2x.png diff --git a/Juick/Images.xcassets/res/chats_icon.imageset/chats_icon@3x.png b/Juick/Images.xcassets/res/chats_icon.imageset/chats_icon@3x.png Binary files differnew file mode 100644 index 0000000..9009095 --- /dev/null +++ b/Juick/Images.xcassets/res/chats_icon.imageset/chats_icon@3x.png diff --git a/Juick/Images.xcassets/res/circle.imageset/Contents.json b/Juick/Images.xcassets/res/circle.imageset/Contents.json new file mode 100644 index 0000000..cb3acd9 --- /dev/null +++ b/Juick/Images.xcassets/res/circle.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "circle.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "circle@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "circle@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/circle.imageset/circle.png b/Juick/Images.xcassets/res/circle.imageset/circle.png Binary files differnew file mode 100644 index 0000000..f0e5b53 --- /dev/null +++ b/Juick/Images.xcassets/res/circle.imageset/circle.png diff --git a/Juick/Images.xcassets/res/circle.imageset/circle@2x.png b/Juick/Images.xcassets/res/circle.imageset/circle@2x.png Binary files differnew file mode 100644 index 0000000..431af57 --- /dev/null +++ b/Juick/Images.xcassets/res/circle.imageset/circle@2x.png diff --git a/Juick/Images.xcassets/res/circle.imageset/circle@3x.png b/Juick/Images.xcassets/res/circle.imageset/circle@3x.png Binary files differnew file mode 100644 index 0000000..f8b9c70 --- /dev/null +++ b/Juick/Images.xcassets/res/circle.imageset/circle@3x.png diff --git a/Juick/Images.xcassets/res/circle_left.imageset/Contents.json b/Juick/Images.xcassets/res/circle_left.imageset/Contents.json new file mode 100644 index 0000000..021f3a0 --- /dev/null +++ b/Juick/Images.xcassets/res/circle_left.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "circle_left.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "circle_left@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "circle_left@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/circle_left.imageset/circle_left.png b/Juick/Images.xcassets/res/circle_left.imageset/circle_left.png Binary files differnew file mode 100644 index 0000000..1ea5221 --- /dev/null +++ b/Juick/Images.xcassets/res/circle_left.imageset/circle_left.png diff --git a/Juick/Images.xcassets/res/circle_left.imageset/circle_left@2x.png b/Juick/Images.xcassets/res/circle_left.imageset/circle_left@2x.png Binary files differnew file mode 100644 index 0000000..69be45d --- /dev/null +++ b/Juick/Images.xcassets/res/circle_left.imageset/circle_left@2x.png diff --git a/Juick/Images.xcassets/res/circle_left.imageset/circle_left@3x.png b/Juick/Images.xcassets/res/circle_left.imageset/circle_left@3x.png Binary files differnew file mode 100644 index 0000000..dcc262e --- /dev/null +++ b/Juick/Images.xcassets/res/circle_left.imageset/circle_left@3x.png diff --git a/Juick/Images.xcassets/res/circle_right.imageset/Contents.json b/Juick/Images.xcassets/res/circle_right.imageset/Contents.json new file mode 100644 index 0000000..1645b0d --- /dev/null +++ b/Juick/Images.xcassets/res/circle_right.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "circle_right.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "circle_right@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "circle_right@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/circle_right.imageset/circle_right.png b/Juick/Images.xcassets/res/circle_right.imageset/circle_right.png Binary files differnew file mode 100644 index 0000000..4b0eb6d --- /dev/null +++ b/Juick/Images.xcassets/res/circle_right.imageset/circle_right.png diff --git a/Juick/Images.xcassets/res/circle_right.imageset/circle_right@2x.png b/Juick/Images.xcassets/res/circle_right.imageset/circle_right@2x.png Binary files differnew file mode 100644 index 0000000..2d9c488 --- /dev/null +++ b/Juick/Images.xcassets/res/circle_right.imageset/circle_right@2x.png diff --git a/Juick/Images.xcassets/res/circle_right.imageset/circle_right@3x.png b/Juick/Images.xcassets/res/circle_right.imageset/circle_right@3x.png Binary files differnew file mode 100644 index 0000000..0778501 --- /dev/null +++ b/Juick/Images.xcassets/res/circle_right.imageset/circle_right@3x.png diff --git a/Juick/Images.xcassets/res/circle_square.imageset/Contents.json b/Juick/Images.xcassets/res/circle_square.imageset/Contents.json new file mode 100644 index 0000000..f9ef167 --- /dev/null +++ b/Juick/Images.xcassets/res/circle_square.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "circle_square.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "circle_square@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "circle_square@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/circle_square.imageset/circle_square.png b/Juick/Images.xcassets/res/circle_square.imageset/circle_square.png Binary files differnew file mode 100644 index 0000000..16643dc --- /dev/null +++ b/Juick/Images.xcassets/res/circle_square.imageset/circle_square.png diff --git a/Juick/Images.xcassets/res/circle_square.imageset/circle_square@2x.png b/Juick/Images.xcassets/res/circle_square.imageset/circle_square@2x.png Binary files differnew file mode 100644 index 0000000..42179f4 --- /dev/null +++ b/Juick/Images.xcassets/res/circle_square.imageset/circle_square@2x.png diff --git a/Juick/Images.xcassets/res/circle_square.imageset/circle_square@3x.png b/Juick/Images.xcassets/res/circle_square.imageset/circle_square@3x.png Binary files differnew file mode 100644 index 0000000..7ce6281 --- /dev/null +++ b/Juick/Images.xcassets/res/circle_square.imageset/circle_square@3x.png diff --git a/Juick/Images.xcassets/res/edit_icon.imageset/Contents.json b/Juick/Images.xcassets/res/edit_icon.imageset/Contents.json new file mode 100644 index 0000000..68f6792 --- /dev/null +++ b/Juick/Images.xcassets/res/edit_icon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "edit_icon.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "edit_icon@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "edit_icon@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/edit_icon.imageset/edit_icon.png b/Juick/Images.xcassets/res/edit_icon.imageset/edit_icon.png Binary files differnew file mode 100644 index 0000000..f3bf8b8 --- /dev/null +++ b/Juick/Images.xcassets/res/edit_icon.imageset/edit_icon.png diff --git a/Juick/Images.xcassets/res/edit_icon.imageset/edit_icon@2x.png b/Juick/Images.xcassets/res/edit_icon.imageset/edit_icon@2x.png Binary files differnew file mode 100644 index 0000000..2a915a9 --- /dev/null +++ b/Juick/Images.xcassets/res/edit_icon.imageset/edit_icon@2x.png diff --git a/Juick/Images.xcassets/res/edit_icon.imageset/edit_icon@3x.png b/Juick/Images.xcassets/res/edit_icon.imageset/edit_icon@3x.png Binary files differnew file mode 100644 index 0000000..cb58e3d --- /dev/null +++ b/Juick/Images.xcassets/res/edit_icon.imageset/edit_icon@3x.png diff --git a/Juick/Images.xcassets/res/nearby_icon.imageset/Contents.json b/Juick/Images.xcassets/res/nearby_icon.imageset/Contents.json new file mode 100644 index 0000000..5e03565 --- /dev/null +++ b/Juick/Images.xcassets/res/nearby_icon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "nearby_icon.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "nearby_icon@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "nearby_icon@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/nearby_icon.imageset/nearby_icon.png b/Juick/Images.xcassets/res/nearby_icon.imageset/nearby_icon.png Binary files differnew file mode 100644 index 0000000..e0e4665 --- /dev/null +++ b/Juick/Images.xcassets/res/nearby_icon.imageset/nearby_icon.png diff --git a/Juick/Images.xcassets/res/nearby_icon.imageset/nearby_icon@2x.png b/Juick/Images.xcassets/res/nearby_icon.imageset/nearby_icon@2x.png Binary files differnew file mode 100644 index 0000000..05f367c --- /dev/null +++ b/Juick/Images.xcassets/res/nearby_icon.imageset/nearby_icon@2x.png diff --git a/Juick/Images.xcassets/res/nearby_icon.imageset/nearby_icon@3x.png b/Juick/Images.xcassets/res/nearby_icon.imageset/nearby_icon@3x.png Binary files differnew file mode 100644 index 0000000..586ed71 --- /dev/null +++ b/Juick/Images.xcassets/res/nearby_icon.imageset/nearby_icon@3x.png diff --git a/Juick/Images.xcassets/res/new_chat_icon.imageset/Contents.json b/Juick/Images.xcassets/res/new_chat_icon.imageset/Contents.json new file mode 100644 index 0000000..df38a58 --- /dev/null +++ b/Juick/Images.xcassets/res/new_chat_icon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "new_chat_icon.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "new_chat_icon@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "new_chat_icon@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/new_chat_icon.imageset/new_chat_icon.png b/Juick/Images.xcassets/res/new_chat_icon.imageset/new_chat_icon.png Binary files differnew file mode 100644 index 0000000..bcf43a8 --- /dev/null +++ b/Juick/Images.xcassets/res/new_chat_icon.imageset/new_chat_icon.png diff --git a/Juick/Images.xcassets/res/new_chat_icon.imageset/new_chat_icon@2x.png b/Juick/Images.xcassets/res/new_chat_icon.imageset/new_chat_icon@2x.png Binary files differnew file mode 100644 index 0000000..d786501 --- /dev/null +++ b/Juick/Images.xcassets/res/new_chat_icon.imageset/new_chat_icon@2x.png diff --git a/Juick/Images.xcassets/res/new_chat_icon.imageset/new_chat_icon@3x.png b/Juick/Images.xcassets/res/new_chat_icon.imageset/new_chat_icon@3x.png Binary files differnew file mode 100644 index 0000000..f1dafa7 --- /dev/null +++ b/Juick/Images.xcassets/res/new_chat_icon.imageset/new_chat_icon@3x.png diff --git a/Juick/Images.xcassets/res/plus_icon.imageset/Contents.json b/Juick/Images.xcassets/res/plus_icon.imageset/Contents.json new file mode 100644 index 0000000..c3e2c88 --- /dev/null +++ b/Juick/Images.xcassets/res/plus_icon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "plus_icon.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "plus_icon@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "plus_icon@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/plus_icon.imageset/plus_icon.png b/Juick/Images.xcassets/res/plus_icon.imageset/plus_icon.png Binary files differnew file mode 100644 index 0000000..0562748 --- /dev/null +++ b/Juick/Images.xcassets/res/plus_icon.imageset/plus_icon.png diff --git a/Juick/Images.xcassets/res/plus_icon.imageset/plus_icon@2x.png b/Juick/Images.xcassets/res/plus_icon.imageset/plus_icon@2x.png Binary files differnew file mode 100644 index 0000000..fa037a5 --- /dev/null +++ b/Juick/Images.xcassets/res/plus_icon.imageset/plus_icon@2x.png diff --git a/Juick/Images.xcassets/res/plus_icon.imageset/plus_icon@3x.png b/Juick/Images.xcassets/res/plus_icon.imageset/plus_icon@3x.png Binary files differnew file mode 100644 index 0000000..9650046 --- /dev/null +++ b/Juick/Images.xcassets/res/plus_icon.imageset/plus_icon@3x.png diff --git a/Juick/Images.xcassets/res/profile_icon.imageset/Contents.json b/Juick/Images.xcassets/res/profile_icon.imageset/Contents.json new file mode 100644 index 0000000..1ae5012 --- /dev/null +++ b/Juick/Images.xcassets/res/profile_icon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "profile_icon.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "profile_icon@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "profile_icon@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/profile_icon.imageset/profile_icon.png b/Juick/Images.xcassets/res/profile_icon.imageset/profile_icon.png Binary files differnew file mode 100644 index 0000000..5cbd35c --- /dev/null +++ b/Juick/Images.xcassets/res/profile_icon.imageset/profile_icon.png diff --git a/Juick/Images.xcassets/res/profile_icon.imageset/profile_icon@2x.png b/Juick/Images.xcassets/res/profile_icon.imageset/profile_icon@2x.png Binary files differnew file mode 100644 index 0000000..780e59a --- /dev/null +++ b/Juick/Images.xcassets/res/profile_icon.imageset/profile_icon@2x.png diff --git a/Juick/Images.xcassets/res/profile_icon.imageset/profile_icon@3x.png b/Juick/Images.xcassets/res/profile_icon.imageset/profile_icon@3x.png Binary files differnew file mode 100644 index 0000000..74d55b8 --- /dev/null +++ b/Juick/Images.xcassets/res/profile_icon.imageset/profile_icon@3x.png diff --git a/Juick/Images.xcassets/res/search_icon.imageset/Contents.json b/Juick/Images.xcassets/res/search_icon.imageset/Contents.json new file mode 100644 index 0000000..00819b0 --- /dev/null +++ b/Juick/Images.xcassets/res/search_icon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "search_icon.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "search_icon@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "search_icon@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/search_icon.imageset/search_icon.png b/Juick/Images.xcassets/res/search_icon.imageset/search_icon.png Binary files differnew file mode 100644 index 0000000..3bc5682 --- /dev/null +++ b/Juick/Images.xcassets/res/search_icon.imageset/search_icon.png diff --git a/Juick/Images.xcassets/res/search_icon.imageset/search_icon@2x.png b/Juick/Images.xcassets/res/search_icon.imageset/search_icon@2x.png Binary files differnew file mode 100644 index 0000000..2b6cab0 --- /dev/null +++ b/Juick/Images.xcassets/res/search_icon.imageset/search_icon@2x.png diff --git a/Juick/Images.xcassets/res/search_icon.imageset/search_icon@3x.png b/Juick/Images.xcassets/res/search_icon.imageset/search_icon@3x.png Binary files differnew file mode 100644 index 0000000..44adf99 --- /dev/null +++ b/Juick/Images.xcassets/res/search_icon.imageset/search_icon@3x.png diff --git a/Juick/Images.xcassets/res/settings_icon.imageset/Contents.json b/Juick/Images.xcassets/res/settings_icon.imageset/Contents.json new file mode 100644 index 0000000..72b8e2e --- /dev/null +++ b/Juick/Images.xcassets/res/settings_icon.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "settings_icon.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "settings_icon@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "settings_icon@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/settings_icon.imageset/settings_icon.png b/Juick/Images.xcassets/res/settings_icon.imageset/settings_icon.png Binary files differnew file mode 100644 index 0000000..082ca9f --- /dev/null +++ b/Juick/Images.xcassets/res/settings_icon.imageset/settings_icon.png diff --git a/Juick/Images.xcassets/res/settings_icon.imageset/settings_icon@2x.png b/Juick/Images.xcassets/res/settings_icon.imageset/settings_icon@2x.png Binary files differnew file mode 100644 index 0000000..344531b --- /dev/null +++ b/Juick/Images.xcassets/res/settings_icon.imageset/settings_icon@2x.png diff --git a/Juick/Images.xcassets/res/settings_icon.imageset/settings_icon@3x.png b/Juick/Images.xcassets/res/settings_icon.imageset/settings_icon@3x.png Binary files differnew file mode 100644 index 0000000..1f79f5b --- /dev/null +++ b/Juick/Images.xcassets/res/settings_icon.imageset/settings_icon@3x.png diff --git a/Juick/Images.xcassets/res/side_button.imageset/Contents.json b/Juick/Images.xcassets/res/side_button.imageset/Contents.json new file mode 100644 index 0000000..7334a81 --- /dev/null +++ b/Juick/Images.xcassets/res/side_button.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "side_button.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "side_button@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "side_button@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +}
\ No newline at end of file diff --git a/Juick/Images.xcassets/res/side_button.imageset/side_button.png b/Juick/Images.xcassets/res/side_button.imageset/side_button.png Binary files differnew file mode 100644 index 0000000..5f674b9 --- /dev/null +++ b/Juick/Images.xcassets/res/side_button.imageset/side_button.png diff --git a/Juick/Images.xcassets/res/side_button.imageset/side_button@2x.png b/Juick/Images.xcassets/res/side_button.imageset/side_button@2x.png Binary files differnew file mode 100644 index 0000000..28fde79 --- /dev/null +++ b/Juick/Images.xcassets/res/side_button.imageset/side_button@2x.png diff --git a/Juick/Images.xcassets/res/side_button.imageset/side_button@3x.png b/Juick/Images.xcassets/res/side_button.imageset/side_button@3x.png Binary files differnew file mode 100644 index 0000000..b1197d6 --- /dev/null +++ b/Juick/Images.xcassets/res/side_button.imageset/side_button@3x.png diff --git a/Juick/LaunchScreen.storyboard b/Juick/LaunchScreen.storyboard new file mode 100644 index 0000000..e0a196b --- /dev/null +++ b/Juick/LaunchScreen.storyboard @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> + <device id="retina4_7" orientation="portrait"> + <adaptation id="fullscreen"/> + </device> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/> + <capability name="Safe area layout guides" minToolsVersion="9.0"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <scenes> + <!--View Controller--> + <scene sceneID="EHf-IW-A2E"> + <objects> + <viewController id="01J-lp-oVM" sceneMemberID="viewController"> + <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Splash.png" translatesAutoresizingMaskIntoConstraints="NO" id="D5d-4R-c9b"> + <rect key="frame" x="139.5" y="285.5" width="96" height="96"/> + <color key="tintColor" red="0.0" green="0.40000000000000002" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </imageView> + </subviews> + <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <constraints> + <constraint firstItem="D5d-4R-c9b" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="Tmo-sv-3CG"/> + <constraint firstItem="D5d-4R-c9b" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="k0r-L6-uBV"/> + </constraints> + <viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/> + </view> + </viewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="53" y="375"/> + </scene> + </scenes> + <resources> + <image name="Splash.png" width="96" height="96"/> + </resources> +</document> diff --git a/Juick/Main.storyboard b/Juick/Main.storyboard new file mode 100644 index 0000000..ebc1465 --- /dev/null +++ b/Juick/Main.storyboard @@ -0,0 +1,219 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="meX-Jy-oiG"> + <device id="retina4_7" orientation="portrait"> + <adaptation id="fullscreen"/> + </device> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/> + <capability name="Safe area layout guides" minToolsVersion="9.0"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <scenes> + <!--Item--> + <scene sceneID="97k-sM-CYI"> + <objects> + <navigationController toolbarHidden="NO" id="meX-Jy-oiG" customClass="RootNavigationController" sceneMemberID="viewController"> + <tabBarItem key="tabBarItem" title="Item" id="P8W-XD-U6H"/> + <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Rtg-Ag-BXy"> + <rect key="frame" x="0.0" y="20" width="375" height="44"/> + <autoresizingMask key="autoresizingMask"/> + </navigationBar> + <toolbar key="toolbar" opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="tdc-JF-lSX"> + <rect key="frame" x="0.0" y="623" width="375" height="44"/> + <autoresizingMask key="autoresizingMask"/> + </toolbar> + <connections> + <segue destination="VCH-GK-jaH" kind="relationship" relationship="rootViewController" id="3ou-Pe-XsC"/> + </connections> + </navigationController> + <placeholder placeholderIdentifier="IBFirstResponder" id="e3G-bn-wym" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="-1845" y="-168"/> + </scene> + <!--Discover--> + <scene sceneID="uvH-u9-x7X"> + <objects> + <tableViewController title="Discover" id="VCH-GK-jaH" customClass="MessagesViewController" sceneMemberID="viewController"> + <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="tbe-Zb-PfB"> + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <prototypes> + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="messageCell" rowHeight="500" id="st1-Fk-tNZ" customClass="MessageCell"> + <rect key="frame" x="0.0" y="28" width="375" height="500"/> + <autoresizingMask key="autoresizingMask"/> + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="st1-Fk-tNZ" id="xvN-rb-NLE"> + <rect key="frame" x="0.0" y="0.0" width="375" height="499.5"/> + <autoresizingMask key="autoresizingMask"/> + <subviews> + <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="cgI-af-UvH"> + <rect key="frame" x="12" y="12" width="355" height="475.5"/> + <subviews> + <stackView opaque="NO" contentMode="scaleToFill" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="F0Z-KW-PPm"> + <rect key="frame" x="0.0" y="0.0" width="355" height="48"/> + <subviews> + <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Ru8-1o-eNk"> + <rect key="frame" x="0.0" y="0.0" width="48" height="48"/> + <constraints> + <constraint firstAttribute="height" constant="48" id="TLU-lh-eWe"/> + <constraint firstAttribute="width" constant="48" id="kdx-OF-amx"/> + </constraints> + </imageView> + <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="6" translatesAutoresizingMaskIntoConstraints="NO" id="FUd-gc-92F"> + <rect key="frame" x="60" y="0.0" width="295" height="48"/> + <subviews> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ugnich" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KXv-uC-Gdh"> + <rect key="frame" x="0.0" y="0.0" width="295" height="26"/> + <fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/> + <color key="textColor" red="0.0" green="0.40000000000000002" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="252" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" text="1 hour ago" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="t0d-vX-oUw"> + <rect key="frame" x="0.0" y="32" width="295" height="16"/> + <fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/> + <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + </subviews> + </stackView> + </subviews> + </stackView> + <view contentMode="scaleToFill" verticalCompressionResistancePriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="pDi-ol-EFN" customClass="TagListView"> + <rect key="frame" x="0.0" y="60" width="355" height="0.0"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <userDefinedRuntimeAttributes> + <userDefinedRuntimeAttribute type="color" keyPath="textColor"> + <color key="value" red="0.53333333333333333" green="0.53333333333333333" blue="0.53333333333333333" alpha="1" colorSpace="calibratedRGB"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="color" keyPath="tagBackgroundColor"> + <color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> + <real key="value" value="0.0"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="number" keyPath="borderWidth"> + <real key="value" value="1"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="number" keyPath="paddingY"> + <real key="value" value="6"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="number" keyPath="paddingX"> + <real key="value" value="6"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="number" keyPath="marginY"> + <real key="value" value="4"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="number" keyPath="marginX"> + <real key="value" value="6"/> + </userDefinedRuntimeAttribute> + <userDefinedRuntimeAttribute type="color" keyPath="borderColor"> + <color key="value" red="0.80000000000000004" green="0.80000000000000004" blue="0.80000000000000004" alpha="1" colorSpace="calibratedRGB"/> + </userDefinedRuntimeAttribute> + </userDefinedRuntimeAttributes> + </view> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalCompressionResistancePriority="999" verticalCompressionResistancePriority="999" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lrt-fN-NSC" customClass="TTTAttributedLabel"> + <rect key="frame" x="0.0" y="72" width="355" height="377"/> + <string key="text">Lorem Ipsum - это текст-"рыба", часто используемый в печати и вэб-дизайне. Lorem Ipsum является стандартной "рыбой" для текстов на латинице с начала XVI века. В то время некий безымянный печатник создал большую коллекцию размеров и форм шрифтов, используя Lorem Ipsum для распечатки образцов. Lorem Ipsum не только успешно пережил без заметных изменений пять веков, но и перешагнул в электронный дизайн. Его популяризации в новое время послужили публикация листов Letraset с образцами Lorem Ipsum в 60-х годах и, в более недавнее время, программы электронной вёрстки типа Aldus PageMaker, в шаблонах которых используется Lorem Ipsum.</string> + <fontDescription key="fontDescription" style="UICTFontTextStyleBody"/> + <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="252" verticalHuggingPriority="252" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="DBT-AH-lDA"> + <rect key="frame" x="0.0" y="461" width="355" height="2.5"/> + </imageView> + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7V8-9G-Gl5"> + <rect key="frame" x="0.0" y="475.5" width="355" height="0.0"/> + <fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/> + <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + <nil key="highlightedColor"/> + </label> + </subviews> + </stackView> + </subviews> + <constraints> + <constraint firstAttribute="bottom" secondItem="cgI-af-UvH" secondAttribute="bottom" constant="12" id="Aoy-AP-NNi"/> + <constraint firstItem="cgI-af-UvH" firstAttribute="leading" secondItem="xvN-rb-NLE" secondAttribute="leading" constant="12" id="T5N-b7-LPh"/> + <constraint firstAttribute="trailing" secondItem="cgI-af-UvH" secondAttribute="trailing" constant="8" id="rYj-Qp-u1a"/> + <constraint firstItem="cgI-af-UvH" firstAttribute="top" secondItem="xvN-rb-NLE" secondAttribute="top" constant="12" id="vqC-ka-ipr"/> + </constraints> + </tableViewCellContentView> + <connections> + <outlet property="attach" destination="DBT-AH-lDA" id="3ox-VE-rnF"/> + <outlet property="avatar" destination="Ru8-1o-eNk" id="oKB-Dv-x2d"/> + <outlet property="summary" destination="7V8-9G-Gl5" id="Df0-Nn-IIF"/> + <outlet property="tags" destination="pDi-ol-EFN" id="pgG-Xx-Qof"/> + <outlet property="text" destination="lrt-fN-NSC" id="JK0-j5-eDK"/> + <outlet property="timestamp" destination="t0d-vX-oUw" id="Jrz-yT-8vV"/> + <outlet property="title" destination="KXv-uC-Gdh" id="UxB-OJ-OHr"/> + </connections> + </tableViewCell> + </prototypes> + <connections> + <outlet property="dataSource" destination="VCH-GK-jaH" id="6Tf-Lx-Adx"/> + <outlet property="delegate" destination="VCH-GK-jaH" id="a3g-k1-u9r"/> + </connections> + </tableView> + <tabBarItem key="tabBarItem" title="Discover" image="nearby_icon" landscapeImage="new_chat_icon" selectedImage="nearby_icon" id="xwM-dS-nrL"> + <color key="badgeColor" red="0.0" green="0.40000000000000002" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> + </tabBarItem> + <navigationItem key="navigationItem" id="M2f-nV-K0C"/> + </tableViewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="skE-j1-NV7" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="-1074" y="-169"/> + </scene> + <!--Post--> + <scene sceneID="bF2-U0-WHJ"> + <objects> + <viewController id="rr1-jx-MLx" customClass="NewPostViewController" sceneMemberID="viewController"> + <view key="view" contentMode="scaleToFill" id="7ep-bO-aeZ"> + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="XYj-Y4-lfM"> + <rect key="frame" x="8" y="28" width="359" height="631"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string> + <fontDescription key="fontDescription" style="UICTFontTextStyleBody"/> + <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/> + </textView> + </subviews> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <constraints> + <constraint firstItem="GP4-ea-eeC" firstAttribute="bottom" secondItem="XYj-Y4-lfM" secondAttribute="bottom" constant="8" id="PFp-o1-UyE"/> + <constraint firstItem="XYj-Y4-lfM" firstAttribute="leading" secondItem="GP4-ea-eeC" secondAttribute="leading" constant="8" id="Sf9-vX-yc8"/> + <constraint firstItem="GP4-ea-eeC" firstAttribute="trailing" secondItem="XYj-Y4-lfM" secondAttribute="trailing" constant="8" id="VbZ-X5-VkM"/> + <constraint firstItem="XYj-Y4-lfM" firstAttribute="top" secondItem="GP4-ea-eeC" secondAttribute="top" constant="8" id="pxD-UW-zMN"/> + </constraints> + <viewLayoutGuide key="safeArea" id="GP4-ea-eeC"/> + </view> + <tabBarItem key="tabBarItem" tag="1" title="Post" image="new_chat_icon" landscapeImage="new_chat_icon" selectedImage="new_chat_icon" id="Oh5-L7-Bey"/> + </viewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="Pm0-3R-NV9" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="-319" y="340"/> + </scene> + <!--Notifications--> + <scene sceneID="Lag-uC-EkY"> + <objects> + <viewController id="XX2-Oc-8ev" sceneMemberID="viewController"> + <view key="view" contentMode="scaleToFill" id="IVn-gT-D2f"> + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <viewLayoutGuide key="safeArea" id="hUV-QV-gaB"/> + </view> + <tabBarItem key="tabBarItem" tag="2" title="Notifications" image="chats_icon" landscapeImage="chats_icon" selectedImage="chats_icon" id="VYV-km-n8d"/> + </viewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="ebm-ux-i3g" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="1033" y="-24"/> + </scene> + </scenes> + <resources> + <image name="chats_icon" width="20" height="22"/> + <image name="nearby_icon" width="20" height="20"/> + <image name="new_chat_icon" width="20" height="20"/> + </resources> +</document> diff --git a/Juick/Model/Message.h b/Juick/Model/Message.h index 438f693..1b41315 100644 --- a/Juick/Model/Message.h +++ b/Juick/Model/Message.h @@ -21,9 +21,4 @@ @property NSString *repliesBy; @property NSNumber *repliesCount; -+(void) pullNextFromPath:(NSString *)path params:(NSDictionary *)params callback:(void(^)(NSArray *))callback; -+(NSString *) messagesUrl; -+(NSString *) threadUrl; -+(NSString *) feedUrl; - @end diff --git a/Juick/Model/Message.m b/Juick/Model/Message.m index 4a6e96c..d4d6a88 100644 --- a/Juick/Model/Message.m +++ b/Juick/Model/Message.m @@ -7,7 +7,6 @@ // #import "Message.h" -#import "PDKeychainBindings.h" #import "AppDelegate.h" @implementation Message @@ -20,40 +19,4 @@ @"repliesCount": @"replies", @"repliesBy": @"repliesby"}; } - - -+(void) pullNextFromPath:(NSString *)path params:(NSDictionary *) params callback:(void(^)(NSArray *))callback { - AFHTTPSessionManager *manager = [APIClient sharedClient].manager; - if ([[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] != nil) { - manager.requestSerializer = [AFJSONRequestSerializer serializer]; - [manager.requestSerializer setAuthorizationHeaderFieldWithUsername:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] password:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.password"]]; - } - [manager GET:path parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - NSMutableArray *messages = [NSMutableArray new]; - [((NSArray *)responseObject) enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { - [messages addObject:[Message yy_modelWithJSON:obj]]; - }]; - callback(messages); - } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { - NSLog(@"REST Error: %@", error); - NSInteger statusCode = ((NSHTTPURLResponse *)task.response).statusCode; - if (statusCode == 401) { - AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - [appDelegate pushLoginForm]; - } - }]; -} - -+(NSString *) messagesUrl { - return @"https://api.juick.com/messages"; -} - -+(NSString *) threadUrl { - return @"https://api.juick.com/thread"; -} - -+(NSString *) feedUrl { - return @"https://api.juick.com/home"; -} - @end diff --git a/Juick/Model/User.h b/Juick/Model/User.h index 84300f3..ca84d50 100644 --- a/Juick/Model/User.h +++ b/Juick/Model/User.h @@ -7,7 +7,7 @@ // #import <Foundation/Foundation.h> -#import "PDKeychainBindings.h" +@import PDKeychainBindingsController; #import "SIAlertView.h" #import "APIClient.h" #import "YYModel.h" diff --git a/Juick/Splash.png b/Juick/Splash.png Binary files differnew file mode 100644 index 0000000..c5d9d60 --- /dev/null +++ b/Juick/Splash.png diff --git a/Juick/Splash@2x.png b/Juick/Splash@2x.png Binary files differnew file mode 100644 index 0000000..166a664 --- /dev/null +++ b/Juick/Splash@2x.png diff --git a/Juick/Splash@3x.png b/Juick/Splash@3x.png Binary files differnew file mode 100644 index 0000000..3ef7388 --- /dev/null +++ b/Juick/Splash@3x.png diff --git a/Juick/Supporting Files/Juick-Info.plist b/Juick/Supporting Files/Juick-Info.plist index 4e1224b..74fbe61 100644 --- a/Juick/Supporting Files/Juick-Info.plist +++ b/Juick/Supporting Files/Juick-Info.plist @@ -35,9 +35,12 @@ <key>UIAppFonts</key> <array> <string>FontAwesome.ttf</string> + <string>SerpentineBoldItalic.ttf</string> </array> <key>UILaunchStoryboardName</key> - <string>Launch Screen</string> + <string>LaunchScreen</string> + <key>UIMainStoryboardFile</key> + <string>Main</string> <key>UIPrerenderedIcon</key> <true/> <key>UIRequiredDeviceCapabilities</key> diff --git a/Juick/Supporting Files/Juick-Prefix.pch b/Juick/Supporting Files/Juick-Prefix.pch index f69266f..1062827 100644 --- a/Juick/Supporting Files/Juick-Prefix.pch +++ b/Juick/Supporting Files/Juick-Prefix.pch @@ -15,13 +15,4 @@ #import <Foundation/Foundation.h> #import <SystemConfiguration/SystemConfiguration.h> #import <MobileCoreServices/MobileCoreServices.h> - #import <YYWebImage/YYWebImage.h> - #import <NSString+HTML.h> - #import "UIImage+Utils.h" - #import <NSString+FontAwesome.h> - #import <TTTAttributedLabel/TTTAttributedLabel.h> - #import <AFNetworking/AFNetworking.h> - #import <YYModel/YYModel.h> - #import <DateTools/DateTools.h> - #import <PHFComposeBarView/PHFComposeBarView.h> #endif diff --git a/Juick/Supporting Files/SerpentineBoldItalic.ttf b/Juick/Supporting Files/SerpentineBoldItalic.ttf Binary files differnew file mode 100644 index 0000000..21434ec --- /dev/null +++ b/Juick/Supporting Files/SerpentineBoldItalic.ttf diff --git a/Juick/ViewControllers/LoginViewController.h b/Juick/ViewControllers/LoginViewController.h index bf980fa..6a834a8 100644 --- a/Juick/ViewControllers/LoginViewController.h +++ b/Juick/ViewControllers/LoginViewController.h @@ -8,7 +8,7 @@ #import <UIKit/UIKit.h> #import "XLForm.h" -#import "PDKeychainbindingsController.h" +#import "PDKeychainBindingsController.h" @interface LoginViewController : XLFormViewController diff --git a/Juick/ViewControllers/LoginViewController.m b/Juick/ViewControllers/LoginViewController.m index eedc6d3..1718366 100644 --- a/Juick/ViewControllers/LoginViewController.m +++ b/Juick/ViewControllers/LoginViewController.m @@ -12,20 +12,9 @@ @implementation LoginViewController -- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self){ - [self initializeForm]; - } - return self; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self){ - [self initializeForm]; - } - return self; +- (void) awakeFromNib { + [super awakeFromNib]; + [self initializeForm]; } - (void)initializeForm { diff --git a/Juick/ViewControllers/MessagesViewController.h b/Juick/ViewControllers/MessagesViewController.h index 3dac200..fc3545a 100644 --- a/Juick/ViewControllers/MessagesViewController.h +++ b/Juick/ViewControllers/MessagesViewController.h @@ -7,9 +7,10 @@ // #import <UIKit/UIKit.h> +@import PHFComposeBarView; @interface MessagesViewController : UITableViewController<PHFComposeBarViewDelegate> -- (void)loadFromPath:(NSString *)messagesPath withParams:(NSDictionary *)params withTitle:(NSString *)title; +@property(nonatomic, strong) NSString *path; +@property(nonatomic, strong) NSMutableDictionary *params; - (void) refreshData; -- (void) composePressed; @end diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m index 95879bf..b877cd1 100644 --- a/Juick/ViewControllers/MessagesViewController.m +++ b/Juick/ViewControllers/MessagesViewController.m @@ -6,58 +6,34 @@ // Copyright (c) 2013 com.juick. All rights reserved. // -#import "SWRevealViewController/SWRevealViewController.h" #import "MessagesViewController.h" +@import YYWebImage; #import "MessageCell.h" #import "Message.h" #import "ColorScheme.h" #import "NewPostViewController.h" +#import "LoginViewController.h" +#import "ThreadViewController.h" #import "NSURL+PathParameters.h" -static NSString *CellIdentifier = @"MessageCell"; - @interface MessagesViewController (); @property(nonatomic, strong) NSMutableArray *messages; @property(nonatomic, assign) Boolean dataLoading; -@property(nonatomic, strong) NSString *path; -@property(nonatomic, strong) NSMutableDictionary *params; -@property(nonatomic, strong) dispatch_queue_t concurrent_queue; -@property (nonatomic, readwrite, retain) UIView *inputAccessoryView; - @end @implementation MessagesViewController -- (id)init { - if (self = [super init]) { - self.concurrent_queue = dispatch_queue_create("Queue", DISPATCH_QUEUE_SERIAL); - }; - return self; -} - -- (void)loadFromPath:(NSString *)messagesPath withParams:(NSDictionary *)params withTitle:(NSString *)title -{ - [self setPath:messagesPath]; - [self setParams:[[NSMutableDictionary alloc] initWithDictionary:params]]; - self.title = title; - __weak MessagesViewController * weakSelf = self; - dispatch_sync(self.concurrent_queue, ^{ - [self.messages removeAllObjects]; - [weakSelf refreshData]; - }); -} - - (void) refreshData { self.dataLoading = YES; - [Message pullNextFromPath:self.path params:self.params callback:^(NSArray *next) { + [[APIClient sharedClient] pullNextFromPath:self.path params:self.params callback:^(NSArray *next, NSError *err) { NSArray *newMsgs = next; - if ([self.path isEqualToString:[Message threadUrl]]) { + if ([self.path isEqualToString:[APIClient threadUrl]]) { NSUInteger lastRid = [((Message *)[self.messages lastObject]).rid unsignedIntegerValue]; NSUInteger count = [next count] - 1; NSUInteger oldCount = [self.messages count]; @@ -84,30 +60,37 @@ static NSString *CellIdentifier = @"MessageCell"; - (void)viewDidLoad { [super viewDidLoad]; + self.dataLoading = NO; [self.view setBackgroundColor:[ColorScheme mainBackground]]; self.messages = [NSMutableArray array]; + self.params = [NSMutableDictionary new]; - SWRevealViewController *revealController = [self revealViewController]; - if (revealController) { - // TODO: add to thread view too - [self.view addGestureRecognizer:[revealController panGestureRecognizer]]; - } - - [self.tableView registerNib:[UINib nibWithNibName:@"MessageCell" bundle:nil] forCellReuseIdentifier:CellIdentifier]; self.tableView.rowHeight = UITableViewAutomaticDimension; self.tableView.estimatedRowHeight = 500.0f; self.refreshControl = [UIRefreshControl new]; - [self.refreshControl addTarget:self action:@selector(refreshData) forControlEvents:UIControlEventValueChanged];} + [self.refreshControl addTarget:self action:@selector(refreshData) forControlEvents:UIControlEventValueChanged]; + if ([User isAuthenticated]) { + [User checkIsValid:^(BOOL success) { + if (success) { + self.path = [APIClient feedUrl]; + [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeAlert|UIUserNotificationTypeSound|UIUserNotificationTypeBadge) categories:nil]]; + [self refreshData]; + } else { + [User throwUnableToLogin]; + } + }]; + + } else { + self.path = [APIClient messagesUrl]; + [self refreshData]; + } + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"profile_icon"] style:UIBarButtonItemStylePlain target:self action:@selector(composePressed)]; + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"settings_icon"] style:UIBarButtonItemStylePlain target:self action:@selector(composePressed)]; +} - (void) composePressed { - CATransition* transition = [CATransition animation]; - transition.duration = 0.3; - transition.type = kCATransitionFade; - transition.subtype = kCATransitionFromTop; - [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; - [self.navigationController pushViewController:[[NewPostViewController alloc] init] animated:NO]; } - (void)viewDidAppear:(BOOL)animated @@ -137,32 +120,20 @@ static NSString *CellIdentifier = @"MessageCell"; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - __block NSInteger count; - dispatch_sync(self.concurrent_queue, ^{ - count = self.messages.count; - }); - return count; + return self.messages.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; - __block Message *msg; - dispatch_sync(self.concurrent_queue, ^{ - msg = [self.messages objectAtIndex:indexPath.row]; - }); + MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:@"messageCell" forIndexPath:indexPath]; + Message *msg = [self.messages objectAtIndex:indexPath.row]; cell.layer.borderWidth = 6; cell.layer.borderColor = [ColorScheme mainBackground].CGColor; [cell setMessage:msg]; if ([msg.attach length] > 0) { [cell.attach yy_setImageWithURL:[NSURL URLWithString:msg.attach] placeholder:[UIImage imageNamed:@"AttachPlaceholder"] options:YYWebImageOptionProgressiveBlur | YYWebImageOptionSetImageWithFadeAnimation completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) { - [[NSOperationQueue mainQueue] addOperationWithBlock:^{ - [cell setNeedsUpdateConstraints]; - [cell updateConstraintsIfNeeded]; - [cell setNeedsLayout]; - [cell layoutIfNeeded]; - }]; + [cell setNeedsUpdateConstraints]; + [cell updateConstraintsIfNeeded]; }]; - } else { cell.attach.image = nil; } @@ -171,14 +142,12 @@ static NSString *CellIdentifier = @"MessageCell"; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - if ([self.path isEqualToString:[Message threadUrl]]) + if ([self.path isEqualToString:[APIClient threadUrl]]) return; - __block Message *msg; - dispatch_sync(self.concurrent_queue, ^{ - msg = [self.messages objectAtIndex:indexPath.row]; - }); - MessagesViewController *threadViewController = [[MessagesViewController alloc] init]; - [threadViewController loadFromPath:[Message threadUrl] withParams:[NSDictionary dictionaryWithObjectsAndKeys:msg.mid, @"mid", nil] withTitle:@"Thread"]; + Message *msg = [self.messages objectAtIndex:indexPath.row]; + ThreadViewController *threadViewController = [[ThreadViewController alloc] init]; + [threadViewController setPath:[APIClient threadUrl]]; + [threadViewController setParams:[NSMutableDictionary dictionaryWithObjectsAndKeys:msg.mid, @"mid", nil]]; [self.navigationController pushViewController:threadViewController animated:NO]; } @@ -186,36 +155,15 @@ static NSString *CellIdentifier = @"MessageCell"; CGFloat actualPosition = scrollView_.contentOffset.y; CGFloat contentHeight = scrollView_.contentSize.height - scrollView_.contentSize.height / 2; if (actualPosition >= contentHeight && !self.dataLoading) { - __block Message *lastMsg; - dispatch_sync(self.concurrent_queue, ^{ - lastMsg = [self.messages lastObject]; + Message *lastMsg = [self.messages lastObject]; + if (lastMsg != nil) { NSNumber *lastMid = lastMsg.mid; - if (![self.path isEqualToString:[Message threadUrl]]) { - [self.params setValue:lastMid forKey:@"before_mid"]; + if (![self.path isEqualToString:[APIClient threadUrl]]) { + [self.params setObject:lastMid forKey:@"before_mid"]; } [self refreshData]; - }); - } -} - -- (BOOL) canBecomeFirstResponder { - return [self.path isEqualToString:[Message threadUrl]]; -} - -- (UIView *)inputAccessoryView { - if (!_inputAccessoryView) { - CGRect viewBounds = self.view.bounds; - CGRect frame = CGRectMake(0, viewBounds.size.height - PHFComposeBarViewInitialHeight, viewBounds.size.width, - PHFComposeBarViewInitialHeight); - PHFComposeBarView *_view = [[PHFComposeBarView alloc] initWithFrame:frame]; - _view.backgroundColor = [UIColor whiteColor]; - _view.buttonTintColor = [ColorScheme linkColor]; - _view.maxLinesCount = 4; - _view.utilityButtonImage = [UIImage imageNamed:@"Camera"]; - _view.delegate = self; - _inputAccessoryView = _view; + } } - return _inputAccessoryView; } @end diff --git a/Juick/ViewControllers/NewPostViewController.m b/Juick/ViewControllers/NewPostViewController.m index 8c8fbf0..318de4e 100644 --- a/Juick/ViewControllers/NewPostViewController.m +++ b/Juick/ViewControllers/NewPostViewController.m @@ -7,55 +7,33 @@ // #import "NewPostViewController.h" +#import "ColorScheme.h" @interface NewPostViewController () +@property (nonatomic, assign) BOOL didSetupConstraints; + @end @implementation NewPostViewController -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Custom initialization - } - return self; -} - - (void)viewDidLoad { [super viewDidLoad]; - self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel + self.navigationController.visibleViewController.title = @"Post"; + self.view.backgroundColor = [ColorScheme mainBackground]; + self.navigationController.visibleViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelCompose)]; - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone - target:self action:@selector(doneCompose)]; + self.navigationController.visibleViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd + target:self action:@selector(doneCompose)]; } - (void) cancelCompose { - CATransition* transition = [CATransition animation]; - transition.duration = 0.3; - transition.type = kCATransitionFade; - transition.subtype = kCATransitionFromTop; - - [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; - [self.navigationController popViewControllerAnimated:NO]; + [self.navigationController.visibleViewController.navigationController popViewControllerAnimated:YES]; } - (void) doneCompose { - CATransition* transition = [CATransition animation]; - transition.duration = 0.3; - transition.type = kCATransitionFade; - transition.subtype = kCATransitionFromTop; - - [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; - [self.navigationController popToRootViewControllerAnimated:NO]; -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. + [self.navigationController.visibleViewController.navigationController popToRootViewControllerAnimated:YES]; } @end diff --git a/Juick/ViewControllers/RevealPanelViewController.h b/Juick/ViewControllers/RevealPanelViewController.h deleted file mode 100644 index 87cc257..0000000 --- a/Juick/ViewControllers/RevealPanelViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// RevealPanelViewController.h -// Juick -// -// Created by Vitaly Takmazov on 04.11.13. -// Copyright (c) 2013 com.juick. All rights reserved. -// - -#import <UIKit/UIKit.h> -#import "FAImageView.h" -#import "LoginViewController.h" - -@interface RevealPanelViewController : UIViewController<UITableViewDataSource, UITableViewDelegate> -@property (nonatomic, strong) IBOutlet UITableView *tableView; -@property (nonatomic, strong) IBOutlet UIButton *signButton; -@end diff --git a/Juick/ViewControllers/RevealPanelViewController.m b/Juick/ViewControllers/RevealPanelViewController.m deleted file mode 100644 index 623bb87..0000000 --- a/Juick/ViewControllers/RevealPanelViewController.m +++ /dev/null @@ -1,179 +0,0 @@ -// -// RevealPanelViewController.m -// Juick -// -// Created by Vitaly Takmazov on 04.11.13. -// Copyright (c) 2013 com.juick. All rights reserved. -// - -#import "SWRevealViewController.h" - -#import "RevealPanelViewController.h" -#import "MessagesViewController.h" - -#import "ColorScheme.h" -#import "NSURL+PathParameters.h" -#import "NavCell.h" -#import "Message.h" -#import "User.h" -#import "AppDelegate.h" - - -static NSString *CellIdentifier = @"NavCell"; - -@interface RevealPanelViewController () - -@end - -@implementation RevealPanelViewController - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Custom initialization - } - return self; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - [self.view setBackgroundColor:[UIColor whiteColor]]; - self.tableView = [[UITableView alloc] init]; - //[self.tableView setBackgroundColor:[UIColor whiteColor]]; - self.tableView.delegate = self; - self.tableView.dataSource = self; - [self.tableView setSeparatorInset:UIEdgeInsetsZero]; - self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; - self.tableView.separatorColor =[UIColor whiteColor]; - [self.tableView registerNib:[UINib nibWithNibName:@"NavCell" bundle:nil] forCellReuseIdentifier:CellIdentifier]; - [self.view addSubview:self.tableView]; - self.signButton = [[UIButton alloc] init]; - [self.signButton addTarget:self action:@selector(signInOut) forControlEvents:UIControlEventTouchUpInside]; - [self.view addSubview:self.signButton]; - [self refreshInfo]; -} - --(void) refreshInfo { - NSString *text; - UIColor *color; - - if ([User isAuthenticated]) { - text = @"Sign Out"; - color = [UIColor redColor]; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ - [User get:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] callback:^(User *user) { - if (user != nil) { - /*[self.titleView.image setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/as/%@.png", user.uid]]]; - [self.titleView.title setText:user.uname];*/ - } - }]; - }); - } else { - text = @"Sign In"; - color = [UIColor greenColor]; - } - [self.signButton setTitle:text forState:UIControlStateNormal]; - [self.signButton setBackgroundColor:color]; -} - --(void) signInOut { - [self refreshInfo]; - AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - [appDelegate pushLoginForm]; -} - --(void) viewWillLayoutSubviews { - [super viewWillLayoutSubviews]; - self.tableView.frame = CGRectMake(0, 0, self.view.bounds.size.width, 400); - self.signButton.frame = CGRectMake(0, self.view.bounds.size.height - 40, self.view.bounds.size.width, 40); -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 1; -} - -- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return 4; -} - -- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - return 32 + 10*2; // icon size + insets -} - -- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - NavCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; - NSInteger row = indexPath.row; - [cell.contentView setBackgroundColor:[UIColor whiteColor]]; - cell.icon.font = [UIFont fontWithName:kFontAwesomeFamilyName size:32.f]; - cell.icon.textColor = [ColorScheme colorWithHex:0x222222]; - cell.descriptionText.textColor = [ColorScheme colorWithHex:0x222222]; - if (row == 0) { - cell.descriptionText.text = @"My feed"; - cell.icon.text = [NSString fontAwesomeIconStringForEnum:FAIconHome]; - - } else if (row == 1) { - cell.descriptionText.text = @"Popular"; - cell.icon.text = [NSString fontAwesomeIconStringForEnum:FAIconComments]; - } else if (row == 2) { - cell.descriptionText.text = @"Discover"; - cell.icon.text = [NSString fontAwesomeIconStringForEnum:FAIconSearch]; - } else if (row == 3) { - cell.descriptionText.text = @"Images"; - cell.icon.text = [NSString fontAwesomeIconStringForEnum:FAIconPicture]; - } - UIView *bgColorView = [[UIView alloc] init]; - bgColorView.backgroundColor = [ColorScheme colorWithHex:0xddddd5]; - bgColorView.layer.masksToBounds = YES; - [cell setSelectedBackgroundView:bgColorView]; - [cell.contentView setNeedsLayout]; - [cell.contentView layoutIfNeeded]; - return cell; -} - -- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - NSInteger row = indexPath.row; - NSString *targetPath; - NSDictionary *targetParams; - NSString *targetTitle; - SWRevealViewController *reveal = self.revealViewController; - [reveal revealToggle:self]; - if (row == 0) { - if ([[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"] == nil) { - AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - [appDelegate pushLoginForm]; - return; - } else { - targetTitle = @"My feed"; - targetPath = [Message feedUrl]; - } - - } - if (row == 1) { - targetTitle = @"Popular"; - targetPath = [Message messagesUrl]; - targetParams = [NSDictionary dictionaryWithObjectsAndKeys:@"1", @"popular", nil]; - } else if (row == 2) { - targetTitle = @"Discover"; - targetPath = [Message messagesUrl]; - } - if (row == 3) { - targetTitle = @"Images"; - targetPath = [Message messagesUrl]; - targetParams = [NSDictionary dictionaryWithObjectsAndKeys:@"photo", @"media", nil]; - } - - UINavigationController *front = (UINavigationController *)reveal.frontViewController; - MessagesViewController *messages = (MessagesViewController *)[front.viewControllers objectAtIndex:0]; - [messages loadFromPath:targetPath withParams:targetParams withTitle:targetTitle]; -} - -@end diff --git a/Juick/ViewControllers/RootNavigationController.h b/Juick/ViewControllers/RootNavigationController.h new file mode 100644 index 0000000..f7f6734 --- /dev/null +++ b/Juick/ViewControllers/RootNavigationController.h @@ -0,0 +1,13 @@ +// +// RootNavigationController.h +// Juick +// +// Created by Vitaly Takmazov on 24/09/2017. +// Copyright © 2017 com.juick. All rights reserved. +// + +#import <UIKit/UIKit.h> + +@interface RootNavigationController : UINavigationController + +@end diff --git a/Juick/ViewControllers/RootNavigationController.m b/Juick/ViewControllers/RootNavigationController.m new file mode 100644 index 0000000..9be0a5f --- /dev/null +++ b/Juick/ViewControllers/RootNavigationController.m @@ -0,0 +1,24 @@ +// +// RootNavigationController.m +// Juick +// +// Created by Vitaly Takmazov on 24/09/2017. +// Copyright © 2017 com.juick. All rights reserved. +// + +#import "RootNavigationController.h" +#import "ColorScheme.h" + +@interface RootNavigationController () + +@end + +@implementation RootNavigationController + +- (void) awakeFromNib { + [super awakeFromNib]; + [self.toolbar setTintColor:[ColorScheme linkColor]]; + [self.visibleViewController setToolbarItems:@[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil],[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"nearby_icon"] style:UIBarButtonItemStylePlain target:self action:nil],[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil],[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"new_chat_icon"] style:UIBarButtonItemStylePlain target:self action:nil],[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil],[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"chats_icon"] style:UIBarButtonItemStylePlain target:self action:nil],[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]] animated:YES]; +} + +@end diff --git a/Juick/ViewControllers/ThreadViewController.h b/Juick/ViewControllers/ThreadViewController.h new file mode 100644 index 0000000..3f2b59c --- /dev/null +++ b/Juick/ViewControllers/ThreadViewController.h @@ -0,0 +1,15 @@ +// +// ThreadViewController.h +// Juick +// +// Created by Vitaly Takmazov on 24/09/2017. +// Copyright © 2017 com.juick. All rights reserved. +// + +#import <UIKit/UIKit.h> +@import PHFComposeBarView; + +@interface ThreadViewController : UITableViewController<PHFComposeBarViewDelegate> +@property(nonatomic, strong) NSString *path; +@property(nonatomic, strong) NSMutableDictionary *params; +@end diff --git a/Juick/ViewControllers/ThreadViewController.m b/Juick/ViewControllers/ThreadViewController.m new file mode 100644 index 0000000..2ee4af5 --- /dev/null +++ b/Juick/ViewControllers/ThreadViewController.m @@ -0,0 +1,63 @@ +// +// ThreadViewController.m +// Juick +// +// Created by Vitaly Takmazov on 24/09/2017. +// Copyright © 2017 com.juick. All rights reserved. +// + +#import "ThreadViewController.h" +#import "ColorScheme.h" + +@interface ThreadViewController () + +@property (nonatomic, readwrite, retain) UIView *inputAccessoryView; + +@end + +@implementation ThreadViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { +#warning Incomplete implementation, return the number of sections + return 0; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { +#warning Incomplete implementation, return the number of rows + return 0; +} + + +- (BOOL) canBecomeFirstResponder { + return YES; +} + +- (UIView *)inputAccessoryView { + if (!_inputAccessoryView) { + CGRect viewBounds = self.view.bounds; + CGRect frame = CGRectMake(0, viewBounds.size.height - PHFComposeBarViewInitialHeight, viewBounds.size.width, + PHFComposeBarViewInitialHeight); + PHFComposeBarView *_view = [[PHFComposeBarView alloc] initWithFrame:frame]; + _view.backgroundColor = [UIColor whiteColor]; + _view.buttonTintColor = [ColorScheme linkColor]; + _view.maxLinesCount = 4; + _view.utilityButtonImage = [UIImage imageNamed:@"Camera"]; + _view.delegate = self; + _inputAccessoryView = _view; + } + return _inputAccessoryView; +} + +@end diff --git a/Juick/Views/MessageCell.h b/Juick/Views/MessageCell.h index 394757b..124ed83 100644 --- a/Juick/Views/MessageCell.h +++ b/Juick/Views/MessageCell.h @@ -7,15 +7,19 @@ // #import <UIKit/UIKit.h> +@import TTTAttributedLabel; +@import TagListView_ObjC; #import "Message.h" @interface MessageCell : UITableViewCell<TTTAttributedLabelDelegate> +@property (weak, nonatomic) IBOutlet UIImageView *avatar; +@property (weak, nonatomic) IBOutlet UILabel *timestamp; @property (weak, nonatomic) IBOutlet UILabel *title; -@property (weak, nonatomic) IBOutlet UILabel *timestamp; -@property (weak, nonatomic) IBOutlet UIImageView *avatar; +@property (weak, nonatomic) IBOutlet TagListView *tags; @property (weak, nonatomic) IBOutlet TTTAttributedLabel *text; @property (weak, nonatomic) IBOutlet UIImageView *attach; @property (weak, nonatomic) IBOutlet UILabel *summary; + @property (strong, nonatomic) Message * message; @end diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m index 2aae74b..cc35446 100644 --- a/Juick/Views/MessageCell.m +++ b/Juick/Views/MessageCell.m @@ -7,6 +7,9 @@ // #import "MessageCell.h" +@import YYWebImage; +@import DateTools; +@import MWFeedParser; #import "ColorScheme.h" @implementation MessageCell @@ -19,12 +22,6 @@ (id)kCTUnderlineStyleAttributeName : [NSNumber numberWithInt:NSUnderlineStyleSingle] }; } -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state -} - - (void) setMessage:(Message *)msg { _message = msg; self.avatar.yy_imageURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [msg.user.uid intValue]]]; @@ -45,9 +42,11 @@ self.summary.text = nil; } self.text.text = [msg.text stringByDecodingHTMLEntities]; + [self.tags removeAllTags]; if ([msg.tags count] > 0) { - self.text.text = [[NSString alloc] initWithFormat:@"%@\n%@", [msg.tags componentsJoinedByString:@", "], - [msg.text stringByDecodingHTMLEntities]]; + [msg.tags enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + [self.tags addTag:obj]; + }]; } } diff --git a/Juick/Views/MessageCell.xib b/Juick/Views/MessageCell.xib deleted file mode 100644 index e555b60..0000000 --- a/Juick/Views/MessageCell.xib +++ /dev/null @@ -1,87 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> - <device id="ipad12_9" orientation="portrait"> - <adaptation id="fullscreen"/> - </device> - <dependencies> - <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/> - <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> - </dependencies> - <objects> - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <tableViewCell contentMode="scaleToFill" horizontalHuggingPriority="1000" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" selectionStyle="default" indentationWidth="10" reuseIdentifier="MessageCell" rowHeight="343" id="KGk-i7-Jjw" customClass="MessageCell"> - <rect key="frame" x="0.0" y="0.0" width="592" height="343"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> - <rect key="frame" x="0.0" y="0.0" width="592" height="342"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="rE3-Mc-Kov"> - <rect key="frame" x="12" y="12" width="568" height="318"/> - <subviews> - <stackView opaque="NO" contentMode="scaleToFill" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="lkI-Na-bF2"> - <rect key="frame" x="0.0" y="0.0" width="103.5" height="48"/> - <subviews> - <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="kHx-jc-jaD"> - <constraints> - <constraint firstAttribute="width" constant="48" id="LYl-qV-pOl"/> - <constraint firstAttribute="height" constant="48" id="ebd-hi-9gJ"/> - </constraints> - </imageView> - <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="6" translatesAutoresizingMaskIntoConstraints="NO" id="ttr-pF-8Zm"> - <rect key="frame" x="60" y="0.0" width="43.5" height="48"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zVa-uf-1Mb"> - <rect key="frame" x="0.0" y="0.0" width="43.5" height="26"/> - <fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/> - <color key="textColor" red="0.0" green="0.40000000000000002" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="252" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5IY-8Y-0W9"> - <rect key="frame" x="0.0" y="32" width="43.5" height="16"/> - <fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/> - <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </stackView> - </subviews> - </stackView> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0Q9-qY-nj2" customClass="TTTAttributedLabel"> - <rect key="frame" x="0.0" y="60" width="42" height="0.0"/> - <fontDescription key="fontDescription" style="UICTFontTextStyleBody"/> - <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="53j-SC-IXj"> - <rect key="frame" x="0.0" y="72" width="568" height="234"/> - </imageView> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zDd-8E-ic8"> - <fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/> - <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </stackView> - </subviews> - <constraints> - <constraint firstAttribute="top" secondItem="rE3-Mc-Kov" secondAttribute="top" constant="-12" id="Qoo-Ft-k2p"/> - <constraint firstItem="rE3-Mc-Kov" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="12" id="f8t-VJ-UHp"/> - <constraint firstAttribute="bottom" secondItem="rE3-Mc-Kov" secondAttribute="bottom" constant="12" id="hcr-Ch-wuN"/> - <constraint firstAttribute="trailing" secondItem="rE3-Mc-Kov" secondAttribute="trailing" constant="12" id="viV-Pm-6in"/> - </constraints> - </tableViewCellContentView> - <connections> - <outlet property="attach" destination="53j-SC-IXj" id="KJm-CX-dUB"/> - <outlet property="avatar" destination="kHx-jc-jaD" id="Fta-hP-KqC"/> - <outlet property="summary" destination="zDd-8E-ic8" id="8LF-Oz-1Co"/> - <outlet property="text" destination="0Q9-qY-nj2" id="M0J-BE-oUq"/> - <outlet property="timestamp" destination="5IY-8Y-0W9" id="HBP-8W-F1a"/> - <outlet property="title" destination="zVa-uf-1Mb" id="uOQ-uv-r33"/> - </connections> - <point key="canvasLocation" x="204" y="424.5"/> - </tableViewCell> - </objects> -</document> diff --git a/Juick/Views/NavCell.h b/Juick/Views/NavCell.h deleted file mode 100644 index c8c2b41..0000000 --- a/Juick/Views/NavCell.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// NavCell.h -// Juick -// -// Created by Vitaly Takmazov on 14/08/16. -// Copyright © 2016 com.juick. All rights reserved. -// - -#import <UIKit/UIKit.h> - -@interface NavCell : UITableViewCell -@property (weak, nonatomic) IBOutlet UILabel *icon; -@property (weak, nonatomic) IBOutlet UILabel *descriptionText; -@end diff --git a/Juick/Views/NavCell.m b/Juick/Views/NavCell.m deleted file mode 100644 index f2ab9f1..0000000 --- a/Juick/Views/NavCell.m +++ /dev/null @@ -1,24 +0,0 @@ -// -// NavCell.m -// Juick -// -// Created by Vitaly Takmazov on 14/08/16. -// Copyright © 2016 com.juick. All rights reserved. -// - -#import "NavCell.h" - -@implementation NavCell - -- (void)awakeFromNib { - [super awakeFromNib]; - // Initialization code -} - -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state -} - -@end diff --git a/Juick/Views/NavCell.xib b/Juick/Views/NavCell.xib deleted file mode 100644 index bf2691d..0000000 --- a/Juick/Views/NavCell.xib +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> - <dependencies> - <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> - </dependencies> - <objects> - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="NavCell" id="KGk-i7-Jjw" customClass="NavCell"> - <rect key="frame" x="0.0" y="0.0" width="320" height="44"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> - <rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <stackView opaque="NO" contentMode="scaleToFill" spacing="6" translatesAutoresizingMaskIntoConstraints="NO" id="uyi-Iy-xUe"> - <rect key="frame" x="6" y="6" width="308" height="31"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dqo-um-Eh0"> - <rect key="frame" x="0.0" y="0.0" width="36" height="31"/> - <constraints> - <constraint firstAttribute="width" constant="36" id="VF9-mH-twl"/> - </constraints> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> - <nil key="highlightedColor"/> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="y8z-JG-Wj8"> - <rect key="frame" x="42" y="0.0" width="266" height="31"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> - <nil key="highlightedColor"/> - </label> - </subviews> - </stackView> - </subviews> - <constraints> - <constraint firstItem="uyi-Iy-xUe" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="6" id="2ay-nb-uYm"/> - <constraint firstAttribute="bottom" secondItem="uyi-Iy-xUe" secondAttribute="bottom" constant="6.5" id="Ks0-9y-A2A"/> - <constraint firstItem="uyi-Iy-xUe" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="6" id="TsO-i1-64l"/> - <constraint firstAttribute="trailing" secondItem="uyi-Iy-xUe" secondAttribute="trailing" constant="6" id="oNg-pG-xo1"/> - </constraints> - </tableViewCellContentView> - <connections> - <outlet property="descriptionText" destination="y8z-JG-Wj8" id="pKg-iv-fc3"/> - <outlet property="icon" destination="dqo-um-Eh0" id="0Io-ae-z3D"/> - </connections> - </tableViewCell> - </objects> -</document> |