Skip to content
Open

v1 #5

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9537b1f
added files from the practice project
bereket6725 Oct 19, 2015
54ddd58
fixed bug
bereket6725 Oct 20, 2015
fde701f
changed some colors
bereket6725 Oct 20, 2015
5096d4e
V1 in the house
maldonadoguitar Oct 20, 2015
5cb579b
Merge pull request #1 from maldonadoguitar/master
bereket6725 Oct 20, 2015
3f38794
fixed camera bug
fweathers Oct 20, 2015
8c50c9a
mapkit up and working
fweathers Oct 20, 2015
68098f5
changed backgrounds and font. fixed some other Ui to be consistent
fweathers Oct 20, 2015
7c30673
added to textfield search in meet up
fweathers Oct 20, 2015
992db9e
got rid of in journal entry
fweathers Oct 20, 2015
6dd2b9a
added placeholder text to journalEntryTextViewController
fweathers Oct 20, 2015
27090ab
added pin button to journal entry to go to map view
fweathers Oct 20, 2015
c44db72
pushing
fweathers Oct 20, 2015
59ff9ac
tabBar icons
maldonadoguitar Oct 21, 2015
2b63fb3
new backgrounds
maldonadoguitar Oct 21, 2015
73619b4
small
maldonadoguitar Oct 21, 2015
fce2c62
font color and background changes
maldonadoguitar Oct 21, 2015
784209a
made it persist with Core Data aaaaand fixed the problem in the Colle…
bereket6725 Oct 22, 2015
d0feb85
needed to addedfetched data to singleton array
bereket6725 Oct 22, 2015
b5d1a3b
fixed camera save image
fweathers Oct 22, 2015
35a3211
fixing merge
fweathers Oct 22, 2015
1d0ce45
fixed camera saving to camera roll
fweathers Oct 22, 2015
dc76ba6
fixing font and moved save button
fweathers Oct 22, 2015
49bc2f3
fixed font throughout views
fweathers Oct 22, 2015
49e0a52
keyboard dismissal
bereket6725 Oct 22, 2015
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
  •  
  •  
  •  
Binary file added .DS_Store
Binary file not shown.
14 changes: 14 additions & 0 deletions MapKitViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// MapKitViewController.h
// UNIT2PracticeProject
//
// Created by Felicia Weathers on 10/19/15.
// Copyright © 2015 Bereket . All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

@interface MapKitViewController : UIViewController <CLLocationManagerDelegate>

@end
142 changes: 142 additions & 0 deletions MapKitViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
//
// MapKitViewController.m
// UNIT2PracticeProject
//
// Created by Felicia Weathers on 10/19/15.
// Copyright © 2015 Bereket . All rights reserved.
//

#import "MapKitViewController.h"
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKShareKit/FBSDKShareKit.h>


@interface MapKitViewController ()

@property (weak, nonatomic) IBOutlet MKMapView *mapView;

@property (nonatomic) CLLocationManager *locationManager;
@property (nonatomic) NSMutableArray *placesVisited;
@property (weak, nonatomic) IBOutlet UIButton *pinLocationButton;


@end

@implementation MapKitViewController

- (void)viewDidLoad
{
[super viewDidLoad];

// border radius
[self.pinLocationButton.layer setCornerRadius:30.0f];



// border
[self.mapView.layer setBorderColor:[UIColor lightGrayColor].CGColor];
[self.mapView.layer setBorderWidth:1.5f];

[self.pinLocationButton.layer setBorderColor:[UIColor lightGrayColor].CGColor];
[self.pinLocationButton.layer setBorderWidth:1.5f];

// drop shadow
[self.mapView.layer setShadowColor:[UIColor blackColor].CGColor];
[self.mapView.layer setShadowOpacity:0.8];
[self.mapView.layer setShadowRadius:3.0];
[self.mapView.layer setShadowOffset:CGSizeMake(2.0, 2.0)];

[self.pinLocationButton.layer setShadowColor:[UIColor blackColor].CGColor];
[self.pinLocationButton.layer setShadowOpacity:0.8];
[self.pinLocationButton.layer setShadowRadius:3.0];
[self.pinLocationButton.layer setShadowOffset:CGSizeMake(2.0, 2.0)];



// self.placesVisited = [[NSMutableArray alloc]init];

self.placesVisited = [NSMutableArray arrayWithArray:[[NSUserDefaults standardUserDefaults] objectForKey:@"destinations"]];


CLLocationCoordinate2D center = CLLocationCoordinate2DMake(40.7, -74);
MKCoordinateSpan span = MKCoordinateSpanMake(0.8, 0.8);
[self.mapView setRegion:MKCoordinateRegionMake(center, span)];

//create location manager
self.locationManager = [[CLLocationManager alloc]init];
self.locationManager.delegate = self;

if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)])
{
[self.locationManager requestWhenInUseAuthorization];
}
[self.locationManager startUpdatingLocation];

[self reloadPins];

}

- (void)reloadPins
{
//reload pins

if (self.placesVisited.count != 0)
{

for (int i = 0; i < self.placesVisited.count; i ++)
{
NSLog(@"%lu", self.placesVisited.count);
MKPointAnnotation *mapPin = [[MKPointAnnotation alloc]init];
// mapPin.title = @"The Location";

NSDictionary *coordinates = [self.placesVisited objectAtIndex:i];
mapPin.coordinate = CLLocationCoordinate2DMake([[coordinates objectForKey:@"lat"] doubleValue],[[coordinates objectForKey:@"lng"] doubleValue]);
[self.mapView addAnnotation:mapPin];

NSLog(@"reprint pins");

}
}
}

- (IBAction)pinLocationButtonTapped:(id)sender
{
MKPointAnnotation *mapPin = [[MKPointAnnotation alloc]init];
mapPin.coordinate = CLLocationCoordinate2DMake(self.locationManager.location.coordinate.latitude, self.locationManager.location.coordinate.longitude);

[self.mapView addAnnotation:mapPin];

[self.placesVisited addObject:@{@"lat":[NSNumber numberWithDouble:mapPin.coordinate.latitude], @"lng":[NSNumber numberWithDouble:mapPin.coordinate.longitude ]}];

NSLog(@"Pin Location");

[[NSUserDefaults standardUserDefaults] setObject:self.placesVisited forKey:@"destinations"];
NSLog(@"Data Saved");


//facebook share button
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL
URLWithString:@"https://www.facebook.com/FacebookDevelopers"];
FBSDKShareButton *shareButton = [[FBSDKShareButton alloc] init];
shareButton.shareContent = content;
shareButton.center = self.view.center;
[self.view addSubview:shareButton];

}

- (void)locationManager:(CLLocationManager * _Nonnull)manager
didUpdateLocations:(NSArray<CLLocation *> * _Nonnull)locations
{

CLLocationCoordinate2D center = CLLocationCoordinate2DMake(self.locationManager.location.coordinate.latitude, self.locationManager.location.coordinate.longitude);
MKCoordinateSpan span = MKCoordinateSpanMake(0.8, 0.8);
[self.mapView setRegion:MKCoordinateRegionMake(center, span)];
self.mapView.zoomEnabled = true;
self.mapView.scrollEnabled = true;

}

@end
29 changes: 29 additions & 0 deletions NewJournalEntryViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// NewJournalEntryViewController.h
// UNIT2PracticeProject
//
// Created by Bereket on 10/15/15.
// Copyright © 2015 Bereket . All rights reserved.
//

#import <UIKit/UIKit.h>
#import "JournalEntryObject.h"
#import "NewEntryInputViewController.h"
#import "ImageSingleton.h"

@interface NewJournalEntryViewController : UIViewController

<
UIImagePickerControllerDelegate,
UINavigationControllerDelegate
>

- (IBAction)takeAphotoButtonTapped:(id)sender;


- (IBAction)newEntryButtonTapped:(id)sender;


@property (strong, nonatomic) IBOutlet UIImageView *capturedPicImageView;

@end
122 changes: 122 additions & 0 deletions NewJournalEntryViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
//
// NewJournalEntryViewController.m
// UNIT2PracticeProject
//
// Created by Bereket on 10/15/15.
// Copyright © 2015 Bereket . All rights reserved.
//

#import "NewJournalEntryViewController.h"

@interface NewJournalEntryViewController ()
@property (weak, nonatomic) IBOutlet UIView *takeAPicButton;

@end

@implementation NewJournalEntryViewController

- (void)viewDidLoad {
[super viewDidLoad];

}




- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}



- (IBAction)takeAphotoButtonTapped:(id)sender {

if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {

UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Device has no camera"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];

[myAlertView show];

} else {

UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;

UIImageWriteToSavedPhotosAlbum(self.capturedPicImageView.image, nil, nil, nil);

[self presentViewController: picker animated:YES completion: NULL];

}


}

- (IBAction)newEntryButtonTapped:(id)sender {

UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

[self presentViewController:picker animated:YES completion:NULL];

}


- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {


// UIImage *chosenImage = info[UIImagePickerControllerEditedImage];

self.capturedPicImageView.image = info[UIImagePickerControllerEditedImage];

[ImageSingleton myImage].image = self.capturedPicImageView.image;

//[[PhotoAlbum sharedPhotoAlbum].photoEntries addObject:chosenImage];
UIImageWriteToSavedPhotosAlbum(self.capturedPicImageView.image, nil, nil, nil);


[picker dismissViewControllerAnimated:YES completion:NULL];

}

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo {


self.capturedPicImageView.image = image;

[ImageSingleton myImage].image = self.capturedPicImageView.image;

//[[PhotoAlbum sharedPhotoAlbum].photoEntries addObject:chosenImage];

UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);

[picker dismissViewControllerAnimated:YES completion:NULL];


}


-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{

// if ([segue.identifier isEqualToString:@"InputEntryIdentifier"]) {
//
// NewEntryInputViewController* viewController = segue.destinationViewController;
//
// [ImageSingleton myImage].image = self.capturedPicImageView.image;
//
// if (viewController.selectedPhoto.image != nil) {
// NSLog(@"We have Photo Data");
// }
//

}

@end
2 changes: 2 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pod 'FBSDKShareKit', '~> 4.7'
pod 'AFNetworking', '~> 2.6'
51 changes: 51 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
PODS:
- AFNetworking (2.6.1):
- AFNetworking/NSURLConnection (= 2.6.1)
- AFNetworking/NSURLSession (= 2.6.1)
- AFNetworking/Reachability (= 2.6.1)
- AFNetworking/Security (= 2.6.1)
- AFNetworking/Serialization (= 2.6.1)
- AFNetworking/UIKit (= 2.6.1)
- AFNetworking/NSURLConnection (2.6.1):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/NSURLSession (2.6.1):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (2.6.1)
- AFNetworking/Security (2.6.1)
- AFNetworking/Serialization (2.6.1)
- AFNetworking/UIKit (2.6.1):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- Bolts (1.3.0):
- Bolts/AppLinks (= 1.3.0)
- Bolts/Tasks (= 1.3.0)
- Bolts/AppLinks (1.3.0):
- Bolts/Tasks
- Bolts/Tasks (1.3.0)
- FBSDKCoreKit (4.7.0):
- Bolts (~> 1.1)
- FBSDKCoreKit/arc (= 4.7.0)
- FBSDKCoreKit/no-arc (= 4.7.0)
- FBSDKCoreKit/arc (4.7.0):
- Bolts (~> 1.1)
- FBSDKCoreKit/no-arc (4.7.0):
- Bolts (~> 1.1)
- FBSDKCoreKit/arc
- FBSDKShareKit (4.7.0):
- FBSDKCoreKit

DEPENDENCIES:
- AFNetworking (~> 2.6)
- FBSDKShareKit (~> 4.7)

SPEC CHECKSUMS:
AFNetworking: 8e4e60500beb8bec644cf575beee72990a76d399
Bolts: 805a4a87413e49d4a0c2b7d469084cbc46b09342
FBSDKCoreKit: eb580bfc2040ad44f4c0b4f4d0befb1d35bce59c
FBSDKShareKit: 1f927bb05e4d36a99d5d5bf2f4b1ff294ce3e15c

COCOAPODS: 0.39.0
Loading