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

sorta working #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 24 additions & 0 deletions GJEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// GJEntry.h
// GoJournal
//
// Created by Varindra Hart on 10/13/15.
// Copyright © 2015 Elber Carneiro. All rights reserved.
//

#import <Parse/Parse.h>
#import <UIKit/UIKit.h>
@interface GJEntry : PFObject <PFSubclassing>

@property (nonatomic) PFFile *file;
@property (nonatomic) NSString *mediaType;
@property (nonatomic) NSString *fileExt;
@property (nonatomic) PFGeoPoint *location;
@property (nonatomic) NSString *textMedia;
@property (nonatomic) NSDate *createdDate;

+ (NSString *) parseClassName;
- (void)fileFromImage:(UIImage *)image;
- (void)fileFromVideoURL:(NSURL *)url;
- (NSURL *)urlFromMediaFile;
@end
51 changes: 51 additions & 0 deletions GJEntry.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// GJEntry.m
// GoJournal
//
// Created by Varindra Hart on 10/13/15.
// Copyright © 2015 Elber Carneiro. All rights reserved.
//

#import "GJEntry.h"

@implementation GJEntry

@dynamic file;
@dynamic mediaType;
@dynamic fileExt;
@dynamic location;
@dynamic textMedia;
@dynamic createdDate;

+ (NSString *) parseClassName{

return @"GJEntry";
}

- (void)fileFromImage:(UIImage *)image{

NSData *data = UIImageJPEGRepresentation(image, .8);

self.file = [PFFile fileWithData:data];

}

- (void)fileFromVideoURL:(NSURL *)url{

NSData *data = [NSData dataWithContentsOfURL:url];
self.file = [PFFile fileWithData:data contentType:@"video/mov"];

}

- (NSURL *)urlFromMediaFile{

if (![self.mediaType isEqualToString: @"public.video"]) {
return nil;
}

NSString *stringUrl = self.file.url;
NSURL *url = [NSURL URLWithString:stringUrl];
return url;

}
@end
19 changes: 19 additions & 0 deletions GJOutings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// GJOutings.h
// GoJournal
//
// Created by Varindra Hart on 10/13/15.
// Copyright © 2015 Elber Carneiro. All rights reserved.
//

#import "GJEntry.h"

@interface GJOutings : PFObject <PFSubclassing>

@property (nonatomic) NSString *outingName;
@property (nonatomic) NSDate *createdDate;
@property (nonatomic) NSMutableArray <GJEntry *> *entriesArray;

+ (NSString *)parseClassName;
- (instancetype)initWithNewEntriesArray;
@end
34 changes: 34 additions & 0 deletions GJOutings.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// GJOutings.m
// GoJournal
//
// Created by Varindra Hart on 10/13/15.
// Copyright © 2015 Elber Carneiro. All rights reserved.
//

#import "GJOutings.h"

@implementation GJOutings

@dynamic outingName;
@dynamic createdDate;
@dynamic entriesArray;

+ (NSString *)parseClassName{

return @"GJOutings";
}

- (instancetype)initWithNewEntriesArray{

if (self = [super init]){

self.entriesArray = [NSMutableArray new];
return self;

}

else
return nil;
}
@end
15 changes: 15 additions & 0 deletions GMSMarker+GJEntryArray.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// GMSMarker+GJEntryArray.h
// HikerLite
//
// Created by Varindra Hart on 10/18/15.
// Copyright © 2015 Varindra Hart. All rights reserved.
//

#import <GoogleMaps/GoogleMaps.h>
#import "GJOutings.h"

@interface GMSMarker (GJEntryArray)


@end
19 changes: 19 additions & 0 deletions GMSMarker+GJEntryArray.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// GMSMarker+GJEntryArray.m
// HikerLite
//
// Created by Varindra Hart on 10/18/15.
// Copyright © 2015 Varindra Hart. All rights reserved.
//

#import "GMSMarker+GJEntryArray.h"

@implementation GMSMarker (GJEntryArray)



//- (void)setEntriesArrayForLocation:(NSMutableArray<GJEntry *> *)entriesArrayForLocation {
// self.entriesArrayForLocation = entriesArrayForLocation;
//}

@end
18 changes: 18 additions & 0 deletions GMSMarker_GJEntriesArray.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// GMSMarker_GJEntriesArray.h
// HikerLite
//
// Created by Varindra Hart on 10/18/15.
// Copyright © 2015 Varindra Hart. All rights reserved.
//

#import <GoogleMaps/GoogleMaps.h>
#import <UIKit/UIKit.h>
#import "GJOutings.h"
#import "GJEntry.h"

@interface GMSMarker ()

@property (nonatomic) NSMutableArray <GJEntry *> *entriesArrayForLocation;

@end
14 changes: 14 additions & 0 deletions GMSMarker_WithArray.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// GMSMarker_WithArray.h
// HikerLite
//
// Created by Varindra Hart on 10/18/15.
// Copyright © 2015 Varindra Hart. All rights reserved.
//

#import <GoogleMaps/GoogleMaps.h>
#import "GJEntry.h"

@interface GMSMarker_WithArray : GMSMarker
@property (nonatomic) NSMutableArray <GJEntry *> *entriesArrayForLocation;
@end
13 changes: 13 additions & 0 deletions GMSMarker_WithArray.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// GMSMarker_WithArray.m
// HikerLite
//
// Created by Varindra Hart on 10/18/15.
// Copyright © 2015 Varindra Hart. All rights reserved.
//

#import "GMSMarker_WithArray.h"

@implementation GMSMarker_WithArray

@end
Loading