summaryrefslogtreecommitdiff
path: root/Juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2013-10-26 13:10:31 +0400
committerGravatar Vitaly Takmazov2013-10-26 13:10:31 +0400
commit7e7b734fc859234c9424b2ed98f5a2afef911de0 (patch)
tree1432e57829a5aebd0ca6e1ca596926d788f2e14a /Juick
Initial Commit
Diffstat (limited to 'Juick')
-rw-r--r--Juick/AppDelegate.h15
-rw-r--r--Juick/AppDelegate.m46
-rw-r--r--Juick/Base.lproj/Main.storyboard104
-rw-r--r--Juick/DetailViewController.h16
-rw-r--r--Juick/DetailViewController.m51
-rw-r--r--Juick/Images.xcassets/AppIcon.appiconset/Contents.json23
-rw-r--r--Juick/Images.xcassets/LaunchImage.launchimage/Contents.json23
-rw-r--r--Juick/Juick-Info.plist50
-rw-r--r--Juick/Juick-Prefix.pch16
-rw-r--r--Juick/MasterViewController.h13
-rw-r--r--Juick/MasterViewController.m113
-rw-r--r--Juick/en.lproj/InfoPlist.strings2
-rw-r--r--Juick/main.m18
13 files changed, 490 insertions, 0 deletions
diff --git a/Juick/AppDelegate.h b/Juick/AppDelegate.h
new file mode 100644
index 0000000..ae4c86a
--- /dev/null
+++ b/Juick/AppDelegate.h
@@ -0,0 +1,15 @@
+//
+// AppDelegate.h
+// Juick
+//
+// Created by Vitaly Takmazov on 26.10.13.
+// Copyright (c) 2013 com.juick. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m
new file mode 100644
index 0000000..40b5fae
--- /dev/null
+++ b/Juick/AppDelegate.m
@@ -0,0 +1,46 @@
+//
+// AppDelegate.m
+// Juick
+//
+// Created by Vitaly Takmazov on 26.10.13.
+// Copyright (c) 2013 com.juick. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ // Override point for customization after application launch.
+ 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:.
+}
+
+@end
diff --git a/Juick/Base.lproj/Main.storyboard b/Juick/Base.lproj/Main.storyboard
new file mode 100644
index 0000000..3d5f90c
--- /dev/null
+++ b/Juick/Base.lproj/Main.storyboard
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="rS3-R9-Ivy">
+ <dependencies>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
+ </dependencies>
+ <scenes>
+ <!--Navigation Controller-->
+ <scene sceneID="cUi-kZ-frf">
+ <objects>
+ <navigationController id="rS3-R9-Ivy" sceneMemberID="viewController">
+ <navigationBar key="navigationBar" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="yXu-0R-QUA">
+ <autoresizingMask key="autoresizingMask"/>
+ </navigationBar>
+ <connections>
+ <segue destination="pGg-6v-bdr" kind="relationship" relationship="rootViewController" id="RxB-wf-QIq"/>
+ </connections>
+ </navigationController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="eq9-QA-ai8" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="-1" y="64"/>
+ </scene>
+ <!--class Prefix:identifier Master View Controller - Master-->
+ <scene sceneID="VgW-fR-Quf">
+ <objects>
+ <tableViewController title="Master" id="pGg-6v-bdr" customClass="MasterViewController" sceneMemberID="viewController">
+ <tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="mLL-gJ-YKr">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <prototypes>
+ <tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="2pz-XF-uhl" style="IBUITableViewCellStyleDefault" id="m0d-ak-lc9">
+ <rect key="frame" x="0.0" y="86" width="320" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+ <rect key="frame" x="0.0" y="0.0" width="287" height="43"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <subviews>
+ <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="2pz-XF-uhl">
+ <rect key="frame" x="15" y="0.0" width="270" height="43"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+ </label>
+ </subviews>
+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+ </view>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <connections>
+ <segue destination="Ah7-4n-0Wa" kind="push" identifier="showDetail" id="jUr-3t-vfg"/>
+ </connections>
+ </tableViewCell>
+ </prototypes>
+ <sections/>
+ <connections>
+ <outlet property="dataSource" destination="pGg-6v-bdr" id="P41-gY-KXY"/>
+ <outlet property="delegate" destination="pGg-6v-bdr" id="Y6K-Cp-Qkv"/>
+ </connections>
+ </tableView>
+ <navigationItem key="navigationItem" title="Master" id="tQt-TN-PWz"/>
+ </tableViewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="6Cn-md-YlS" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="459" y="64"/>
+ </scene>
+ <!--class Prefix:identifier Detail View Controller - Detail-->
+ <scene sceneID="Cn3-H9-jdl">
+ <objects>
+ <viewController title="Detail" id="Ah7-4n-0Wa" customClass="DetailViewController" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="MMQ-IT-qOo">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <subviews>
+ <label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="Detail view content goes here" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="Lei-5M-9Gs">
+ <rect key="frame" x="20" y="276" width="280" height="17"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <fontDescription key="fontDescription" type="system" size="system"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstItem="Lei-5M-9Gs" firstAttribute="leading" secondItem="MMQ-IT-qOo" secondAttribute="leading" constant="20" symbolic="YES" id="62x-JV-TTJ"/>
+ <constraint firstItem="Lei-5M-9Gs" firstAttribute="centerY" secondItem="MMQ-IT-qOo" secondAttribute="centerY" id="JzS-HC-Rnl"/>
+ <constraint firstAttribute="trailing" secondItem="Lei-5M-9Gs" secondAttribute="trailing" constant="20" symbolic="YES" id="pXB-RP-Zz6"/>
+ </constraints>
+ </view>
+ <navigationItem key="navigationItem" title="Detail" id="cra-N8-TIN"/>
+ <connections>
+ <outlet property="detailDescriptionLabel" destination="Lei-5M-9Gs" id="sCT-F7-F6f"/>
+ </connections>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="lrm-kH-fPn" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="902" y="64"/>
+ </scene>
+ </scenes>
+ <simulatedMetricsContainer key="defaultSimulatedMetrics">
+ <simulatedStatusBarMetrics key="statusBar"/>
+ <simulatedOrientationMetrics key="orientation"/>
+ <simulatedScreenMetrics key="destination" type="retina4"/>
+ </simulatedMetricsContainer>
+</document> \ No newline at end of file
diff --git a/Juick/DetailViewController.h b/Juick/DetailViewController.h
new file mode 100644
index 0000000..1246805
--- /dev/null
+++ b/Juick/DetailViewController.h
@@ -0,0 +1,16 @@
+//
+// DetailViewController.h
+// Juick
+//
+// Created by Vitaly Takmazov on 26.10.13.
+// Copyright (c) 2013 com.juick. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface DetailViewController : UIViewController
+
+@property (strong, nonatomic) id detailItem;
+
+@property (weak, nonatomic) IBOutlet UILabel *detailDescriptionLabel;
+@end
diff --git a/Juick/DetailViewController.m b/Juick/DetailViewController.m
new file mode 100644
index 0000000..4d510c9
--- /dev/null
+++ b/Juick/DetailViewController.m
@@ -0,0 +1,51 @@
+//
+// DetailViewController.m
+// Juick
+//
+// Created by Vitaly Takmazov on 26.10.13.
+// Copyright (c) 2013 com.juick. All rights reserved.
+//
+
+#import "DetailViewController.h"
+
+@interface DetailViewController ()
+- (void)configureView;
+@end
+
+@implementation DetailViewController
+
+#pragma mark - Managing the detail item
+
+- (void)setDetailItem:(id)newDetailItem
+{
+ if (_detailItem != newDetailItem) {
+ _detailItem = newDetailItem;
+
+ // Update the view.
+ [self configureView];
+ }
+}
+
+- (void)configureView
+{
+ // Update the user interface for the detail item.
+
+ if (self.detailItem) {
+ self.detailDescriptionLabel.text = [self.detailItem description];
+ }
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ // Do any additional setup after loading the view, typically from a nib.
+ [self configureView];
+}
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ // Dispose of any resources that can be recreated.
+}
+
+@end
diff --git a/Juick/Images.xcassets/AppIcon.appiconset/Contents.json b/Juick/Images.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000..a396706
--- /dev/null
+++ b/Juick/Images.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/Juick/Images.xcassets/LaunchImage.launchimage/Contents.json b/Juick/Images.xcassets/LaunchImage.launchimage/Contents.json
new file mode 100644
index 0000000..c79ebd3
--- /dev/null
+++ b/Juick/Images.xcassets/LaunchImage.launchimage/Contents.json
@@ -0,0 +1,23 @@
+{
+ "images" : [
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "subtype" : "retina4",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/Juick/Juick-Info.plist b/Juick/Juick-Info.plist
new file mode 100644
index 0000000..846633e
--- /dev/null
+++ b/Juick/Juick-Info.plist
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.juick.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIMainStoryboardFile</key>
+ <string>Main</string>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UIStatusBarTintParameters</key>
+ <dict>
+ <key>UINavigationBar</key>
+ <dict>
+ <key>Style</key>
+ <string>UIBarStyleDefault</string>
+ <key>Translucent</key>
+ <false/>
+ </dict>
+ </dict>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
diff --git a/Juick/Juick-Prefix.pch b/Juick/Juick-Prefix.pch
new file mode 100644
index 0000000..82a2bb4
--- /dev/null
+++ b/Juick/Juick-Prefix.pch
@@ -0,0 +1,16 @@
+//
+// Prefix header
+//
+// The contents of this file are implicitly included at the beginning of every source file.
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_5_0
+#warning "This project uses features only available in iOS SDK 5.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
diff --git a/Juick/MasterViewController.h b/Juick/MasterViewController.h
new file mode 100644
index 0000000..be49967
--- /dev/null
+++ b/Juick/MasterViewController.h
@@ -0,0 +1,13 @@
+//
+// MasterViewController.h
+// Juick
+//
+// Created by Vitaly Takmazov on 26.10.13.
+// Copyright (c) 2013 com.juick. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface MasterViewController : UITableViewController
+
+@end
diff --git a/Juick/MasterViewController.m b/Juick/MasterViewController.m
new file mode 100644
index 0000000..41b2ef5
--- /dev/null
+++ b/Juick/MasterViewController.m
@@ -0,0 +1,113 @@
+//
+// MasterViewController.m
+// Juick
+//
+// Created by Vitaly Takmazov on 26.10.13.
+// Copyright (c) 2013 com.juick. All rights reserved.
+//
+
+#import "MasterViewController.h"
+
+#import "DetailViewController.h"
+
+@interface MasterViewController () {
+ NSMutableArray *_objects;
+}
+@end
+
+@implementation MasterViewController
+
+- (void)awakeFromNib
+{
+ [super awakeFromNib];
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+ // Do any additional setup after loading the view, typically from a nib.
+ self.navigationItem.leftBarButtonItem = self.editButtonItem;
+
+ UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)];
+ self.navigationItem.rightBarButtonItem = addButton;
+}
+
+- (void)didReceiveMemoryWarning
+{
+ [super didReceiveMemoryWarning];
+ // Dispose of any resources that can be recreated.
+}
+
+- (void)insertNewObject:(id)sender
+{
+ if (!_objects) {
+ _objects = [[NSMutableArray alloc] init];
+ }
+ [_objects insertObject:[NSDate date] atIndex:0];
+ NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
+ [self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
+}
+
+#pragma mark - Table View
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+ return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+ return _objects.count;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
+
+ NSDate *object = _objects[indexPath.row];
+ cell.textLabel.text = [object description];
+ return cell;
+}
+
+- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ // Return NO if you do not want the specified item to be editable.
+ return YES;
+}
+
+- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ if (editingStyle == UITableViewCellEditingStyleDelete) {
+ [_objects removeObjectAtIndex:indexPath.row];
+ [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
+ } else if (editingStyle == UITableViewCellEditingStyleInsert) {
+ // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
+ }
+}
+
+/*
+// Override to support rearranging the table view.
+- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
+{
+}
+*/
+
+/*
+// Override to support conditional rearranging of the table view.
+- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ // Return NO if you do not want the item to be re-orderable.
+ return YES;
+}
+*/
+
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
+{
+ if ([[segue identifier] isEqualToString:@"showDetail"]) {
+ NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
+ NSDate *object = _objects[indexPath.row];
+ [[segue destinationViewController] setDetailItem:object];
+ }
+}
+
+@end
diff --git a/Juick/en.lproj/InfoPlist.strings b/Juick/en.lproj/InfoPlist.strings
new file mode 100644
index 0000000..477b28f
--- /dev/null
+++ b/Juick/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
diff --git a/Juick/main.m b/Juick/main.m
new file mode 100644
index 0000000..67b222f
--- /dev/null
+++ b/Juick/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// Juick
+//
+// Created by Vitaly Takmazov on 26.10.13.
+// Copyright (c) 2013 com.juick. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+
+int main(int argc, char * argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}