shlist

share and manage lists between multiple people
Log | Files | Refs

commit 7f75b01c64d2f180fe9d689ee8721a09f7cc7476
parent c56519b44214effaac33c54fb21ea265203a2543
Author: Kyle Milz <kyle@Kyles-MacBook-Pro.local>
Date:   Mon, 22 Jun 2015 00:23:13 -0600

ios: add xcode based project

Diffstat:
Aios-ng/DBManager.h | 12++++++++++++
Aios-ng/DBManager.m | 158+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aios-ng/shlist.xcodeproj/project.pbxproj | 470+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aios-ng/shlist.xcodeproj/project.xcworkspace/contents.xcworkspacedata | 7+++++++
Aios-ng/shlist.xcodeproj/project.xcworkspace/xcuserdata/kyle.xcuserdatad/UserInterfaceState.xcuserstate | 0
Aios-ng/shlist.xcodeproj/xcuserdata/kyle.xcuserdatad/xcschemes/shlist.xcscheme | 112+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aios-ng/shlist.xcodeproj/xcuserdata/kyle.xcuserdatad/xcschemes/xcschememanagement.plist | 27+++++++++++++++++++++++++++
Aios-ng/shlist/AppDelegate.h | 9+++++++++
Aios-ng/shlist/AppDelegate.m | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aios-ng/shlist/Base.lproj/LaunchScreen.xib | 41+++++++++++++++++++++++++++++++++++++++++
Aios-ng/shlist/Base.lproj/Main.storyboard | 185+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aios-ng/shlist/Images.xcassets/AppIcon.appiconset/Contents.json | 164+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aios-ng/shlist/Images.xcassets/AppIcon.appiconset/octopus.png | 0
Aios-ng/shlist/Info.plist | 47+++++++++++++++++++++++++++++++++++++++++++++++
Aios-ng/shlist/NewListViewController.h | 8++++++++
Aios-ng/shlist/NewListViewController.m | 42++++++++++++++++++++++++++++++++++++++++++
Aios-ng/shlist/Server.h | 6++++++
Aios-ng/shlist/Server.m | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Aios-ng/shlist/SharedList.h | 17+++++++++++++++++
Aios-ng/shlist/SharedList.m | 12++++++++++++
Aios-ng/shlist/SharedListsTableViewController.h | 9+++++++++
Aios-ng/shlist/SharedListsTableViewController.m | 140+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aios-ng/shlist/main.m | 8++++++++
Aios-ng/shlistTests/Info.plist | 24++++++++++++++++++++++++
Aios-ng/shlistTests/shlistTests.m | 32++++++++++++++++++++++++++++++++
25 files changed, 1637 insertions(+), 0 deletions(-)

diff --git a/ios-ng/DBManager.h b/ios-ng/DBManager.h @@ -0,0 +1,11 @@ +#import <Foundation/Foundation.h> + +@interface DBManager : NSObject + +-(instancetype)initWithDatabaseFilename:(NSString *)dbFilename; + +@property (nonatomic, strong) NSMutableArray *arrColumnNames; +@property (nonatomic) int affectedRows; +@property (nonatomic) long long lastInsertedRowID; + +@end +\ No newline at end of file diff --git a/ios-ng/DBManager.m b/ios-ng/DBManager.m @@ -0,0 +1,157 @@ +#import "DBManager.h" +#import "sqlite3.h" + +@interface DBManager() + +@property (nonatomic, strong) NSString *documentsDirectory; +@property (nonatomic, strong) NSString *databaseFilename; +@property (nonatomic, strong) NSMutableArray *arrResults; + +-(void)copyDatabaseIntoDocumentsDirectory; +-(void)runQuery:(const char *)query isQueryExecutable:(BOOL)queryExecutable; + +@end + +@implementation DBManager + +-(instancetype)initWithDatabaseFilename:(NSString *)dbFilename +{ + self = [super init]; + + if (self) { + // Set the documents directory path to the documentsDirectory property. + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + self.documentsDirectory = [paths objectAtIndex:0]; + + // Keep the database filename. + self.databaseFilename = dbFilename; + + // Copy the database file into the documents directory if necessary. + [self copyDatabaseIntoDocumentsDirectory]; + } + return self; +} + +-(void)copyDatabaseIntoDocumentsDirectory +{ + // Check if the database file exists in the documents directory. + NSString *destinationPath = [self.documentsDirectory stringByAppendingPathComponent:self.databaseFilename]; + if (![[NSFileManager defaultManager] fileExistsAtPath:destinationPath]) { + // The database file does not exist in the documents directory, so copy it from the main bundle now. + NSString *sourcePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:self.databaseFilename]; + NSError *error; + [[NSFileManager defaultManager] copyItemAtPath:sourcePath toPath:destinationPath error:&error]; + + // Check if any error occurred during copying and display it. + if (error != nil) { + NSLog(@"%@", [error localizedDescription]); + } + } +} + +-(void)runQuery:(const char *)query isQueryExecutable:(BOOL)queryExecutable +{ + // Create a sqlite object. + sqlite3 *sqlite3Database; + + // Set the database file path. + NSString *databasePath = [self.documentsDirectory stringByAppendingPathComponent:self.databaseFilename]; + + // Initialize the results array. + if (self.arrResults != nil) { + [self.arrResults removeAllObjects]; + self.arrResults = nil; + } + self.arrResults = [[NSMutableArray alloc] init]; + + // Initialize the column names array. + if (self.arrColumnNames != nil) { + [self.arrColumnNames removeAllObjects]; + self.arrColumnNames = nil; + } + self.arrColumnNames = [[NSMutableArray alloc] init]; + + // Open the database. + BOOL openDatabaseResult = sqlite3_open([databasePath UTF8String], &sqlite3Database); + if (openDatabaseResult != SQLITE_OK) { + NSLog(@"opening database %@ failed: %s", databasePath, sqlite3_errmsg(sqlite3Database)); + return; + } + + // Declare a sqlite3_stmt object in which will be stored the query after having been compiled into a SQLite statement. + sqlite3_stmt *compiledStatement; + + // Load all data from database to memory. + BOOL prepareStatementResult = sqlite3_prepare_v2(sqlite3Database, query, -1, &compiledStatement, NULL); + if (prepareStatementResult != SQLITE_OK) { + NSLog(@"preparing query %s failed: %s", query, sqlite3_errmsg(sqlite3Database)); + sqlite3_close(sqlite3Database); + + return; + } + + // Check if the query is non-executable. + if (!queryExecutable) { + // In this case data must be loaded from the database. + + // Declare an array to keep the data for each fetched row. + NSMutableArray *arrDataRow; + + // Loop through the results and add them to the results array row by row. + while(sqlite3_step(compiledStatement) == SQLITE_ROW) { + // Initialize the mutable array that will contain the data of a fetched row. + arrDataRow = [[NSMutableArray alloc] init]; + + // Get the total number of columns. + int totalColumns = sqlite3_column_count(compiledStatement); + + // Go through all columns and fetch each column data. + for (int i=0; i<totalColumns; i++){ + // Convert the column data to text (characters). + char *dbDataAsChars = (char *)sqlite3_column_text(compiledStatement, i); + + // If there are contents in the currenct column (field) then add them to the current row array. + if (dbDataAsChars != NULL) { + // Convert the characters to string. + [arrDataRow addObject:[NSString stringWithUTF8String:dbDataAsChars]]; + } + + // Keep the current column name. + if (self.arrColumnNames.count != totalColumns) { + dbDataAsChars = (char *)sqlite3_column_name(compiledStatement, i); + [self.arrColumnNames addObject:[NSString stringWithUTF8String:dbDataAsChars]]; + } + } + + // Store each fetched data row in the results array, but first check if there is actually data. + if (arrDataRow.count > 0) { + [self.arrResults addObject:arrDataRow]; + } + } + } + else { + // This is the case of an executable query (insert, update, ...). + + // Execute the query. + BOOL executeQueryResults = sqlite3_step(compiledStatement); + if (executeQueryResults == SQLITE_DONE) { + // Keep the affected rows. + self.affectedRows = sqlite3_changes(sqlite3Database); + + // Keep the last inserted row ID. + self.lastInsertedRowID = sqlite3_last_insert_rowid(sqlite3Database); + } + else { + // If could not execute the query show the error message on the debugger. + NSLog(@"DB Error: %s", sqlite3_errmsg(sqlite3Database)); + } + } + + // Release the compiled statement from memory. + sqlite3_finalize(compiledStatement); + + // Close the database. + sqlite3_close(sqlite3Database); +} + +@end +\ No newline at end of file diff --git a/ios-ng/shlist.xcodeproj/project.pbxproj b/ios-ng/shlist.xcodeproj/project.pbxproj @@ -0,0 +1,470 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 27C70F051B32AF8000DADEB3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 27C70F041B32AF8000DADEB3 /* main.m */; }; + 27C70F081B32AF8000DADEB3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 27C70F071B32AF8000DADEB3 /* AppDelegate.m */; }; + 27C70F0B1B32AF8000DADEB3 /* Server.m in Sources */ = {isa = PBXBuildFile; fileRef = 27C70F0A1B32AF8000DADEB3 /* Server.m */; }; + 27C70F0E1B32AF8000DADEB3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 27C70F0C1B32AF8000DADEB3 /* Main.storyboard */; }; + 27C70F101B32AF8000DADEB3 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 27C70F0F1B32AF8000DADEB3 /* Images.xcassets */; }; + 27C70F131B32AF8000DADEB3 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 27C70F111B32AF8000DADEB3 /* LaunchScreen.xib */; }; + 27C70F1F1B32AF8000DADEB3 /* shlistTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 27C70F1E1B32AF8000DADEB3 /* shlistTests.m */; }; + 27C70F2A1B33D1C900DADEB3 /* SharedList.m in Sources */ = {isa = PBXBuildFile; fileRef = 27C70F291B33D1C900DADEB3 /* SharedList.m */; }; + 27C70F2D1B33F3C300DADEB3 /* NewListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 27C70F2C1B33F3C300DADEB3 /* NewListViewController.m */; }; + 27C70F301B33F4FA00DADEB3 /* SharedListsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 27C70F2F1B33F4FA00DADEB3 /* SharedListsTableViewController.m */; }; + 27C70F321B3650CB00DADEB3 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 27C70F311B3650CB00DADEB3 /* libsqlite3.dylib */; }; + 27C70F351B36513200DADEB3 /* DBManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 27C70F341B36513200DADEB3 /* DBManager.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 27C70F191B32AF8000DADEB3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 27C70EF71B32AF7F00DADEB3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 27C70EFE1B32AF8000DADEB3; + remoteInfo = shlist; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 27C70EFF1B32AF8000DADEB3 /* shlist.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = shlist.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 27C70F031B32AF8000DADEB3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; + 27C70F041B32AF8000DADEB3 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; + 27C70F061B32AF8000DADEB3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; + 27C70F071B32AF8000DADEB3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; + 27C70F091B32AF8000DADEB3 /* Server.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Server.h; path = shlist/Server.h; sourceTree = "<group>"; }; + 27C70F0A1B32AF8000DADEB3 /* Server.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = Server.m; path = shlist/Server.m; sourceTree = "<group>"; }; + 27C70F0D1B32AF8000DADEB3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; + 27C70F0F1B32AF8000DADEB3 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; }; + 27C70F121B32AF8000DADEB3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; }; + 27C70F181B32AF8000DADEB3 /* shlistTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = shlistTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 27C70F1D1B32AF8000DADEB3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; + 27C70F1E1B32AF8000DADEB3 /* shlistTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = shlistTests.m; sourceTree = "<group>"; }; + 27C70F281B33CE2500DADEB3 /* SharedList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SharedList.h; sourceTree = "<group>"; }; + 27C70F291B33D1C900DADEB3 /* SharedList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SharedList.m; sourceTree = "<group>"; }; + 27C70F2B1B33F3C300DADEB3 /* NewListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewListViewController.h; sourceTree = "<group>"; }; + 27C70F2C1B33F3C300DADEB3 /* NewListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewListViewController.m; sourceTree = "<group>"; }; + 27C70F2E1B33F4FA00DADEB3 /* SharedListsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedListsTableViewController.h; sourceTree = "<group>"; }; + 27C70F2F1B33F4FA00DADEB3 /* SharedListsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SharedListsTableViewController.m; sourceTree = "<group>"; }; + 27C70F311B3650CB00DADEB3 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; + 27C70F331B36513200DADEB3 /* DBManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBManager.h; sourceTree = "<group>"; }; + 27C70F341B36513200DADEB3 /* DBManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBManager.m; sourceTree = "<group>"; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 27C70EFC1B32AF8000DADEB3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 27C70F321B3650CB00DADEB3 /* libsqlite3.dylib in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 27C70F151B32AF8000DADEB3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 27C70EF61B32AF7F00DADEB3 = { + isa = PBXGroup; + children = ( + 27C70F331B36513200DADEB3 /* DBManager.h */, + 27C70F341B36513200DADEB3 /* DBManager.m */, + 27C70F091B32AF8000DADEB3 /* Server.h */, + 27C70F0A1B32AF8000DADEB3 /* Server.m */, + 27C70F311B3650CB00DADEB3 /* libsqlite3.dylib */, + 27C70F011B32AF8000DADEB3 /* shlist */, + 27C70F1B1B32AF8000DADEB3 /* shlistTests */, + 27C70F001B32AF8000DADEB3 /* Products */, + ); + sourceTree = "<group>"; + }; + 27C70F001B32AF8000DADEB3 /* Products */ = { + isa = PBXGroup; + children = ( + 27C70EFF1B32AF8000DADEB3 /* shlist.app */, + 27C70F181B32AF8000DADEB3 /* shlistTests.xctest */, + ); + name = Products; + sourceTree = "<group>"; + }; + 27C70F011B32AF8000DADEB3 /* shlist */ = { + isa = PBXGroup; + children = ( + 27C70F061B32AF8000DADEB3 /* AppDelegate.h */, + 27C70F071B32AF8000DADEB3 /* AppDelegate.m */, + 27C70F0C1B32AF8000DADEB3 /* Main.storyboard */, + 27C70F2E1B33F4FA00DADEB3 /* SharedListsTableViewController.h */, + 27C70F2F1B33F4FA00DADEB3 /* SharedListsTableViewController.m */, + 27C70F2B1B33F3C300DADEB3 /* NewListViewController.h */, + 27C70F2C1B33F3C300DADEB3 /* NewListViewController.m */, + 27C70F281B33CE2500DADEB3 /* SharedList.h */, + 27C70F291B33D1C900DADEB3 /* SharedList.m */, + 27C70F0F1B32AF8000DADEB3 /* Images.xcassets */, + 27C70F111B32AF8000DADEB3 /* LaunchScreen.xib */, + 27C70F021B32AF8000DADEB3 /* Supporting Files */, + ); + path = shlist; + sourceTree = "<group>"; + }; + 27C70F021B32AF8000DADEB3 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 27C70F031B32AF8000DADEB3 /* Info.plist */, + 27C70F041B32AF8000DADEB3 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = "<group>"; + }; + 27C70F1B1B32AF8000DADEB3 /* shlistTests */ = { + isa = PBXGroup; + children = ( + 27C70F1E1B32AF8000DADEB3 /* shlistTests.m */, + 27C70F1C1B32AF8000DADEB3 /* Supporting Files */, + ); + path = shlistTests; + sourceTree = "<group>"; + }; + 27C70F1C1B32AF8000DADEB3 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 27C70F1D1B32AF8000DADEB3 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 27C70EFE1B32AF8000DADEB3 /* shlist */ = { + isa = PBXNativeTarget; + buildConfigurationList = 27C70F221B32AF8000DADEB3 /* Build configuration list for PBXNativeTarget "shlist" */; + buildPhases = ( + 27C70EFB1B32AF8000DADEB3 /* Sources */, + 27C70EFC1B32AF8000DADEB3 /* Frameworks */, + 27C70EFD1B32AF8000DADEB3 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = shlist; + productName = shlist; + productReference = 27C70EFF1B32AF8000DADEB3 /* shlist.app */; + productType = "com.apple.product-type.application"; + }; + 27C70F171B32AF8000DADEB3 /* shlistTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 27C70F251B32AF8000DADEB3 /* Build configuration list for PBXNativeTarget "shlistTests" */; + buildPhases = ( + 27C70F141B32AF8000DADEB3 /* Sources */, + 27C70F151B32AF8000DADEB3 /* Frameworks */, + 27C70F161B32AF8000DADEB3 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 27C70F1A1B32AF8000DADEB3 /* PBXTargetDependency */, + ); + name = shlistTests; + productName = shlistTests; + productReference = 27C70F181B32AF8000DADEB3 /* shlistTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 27C70EF71B32AF7F00DADEB3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0630; + ORGANIZATIONNAME = octopus; + TargetAttributes = { + 27C70EFE1B32AF8000DADEB3 = { + CreatedOnToolsVersion = 6.3.2; + DevelopmentTeam = U2FXYUBV5L; + }; + 27C70F171B32AF8000DADEB3 = { + CreatedOnToolsVersion = 6.3.2; + TestTargetID = 27C70EFE1B32AF8000DADEB3; + }; + }; + }; + buildConfigurationList = 27C70EFA1B32AF7F00DADEB3 /* Build configuration list for PBXProject "shlist" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 27C70EF61B32AF7F00DADEB3; + productRefGroup = 27C70F001B32AF8000DADEB3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 27C70EFE1B32AF8000DADEB3 /* shlist */, + 27C70F171B32AF8000DADEB3 /* shlistTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 27C70EFD1B32AF8000DADEB3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 27C70F0E1B32AF8000DADEB3 /* Main.storyboard in Resources */, + 27C70F131B32AF8000DADEB3 /* LaunchScreen.xib in Resources */, + 27C70F101B32AF8000DADEB3 /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 27C70F161B32AF8000DADEB3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 27C70EFB1B32AF8000DADEB3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 27C70F351B36513200DADEB3 /* DBManager.m in Sources */, + 27C70F0B1B32AF8000DADEB3 /* Server.m in Sources */, + 27C70F2A1B33D1C900DADEB3 /* SharedList.m in Sources */, + 27C70F2D1B33F3C300DADEB3 /* NewListViewController.m in Sources */, + 27C70F081B32AF8000DADEB3 /* AppDelegate.m in Sources */, + 27C70F301B33F4FA00DADEB3 /* SharedListsTableViewController.m in Sources */, + 27C70F051B32AF8000DADEB3 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 27C70F141B32AF8000DADEB3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 27C70F1F1B32AF8000DADEB3 /* shlistTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 27C70F1A1B32AF8000DADEB3 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 27C70EFE1B32AF8000DADEB3 /* shlist */; + targetProxy = 27C70F191B32AF8000DADEB3 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 27C70F0C1B32AF8000DADEB3 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 27C70F0D1B32AF8000DADEB3 /* Base */, + ); + name = Main.storyboard; + sourceTree = "<group>"; + }; + 27C70F111B32AF8000DADEB3 /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + 27C70F121B32AF8000DADEB3 /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = "<group>"; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 27C70F201B32AF8000DADEB3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 27C70F211B32AF8000DADEB3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 27C70F231B32AF8000DADEB3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + INFOPLIST_FILE = shlist/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + }; + name = Debug; + }; + 27C70F241B32AF8000DADEB3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + INFOPLIST_FILE = shlist/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + }; + name = Release; + }; + 27C70F261B32AF8000DADEB3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = shlistTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/shlist.app/shlist"; + }; + name = Debug; + }; + 27C70F271B32AF8000DADEB3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = shlistTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/shlist.app/shlist"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 27C70EFA1B32AF7F00DADEB3 /* Build configuration list for PBXProject "shlist" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 27C70F201B32AF8000DADEB3 /* Debug */, + 27C70F211B32AF8000DADEB3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 27C70F221B32AF8000DADEB3 /* Build configuration list for PBXNativeTarget "shlist" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 27C70F231B32AF8000DADEB3 /* Debug */, + 27C70F241B32AF8000DADEB3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 27C70F251B32AF8000DADEB3 /* Build configuration list for PBXNativeTarget "shlistTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 27C70F261B32AF8000DADEB3 /* Debug */, + 27C70F271B32AF8000DADEB3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 27C70EF71B32AF7F00DADEB3 /* Project object */; +} diff --git a/ios-ng/shlist.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios-ng/shlist.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Workspace + version = "1.0"> + <FileRef + location = "self:shlist.xcodeproj"> + </FileRef> +</Workspace> diff --git a/ios-ng/shlist.xcodeproj/project.xcworkspace/xcuserdata/kyle.xcuserdatad/UserInterfaceState.xcuserstate b/ios-ng/shlist.xcodeproj/project.xcworkspace/xcuserdata/kyle.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ. diff --git a/ios-ng/shlist.xcodeproj/xcuserdata/kyle.xcuserdatad/xcschemes/shlist.xcscheme b/ios-ng/shlist.xcodeproj/xcuserdata/kyle.xcuserdatad/xcschemes/shlist.xcscheme @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "0630" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "27C70EFE1B32AF8000DADEB3" + BuildableName = "shlist.app" + BlueprintName = "shlist" + ReferencedContainer = "container:shlist.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "NO" + buildForArchiving = "NO" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "27C70F171B32AF8000DADEB3" + BuildableName = "shlistTests.xctest" + BlueprintName = "shlistTests" + ReferencedContainer = "container:shlist.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> + <Testables> + <TestableReference + skipped = "NO"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "27C70F171B32AF8000DADEB3" + BuildableName = "shlistTests.xctest" + BlueprintName = "shlistTests" + ReferencedContainer = "container:shlist.xcodeproj"> + </BuildableReference> + </TestableReference> + </Testables> + <MacroExpansion> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "27C70EFE1B32AF8000DADEB3" + BuildableName = "shlist.app" + BlueprintName = "shlist" + ReferencedContainer = "container:shlist.xcodeproj"> + </BuildableReference> + </MacroExpansion> + </TestAction> + <LaunchAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Debug" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + allowLocationSimulation = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "27C70EFE1B32AF8000DADEB3" + BuildableName = "shlist.app" + BlueprintName = "shlist" + ReferencedContainer = "container:shlist.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Release" + debugDocumentVersioning = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "27C70EFE1B32AF8000DADEB3" + BuildableName = "shlist.app" + BlueprintName = "shlist" + ReferencedContainer = "container:shlist.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/ios-ng/shlist.xcodeproj/xcuserdata/kyle.xcuserdatad/xcschemes/xcschememanagement.plist b/ios-ng/shlist.xcodeproj/xcuserdata/kyle.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ +<?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>SchemeUserState</key> + <dict> + <key>shlist.xcscheme</key> + <dict> + <key>orderHint</key> + <integer>0</integer> + </dict> + </dict> + <key>SuppressBuildableAutocreation</key> + <dict> + <key>27C70EFE1B32AF8000DADEB3</key> + <dict> + <key>primary</key> + <true/> + </dict> + <key>27C70F171B32AF8000DADEB3</key> + <dict> + <key>primary</key> + <true/> + </dict> + </dict> +</dict> +</plist> diff --git a/ios-ng/shlist/AppDelegate.h b/ios-ng/shlist/AppDelegate.h @@ -0,0 +1,9 @@ +#import <UIKit/UIKit.h> + +@interface AppDelegate : UIResponder <UIApplicationDelegate> + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/ios-ng/shlist/AppDelegate.m b/ios-ng/shlist/AppDelegate.m @@ -0,0 +1,58 @@ +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@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/ios-ng/shlist/Base.lproj/LaunchScreen.xib b/ios-ng/shlist/Base.lproj/LaunchScreen.xib @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> + <dependencies> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/> + <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> + </dependencies> + <objects> + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> + <view contentMode="scaleToFill" id="iN0-l3-epB"> + <rect key="frame" x="0.0" y="0.0" width="480" height="480"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 octopus. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye"> + <rect key="frame" x="20" y="439" width="441" height="21"/> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> + <nil key="highlightedColor"/> + </label> + <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="shlist" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> + <rect key="frame" x="20" y="140" width="441" height="43"/> + <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> + <nil key="highlightedColor"/> + </label> + </subviews> + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> + <constraints> + <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/> + <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/> + <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/> + <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/> + <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/> + <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/> + </constraints> + <nil key="simulatedStatusBarMetrics"/> + <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> + <point key="canvasLocation" x="548" y="455"/> + </view> + </objects> +</document> diff --git a/ios-ng/shlist/Base.lproj/Main.storyboard b/ios-ng/shlist/Base.lproj/Main.storyboard @@ -0,0 +1,185 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="0GJ-5e-Vr4"> + <dependencies> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/> + <capability name="Constraints to layout margins" minToolsVersion="6.0"/> + </dependencies> + <scenes> + <!--Table View Controller--> + <scene sceneID="NFJ-ye-dsA"> + <objects> + <tableViewController id="pMK-tA-j4s" sceneMemberID="viewController"> + <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="dCf-l7-AN3"> + <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <prototypes> + <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="s1K-8G-gXq"> + <autoresizingMask key="autoresizingMask"/> + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="s1K-8G-gXq" id="H4s-wq-8Lq"> + <autoresizingMask key="autoresizingMask"/> + </tableViewCellContentView> + </tableViewCell> + </prototypes> + <connections> + <outlet property="dataSource" destination="pMK-tA-j4s" id="uS9-5b-uK0"/> + <outlet property="delegate" destination="pMK-tA-j4s" id="T4n-F1-eqf"/> + </connections> + </tableView> + </tableViewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="H64-xB-1er" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="1008" y="-358"/> + </scene> + <!--Shared Lists--> + <scene sceneID="hc1-Lv-WtP"> + <objects> + <tableViewController id="x0J-ua-E8Q" customClass="SharedListsTableViewController" sceneMemberID="viewController"> + <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="D4a-1U-mWV"> + <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> + <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="SharedListPrototypeCell" textLabel="zqW-ht-Knz" detailTextLabel="C9r-D2-l6m" style="IBUITableViewCellStyleSubtitle" id="cBl-Ro-lD0"> + <autoresizingMask key="autoresizingMask"/> + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="cBl-Ro-lD0" id="EBK-6r-ANI"> + <autoresizingMask key="autoresizingMask"/> + <subviews> + <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="zqW-ht-Knz"> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <fontDescription key="fontDescription" type="system" pointSize="16"/> + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> + <nil key="highlightedColor"/> + </label> + <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Subtitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="C9r-D2-l6m"> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <fontDescription key="fontDescription" type="system" pointSize="11"/> + <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> + <nil key="highlightedColor"/> + </label> + </subviews> + </tableViewCellContentView> + <connections> + <segue destination="pMK-tA-j4s" kind="show" id="ORk-KR-Twe"/> + </connections> + </tableViewCell> + </prototypes> + <sections/> + <connections> + <outlet property="dataSource" destination="x0J-ua-E8Q" id="a5b-kh-dYA"/> + <outlet property="delegate" destination="x0J-ua-E8Q" id="kjY-bc-cY1"/> + </connections> + </tableView> + <toolbarItems/> + <navigationItem key="navigationItem" title="Shared Lists" id="uhM-V6-aB7"> + <barButtonItem key="rightBarButtonItem" systemItem="add" id="hNc-gt-QbU"> + <connections> + <segue destination="zuT-Jr-cfg" kind="presentation" id="Tbe-NZ-dy8"/> + </connections> + </barButtonItem> + </navigationItem> + <simulatedToolbarMetrics key="simulatedBottomBarMetrics"/> + </tableViewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="iHC-sh-5gq" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="292" y="380"/> + </scene> + <!--New List--> + <scene sceneID="tne-QT-ifu"> + <objects> + <viewController id="BYZ-38-t0r" customClass="NewListViewController" sceneMemberID="viewController"> + <layoutGuides> + <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> + <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> + </layoutGuides> + <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> + <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="new list name" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="gPO-fo-XXP"> + <rect key="frame" x="0.0" y="88" width="600" height="30"/> + <fontDescription key="fontDescription" type="system" pointSize="14"/> + <textInputTraits key="textInputTraits"/> + <connections> + <action selector="textField:" destination="BYZ-38-t0r" eventType="editingDidEnd" id="x6t-Ub-mbI"/> + </connections> + </textField> + <datePicker contentMode="scaleToFill" ambiguous="YES" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="date" minuteInterval="1" translatesAutoresizingMaskIntoConstraints="NO" id="6qD-8D-Z17"> + <rect key="frame" x="0.0" y="134" width="600" height="162"/> + <date key="date" timeIntervalSinceReferenceDate="456394105.70743901"> + <!--2015-06-19 08:08:25 +0000--> + </date> + </datePicker> + </subviews> + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> + <constraints> + <constraint firstAttribute="centerX" secondItem="gPO-fo-XXP" secondAttribute="centerX" id="1OY-B2-wev"/> + <constraint firstAttribute="trailingMargin" secondItem="6qD-8D-Z17" secondAttribute="trailing" constant="-16" id="Bo3-B6-6Tu"/> + <constraint firstItem="gPO-fo-XXP" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" constant="-16" id="H3z-m6-BeL"/> + <constraint firstAttribute="trailingMargin" secondItem="gPO-fo-XXP" secondAttribute="trailing" constant="-16" id="iEx-da-9za"/> + <constraint firstItem="6qD-8D-Z17" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" constant="-16" id="o9a-P2-Pqm"/> + <constraint firstAttribute="centerX" secondItem="6qD-8D-Z17" secondAttribute="centerX" id="scx-j8-F8B"/> + </constraints> + </view> + <navigationItem key="navigationItem" title="New List" id="5ys-ck-wLj"> + <barButtonItem key="leftBarButtonItem" systemItem="cancel" id="WaR-Ud-Hmo"> + <connections> + <segue destination="C3w-Ab-gX6" kind="unwind" unwindAction="unwindToList:" id="7wZ-HT-2Br"/> + </connections> + </barButtonItem> + <barButtonItem key="rightBarButtonItem" systemItem="save" id="gBs-i9-WN3"> + <connections> + <segue destination="C3w-Ab-gX6" kind="unwind" unwindAction="unwindToList:" id="O1j-G2-VLY"/> + </connections> + </barButtonItem> + </navigationItem> + <connections> + <outlet property="date" destination="6qD-8D-Z17" id="pFe-hc-J9g"/> + <outlet property="saveButton" destination="gBs-i9-WN3" id="MOy-AZ-jOX"/> + <outlet property="textField" destination="gPO-fo-XXP" id="A02-ZD-oNk"/> + </connections> + </viewController> + <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> + <exit id="C3w-Ab-gX6" userLabel="Exit" sceneMemberID="exit"/> + </objects> + <point key="canvasLocation" x="2064" y="387"/> + </scene> + <!--Navigation Controller--> + <scene sceneID="vP4-SE-UGa"> + <objects> + <navigationController automaticallyAdjustsScrollViewInsets="NO" id="0GJ-5e-Vr4" sceneMemberID="viewController"> + <toolbarItems/> + <navigationBar key="navigationBar" contentMode="scaleToFill" id="WYU-lv-pXW"> + <rect key="frame" x="0.0" y="0.0" width="320" height="44"/> + <autoresizingMask key="autoresizingMask"/> + </navigationBar> + <nil name="viewControllers"/> + <connections> + <segue destination="x0J-ua-E8Q" kind="relationship" relationship="rootViewController" id="tuU-c4-Wa3"/> + </connections> + </navigationController> + <placeholder placeholderIdentifier="IBFirstResponder" id="F0p-6e-kSs" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="-520" y="380"/> + </scene> + <!--Navigation Controller--> + <scene sceneID="tIS-8B-PrL"> + <objects> + <navigationController automaticallyAdjustsScrollViewInsets="NO" id="zuT-Jr-cfg" sceneMemberID="viewController"> + <toolbarItems/> + <navigationBar key="navigationBar" contentMode="scaleToFill" id="MoP-43-Q44"> + <rect key="frame" x="0.0" y="0.0" width="320" height="44"/> + <autoresizingMask key="autoresizingMask"/> + </navigationBar> + <nil name="viewControllers"/> + <connections> + <segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="IA0-bn-1rc"/> + </connections> + </navigationController> + <placeholder placeholderIdentifier="IBFirstResponder" id="9KD-4M-SJA" userLabel="First Responder" sceneMemberID="firstResponder"/> + </objects> + <point key="canvasLocation" x="1252" y="387"/> + </scene> + </scenes> +</document> diff --git a/ios-ng/shlist/Images.xcassets/AppIcon.appiconset/Contents.json b/ios-ng/shlist/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,163 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "57x57", + "scale" : "1x" + }, + { + "idiom" : "iphone", + "size" : "57x57", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "octopus.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "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" : "50x50", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "50x50", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "72x72", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "72x72", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "car", + "size" : "120x120", + "scale" : "1x" + }, + { + "size" : "24x24", + "idiom" : "watch", + "scale" : "2x", + "role" : "notificationCenter", + "subtype" : "38mm" + }, + { + "size" : "27.5x27.5", + "idiom" : "watch", + "scale" : "2x", + "role" : "notificationCenter", + "subtype" : "42mm" + }, + { + "size" : "29x29", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "watch", + "role" : "companionSettings", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "watch", + "scale" : "2x", + "role" : "appLauncher", + "subtype" : "38mm" + }, + { + "size" : "44x44", + "idiom" : "watch", + "scale" : "2x", + "role" : "longLook", + "subtype" : "42mm" + }, + { + "size" : "86x86", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "38mm" + }, + { + "size" : "98x98", + "idiom" : "watch", + "scale" : "2x", + "role" : "quickLook", + "subtype" : "42mm" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} +\ No newline at end of file diff --git a/ios-ng/shlist/Images.xcassets/AppIcon.appiconset/octopus.png b/ios-ng/shlist/Images.xcassets/AppIcon.appiconset/octopus.png Binary files differ. diff --git a/ios-ng/shlist/Info.plist b/ios-ng/shlist/Info.plist @@ -0,0 +1,47 @@ +<?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>octopus.$(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</string> + <key>LSRequiresIPhoneOS</key> + <true/> + <key>UILaunchStoryboardName</key> + <string>LaunchScreen</string> + <key>UIMainStoryboardFile</key> + <string>Main</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> diff --git a/ios-ng/shlist/NewListViewController.h b/ios-ng/shlist/NewListViewController.h @@ -0,0 +1,8 @@ +#import <UIKit/UIKit.h> +#import "SharedList.h" + +@interface NewListViewController : UIViewController + +@property SharedList *shared_list; + +@end diff --git a/ios-ng/shlist/NewListViewController.m b/ios-ng/shlist/NewListViewController.m @@ -0,0 +1,41 @@ +#import "NewListViewController.h" + +@interface NewListViewController () +@property (weak, nonatomic) IBOutlet UIBarButtonItem *saveButton; +@property (weak, nonatomic) IBOutlet UITextField *textField; +@property (weak, nonatomic) IBOutlet UIDatePicker *date; + +@end + +@implementation NewListViewController + + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. + + if (sender != self.saveButton) return; + + if (self.textField.text.length > 0) { + self.shared_list = [[SharedList alloc] init]; + self.shared_list.list_name = self.textField.text; + self.shared_list.list_members = @"Test, Test"; + + NSLog(@"prepareForSegue(): %@", self.textField.text); + } +} + +@end +\ No newline at end of file diff --git a/ios-ng/shlist/Server.h b/ios-ng/shlist/Server.h @@ -0,0 +1,5 @@ +#import <UIKit/UIKit.h> + +@interface Server : NSObject <NSStreamDelegate> + +@end +\ No newline at end of file diff --git a/ios-ng/shlist/Server.m b/ios-ng/shlist/Server.m @@ -0,0 +1,49 @@ +#import "Server.h" + +@interface Server () +- (void)network_init; + +@end + +@implementation Server + +NSInputStream *inputStream; +NSOutputStream *outputStream; +bool initialized = 0; + + +- (void)network_init +{ + CFReadStreamRef readStream; + CFWriteStreamRef writeStream; + + CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)@"absentmindedproductions.ca", 5437, &readStream, &writeStream); + inputStream = (__bridge NSInputStream *)readStream; + outputStream = (__bridge NSOutputStream *)writeStream; + + [inputStream setDelegate:self]; + [outputStream setDelegate:self]; + + [inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; + [outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; + + [inputStream open]; + [outputStream open]; +} + +- (void)read +{ + if (!initialized) { + [self network_init]; + } +} + +- (void)write +{ + if (!initialized) { + [self network_init]; + } +} + + +@end diff --git a/ios-ng/shlist/SharedList.h b/ios-ng/shlist/SharedList.h @@ -0,0 +1,16 @@ +#ifndef shlist_List_h +#define shlist_List_h + +@interface SharedList : NSObject + +// @property (weak, nonatomic) IBOutlet; +// UILabel *names; + +@property NSString *list_name; +@property NSString *list_members; +@property NSDate *list_date; + +- (void)set_name:(NSString*)name; +@end + +#endif +\ No newline at end of file diff --git a/ios-ng/shlist/SharedList.m b/ios-ng/shlist/SharedList.m @@ -0,0 +1,11 @@ +#import <Foundation/Foundation.h> +#import "SharedList.h" + +@implementation SharedList + +- (void)set_name:(NSString*)name +{ + self.list_name = name; +} + +@end +\ No newline at end of file diff --git a/ios-ng/shlist/SharedListsTableViewController.h b/ios-ng/shlist/SharedListsTableViewController.h @@ -0,0 +1,9 @@ +#import <UIKit/UIKit.h> + +@interface SharedListsTableViewController : UITableViewController + +@property NSMutableArray *shared_lists; + +- (IBAction)unwindToList:(UIStoryboardSegue *)segue; + +@end diff --git a/ios-ng/shlist/SharedListsTableViewController.m b/ios-ng/shlist/SharedListsTableViewController.m @@ -0,0 +1,140 @@ +#import "SharedListsTableViewController.h" +#import "SharedList.h" +#import "NewListViewController.h" + +@interface SharedListsTableViewController () + +@end + +@implementation SharedListsTableViewController + +- (void)load_initial_data +{ + // load local shared list data from db + // sync with server and check if there's any updates + + NSLog(@"Loading initial data"); + + SharedList *list1 = [[SharedList alloc] init]; + list1.list_name = @"Camping"; + list1.list_members = @"David, Kyle, Greg"; + [self.shared_lists addObject:list1]; + + SharedList *list2 = [[SharedList alloc] init]; + list2.list_name = @"Wedding"; + list2.list_members = @"Kyle, Stephanie"; + [self.shared_lists addObject:list2]; + +} + +- (IBAction)unwindToList:(UIStoryboardSegue *)segue { + NewListViewController *source = [segue sourceViewController]; + SharedList *list = source.shared_list; + + if (list != nil) { + [self.shared_lists addObject:list]; + [self.tableView reloadData]; + } + + NSLog(@"unwindToList(): done"); +} + +- (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.rightBarButtonItem = self.editButtonItem; + + self.shared_lists = [[NSMutableArray alloc] init]; + [self load_initial_data]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + // Return the number of sections. + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + // Return the number of rows in the section. + return [self.shared_lists count]; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + // UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SharedListPrototypeCell" forIndexPath:indexPath]; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SharedListPrototypeCell"]; + + if (cell == nil) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"SharedListPrototypeCell"]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + } + + + NSLog(@"cellForRowAtIndexPath(): start"); + + // Configure the cell... + + SharedList *shared_list = [self.shared_lists objectAtIndex:indexPath.row]; + cell.textLabel.text = shared_list.list_name; + cell.detailTextLabel.text = shared_list.list_members; + + return cell; +} + + +/* +// Override to support conditional editing of the table view. +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the specified item to be editable. + return YES; +} +*/ + +/* +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + [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; +} +*/ + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/ios-ng/shlist/main.m b/ios-ng/shlist/main.m @@ -0,0 +1,8 @@ +#import <UIKit/UIKit.h> +#import "AppDelegate.h" + +int main(int argc, char *argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/ios-ng/shlistTests/Info.plist b/ios-ng/shlistTests/Info.plist @@ -0,0 +1,24 @@ +<?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>octopus.$(PRODUCT_NAME:rfc1034identifier)</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>$(PRODUCT_NAME)</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> diff --git a/ios-ng/shlistTests/shlistTests.m b/ios-ng/shlistTests/shlistTests.m @@ -0,0 +1,32 @@ +#import <UIKit/UIKit.h> +#import <XCTest/XCTest.h> + +@interface shlistTests : XCTestCase + +@end + +@implementation shlistTests + +- (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 { + // This is an example of a functional test case. + XCTAssert(YES, @"Pass"); +} + +- (void)testPerformanceExample { + // This is an example of a performance test case. + [self measureBlock:^{ + // Put the code you want to measure the time of here. + }]; +} + +@end