summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-10-15 23:47:11 +0300
committerGravatar Vitaly Takmazov2017-10-15 23:47:11 +0300
commit8ae952ec8df2a713afeaef5960a88888e050c6fc (patch)
treeb7b09deed573336e5d274eed790c30ba57e4a910
parent6499148cb3f62e20534b62c181125ebeacfa3438 (diff)
WIP
-rw-r--r--Juick.xcodeproj/project.pbxproj46
-rw-r--r--Juick/0.pngbin1586 -> 0 bytes
-rw-r--r--Juick/AppDelegate.h2
-rw-r--r--Juick/AppDelegate.m25
-rw-r--r--Juick/AttachPlaceholder@2x.pngbin15565 -> 0 bytes
-rw-r--r--Juick/CoreDataStack.h189
-rw-r--r--Juick/CoreDataStack.m133
-rw-r--r--Juick/Helpers/ColorScheme.h1
-rw-r--r--Juick/Helpers/ColorScheme.m5
-rw-r--r--Juick/Helpers/UIImage+Utils.h1
-rw-r--r--Juick/Helpers/UIImage+Utils.m14
-rw-r--r--Juick/Main.storyboard270
-rw-r--r--Juick/Model/Attachment.h18
-rw-r--r--Juick/Model/Attachment.m13
-rw-r--r--Juick/Model/Message.h2
-rw-r--r--Juick/Supporting Files/Juick-Prefix.pch1
-rw-r--r--Juick/ViewControllers/MessagesViewController.m49
-rw-r--r--Juick/ViewControllers/NewPostViewController.h3
-rw-r--r--Juick/ViewControllers/NewPostViewController.m21
-rw-r--r--Juick/ViewControllers/RootNavigationController.h13
-rw-r--r--Juick/ViewControllers/RootNavigationController.m24
-rw-r--r--Juick/Views/MessageCell.h5
-rw-r--r--Juick/Views/MessageCell.m26
-rw-r--r--Juick/reveal-icon.pngbin1118 -> 0 bytes
-rw-r--r--Juick/reveal-icon@2x.pngbin1066 -> 0 bytes
-rw-r--r--Podfile2
-rw-r--r--Podfile.lock2
27 files changed, 657 insertions, 208 deletions
diff --git a/Juick.xcodeproj/project.pbxproj b/Juick.xcodeproj/project.pbxproj
index 7b37c06..d2961f0 100644
--- a/Juick.xcodeproj/project.pbxproj
+++ b/Juick.xcodeproj/project.pbxproj
@@ -27,26 +27,24 @@
773F23371F76ED5E00B5B0DF /* Splash.png in Resources */ = {isa = PBXBuildFile; fileRef = 773F23341F76ED5D00B5B0DF /* Splash.png */; };
773F23381F76ED5E00B5B0DF /* Splash@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 773F23351F76ED5D00B5B0DF /* Splash@2x.png */; };
773F23391F76ED5E00B5B0DF /* Splash@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 773F23361F76ED5E00B5B0DF /* Splash@3x.png */; };
- 77418CBB182F9A78004111B7 /* AttachPlaceholder@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 77418CBA182F9A78004111B7 /* AttachPlaceholder@2x.png */; };
+ 774153CE1F92A61500A19A50 /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 774153CD1F92A61500A19A50 /* UserNotifications.framework */; };
77418CBD182FB9B6004111B7 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77418CBC182FB9B6004111B7 /* ImageIO.framework */; };
77418CBF182FBAB5004111B7 /* iTunesArtwork in Resources */ = {isa = PBXBuildFile; fileRef = 77418CBE182FBAB5004111B7 /* iTunesArtwork */; };
77418CC1182FBABB004111B7 /* iTunesArtwork@2x in Resources */ = {isa = PBXBuildFile; fileRef = 77418CC0182FBABB004111B7 /* iTunesArtwork@2x */; };
+ 774528C21F930C06004D110B /* Attachment.m in Sources */ = {isa = PBXBuildFile; fileRef = 774528C11F930C06004D110B /* Attachment.m */; };
+ 774528C51F93AC0F004D110B /* CoreDataStack.m in Sources */ = {isa = PBXBuildFile; fileRef = 774528C41F93AC0F004D110B /* CoreDataStack.m */; };
77975A1D182B6E9A00410C2B /* NewPostViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77975A1C182B6E9A00410C2B /* NewPostViewController.m */; };
77975A1F182BDCE900410C2B /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77975A1E182BDCE900410C2B /* SystemConfiguration.framework */; };
77975A21182BDCF300410C2B /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77975A20182BDCF300410C2B /* MobileCoreServices.framework */; };
77A0954A181F1F25002BDECD /* Message.m in Sources */ = {isa = PBXBuildFile; fileRef = 77A09549181F1F25002BDECD /* Message.m */; };
- 77A5BDB0189AEB28000F8D9E /* 0.png in Resources */ = {isa = PBXBuildFile; fileRef = 77A5BDAF189AEB28000F8D9E /* 0.png */; };
77B09994189D0B9900A84F59 /* UIImage+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 77B09993189D0B9900A84F59 /* UIImage+Utils.m */; };
77B099A6189D57F000A84F59 /* User.m in Sources */ = {isa = PBXBuildFile; fileRef = 77B099A5189D57F000A84F59 /* User.m */; };
- 77C67EDE182827DB00427098 /* reveal-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 77C67EDC182827DB00427098 /* reveal-icon.png */; };
- 77C67EDF182827DB00427098 /* reveal-icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 77C67EDD182827DB00427098 /* reveal-icon@2x.png */; };
77C67EE51828342000427098 /* NSURL+PathParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 77C67EE41828342000427098 /* NSURL+PathParameters.m */; };
77C67EE81828379700427098 /* ColorScheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 77C67EE71828379700427098 /* ColorScheme.m */; };
77C67EEA18283C8D00427098 /* buttons.png in Resources */ = {isa = PBXBuildFile; fileRef = 77C67EE918283C8D00427098 /* buttons.png */; };
77C67EEC18283F2D00427098 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77C67EEB18283F2D00427098 /* QuartzCore.framework */; };
77C6ADDE1F770EB2000AEA8C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 77C6ADDD1F770EB2000AEA8C /* Main.storyboard */; };
77C6ADE41F7717BC000AEA8C /* ThreadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77C6ADE31F7717BC000AEA8C /* ThreadViewController.m */; };
- 77E029F61F77E9A8006A0203 /* RootNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E029F51F77E9A8006A0203 /* RootNavigationController.m */; };
77E35A82189A5B5A00B2D216 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E35A81189A5B5A00B2D216 /* LoginViewController.m */; };
77FCADDF1D6A50DA00CBA649 /* APIClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 77FCADDE1D6A50DA00CBA649 /* APIClient.m */; };
77FFC0191D5FD186003BD81A /* MessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 77FFC0171D5FD186003BD81A /* MessageCell.m */; };
@@ -88,23 +86,26 @@
773F23341F76ED5D00B5B0DF /* Splash.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Splash.png; sourceTree = "<group>"; };
773F23351F76ED5D00B5B0DF /* Splash@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Splash@2x.png"; sourceTree = "<group>"; };
773F23361F76ED5E00B5B0DF /* Splash@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Splash@3x.png"; sourceTree = "<group>"; };
- 77418CBA182F9A78004111B7 /* AttachPlaceholder@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AttachPlaceholder@2x.png"; sourceTree = "<group>"; };
+ 774153CD1F92A61500A19A50 /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
77418CBC182FB9B6004111B7 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
77418CBE182FBAB5004111B7 /* iTunesArtwork */ = {isa = PBXFileReference; lastKnownFileType = file; path = iTunesArtwork; sourceTree = "<group>"; };
77418CC0182FBABB004111B7 /* iTunesArtwork@2x */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTunesArtwork@2x"; sourceTree = "<group>"; };
+ 774528C01F930C06004D110B /* Attachment.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Attachment.h; sourceTree = "<group>"; };
+ 774528C11F930C06004D110B /* Attachment.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Attachment.m; sourceTree = "<group>"; };
+ 774528C31F93AC0F004D110B /* CoreDataStack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CoreDataStack.h; sourceTree = "<group>"; };
+ 774528C41F93AC0F004D110B /* CoreDataStack.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CoreDataStack.m; sourceTree = "<group>"; };
+ 774528C91F93EE83004D110B /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; };
+ 774528CB1F93EE9F004D110B /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
77975A1B182B6E9A00410C2B /* NewPostViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewPostViewController.h; sourceTree = "<group>"; };
77975A1C182B6E9A00410C2B /* NewPostViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewPostViewController.m; sourceTree = "<group>"; };
77975A1E182BDCE900410C2B /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
77975A20182BDCF300410C2B /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
77A09548181F1F25002BDECD /* Message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Message.h; sourceTree = "<group>"; };
77A09549181F1F25002BDECD /* Message.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Message.m; sourceTree = "<group>"; };
- 77A5BDAF189AEB28000F8D9E /* 0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 0.png; sourceTree = "<group>"; };
77B09992189D0B9900A84F59 /* UIImage+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Utils.h"; sourceTree = "<group>"; };
77B09993189D0B9900A84F59 /* UIImage+Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Utils.m"; sourceTree = "<group>"; };
77B099A4189D57F000A84F59 /* User.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = User.h; sourceTree = "<group>"; };
77B099A5189D57F000A84F59 /* User.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = User.m; sourceTree = "<group>"; };
- 77C67EDC182827DB00427098 /* reveal-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "reveal-icon.png"; sourceTree = "<group>"; };
- 77C67EDD182827DB00427098 /* reveal-icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "reveal-icon@2x.png"; sourceTree = "<group>"; };
77C67EE31828342000427098 /* NSURL+PathParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+PathParameters.h"; sourceTree = "<group>"; };
77C67EE41828342000427098 /* NSURL+PathParameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+PathParameters.m"; sourceTree = "<group>"; };
77C67EE61828379700427098 /* ColorScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorScheme.h; sourceTree = "<group>"; };
@@ -114,8 +115,6 @@
77C6ADDD1F770EB2000AEA8C /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
77C6ADE21F7717BC000AEA8C /* ThreadViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ThreadViewController.h; sourceTree = "<group>"; };
77C6ADE31F7717BC000AEA8C /* ThreadViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ThreadViewController.m; sourceTree = "<group>"; };
- 77E029F41F77E9A8006A0203 /* RootNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RootNavigationController.h; sourceTree = "<group>"; };
- 77E029F51F77E9A8006A0203 /* RootNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RootNavigationController.m; sourceTree = "<group>"; };
77E35A80189A5B5A00B2D216 /* LoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginViewController.h; sourceTree = "<group>"; };
77E35A81189A5B5A00B2D216 /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = "<group>"; };
77FCADDE1D6A50DA00CBA649 /* APIClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APIClient.m; sourceTree = "<group>"; };
@@ -133,6 +132,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 774153CE1F92A61500A19A50 /* UserNotifications.framework in Frameworks */,
77418CBD182FB9B6004111B7 /* ImageIO.framework in Frameworks */,
77975A21182BDCF300410C2B /* MobileCoreServices.framework in Frameworks */,
77975A1F182BDCE900410C2B /* SystemConfiguration.framework in Frameworks */,
@@ -180,6 +180,9 @@
77317BAA181BBE8500D60005 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 774528CB1F93EE9F004D110B /* libz.tbd */,
+ 774528C91F93EE83004D110B /* AssetsLibrary.framework */,
+ 774153CD1F92A61500A19A50 /* UserNotifications.framework */,
77418CBC182FB9B6004111B7 /* ImageIO.framework */,
77975A20182BDCF300410C2B /* MobileCoreServices.framework */,
77975A1E182BDCE900410C2B /* SystemConfiguration.framework */,
@@ -206,19 +209,17 @@
77317BB2181BBE8500D60005 /* Supporting Files */,
774DD45F1D735E0300C7F290 /* ViewControllers */,
77FFC0151D5FD13C003BD81A /* Views */,
- 77A5BDAF189AEB28000F8D9E /* 0.png */,
77FCADE01D6A50EC00CBA649 /* APIClient.h */,
77FCADDE1D6A50DA00CBA649 /* APIClient.m */,
77317BBA181BBE8500D60005 /* AppDelegate.h */,
77317BBB181BBE8500D60005 /* AppDelegate.m */,
- 77418CBA182F9A78004111B7 /* AttachPlaceholder@2x.png */,
77317BC6181BBE8500D60005 /* Images.xcassets */,
77C67EE918283C8D00427098 /* buttons.png */,
77418CBE182FBAB5004111B7 /* iTunesArtwork */,
77418CC0182FBABB004111B7 /* iTunesArtwork@2x */,
- 77C67EDC182827DB00427098 /* reveal-icon.png */,
- 77C67EDD182827DB00427098 /* reveal-icon@2x.png */,
77C6ADDD1F770EB2000AEA8C /* Main.storyboard */,
+ 774528C31F93AC0F004D110B /* CoreDataStack.h */,
+ 774528C41F93AC0F004D110B /* CoreDataStack.m */,
);
path = Juick;
sourceTree = "<group>";
@@ -262,6 +263,8 @@
77B099A5189D57F000A84F59 /* User.m */,
770A428F1E8881CB000B206A /* TokensList.h */,
770A42901E8881CB000B206A /* TokensList.m */,
+ 774528C01F930C06004D110B /* Attachment.h */,
+ 774528C11F930C06004D110B /* Attachment.m */,
);
path = Model;
sourceTree = "<group>";
@@ -277,8 +280,6 @@
77975A1C182B6E9A00410C2B /* NewPostViewController.m */,
77C6ADE21F7717BC000AEA8C /* ThreadViewController.h */,
77C6ADE31F7717BC000AEA8C /* ThreadViewController.m */,
- 77E029F41F77E9A8006A0203 /* RootNavigationController.h */,
- 77E029F51F77E9A8006A0203 /* RootNavigationController.m */,
);
path = ViewControllers;
sourceTree = "<group>";
@@ -397,11 +398,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 77C67EDF182827DB00427098 /* reveal-icon@2x.png in Resources */,
77317BC7181BBE8500D60005 /* Images.xcassets in Resources */,
77C67EEA18283C8D00427098 /* buttons.png in Resources */,
773F23391F76ED5E00B5B0DF /* Splash@3x.png in Resources */,
- 77A5BDB0189AEB28000F8D9E /* 0.png in Resources */,
77C6ADDE1F770EB2000AEA8C /* Main.storyboard in Resources */,
773F23381F76ED5E00B5B0DF /* Splash@2x.png in Resources */,
77418CC1182FBABB004111B7 /* iTunesArtwork@2x in Resources */,
@@ -410,8 +409,6 @@
77418CBF182FBAB5004111B7 /* iTunesArtwork in Resources */,
77317BB6181BBE8500D60005 /* InfoPlist.strings in Resources */,
773F23331F76ECAC00B5B0DF /* LaunchScreen.storyboard in Resources */,
- 77418CBB182F9A78004111B7 /* AttachPlaceholder@2x.png in Resources */,
- 77C67EDE182827DB00427098 /* reveal-icon.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -521,6 +518,7 @@
77317BBC181BBE8500D60005 /* AppDelegate.m in Sources */,
77FCADDF1D6A50DA00CBA649 /* APIClient.m in Sources */,
77A0954A181F1F25002BDECD /* Message.m in Sources */,
+ 774528C51F93AC0F004D110B /* CoreDataStack.m in Sources */,
77B09994189D0B9900A84F59 /* UIImage+Utils.m in Sources */,
77317BC2181BBE8500D60005 /* MessagesViewController.m in Sources */,
770A42911E8881CB000B206A /* TokensList.m in Sources */,
@@ -531,8 +529,8 @@
77C67EE51828342000427098 /* NSURL+PathParameters.m in Sources */,
77FFC0191D5FD186003BD81A /* MessageCell.m in Sources */,
77E35A82189A5B5A00B2D216 /* LoginViewController.m in Sources */,
- 77E029F61F77E9A8006A0203 /* RootNavigationController.m in Sources */,
77317BB8181BBE8500D60005 /* main.m in Sources */,
+ 774528C21F930C06004D110B /* Attachment.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -685,7 +683,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Juick/Supporting Files/Juick-Prefix.pch";
INFOPLIST_FILE = "Juick/Supporting Files/Juick-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 9.3;
+ IPHONEOS_DEPLOYMENT_TARGET = 10.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.juick.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -704,7 +702,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Juick/Supporting Files/Juick-Prefix.pch";
INFOPLIST_FILE = "Juick/Supporting Files/Juick-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 9.3;
+ IPHONEOS_DEPLOYMENT_TARGET = 10.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.juick.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
diff --git a/Juick/0.png b/Juick/0.png
deleted file mode 100644
index 7f2f7ac..0000000
--- a/Juick/0.png
+++ /dev/null
Binary files differ
diff --git a/Juick/AppDelegate.h b/Juick/AppDelegate.h
index 6753fd7..b5954e1 100644
--- a/Juick/AppDelegate.h
+++ b/Juick/AppDelegate.h
@@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>
#import "User.h"
-@interface AppDelegate : UIResponder <UIApplicationDelegate>
+@interface AppDelegate : UIResponder <UIApplicationDelegate, UNUserNotificationCenterDelegate>
@property (strong, nonatomic) UIWindow *window;
diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m
index b5c4e27..7be4424 100644
--- a/Juick/AppDelegate.m
+++ b/Juick/AppDelegate.m
@@ -20,16 +20,23 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UINavigationBar appearance] setTintColor:[ColorScheme linkColor]];
+ [[UINavigationBar appearance] setBackgroundColor:[ColorScheme headerBackground]];
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [ColorScheme linkColor]}];
+ [[UIToolbar appearance] setTintColor:[ColorScheme linkColor]];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
return YES;
}
-
--(void) application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
- [[UIApplication sharedApplication] registerForRemoteNotifications];
+- (void)registerForRemoteNotifications {
+ UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
+ center.delegate = self;
+ [center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error){
+ if(!error){
+ [[UIApplication sharedApplication] registerForRemoteNotifications];
+ }
+ }];
}
-(void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
@@ -46,4 +53,16 @@
NSLog(@"Error: %@", [error debugDescription]);
}
+//Called when a notification is delivered to a foreground app.
+-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler{
+ NSLog(@"User Info : %@",notification.request.content.userInfo);
+ completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
+}
+
+//Called to let your app know which action was selected by the user for a given notification.
+-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler{
+ NSLog(@"User Info : %@",response.notification.request.content.userInfo);
+ completionHandler();
+}
+
@end
diff --git a/Juick/AttachPlaceholder@2x.png b/Juick/AttachPlaceholder@2x.png
deleted file mode 100644
index 94e8c32..0000000
--- a/Juick/AttachPlaceholder@2x.png
+++ /dev/null
Binary files differ
diff --git a/Juick/CoreDataStack.h b/Juick/CoreDataStack.h
new file mode 100644
index 0000000..b430654
--- /dev/null
+++ b/Juick/CoreDataStack.h
@@ -0,0 +1,189 @@
+//
+// CoreDataStack.h
+// Juick
+//
+// Created by Vitaly Takmazov on 15/10/2017.
+// Copyright © 2017 com.juick. All rights reserved.
+//
+
+@import Foundation;
+@import CoreData;
+
+NS_ASSUME_NONNULL_BEGIN
+
+API_AVAILABLE(macosx(10.12),ios(10.0),tvos(10.0),watchos(3.0))
+@interface CoreDataStack : NSObject
+
+/**
+ The default directory for the persistent stores on the current platform.
+ @return An `NSURL` for the directory containing the persistent store(s). If the
+ persistent store does not exist it will be created by default in this location
+ when loaded.
+ */
++ (NSURL *)defaultDirectoryURL;
+
+///---------------------
+/// @name Properties
+///---------------------
+
+/**
+ A read-only flag indicating if the persistent store is loaded.
+ */
+@property (readonly, assign, getter=isStoreLoaded) BOOL storeLoaded;
+
+/**
+ The managed object context associated with the main queue (read-only). To
+ perform tasks on a private background queue see `performBackgroundTask:` and
+ `newPrivateContext`.
+ The context is configured to be generational and to automatically consume save
+ notifications from other contexts.
+ */
+@property (readonly, strong) NSManagedObjectContext *viewContext;
+
+/**
+ The `URL` of the persistent store for this Core Data Stack. If there are more
+ than one stores this property returns the first store it finds. The store may
+ not yet exist. It will be created at this URL by default when first loaded.
+
+ This is a readonly property to create a persistent store in a different
+ location use `loadStoreAtURL:withCompletionHandler`. To move an existing
+ persistent store use `replacePersistentStoreAtURL:withPersistentStoreFromURL:`.
+ */
+@property (readonly, copy) NSURL *storeURL;
+
+/**
+ A flag that indicates whether this store is read-only. Set this value to YES
+ before loading the persistent store if you want a read-only store (for example
+ if you are loading a store from the application bundle).
+
+ Default is NO.
+ */
+@property (assign, getter=isReadOnly) BOOL readOnly;
+
+/**
+ A flag that indicates whether the store is added asynchronously. Set this
+ value before loading the persistent store.
+
+ Default is YES.
+ */
+@property (assign) BOOL shouldAddStoreAsynchronously;
+
+/**
+ A flag that indicates whether the store should be migrated
+ automatically if the store model version does not match the
+ coordinators model version.
+
+ Set this value before loading the persistent store.
+ Default is YES.
+ */
+@property (assign) BOOL shouldMigrateStoreAutomatically;
+
+/**
+ A flag that indicates whether a mapping model should be inferred
+ when migrating a store.
+ Set this value before loading the persistent store.
+
+ Default is YES.
+ */
+@property (assign) BOOL shouldInferMappingModelAutomatically;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+- (instancetype)init NS_UNAVAILABLE;
+
+/**
+ Creates and returns a `CoreDataController` object. This is the designated
+ initializer for the class. It creates the managed object model, persistent
+ store coordinator and main managed object context but does not load the
+ persistent store.
+
+ @param name The name of the `NSManagedObjectModel` and by default the name used
+ for the persistent store
+ @return A `CoreDataController` object initialized with the given name.
+ */
+- (instancetype)initWithName:(NSString *)name NS_DESIGNATED_INITIALIZER;
+
+///---------------------------------
+/// @name Loading a Persistent Store
+///---------------------------------
+
+/**
+ Load the persistent store.
+ @param handler This handler block is executed on the calling thread when the
+ loading of the persistent store has completed.
+
+ To override the default name and location of the persistent store use
+ `loadStoreAtURL:withCompletionHandler:`.
+ */
+- (void)loadStoreWithCompletionHandler:(void(^)(NSError *))handler;
+
+/**
+ Load the persistent store.
+ @param storeURL The URL for the location of the persistent store. It will be created if it does not exist.
+ @param handler This handler block is executed on the calling thread when the
+ loading of the persistent store has completed.
+ */
+- (void)loadStoreAtURL:(NSURL *)storeURL withCompletionHandler:(void(^)(NSError * _Nullable))handler;
+
+///----------------------------------
+/// @name Managing a Persistent Store
+///----------------------------------
+
+/**
+ A flag indicating if the persistent store exists at the specified URL.
+ @param storeURL An `NSURL` object for the location of the peristent store.
+ @return YES if a file exists at the specified URL otherwise NO.
+ @warning This method checks if a file exists at the specified location but
+ does not verify if it is a valid persistent store.
+ */
+- (BOOL)persistentStoreExistsAtURL:(NSURL *)storeURL;
+
+/**
+ Replace a persistent store.
+ @param destinationURL An `NSURL` for the persistent store to be replaced.
+ @param sourceURL An `NSURL` for the source persistent store.
+ @return A flag indicating if the operation was successful.
+ */
+- (BOOL)replacePersistentStoreAtURL:(NSURL *)destinationURL withPersistentStoreFromURL:(NSURL *)sourceURL;
+
+/**
+ Destroy a persistent store.
+ @param storeURL An `NSURL` for the persistent store to be destroyed.
+ @return A flag indicating if the operation was successful.
+ */
+- (BOOL)destroyPersistentStoreAtURL:(NSURL *)storeURL;
+
+///----------------------------------
+/// @name Performing Background tasks
+///----------------------------------
+
+/**
+ Execute a block on a new private queue context.
+ @param block A block to execute on a newly created private context. The context
+ is passed to the block as a paramater.
+ */
+- (void)performBackgroundTask:(void(^)(NSManagedObjectContext *))block;
+
+/**
+ Create and return a new private queue `NSManagedObjectContext`. The new context
+ is set to consume `NSManagedObjectContextSave` broadcasts automatically.
+ @return A new private managed object context.
+ */
+- (NSManagedObjectContext *)newPrivateContext NS_RETURNS_RETAINED;
+
+///------------------------
+/// @name NSManagedObjectID
+///------------------------
+
+/**
+ Return an object ID for the specified URI representation if a matching
+ store is available.
+ @param url An `NSURL` containing a URI of a managed object.
+ @return An `NSManagedObjectID` or `nil`.
+ */
+- (NSManagedObjectID *)managedObjectIDForURIRepresentation:(NSURL *)url;
+
+@end
+NS_ASSUME_NONNULL_END
diff --git a/Juick/CoreDataStack.m b/Juick/CoreDataStack.m
new file mode 100644
index 0000000..6122731
--- /dev/null
+++ b/Juick/CoreDataStack.m
@@ -0,0 +1,133 @@
+//
+// CoreDataStack.m
+// Juick
+//
+// Created by Vitaly Takmazov on 15/10/2017.
+// Copyright © 2017 com.juick. All rights reserved.
+//
+
+#import "CoreDataStack.h"
+
+@interface CoreDataStack ()
+@property (nonatomic, getter=isStoreLoaded) BOOL storeLoaded;
+@property (nonatomic, strong) NSPersistentContainer *persistentContainer;
+@end
+
+@implementation CoreDataStack
+
++ (NSURL *)defaultDirectoryURL {
+ return [NSPersistentContainer defaultDirectoryURL];
+}
+
+- (instancetype)initWithName:(NSString *)name {
+
+ NSManagedObjectModel *mom = [NSManagedObjectModel mergedModelFromBundles:nil];
+ if (mom == nil) return nil;
+
+ self = [super init];
+ if (self) {
+ _storeLoaded = NO;
+ _shouldAddStoreAsynchronously = YES;
+ _shouldMigrateStoreAutomatically = YES;
+ _shouldInferMappingModelAutomatically = YES;
+ _readOnly = NO;
+ _persistentContainer = [NSPersistentContainer persistentContainerWithName:name managedObjectModel:mom];
+ _persistentContainer.viewContext.automaticallyMergesChangesFromParent = YES;
+ }
+ return self;
+}
+
+- (void)loadStoreWithCompletionHandler:(void(^)(NSError *))handler {
+
+ [self loadStoreAtURL:self.storeURL withCompletionHandler:handler];
+}
+
+- (void)loadStoreAtURL:(NSURL *)storeURL withCompletionHandler:(void(^)(NSError *))handler {
+
+ if (!self.persistentContainer) {
+ NSError *error = [NSError errorWithDomain:NSCocoaErrorDomain code:NSNotFound userInfo:nil];
+ if (handler) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ handler(error);
+ });
+ }
+ return;
+ }
+
+ self.persistentContainer.persistentStoreDescriptions = @[[self storeDescriptionWithURL:storeURL]];
+ [self.persistentContainer loadPersistentStoresWithCompletionHandler:
+ ^(NSPersistentStoreDescription *storeDescription, NSError *error) {
+ if (error == nil) {
+ self.storeLoaded = YES;
+ }
+ if (handler) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ handler(error);
+ });
+ }
+ }];
+}
+
+- (BOOL)persistentStoreExistsAtURL:(NSURL *)storeURL {
+
+ if (storeURL.isFileURL &&
+ [NSFileManager.defaultManager fileExistsAtPath:storeURL.path]) {
+ return YES;
+ }
+ return NO;
+}
+
+- (NSURL *)storeURL {
+ NSArray *descriptions = self.persistentContainer.persistentStoreDescriptions;
+ NSPersistentStoreDescription *description = [descriptions firstObject];
+ return description.URL;
+}
+
+- (BOOL)destroyPersistentStoreAtURL:(NSURL *)storeURL {
+
+ NSError *error = nil;
+ BOOL result = [self.persistentContainer.persistentStoreCoordinator destroyPersistentStoreAtURL:storeURL withType:NSSQLiteStoreType options:nil error:&error];
+ return result;
+}
+
+- (BOOL)replacePersistentStoreAtURL:(NSURL *)destinationURL withPersistentStoreFromURL:(NSURL *)sourceURL {
+
+ NSError *error = nil;
+ BOOL result = [self.persistentContainer.persistentStoreCoordinator replacePersistentStoreAtURL:destinationURL destinationOptions:nil withPersistentStoreFromURL:sourceURL sourceOptions:nil storeType:NSSQLiteStoreType error:&error];
+ return result;
+}
+
+- (NSManagedObjectContext *)viewContext {
+
+ return self.persistentContainer.viewContext;
+}
+
+- (NSManagedObjectContext *)newPrivateContext {
+
+ return [self.persistentContainer newBackgroundContext];
+}
+
+- (void)performBackgroundTask:(void(^)(NSManagedObjectContext *))block {
+
+ [self.persistentContainer performBackgroundTask:block];
+}
+
+- (NSManagedObjectID *)managedObjectIDForURIRepresentation:(NSURL *)url {
+ return [self.persistentContainer.persistentStoreCoordinator managedObjectIDForURIRepresentation:url];
+}
+
+#pragma mark -
+#pragma mark === Private methods ===
+#pragma mark -
+
+- (NSPersistentStoreDescription *)storeDescriptionWithURL:(NSURL *)URL {
+
+ NSPersistentStoreDescription *description = [NSPersistentStoreDescription persistentStoreDescriptionWithURL:URL];
+ description.shouldAddStoreAsynchronously = self.shouldAddStoreAsynchronously;
+ description.shouldMigrateStoreAutomatically = self.shouldMigrateStoreAutomatically;
+ description.shouldInferMappingModelAutomatically = self.shouldInferMappingModelAutomatically;
+ description.readOnly = self.isReadOnly;
+ return description;
+}
+
+@end
diff --git a/Juick/Helpers/ColorScheme.h b/Juick/Helpers/ColorScheme.h
index de69689..3226f75 100644
--- a/Juick/Helpers/ColorScheme.h
+++ b/Juick/Helpers/ColorScheme.h
@@ -13,5 +13,6 @@
+ (UIColor *)colorWithHex:(UInt32)col;
+(UIColor *) mainBackground;
++(UIColor *) headerBackground;
+(UIColor *) linkColor;
@end
diff --git a/Juick/Helpers/ColorScheme.m b/Juick/Helpers/ColorScheme.m
index 56684a6..53cca4f 100644
--- a/Juick/Helpers/ColorScheme.m
+++ b/Juick/Helpers/ColorScheme.m
@@ -24,9 +24,12 @@
return [UIColor colorWithRed:(float)r/255.0f green:(float)g/255.0f blue:(float)b/255.0f alpha:1];
}
++ (UIColor *) headerBackground {
+ return [self colorWithHex:0xeeeee5];
+}
+ (UIColor *) mainBackground {
- return [self colorWithHex:0xf8f8f8];
+ return [self colorWithHex:0xddddd5];
}
+ (UIColor *) linkColor {
diff --git a/Juick/Helpers/UIImage+Utils.h b/Juick/Helpers/UIImage+Utils.h
index 8de91bf..d2e8b99 100644
--- a/Juick/Helpers/UIImage+Utils.h
+++ b/Juick/Helpers/UIImage+Utils.h
@@ -16,4 +16,5 @@
+ (UIImage*)imageWithImage:(UIImage *)image fitInsideWidth:(float)width fitInsideHeight:(float)height;
+ (UIImage*)imageWithImage:(UIImage *)image fitOutsideWidth:(float)width fitOutsideHeight:(float)height;
+ (UIImage*)imageWithImage:(UIImage *)image cropToWidth:(float)width cropToHeight:(float)height;
++ (UIImage*)placeholderImageWithColor:(UIColor *)color size:(CGSize)size;
@end
diff --git a/Juick/Helpers/UIImage+Utils.m b/Juick/Helpers/UIImage+Utils.m
index 4617c65..c209bcf 100644
--- a/Juick/Helpers/UIImage+Utils.m
+++ b/Juick/Helpers/UIImage+Utils.m
@@ -66,4 +66,18 @@
return img;
}
++(UIImage *) placeholderImageWithColor:(UIColor *)color size:(CGSize)size {
+ CGRect rect = (CGRect){
+ .origin = CGPointZero,
+ .size = size
+ };
+ UIGraphicsBeginImageContextWithOptions(rect.size, false, 0.0f);
+ [color setFill];
+ UIRectFill(rect);
+ UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
+ UIGraphicsEndImageContext();
+
+ return [[self alloc] initWithCGImage:[image CGImage]];
+}
+
@end
diff --git a/Juick/Main.storyboard b/Juick/Main.storyboard
index ebc1465..5394264 100644
--- a/Juick/Main.storyboard
+++ b/Juick/Main.storyboard
@@ -1,5 +1,5 @@
<?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">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="meX-Jy-oiG">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
@@ -10,11 +10,11 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
- <!--Item-->
+ <!--Navigation Controller-->
<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"/>
+ <navigationController toolbarHidden="NO" id="meX-Jy-oiG" sceneMemberID="viewController">
+ <toolbarItems/>
<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"/>
@@ -29,72 +29,69 @@
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="e3G-bn-wym" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
- <point key="canvasLocation" x="-1845" y="-168"/>
+ <point key="canvasLocation" x="-1153.125" y="-186.75999999999999"/>
</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">
+ <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" 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">
+ <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="messageCell" rowHeight="500" id="e1h-hQ-iWB" 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">
+ <tableViewCellContentView key="contentView" opaque="NO" multipleTouchEnabled="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="e1h-hQ-iWB" id="LVD-Z8-CLG">
<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"/>
+ <stackView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="249" verticalCompressionResistancePriority="749" axis="vertical" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="UAN-1F-VSl">
+ <rect key="frame" x="8" y="8" width="359" height="483.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"/>
+ <stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="fcy-yR-0PD">
+ <rect key="frame" x="0.0" y="0.0" width="359" height="48"/>
<subviews>
- <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Ru8-1o-eNk">
+ <imageView userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yLX-wS-bB1">
<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"/>
+ <constraint firstAttribute="width" constant="48" id="c8k-kD-iPC"/>
+ <constraint firstAttribute="height" constant="48" id="wSE-Wv-vu3"/>
</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"/>
+ <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="4" translatesAutoresizingMaskIntoConstraints="NO" id="ZVR-KJ-pah">
+ <rect key="frame" x="56" y="0.0" width="303" 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"/>
+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jNN-1r-7dJ">
+ <rect key="frame" x="0.0" y="0.0" width="303" height="20.5"/>
<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="textColor"/>
<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"/>
+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UiL-3x-RCt">
+ <rect key="frame" x="0.0" y="24.5" width="303" height="23.5"/>
<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="textColor"/>
<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"/>
+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jYp-Nz-sOJ" customClass="TagListView">
+ <rect key="frame" x="0.0" y="60" width="359" height="29"/>
<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"/>
+ <color key="value" red="0.53333333329999999" green="0.53333333329999999" blue="0.53333333329999999" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
+ <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+ <color key="value" red="0.80000000000000004" green="0.80000000000000004" blue="0.80000000000000004" alpha="1" colorSpace="calibratedRGB"/>
+ </userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="paddingY">
<real key="value" value="6"/>
</userDefinedRuntimeAttribute>
@@ -107,45 +104,50 @@
<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>
+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="999" verticalHuggingPriority="249" horizontalCompressionResistancePriority="999" verticalCompressionResistancePriority="749" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zqL-hd-LLy" customClass="TTTAttributedLabel">
+ <rect key="frame" x="0.0" y="101" width="359" height="86.5"/>
+ <mutableString key="text">Блин, парился через teamviewer заокеан, там xcode, а к xcode подключен iphone, а в iphone торчит t-mobile, а на iphone наш Qt application, который не коннектиццо к серверу в упор.
+
+А в qt creator видно что приходит ошибка NetworkError, логи не пишет, а кто отправляет и почему — непонятно, а отладчик не ставит брякпойнты в сорцах Qt, а приходит qt сигнал — и понятно, что никаких тебе стектрейсов. Плакал, пока не запустил НЕ через отладчик Qt Creator, а прямо в xcode, там брякпойнты ставит.</mutableString>
<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="textColor"/>
<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 userInteractionEnabled="NO" contentMode="scaleAspectFit" verticalHuggingPriority="249" verticalCompressionResistancePriority="749" adjustsImageSizeForAccessibilityContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="XN9-V3-t43">
+ <rect key="frame" x="0.0" y="199.5" width="359" height="256"/>
+ <constraints>
+ <constraint firstAttribute="height" priority="999" constant="256" id="J17-nb-wur"/>
+ </constraints>
</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"/>
+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FAF-xW-CXb">
+ <rect key="frame" x="0.0" y="467.5" width="359" 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"/>
+ <color key="textColor" red="0.53333333329999999" green="0.53333333329999999" blue="0.53333333329999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<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"/>
+ <constraint firstAttribute="bottom" secondItem="UAN-1F-VSl" secondAttribute="bottom" constant="8" id="9iJ-eR-JuR"/>
+ <constraint firstItem="UAN-1F-VSl" firstAttribute="leading" secondItem="LVD-Z8-CLG" secondAttribute="leading" constant="8" id="GxT-Ne-ZLT"/>
+ <constraint firstAttribute="trailing" secondItem="UAN-1F-VSl" secondAttribute="trailing" constant="8" id="KFg-Im-T1W"/>
+ <constraint firstItem="UAN-1F-VSl" firstAttribute="top" secondItem="LVD-Z8-CLG" secondAttribute="top" constant="8" id="WQ5-ab-cBr"/>
</constraints>
</tableViewCellContentView>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<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"/>
+ <outlet property="attach" destination="XN9-V3-t43" id="YAR-Rw-IHV"/>
+ <outlet property="attachmentHeight" destination="J17-nb-wur" id="xd5-EV-Cny"/>
+ <outlet property="avatar" destination="yLX-wS-bB1" id="31D-uh-uo9"/>
+ <outlet property="summary" destination="FAF-xW-CXb" id="Gmx-Po-GIW"/>
+ <outlet property="tags" destination="jYp-Nz-sOJ" id="xZ8-gu-UzS"/>
+ <outlet property="text" destination="zqL-hd-LLy" id="u0i-fj-3x4"/>
+ <outlet property="timestamp" destination="UiL-3x-RCt" id="P2X-dW-ycQ"/>
+ <outlet property="title" destination="jNN-1r-7dJ" id="B73-VP-D6l"/>
</connections>
</tableViewCell>
</prototypes>
@@ -154,66 +156,162 @@
<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"/>
+ <toolbarItems>
+ <barButtonItem image="chats_icon" id="eaY-Yt-u9g">
+ <connections>
+ <segue destination="vqF-gx-pZG" kind="push" id="D96-j8-t2e"/>
+ </connections>
+ </barButtonItem>
+ <barButtonItem style="plain" systemItem="flexibleSpace" id="JhF-fJ-DQL"/>
+ <barButtonItem systemItem="compose" id="ovc-xl-vHA">
+ <connections>
+ <segue destination="rr1-jx-MLx" kind="push" id="vj1-M0-h6U"/>
+ </connections>
+ </barButtonItem>
+ </toolbarItems>
+ <navigationItem key="navigationItem" title="Discover" id="M2f-nV-K0C">
+ <barButtonItem key="leftBarButtonItem" image="profile_icon" id="Sd1-hN-fdS">
+ <connections>
+ <segue destination="NJR-jw-Kd1" kind="push" id="LYE-GD-USd"/>
+ </connections>
+ </barButtonItem>
+ </navigationItem>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="skE-j1-NV7" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
- <point key="canvasLocation" x="-1074" y="-169"/>
+ <point key="canvasLocation" x="-671.5" y="-188.5"/>
+ </scene>
+ <!--Profile-->
+ <scene sceneID="pZT-hd-B6F">
+ <objects>
+ <tableViewController title="Profile" id="NJR-jw-Kd1" 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="UQ6-nv-K3A">
+ <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="profileCell" id="Tqu-K7-cUZ">
+ <rect key="frame" x="0.0" y="28" width="375" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Tqu-K7-cUZ" id="7Z9-n4-t7M">
+ <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </tableViewCellContentView>
+ </tableViewCell>
+ </prototypes>
+ <connections>
+ <outlet property="dataSource" destination="NJR-jw-Kd1" id="tZv-rv-QVF"/>
+ <outlet property="delegate" destination="NJR-jw-Kd1" id="poz-3B-0mE"/>
+ </connections>
+ </tableView>
+ <navigationItem key="navigationItem" id="cFa-km-EJ2"/>
+ </tableViewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="cV6-IK-Ozg" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="-657.5" y="665.88833333333332"/>
</scene>
- <!--Post-->
+ <!--Notifications-->
+ <scene sceneID="CAp-HD-pIQ">
+ <objects>
+ <tableViewController title="Notifications" id="vqF-gx-pZG" 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="ZQ7-23-Nqu">
+ <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="notificationCell" id="KSR-Fu-ZcK">
+ <rect key="frame" x="0.0" y="28" width="375" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="KSR-Fu-ZcK" id="BUc-6q-MYj">
+ <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </tableViewCellContentView>
+ </tableViewCell>
+ </prototypes>
+ <connections>
+ <outlet property="dataSource" destination="vqF-gx-pZG" id="kEz-Xy-OQT"/>
+ <outlet property="delegate" destination="vqF-gx-pZG" id="xKF-Xt-zWe"/>
+ </connections>
+ </tableView>
+ <navigationItem key="navigationItem" title="Notifications" id="hVh-CA-hQo"/>
+ </tableViewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="8ge-Xf-wBN" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="-222.5" y="667"/>
+ </scene>
+ <!--New post-->
<scene sceneID="bF2-U0-WHJ">
<objects>
- <viewController id="rr1-jx-MLx" customClass="NewPostViewController" sceneMemberID="viewController">
+ <viewController title="New post" 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"/>
+ <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GB6-qL-STb" customClass="PostView">
+ <rect key="frame" x="8" y="72" width="359" height="543"/>
+ <subviews>
+ <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="XYj-Y4-lfM">
+ <rect key="frame" x="0.0" y="0.0" width="359" height="543"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
+ <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
+ <userDefinedRuntimeAttributes>
+ <userDefinedRuntimeAttribute type="color" keyPath="layer.shadowColor">
+ <color key="value" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
+ </userDefinedRuntimeAttribute>
+ <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="NO"/>
+ <userDefinedRuntimeAttribute type="string" keyPath="layer.shadowOpacity" value="0.16"/>
+ <userDefinedRuntimeAttribute type="size" keyPath="layer.shadowOffset">
+ <size key="value" width="0.0" height="3"/>
+ </userDefinedRuntimeAttribute>
+ </userDefinedRuntimeAttributes>
+ </textView>
+ </subviews>
<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>
+ <constraints>
+ <constraint firstAttribute="trailing" secondItem="XYj-Y4-lfM" secondAttribute="trailing" id="jI3-cJ-6Mp"/>
+ <constraint firstAttribute="bottom" secondItem="XYj-Y4-lfM" secondAttribute="bottom" id="jXU-c3-buK"/>
+ <constraint firstItem="XYj-Y4-lfM" firstAttribute="leading" secondItem="GB6-qL-STb" secondAttribute="leading" id="mVZ-wx-MTI"/>
+ <constraint firstItem="XYj-Y4-lfM" firstAttribute="top" secondItem="GB6-qL-STb" secondAttribute="top" id="t5x-bF-ptj"/>
+ </constraints>
+ </view>
</subviews>
- <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <color key="backgroundColor" red="0.97254901960784312" green="0.97254901960784312" blue="0.97254901960784312" alpha="1" colorSpace="calibratedRGB"/>
<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"/>
+ <constraint firstItem="GB6-qL-STb" firstAttribute="leading" secondItem="UJz-7C-l1q" secondAttribute="leading" constant="8" id="47p-h8-Jtb"/>
+ <constraint firstItem="UJz-7C-l1q" firstAttribute="trailing" secondItem="GB6-qL-STb" secondAttribute="trailing" constant="8" id="4oU-Mg-KhG"/>
+ <constraint firstItem="GB6-qL-STb" firstAttribute="top" secondItem="UJz-7C-l1q" secondAttribute="top" constant="8" id="IcR-4Z-amS"/>
+ <constraint firstItem="UJz-7C-l1q" firstAttribute="bottom" secondItem="GB6-qL-STb" secondAttribute="bottom" constant="8" id="g8x-pU-RPk"/>
</constraints>
- <viewLayoutGuide key="safeArea" id="GP4-ea-eeC"/>
+ <viewLayoutGuide key="safeArea" id="UJz-7C-l1q"/>
</view>
- <tabBarItem key="tabBarItem" tag="1" title="Post" image="new_chat_icon" landscapeImage="new_chat_icon" selectedImage="new_chat_icon" id="Oh5-L7-Bey"/>
+ <navigationItem key="navigationItem" id="Yd6-Yh-gtd"/>
+ <connections>
+ <outlet property="bottomConstraint" destination="g8x-pU-RPk" id="pan-Nq-6Tb"/>
+ <outlet property="textView" destination="XYj-Y4-lfM" id="AhV-B8-GYd"/>
+ </connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Pm0-3R-NV9" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
- <point key="canvasLocation" x="-319" y="340"/>
+ <point key="canvasLocation" x="-222.5" y="-187.87166666666664"/>
</scene>
- <!--Notifications-->
- <scene sceneID="Lag-uC-EkY">
+ <!--View Controller-->
+ <scene sceneID="2JO-Ow-tN4">
<objects>
- <viewController id="XX2-Oc-8ev" sceneMemberID="viewController">
- <view key="view" contentMode="scaleToFill" id="IVn-gT-D2f">
+ <viewController id="1fn-M8-sIw" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="yTB-MW-YgM">
<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"/>
+ <viewLayoutGuide key="safeArea" id="M9k-qT-r2t"/>
</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"/>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="xeU-Vq-blW" 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"/>
+ <image name="profile_icon" width="16" height="20"/>
</resources>
</document>
diff --git a/Juick/Model/Attachment.h b/Juick/Model/Attachment.h
new file mode 100644
index 0000000..26fc1c0
--- /dev/null
+++ b/Juick/Model/Attachment.h
@@ -0,0 +1,18 @@
+//
+// Attachment.h
+// Juick
+//
+// Created by Vitaly Takmazov on 15/10/2017.
+// Copyright © 2017 com.juick. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface Attachment : NSObject
+@property(nonatomic, strong) NSString *url;
+@property(nonatomic, strong) NSNumber *width;
+@property(nonatomic, strong) NSNumber *height;
+@property(nonatomic, strong) Attachment *small;
+@property(nonatomic, strong) Attachment *medium;
+@property(nonatomic, strong) Attachment *thumbnail;
+@end
diff --git a/Juick/Model/Attachment.m b/Juick/Model/Attachment.m
new file mode 100644
index 0000000..a54e462
--- /dev/null
+++ b/Juick/Model/Attachment.m
@@ -0,0 +1,13 @@
+//
+// Attachment.m
+// Juick
+//
+// Created by Vitaly Takmazov on 15/10/2017.
+// Copyright © 2017 com.juick. All rights reserved.
+//
+
+#import "Attachment.h"
+
+@implementation Attachment
+
+@end
diff --git a/Juick/Model/Message.h b/Juick/Model/Message.h
index 1b41315..5eab279 100644
--- a/Juick/Model/Message.h
+++ b/Juick/Model/Message.h
@@ -8,6 +8,7 @@
#import <Foundation/Foundation.h>
#import "User.h"
+#import "Attachment.h"
@interface Message : NSObject
@@ -20,5 +21,6 @@
@property NSString *attach;
@property NSString *repliesBy;
@property NSNumber *repliesCount;
+@property Attachment *attachment;
@end
diff --git a/Juick/Supporting Files/Juick-Prefix.pch b/Juick/Supporting Files/Juick-Prefix.pch
index 1062827..1af6911 100644
--- a/Juick/Supporting Files/Juick-Prefix.pch
+++ b/Juick/Supporting Files/Juick-Prefix.pch
@@ -15,4 +15,5 @@
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
+ #import <UserNotifications/UserNotifications.h>
#endif
diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m
index b877cd1..badc4a3 100644
--- a/Juick/ViewControllers/MessagesViewController.m
+++ b/Juick/ViewControllers/MessagesViewController.m
@@ -7,7 +7,6 @@
//
#import "MessagesViewController.h"
-@import YYWebImage;
#import "MessageCell.h"
#import "Message.h"
@@ -21,7 +20,7 @@
#import "NSURL+PathParameters.h"
-@interface MessagesViewController ();
+@interface MessagesViewController ()
@property(nonatomic, strong) NSMutableArray *messages;
@property(nonatomic, assign) Boolean dataLoading;
@@ -63,18 +62,16 @@
self.dataLoading = NO;
[self.view setBackgroundColor:[ColorScheme mainBackground]];
- self.messages = [NSMutableArray array];
- self.params = [NSMutableDictionary new];
-
self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 500.0f;
+ self.messages = [NSMutableArray array];
+ self.params = [NSMutableDictionary new];
self.refreshControl = [UIRefreshControl new];
[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];
@@ -85,36 +82,12 @@
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 {
}
-- (void)viewDidAppear:(BOOL)animated
-{
- [super viewDidAppear:animated];
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(contentSizeCategoryChanged:)
- name:UIContentSizeCategoryDidChangeNotification
- object:nil];
-}
-
-- (void)viewDidDisappear:(BOOL)animated
-{
- [super viewDidDisappear:animated];
- [[NSNotificationCenter defaultCenter] removeObserver:self
- name:UIContentSizeCategoryDidChangeNotification
- object:nil];
-}
-
-- (void)contentSizeCategoryChanged:(NSNotification *)notification
-{
- [self.tableView reloadData];
-}
-
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
@@ -124,20 +97,10 @@
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- 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) {
- [cell setNeedsUpdateConstraints];
- [cell updateConstraintsIfNeeded];
- }];
- } else {
- cell.attach.image = nil;
- }
-
+ NSString * cellIdentifier = @"messageCell";
+ MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
+ [cell configureWithMessage:msg];
return cell;
}
diff --git a/Juick/ViewControllers/NewPostViewController.h b/Juick/ViewControllers/NewPostViewController.h
index ceaca49..3d4ba88 100644
--- a/Juick/ViewControllers/NewPostViewController.h
+++ b/Juick/ViewControllers/NewPostViewController.h
@@ -9,5 +9,6 @@
#import <UIKit/UIKit.h>
@interface NewPostViewController : UIViewController
-
+@property (weak, nonatomic) IBOutlet UITextView *textView;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomConstraint;
@end
diff --git a/Juick/ViewControllers/NewPostViewController.m b/Juick/ViewControllers/NewPostViewController.m
index 318de4e..9643b78 100644
--- a/Juick/ViewControllers/NewPostViewController.m
+++ b/Juick/ViewControllers/NewPostViewController.m
@@ -12,6 +12,7 @@
@interface NewPostViewController ()
@property (nonatomic, assign) BOOL didSetupConstraints;
+@property (nonatomic, assign) int paddingValue;
@end
@@ -21,14 +22,17 @@
{
[super viewDidLoad];
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.navigationController.visibleViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
- target:self action:@selector(doneCompose)];
+ target:self action:@selector(doneCompose)];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
+ [self.textView becomeFirstResponder];
}
- (void) cancelCompose {
+ [self.textView resignFirstResponder];
[self.navigationController.visibleViewController.navigationController popViewControllerAnimated:YES];
}
@@ -36,4 +40,17 @@
[self.navigationController.visibleViewController.navigationController popToRootViewControllerAnimated:YES];
}
+-(void) keyboardDidShow:(NSNotification *)sender {
+ CGRect frame = [sender.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
+ CGRect newFrame = [self.view convertRect:frame fromView:[[UIApplication sharedApplication] delegate].window];
+ [self.view layoutIfNeeded];
+ [UIView animateWithDuration:[sender.userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue] animations:^{
+ self.bottomConstraint.constant = newFrame.origin.y - CGRectGetHeight(self.view.frame) + self.paddingValue;
+ [self.view layoutIfNeeded];
+ }];
+}
+-(void) keyboardWillHide:(NSNotification *)sender {
+ self.bottomConstraint.constant = self.paddingValue;
+ [self.view layoutIfNeeded];
+}
@end
diff --git a/Juick/ViewControllers/RootNavigationController.h b/Juick/ViewControllers/RootNavigationController.h
deleted file mode 100644
index f7f6734..0000000
--- a/Juick/ViewControllers/RootNavigationController.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// 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
deleted file mode 100644
index 9be0a5f..0000000
--- a/Juick/ViewControllers/RootNavigationController.m
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// 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/Views/MessageCell.h b/Juick/Views/MessageCell.h
index 124ed83..92345d6 100644
--- a/Juick/Views/MessageCell.h
+++ b/Juick/Views/MessageCell.h
@@ -13,13 +13,14 @@
@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 TagListView *tags;
@property (weak, nonatomic) IBOutlet TTTAttributedLabel *text;
@property (weak, nonatomic) IBOutlet UIImageView *attach;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *attachmentHeight;
@property (weak, nonatomic) IBOutlet UILabel *summary;
-@property (strong, nonatomic) Message * message;
+- (void) configureWithMessage:(Message *)msg;
@end
diff --git a/Juick/Views/MessageCell.m b/Juick/Views/MessageCell.m
index cc35446..1cfe304 100644
--- a/Juick/Views/MessageCell.m
+++ b/Juick/Views/MessageCell.m
@@ -6,11 +6,14 @@
// Copyright © 2016 com.juick. All rights reserved.
//
+
#import "MessageCell.h"
-@import YYWebImage;
+#import "ColorScheme.h"
+#import "UIImage+Utils.h"
+
@import DateTools;
@import MWFeedParser;
-#import "ColorScheme.h"
+@import YYWebImage;
@implementation MessageCell
@@ -20,11 +23,22 @@
self.text.delegate = self;
self.text.linkAttributes = @{ (id)kCTForegroundColorAttributeName: [ColorScheme linkColor],
(id)kCTUnderlineStyleAttributeName : [NSNumber numberWithInt:NSUnderlineStyleSingle] };
+ self.title.textColor = [ColorScheme linkColor];
+ self.timestamp.textColor = [UIColor grayColor];
+ self.summary.textColor = [UIColor grayColor];
+ self.tags.textFont = [UIFont preferredFontForTextStyle:UIFontTextStyleFootnote];
}
-- (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]]];
+- (void) configureWithMessage:(Message *)msg {
+ [self.avatar setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://i.juick.com/a/%d.png", [msg.user.uid intValue]]]];
+ if ([msg.attach length] > 0) {
+ CGFloat imageHeight = [msg.attachment.small.height floatValue] / [[UIScreen mainScreen] scale];
+ self.attachmentHeight.constant = imageHeight;
+ [self.attach yy_setImageWithURL:[NSURL URLWithString:msg.attach] options:YYWebImageOptionProgressiveBlur|YYWebImageOptionSetImageWithFadeAnimation];
+ } else {
+ self.attachmentHeight.constant = 0;
+ self.attach.image = nil;
+ }
self.title.text = msg.user.uname;
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
@@ -51,7 +65,7 @@
}
-(void)attributedLabel:(TTTAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url {
- [[UIApplication sharedApplication] openURL:url];
+ [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
}
@end
diff --git a/Juick/reveal-icon.png b/Juick/reveal-icon.png
deleted file mode 100644
index 4a4d467..0000000
--- a/Juick/reveal-icon.png
+++ /dev/null
Binary files differ
diff --git a/Juick/reveal-icon@2x.png b/Juick/reveal-icon@2x.png
deleted file mode 100644
index 08dc402..0000000
--- a/Juick/reveal-icon@2x.png
+++ /dev/null
Binary files differ
diff --git a/Podfile b/Podfile
index 9aaabbc..f6e662e 100644
--- a/Podfile
+++ b/Podfile
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
-platform :ios, "9.3"
+platform :ios, "10.3"
use_frameworks!
target "Juick" do
diff --git a/Podfile.lock b/Podfile.lock
index 1ad7c7d..894d72f 100644
--- a/Podfile.lock
+++ b/Podfile.lock
@@ -73,6 +73,6 @@ SPEC CHECKSUMS:
YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928
-PODFILE CHECKSUM: 218d807b94c03edbae8c0d8776a914443de03448
+PODFILE CHECKSUM: ee64e1198ecfa623cc7be9773c723981dce299b5
COCOAPODS: 1.4.0.beta.1