Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP postponed till next release] Todo app / tutorial #40

Closed
wants to merge 17 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
529 changes: 529 additions & 0 deletions tutorial/TodoApp/TodoApp.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions tutorial/TodoApp/TodoApp/Base.lproj/Main_iPad.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
</dependencies>
<scenes>
<!--class Prefix:identifier View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="TViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="20" width="768" height="1004"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackOpaque"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
133 changes: 133 additions & 0 deletions tutorial/TodoApp/TodoApp/Base.lproj/Main_iPhone.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="47r-n5-Q0k">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--Add Todo View Controller-->
<scene sceneID="5Bw-cH-Xn7">
<objects>
<viewController id="t1e-Pe-f2e" customClass="TAddTodoViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="o2f-ae-4fk"/>
<viewControllerLayoutGuide type="bottom" id="Cvh-lk-Sgz"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="NOv-lK-h9X">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2Ze-vr-yX5">
<rect key="frame" x="20" y="25" width="48" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Cancel">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="cancelButtonPress:" destination="t1e-Pe-f2e" eventType="touchUpInside" id="dlK-68-4XX"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tag-Wb-WnU">
<rect key="frame" x="260" y="20" width="40" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<state key="normal" title="Add">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="addTodoPress:" destination="t1e-Pe-f2e" eventType="touchUpInside" id="2jf-sw-Cqg"/>
</connections>
</button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="aD2-AP-vwA">
<rect key="frame" x="20" y="68" width="280" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UsU-z8-gsq">
<rect key="frame" x="26" y="120" width="116" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.85098930027173914" green="0.24948018057888441" blue="0.21548504675320662" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<connections>
<outlet property="alertLabel" destination="UsU-z8-gsq" id="fYo-VH-TmE"/>
<outlet property="todoName" destination="aD2-AP-vwA" id="2z0-48-fnK"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Cf0-dX-vjR" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1197" y="256"/>
</scene>
<!--Todo Table View Controller-->
<scene sceneID="k38-x1-PY9">
<objects>
<tableViewController id="zDj-7N-wt1" customClass="TTodoTableViewController" sceneMemberID="viewController">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" showsSelectionImmediatelyOnTouchBegin="NO" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="Rhq-NR-3Sv">
<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="checkmark" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Todo" textLabel="d66-5w-nvR" style="IBUITableViewCellStyleDefault" id="mZx-V6-d9G">
<rect key="frame" x="0.0" y="86" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="mZx-V6-d9G" id="Ygx-mu-pam">
<rect key="frame" x="0.0" y="0.0" width="281" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Tiitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="d66-5w-nvR">
<rect key="frame" x="15" y="0.0" width="266" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="zDj-7N-wt1" id="prT-c1-hNq"/>
<outlet property="delegate" destination="zDj-7N-wt1" id="DFD-9u-xMG"/>
</connections>
</tableView>
<navigationItem key="navigationItem" id="KYk-Np-bR8">
<barButtonItem key="rightBarButtonItem" title="Add todo" id="yec-QY-Kll">
<connections>
<segue destination="t1e-Pe-f2e" kind="modal" id="B3R-gc-f4f"/>
</connections>
</barButtonItem>
</navigationItem>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="qkN-Oa-KZZ" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="718" y="263"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="GvQ-rD-iZ8">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="47r-n5-Q0k" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="rzV-Qd-38p">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="zDj-7N-wt1" kind="relationship" relationship="rootViewController" id="h4D-Qa-OeS"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="xzn-7w-EHv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="125" y="246"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"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"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
7 changes: 7 additions & 0 deletions tutorial/TodoApp/TodoApp/TAddTodoViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <UIKit/UIKit.h>

@interface TAddTodoViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *todoName;
@property (weak, nonatomic) IBOutlet UILabel *alertLabel;

@end
61 changes: 61 additions & 0 deletions tutorial/TodoApp/TodoApp/TAddTodoViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#import "TAddTodoViewController.h"
#import "TAppDelegate.h"
#import <Tightdb/Tightdb.h>


@interface TAddTodoViewController ()

@end

@implementation TAddTodoViewController


- (void)viewDidLoad
{
[super viewDidLoad];

// Auto select input field when modal is shown
[self.todoName becomeFirstResponder];
}

// Close modal when user presses Cancel button
- (IBAction)cancelButtonPress:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}

// Add todo to db, when user presses Add button
- (IBAction)addTodoPress:(id)sender {

NSString *todo = self.todoName.text;

// Only add to db if todoName has been entered
if(todo.length > 0) {

TAppDelegate* delegate = (TAppDelegate*)[[UIApplication sharedApplication]delegate];

bool success = [delegate.sharedGroup writeWithBlock:^(TightdbGroup *tnx) {

TightdbTable *todoTable = [tnx getTable:@"todos" error:nil];

TightdbCursor *row = [todoTable addEmptyRow];
[row setString:self.todoName.text inColumn:0];

return YES; // Commit
} withError:nil];

if (success) {
// Close modal
[self dismissViewControllerAnimated:YES completion:nil];

// Make parent reload the todos from the db
[self.parentViewController viewWillAppear:YES ];
}

} else {
// If no name has been entered, show an error alert
self.alertLabel.text = @"Enter name for todo";
}
}


@end
9 changes: 9 additions & 0 deletions tutorial/TodoApp/TodoApp/TAppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#import <UIKit/UIKit.h>
#import <Tightdb/Tightdb.h>

@interface TAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) TightdbSharedGroup *sharedGroup;

@end
42 changes: 42 additions & 0 deletions tutorial/TodoApp/TodoApp/TAppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#import "TAppDelegate.h"
#import <Tightdb/Tightdb.h>

@implementation TAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.

self.sharedGroup = [TightdbSharedGroup sharedGroupWithFile:[self pathForDataFile:@"todosdb2.tightdb"] withError:nil];


TAppDelegate* delegate = (TAppDelegate*)[[UIApplication sharedApplication]delegate];

[delegate.sharedGroup writeWithBlock:^(TightdbGroup *tnx) {


TightdbTable *todoTable = [tnx getTable:@"todos" error:nil];

if([todoTable getColumnCount] == 0) {
[todoTable addColumnWithType:tightdb_String andName:@"todoName"];
[todoTable addColumnWithType:tightdb_Bool andName:@"completed"];
}

return YES; // Commit
} withError:nil];

return YES;
}

- (NSString *) pathForDataFile:(NSString *)filename {
NSArray* documentDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* path = nil;

if (documentDir) {
path = [documentDir objectAtIndex:0];
}

return [NSString stringWithFormat:@"%@/%@", path, filename];
}

@end
5 changes: 5 additions & 0 deletions tutorial/TodoApp/TodoApp/TTodoTableViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#import <UIKit/UIKit.h>

@interface TTodoTableViewController : UITableViewController

@end
162 changes: 162 additions & 0 deletions tutorial/TodoApp/TodoApp/TTodoTableViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
#import "TTodoTableViewController.h"
#import "TAppDelegate.h"

@interface TTodoTableViewController ()

@end

@implementation TTodoTableViewController

- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];

// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;

// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
self.navigationItem.leftBarButtonItem = self.editButtonItem;



}

// Implement this method, so that when add todo modal disappears, the todolist will be updated
-(void)viewWillAppear:(BOOL)animated
{
[self.tableView reloadData];
}



- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
__block NSInteger rows = 0;
TAppDelegate* delegate = (TAppDelegate*)[[UIApplication sharedApplication]delegate];

[delegate.sharedGroup readWithBlock:^(TightdbGroup *tnx) {

TightdbTable *todoTable = [tnx getTable:@"todos" error:nil];

size_t count = [todoTable count];

rows = count;
}];

return rows;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Todo";
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

// Configure the cell...
cell.textLabel.text = [self getTodoNameForRow:indexPath.row];

_Bool completed = [self getTodoCompletedStatus:indexPath.row];

if(completed) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;

} else {
cell.accessoryType = UITableViewCellAccessoryNone;

}

return cell;
}

// When a row is selected, either checkout the row or uncheck
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

BOOL isCompletedBeforeClicking = [self getTodoCompletedStatus:indexPath.row];

TAppDelegate* delegate = (TAppDelegate*)[[UIApplication sharedApplication]delegate];

[delegate.sharedGroup writeWithBlock:^(TightdbGroup *tnx) {
TightdbTable *todoTable = [tnx getTable:@"todos" error:nil];
[todoTable setBool:!isCompletedBeforeClicking inColumn:1 atRow:indexPath.row];

return YES;
} withError:nil];

// Check the completed status before the row was clicked
if(isCompletedBeforeClicking) {
[tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryNone;
} else {
[tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryCheckmark;
}

[tableView deselectRowAtIndexPath:indexPath animated:YES];
}

// Method handling when a row is deleted
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView beginUpdates];
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Update the model
[self deleteTodo:indexPath.row];
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationRight ];
}

// Exit edit mode
[tableView endUpdates];
[self setEditing:NO animated:NO];
}

// Delete a particular row
-(void) deleteTodo:(NSInteger)rowIndex
{
TAppDelegate* delegate = (TAppDelegate*)[[UIApplication sharedApplication]delegate];

[delegate.sharedGroup writeWithBlock:^(TightdbGroup *tnx) {
TightdbTable *todoTable = [tnx getTable:@"todos" error:nil];
[todoTable removeRowAtIndex:rowIndex];

return YES;
} withError:nil];
}


// Returns the name of specific row
-(NSString *) getTodoNameForRow:(NSInteger)rowIndex
{
__block NSString *todoName = nil;
TAppDelegate* delegate = (TAppDelegate*)[[UIApplication sharedApplication]delegate];

[delegate.sharedGroup readWithBlock:^(TightdbGroup *tnx) {
TightdbTable *todoTable = [tnx getTable:@"todos" error:nil];
todoName = [todoTable getStringInColumn:0 atRow:rowIndex];
}];

return todoName;
}

// Get the status of a particular todo completed status
-(BOOL) getTodoCompletedStatus:(NSInteger)rowIndex
{
__block BOOL completed = NO;
TAppDelegate* delegate = (TAppDelegate*)[[UIApplication sharedApplication]delegate];

[delegate.sharedGroup readWithBlock:^(TightdbGroup *tnx) {
TightdbTable *todoTable = [tnx getTable:@"todos" error:nil];
completed = [todoTable getBoolInColumn:1 atRow:rowIndex];
}];

return completed;
}


@end
49 changes: 49 additions & 0 deletions tutorial/TodoApp/TodoApp/TodoApp-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?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.tightdb.${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_iPhone</string>
<key>UIMainStoryboardFile~ipad</key>
<string>Main_iPad</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
16 changes: 16 additions & 0 deletions tutorial/TodoApp/TodoApp/TodoApp-Prefix.pch
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions tutorial/TodoApp/TodoApp/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

10 changes: 10 additions & 0 deletions tutorial/TodoApp/TodoApp/main.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#import <UIKit/UIKit.h>

#import "TAppDelegate.h"

int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([TAppDelegate class]));
}
}
22 changes: 22 additions & 0 deletions tutorial/TodoApp/TodoAppTests/TodoAppTests-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.tightdb.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
26 changes: 26 additions & 0 deletions tutorial/TodoApp/TodoAppTests/TodoAppTests.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#import <XCTest/XCTest.h>

@interface TodoAppTests : XCTestCase

@end

@implementation TodoAppTests

- (void)setUp
{
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown
{
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}

- (void)testExample
{
XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
}

@end
2 changes: 2 additions & 0 deletions tutorial/TodoApp/TodoAppTests/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */