-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf7fb4d
commit 67540be
Showing
76 changed files
with
3,380 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// AppDelegate.h | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 08/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import <CoreLocation/CoreLocation.h> | ||
|
||
@interface AppDelegate : UIResponder <UIApplicationDelegate,CLLocationManagerDelegate> | ||
|
||
@property (strong, nonatomic) UIWindow *window; | ||
@property (strong, nonatomic) CLLocationManager *locationManager; | ||
@property (strong, nonatomic) CLLocation *userLocation; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// | ||
// AppDelegate.m | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 08/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import "AppDelegate.h" | ||
|
||
|
||
@implementation AppDelegate | ||
|
||
@synthesize locationManager = _locationManager; | ||
@synthesize userLocation = _userLocation; | ||
|
||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | ||
{ | ||
// Override point for customization after application launch. | ||
|
||
|
||
self.locationManager = [[CLLocationManager alloc] init]; | ||
self.locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters; | ||
self.locationManager.delegate = self; | ||
|
||
[self.locationManager startUpdatingLocation]; | ||
|
||
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:. | ||
} | ||
|
||
#pragma mark - | ||
#pragma mark CLLocationManagerDelegate | ||
|
||
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{ | ||
|
||
if (oldLocation!=newLocation) { | ||
self.userLocation = newLocation; | ||
} | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// NSString+MD5.h | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 10/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface NSString (MD5) | ||
|
||
//This method is used to return a MD5 encrypted string | ||
- (NSString*)MD5; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// NSString+MD5.m | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 10/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import "NSString+MD5.h" | ||
#import <CommonCrypto/CommonDigest.h> | ||
|
||
@implementation NSString (MD5) | ||
|
||
//This method is used to return a MD5 encrypted string | ||
- (NSString*)MD5{ | ||
|
||
// Create pointer to the string as UTF8 | ||
const char *ptr = [self UTF8String]; | ||
|
||
// Create byte array of unsigned chars | ||
unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH]; | ||
|
||
// Create 16 byte MD5 hash value, store in buffer | ||
CC_MD5(ptr, strlen(ptr), md5Buffer); | ||
|
||
// Convert MD5 value in the buffer to NSString of hex values | ||
NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2]; | ||
for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) | ||
[output appendFormat:@"%02x",md5Buffer[i]]; | ||
|
||
return output; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// BaseEvent.h | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 10/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <CoreLocation/CoreLocation.h> | ||
|
||
@interface BaseEvent : NSObject | ||
|
||
@property (strong, nonatomic) NSString *baseEventId; | ||
@property (strong, nonatomic) CLLocation *location; | ||
@property (strong, nonatomic) NSDate *date; | ||
@property (assign, nonatomic) BOOL shared; | ||
@property (strong, nonatomic) NSString *creator; | ||
|
||
//The designated initializer | ||
- (id)initBaseEventWithLocation:(CLLocation *)location date:(NSDate *)date shared:(BOOL)shared creator:(NSString *)creator; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// BaseEvent.m | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 10/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import "BaseEvent.h" | ||
|
||
@implementation BaseEvent | ||
|
||
@synthesize baseEventId = _baseEventId; | ||
@synthesize location = _location; | ||
@synthesize date = _date; | ||
@synthesize shared = _shared; | ||
@synthesize creator = _creator; | ||
|
||
//The designated initializer | ||
- (id)initBaseEventWithLocation:(CLLocation *)location date:(NSDate *)date shared:(BOOL)shared creator:(NSString *)creator{ | ||
|
||
self = [super init]; | ||
|
||
if (self) { | ||
_baseEventId = [Utility MD5ForString:[NSString stringWithFormat:@"%f%f%@%i%@",location.coordinate.latitude,location.coordinate.longitude,[date description],shared,creator]]; | ||
_location = location; | ||
_date = date; | ||
_shared = shared; | ||
_creator = creator; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// Event.h | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 10/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "BaseEvent.h" | ||
|
||
@interface Event : BaseEvent | ||
|
||
@property (strong, nonatomic) NSMutableArray *eventItems; | ||
@property (strong, nonatomic) NSMutableArray *emotions; | ||
|
||
//The designated Initializer | ||
- (id)initEventWithLocation:(CLLocation *)location date:(NSDate *)date shared:(BOOL)shared creator:(NSString *)creator; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// Event.m | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 10/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import "Event.h" | ||
|
||
@implementation Event | ||
|
||
@synthesize eventItems = _eventItems; | ||
@synthesize emotions = _emotions; | ||
|
||
//The designated Initializer | ||
- (id)initEventWithLocation:(CLLocation *)location date:(NSDate *)date shared:(BOOL)shared creator:(NSString *)creator{ | ||
|
||
self = [super initBaseEventWithLocation:location date:date shared:shared creator:creator]; | ||
|
||
if (self) { | ||
_eventItems = [[NSMutableArray alloc] init]; | ||
_emotions = [[NSMutableArray alloc] init]; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// EventItem.h | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 10/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface EventItem : NSObject | ||
|
||
@property (strong, nonatomic) NSString *eventItemId; | ||
@property (strong, nonatomic) NSString *creator; | ||
|
||
//The designated initializer | ||
- (id)initEventItemWithId:(NSString *)eventId creator:(NSString *)creator; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// EventItem.m | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 10/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import "EventItem.h" | ||
|
||
@implementation EventItem | ||
|
||
@synthesize eventItemId = _eventItemId; | ||
@synthesize creator = _creator; | ||
|
||
//The designated initializer | ||
- (id)initEventItemWithId:(NSString *)eventId creator:(NSString *)creator{ | ||
|
||
self = [super init]; | ||
|
||
if (self) { | ||
|
||
_eventItemId = [Utility MD5ForString:eventId]; | ||
_creator = creator; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// SampleNote.h | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 14/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "EventItem.h" | ||
|
||
@interface SampleNote : EventItem | ||
|
||
@property (strong, nonatomic) NSString *noteTitle; | ||
@property (strong, nonatomic) NSString *noteText; | ||
|
||
//The designated initializer | ||
- (id)initSampleNoteWithTitle:(NSString *)title text:(NSString *)text eventItemCreator:(NSString *)creator; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// SampleNote.m | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 14/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import "SampleNote.h" | ||
|
||
@implementation SampleNote | ||
|
||
@synthesize noteTitle = _noteTitle; | ||
@synthesize noteText = _noteText; | ||
|
||
//The designated initializer | ||
- (id)initSampleNoteWithTitle:(NSString *)title text:(NSString *)text eventItemCreator:(NSString *)eventCreator;{ | ||
|
||
self = [super initEventItemWithId:[NSString stringWithFormat:@"%@%@%@",title,text,eventCreator] creator:eventCreator]; | ||
|
||
if (self) { | ||
_noteTitle = title; | ||
_noteText = text; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Timeline.h | ||
// Timeline | ||
// | ||
// Created by Alessandro Boron on 10/08/2012. | ||
// Copyright (c) 2012 Alessandro Boron. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class BaseEvent; | ||
|
||
@interface Timeline : NSObject | ||
|
||
@property (strong, nonatomic) NSString *tId; | ||
@property (strong, nonatomic) NSString *title; | ||
@property (strong, nonatomic) NSString *creator; | ||
@property (strong, nonatomic) NSMutableArray *baseEvents; | ||
@property (assign, nonatomic) BOOL shared; | ||
|
||
//The designated initializer | ||
- (id)initTimelineWithTitle:(NSString *)title creator:(NSString *)creator shared:(BOOL)shared; | ||
|
||
//This method is used to return the string representation of the sharing attribute | ||
- (NSString *)sharedDescription; | ||
|
||
@end |
Oops, something went wrong.