From b3eaef8a304ce89242c649cfd0386a66e463acb2 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 7 Nov 2013 03:35:52 +0400 Subject: iPad support and AppIcon --- Juick.xcodeproj/project.pbxproj | 4 +- Juick/AppDelegate.h | 2 +- Juick/AppDelegate.m | 14 ++-- .../AppIcon.appiconset/AppIcon29x29-1.png | Bin 0 -> 6571 bytes .../AppIcon.appiconset/AppIcon29x29.png | Bin 0 -> 6571 bytes .../AppIcon.appiconset/AppIcon29x29@2x-1.png | Bin 0 -> 9324 bytes .../AppIcon.appiconset/AppIcon29x29@2x.png | Bin 0 -> 9324 bytes .../AppIcon.appiconset/AppIcon40x40.png | Bin 0 -> 7427 bytes .../AppIcon.appiconset/AppIcon40x40@2x-1.png | Bin 0 -> 12547 bytes .../AppIcon.appiconset/AppIcon40x40@2x.png | Bin 0 -> 12547 bytes .../AppIcon.appiconset/AppIcon60x60@2x.png | Bin 0 -> 19564 bytes .../AppIcon.appiconset/AppIcon76x76.png | Bin 0 -> 11214 bytes .../AppIcon.appiconset/AppIcon76x76@2x.png | Bin 0 -> 28000 bytes .../AppIcon.appiconset/Contents.json | 77 ++++++++++++++++++++- Juick/MessagesViewController.h | 2 +- Juick/MessagesViewController.m | 19 +++-- 16 files changed, 104 insertions(+), 14 deletions(-) create mode 100644 Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29-1.png create mode 100644 Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29.png create mode 100644 Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x-1.png create mode 100644 Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png create mode 100644 Juick/Images.xcassets/AppIcon.appiconset/AppIcon40x40.png create mode 100644 Juick/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x-1.png create mode 100644 Juick/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png create mode 100644 Juick/Images.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png create mode 100644 Juick/Images.xcassets/AppIcon.appiconset/AppIcon76x76.png create mode 100644 Juick/Images.xcassets/AppIcon.appiconset/AppIcon76x76@2x.png diff --git a/Juick.xcodeproj/project.pbxproj b/Juick.xcodeproj/project.pbxproj index 21f3035..0e7a9b3 100644 --- a/Juick.xcodeproj/project.pbxproj +++ b/Juick.xcodeproj/project.pbxproj @@ -475,7 +475,7 @@ INFOPLIST_FILE = "Juick/Juick-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = 1; + TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = app; }; name = Debug; @@ -495,7 +495,7 @@ INFOPLIST_FILE = "Juick/Juick-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 7.0; PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = 1; + TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = app; }; name = Release; diff --git a/Juick/AppDelegate.h b/Juick/AppDelegate.h index 087b6fd..0b1fbb7 100644 --- a/Juick/AppDelegate.h +++ b/Juick/AppDelegate.h @@ -13,6 +13,6 @@ @interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; -@property (strong, nonatomic) SWRevealViewController *viewController; +@property (strong, nonatomic) UIViewController *viewController; @end diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m index f59ff02..28bacc9 100644 --- a/Juick/AppDelegate.m +++ b/Juick/AppDelegate.m @@ -30,12 +30,18 @@ UINavigationController *main = [[UINavigationController alloc] initWithRootViewController:messages]; UINavigationController *rearNav = [[UINavigationController alloc] initWithRootViewController:rear]; - - SWRevealViewController *reveal = [[SWRevealViewController alloc] initWithRearViewController:rearNav frontViewController:main]; - self.viewController = reveal; + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { + SWRevealViewController *reveal = [[SWRevealViewController alloc] initWithRearViewController:rearNav frontViewController:main]; + self.viewController = reveal; + } else { + UISplitViewController *split = [[UISplitViewController alloc] init]; + split.viewControllers = [NSArray arrayWithObjects:rearNav, main, nil]; + split.delegate = messages; + self.viewController = split; + } self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.rootViewController = reveal; + self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; return YES; diff --git a/Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29-1.png b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29-1.png new file mode 100644 index 0000000..c17b09a Binary files /dev/null and b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29-1.png differ diff --git a/Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29.png b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29.png new file mode 100644 index 0000000..c17b09a Binary files /dev/null and b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29.png differ diff --git a/Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x-1.png b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x-1.png new file mode 100644 index 0000000..1f51f3e Binary files /dev/null and b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x-1.png differ diff --git a/Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png new file mode 100644 index 0000000..1f51f3e Binary files /dev/null and b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png differ diff --git a/Juick/Images.xcassets/AppIcon.appiconset/AppIcon40x40.png b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon40x40.png new file mode 100644 index 0000000..0af7db9 Binary files /dev/null and b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon40x40.png differ diff --git a/Juick/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x-1.png b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x-1.png new file mode 100644 index 0000000..f08b9dc Binary files /dev/null and b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x-1.png differ diff --git a/Juick/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png new file mode 100644 index 0000000..f08b9dc Binary files /dev/null and b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png differ diff --git a/Juick/Images.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png new file mode 100644 index 0000000..55ec21c Binary files /dev/null and b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png differ diff --git a/Juick/Images.xcassets/AppIcon.appiconset/AppIcon76x76.png b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon76x76.png new file mode 100644 index 0000000..9bcf101 Binary files /dev/null and b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon76x76.png differ diff --git a/Juick/Images.xcassets/AppIcon.appiconset/AppIcon76x76@2x.png b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon76x76@2x.png new file mode 100644 index 0000000..e06b21e Binary files /dev/null and b/Juick/Images.xcassets/AppIcon.appiconset/AppIcon76x76@2x.png differ diff --git a/Juick/Images.xcassets/AppIcon.appiconset/Contents.json b/Juick/Images.xcassets/AppIcon.appiconset/Contents.json index a396706..985f259 100644 --- a/Juick/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Juick/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,18 +1,93 @@ { "images" : [ { + "size" : "29x29", "idiom" : "iphone", + "filename" : "AppIcon29x29.png", + "scale" : "1x" + }, + { "size" : "29x29", + "idiom" : "iphone", + "filename" : "AppIcon29x29@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "AppIcon40x40@2x-1.png", "scale" : "2x" }, { "idiom" : "iphone", + "size" : "57x57", + "scale" : "1x" + }, + { + "idiom" : "iphone", + "size" : "57x57", + "scale" : "2x" + }, + { "size" : "60x60", + "idiom" : "iphone", + "filename" : "AppIcon60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "AppIcon29x29-1.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "AppIcon29x29@2x-1.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "AppIcon40x40.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "AppIcon40x40@2x.png", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "50x50", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "50x50", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "72x72", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "72x72", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "AppIcon76x76.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "AppIcon76x76@2x.png", "scale" : "2x" } ], diff --git a/Juick/MessagesViewController.h b/Juick/MessagesViewController.h index ceff611..a5081de 100644 --- a/Juick/MessagesViewController.h +++ b/Juick/MessagesViewController.h @@ -8,7 +8,7 @@ #import -@interface MessagesViewController : UITableViewController +@interface MessagesViewController : UITableViewController - (id)initWithURL:(NSURL *)messagesURL; - (void) refreshData:(UIRefreshControl *)refresh; @end diff --git a/Juick/MessagesViewController.m b/Juick/MessagesViewController.m index 1fb4ece..2f5cc29 100644 --- a/Juick/MessagesViewController.m +++ b/Juick/MessagesViewController.m @@ -95,12 +95,13 @@ static NSString *CellIdentifier = @"MessageCell"; self.dataLoading = NO; self.title = @"Discover"; [self.view setBackgroundColor:[ColorsAndButtons mainBackground]]; - SWRevealViewController *revealController = [self revealViewController]; - [self.navigationController.navigationBar addGestureRecognizer:revealController.panGestureRecognizer]; - UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { + SWRevealViewController *revealController = [self revealViewController]; + [self.navigationController.navigationBar addGestureRecognizer:revealController.panGestureRecognizer]; + UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"] style:UIBarButtonItemStyleBordered target:revealController action:@selector(revealToggle:)]; - - self.navigationItem.leftBarButtonItem = revealButtonItem; + self.navigationItem.leftBarButtonItem = revealButtonItem; + } self.messages = [NSMutableArray array]; UIRefreshControl *refresh = [[UIRefreshControl alloc] init]; [refresh addTarget:self action:@selector(refreshData:) forControlEvents:UIControlEventValueChanged]; @@ -198,5 +199,13 @@ static NSString *CellIdentifier = @"MessageCell"; return 100.0f; } +-(void)splitViewController:(UISplitViewController *)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem { + self.navigationItem.leftBarButtonItem = nil; +} + +-(void)splitViewController:(UISplitViewController *)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)pc { + self.navigationItem.leftBarButtonItem = barButtonItem; +} + @end -- cgit v1.2.3