Permalink
Browse files

initial commit

  • Loading branch information...
1 parent 7399a48 commit 846548f5ea138ffebebee0fd6c3d2bf740ea0e0c Inanc Sevinc committed Sep 16, 2012
Oops, something went wrong.
@@ -0,0 +1,50 @@
+//
+// AppConstants.h
+// Latest News
+//
+// Created by Inanc Sevinc on 9/1/12.
+// Copyright (c) 2012 idolabs. All rights reserved.
+//
+
+#ifndef Latest_News_AppConstants_h
+#define Latest_News_AppConstants_h
+
+#define ROTATION_DEGREE_90_CW (M_PI * 0.5)
+#define ROTATION_DEGREE_90_CCW (M_PI * -0.5)
+
+
+#define IS_IPAD UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
+
+// Width of the cells of the embedded table view (after rotation, which means it controls the rowHeight property)
+#define MAIN_TABLE_CELL__NEWS_ITEM_CELL_WIDTH (IS_IPAD ? 160:100)
+// Height of the cells of the embedded table view (after rotation, which would be the table's width)
+#define MAIN_TABLE_CELL__NEWS_ITEM_CELL_HEIGHT (IS_IPAD ? 160:100)
+
+#define MAIN_TABLE_VIEW__HEADER_SECTION_HEIGHT (IS_IPAD ? 32:20)
+//#define MAIN_TABLE_VIEW_BACKGROUND_COLOR [UIColor scrollViewTexturedBackgroundColor]
+
+
+#define SHARED_CONTEXT_KEY_ALL_NEWS_DATA @"ALL_NEWS_DATA"
+#define SHARED_CONTEXT_KEY__SORTED_RSS_SOURCES_KEYS @"SORTED_RSS_SOURCES_KEYS"
+#define SHARED_CONTEXT_KEY_SELECTED_NEWS_ITEM @"SELECTED_NEWS_ITEM"
+#define SHARED_CONTEXT_KEY__VIEW_CONTROLLERS_PREFIX @"VIEW_CONTROLLERS_PREFIX__"
+
+
+#define STORYBOARD_KEY__SEGUE__NEWS_ITEM_WEB_VIEW @"SEGUE__NEWS_ITEM_WEB_VIEW"
+#define STORYBOARD_KEY__ID__MAIN_TABLE_CELL @"ID__MAIN_TABLE_CELL"
+#define STORYBOARD_KEY__ID__NEWS_ITEM_TABLE_CELL @"ID__NEWS_ITEM_TABLE_CELL"
+
+#define NEWS_ITEM_CELL_IMAGE_PADDING 5
+#define NEWS_ITEM_CELL_IMAGE_BORDER_WIDTH 0.5f
+#define NEWS_ITEM_CELL_LABEL_VIEW_HEIGHT_RATIO 0.30
+#define NEWS_ITEM_CELL_ROTATION ROTATION_DEGREE_90_CW
+#define NEWS_ITEM_CELL_LABEL_NUMBER_OF_LINES 2
+#define NEWS_ITEM_CELL_LABEL_FONT [UIFont boldSystemFontOfSize:11]
+#define NEWS_ITEM_CELL_LABEL_BACKGROUND_COLOR [UIColor colorWithRed:0 green:0 blue:0 alpha:0.4]
+#define NEWS_ITEM_CELL_LABEL_COLOR [UIColor whiteColor];
+
+// Background color for the horizontal table view (the one embedded inside the rows of our vertical table)
+#define MAIN_TABLE_CELL__NEWS_ITEMS_TABLE_BACKGROUND_COLOR [UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:0.2]
+#define MAIN_TABLE_CELL__NEWS_ITEMS_TABLE_ROTATION ROTATION_DEGREE_90_CCW
+
+#endif
@@ -0,0 +1,25 @@
+//
+// AppDelegate.h
+// Latest News
+//
+// Created by Inanc Sevinc on 9/1/12.
+// Copyright (c) 2012 idolabs. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+// used for sharing data between controllers, views etc.
+@property (strong, nonatomic) NSMutableDictionary *sharedContext;
+
++(AppDelegate*)getInstance;
+
++(NSMutableDictionary*)getSharedContextInstance;
+
++ (BOOL) isInternetConnectionAvailable;
+
+
+@end
@@ -0,0 +1,86 @@
+//
+// AppDelegate.m
+// Latest News
+//
+// Created by Inanc Sevinc on 9/1/12.
+// Copyright (c) 2012 idolabs. All rights reserved.
+//
+
+#import "AppDelegate.h"
+#import "../Libraries/Reachability/Reachability.h"
+
+@implementation AppDelegate
+
+-(id)init {
+ self = [super init];
+ if(self) {
+ _sharedContext = [[NSMutableDictionary alloc]init];
+ // disable NSURLCache, fix memory growth problem related with xml response caching
+ [NSURLCache setSharedURLCache:[[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil]];
+// [[NSURLCache sharedURLCache] setMemoryCapacity:0];
+ }
+ return (self);
+}
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+// self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+// // Override point for customization after application launch.
+// self.window.backgroundColor = [UIColor whiteColor];
+// [self.window makeKeyAndVisible];
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
++(AppDelegate*) getInstance{
+ return (AppDelegate*)[[UIApplication sharedApplication] delegate];
+}
+
++(NSMutableDictionary*) getSharedContextInstance{
+ return [AppDelegate getInstance].sharedContext;
+}
++ (BOOL) isInternetConnectionAvailable {
+ Reachability *reachability = [Reachability reachabilityForInternetConnection];
+ NetworkStatus internetStatus = [reachability currentReachabilityStatus];
+
+ if(internetStatus == NotReachable) {
+ UIAlertView *connectionErrorAlert= [[UIAlertView alloc]
+ initWithTitle: NSLocalizedString(@"Bağlantı hatası", @"Network error")
+ message: NSLocalizedString(@"Lütfen cihazınızın internet bağlantısını kontrol edin.", @"Check your internet connection")
+ delegate: self
+ cancelButtonTitle: NSLocalizedString(@"Kapat", @"Close") otherButtonTitles: nil];
+ [connectionErrorAlert show];
+ return NO;
+ }
+ return YES;
+}
+
+
+
+@end
@@ -5,9 +5,24 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
- <string>${PRODUCT_NAME}</string>
+ <string>Mobil Haber</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIcons</key>
+ <dict>
+ <key>CFBundlePrimaryIcon</key>
+ <dict>
+ <key>CFBundleIconFiles</key>
+ <array>
+ <string>icon_ipad.png</string>
+ <string>icon_ipad@2x.png</string>
+ <string>icon_iphone.png</string>
+ <string>icon@2x.png</string>
+ <string>Default-Portrait~ipad.png</string>
+ <string>Default-Portrait@2x~ipad.png</string>
+ </array>
+ </dict>
+ </dict>
<key>CFBundleIdentifier</key>
<string>com.idolabs.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
@@ -24,15 +39,22 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
+ <key>UIMainStoryboardFile</key>
+ <string>MainStoryboard_iPhone</string>
+ <key>UIMainStoryboardFile~ipad</key>
+ <string>MainStoryboard_iPad</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
+ <key>UIStatusBarStyle</key>
+ <string>UIStatusBarStyleBlackOpaque</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
Oops, something went wrong.

0 comments on commit 846548f

Please sign in to comment.