diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/PartTwo/.DS_Store b/PartTwo/.DS_Store new file mode 100644 index 0000000..c7f21fe Binary files /dev/null and b/PartTwo/.DS_Store differ diff --git a/PartTwo/PartTwo.xcodeproj/project.pbxproj b/PartTwo/PartTwo.xcodeproj/project.pbxproj index 5582517..5a7ff0c 100644 --- a/PartTwo/PartTwo.xcodeproj/project.pbxproj +++ b/PartTwo/PartTwo.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 22DE3D441BACBDB200153600 /* CustomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 22DE3D431BACBDB200153600 /* CustomView.m */; settings = {ASSET_TAGS = (); }; }; + 22DE3D461BACBDD600153600 /* CustomView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22DE3D451BACBDD600153600 /* CustomView.xib */; settings = {ASSET_TAGS = (); }; }; 8DD103491BA66E0900CE483B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DD103481BA66E0900CE483B /* main.m */; }; 8DD1034C1BA66E0900CE483B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DD1034B1BA66E0900CE483B /* AppDelegate.m */; }; 8DD1034F1BA66E0900CE483B /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DD1034E1BA66E0900CE483B /* ViewController.m */; }; @@ -35,6 +37,10 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 22DE3D411BACBAEA00153600 /* CustomViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomViewDelegate.h; sourceTree = ""; }; + 22DE3D421BACBDB200153600 /* CustomView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomView.h; sourceTree = ""; }; + 22DE3D431BACBDB200153600 /* CustomView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomView.m; sourceTree = ""; }; + 22DE3D451BACBDD600153600 /* CustomView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CustomView.xib; sourceTree = ""; }; 8DD103441BA66E0900CE483B /* PartTwo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PartTwo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 8DD103481BA66E0900CE483B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 8DD1034A1BA66E0900CE483B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -105,6 +111,10 @@ 8DD1034B1BA66E0900CE483B /* AppDelegate.m */, 8DD1034D1BA66E0900CE483B /* ViewController.h */, 8DD1034E1BA66E0900CE483B /* ViewController.m */, + 22DE3D411BACBAEA00153600 /* CustomViewDelegate.h */, + 22DE3D421BACBDB200153600 /* CustomView.h */, + 22DE3D431BACBDB200153600 /* CustomView.m */, + 22DE3D451BACBDD600153600 /* CustomView.xib */, 8DD103501BA66E0900CE483B /* Main.storyboard */, 8DD103531BA66E0900CE483B /* Assets.xcassets */, 8DD103551BA66E0900CE483B /* LaunchScreen.storyboard */, @@ -244,6 +254,7 @@ buildActionMask = 2147483647; files = ( 8DD103571BA66E0900CE483B /* LaunchScreen.storyboard in Resources */, + 22DE3D461BACBDD600153600 /* CustomView.xib in Resources */, 8DD103541BA66E0900CE483B /* Assets.xcassets in Resources */, 8DD103521BA66E0900CE483B /* Main.storyboard in Resources */, ); @@ -271,6 +282,7 @@ buildActionMask = 2147483647; files = ( 8DD1034F1BA66E0900CE483B /* ViewController.m in Sources */, + 22DE3D441BACBDB200153600 /* CustomView.m in Sources */, 8DD1034C1BA66E0900CE483B /* AppDelegate.m in Sources */, 8DD103491BA66E0900CE483B /* main.m in Sources */, ); @@ -498,6 +510,7 @@ 8DD103731BA66E0900CE483B /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 8DD103741BA66E0900CE483B /* Build configuration list for PBXNativeTarget "PartTwoTests" */ = { isa = XCConfigurationList; @@ -506,6 +519,7 @@ 8DD103761BA66E0900CE483B /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 8DD103771BA66E0900CE483B /* Build configuration list for PBXNativeTarget "PartTwoUITests" */ = { isa = XCConfigurationList; @@ -514,6 +528,7 @@ 8DD103791BA66E0900CE483B /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/PartTwo/PartTwo.xcodeproj/project.xcworkspace/xcuserdata/danieldistant.xcuserdatad/UserInterfaceState.xcuserstate b/PartTwo/PartTwo.xcodeproj/project.xcworkspace/xcuserdata/danieldistant.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..3a4373e Binary files /dev/null and b/PartTwo/PartTwo.xcodeproj/project.xcworkspace/xcuserdata/danieldistant.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/PartTwo/PartTwo.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/PartTwo/PartTwo.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/PartTwo/PartTwo.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/PartTwo/PartTwo.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcschemes/PartTwo.xcscheme b/PartTwo/PartTwo.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcschemes/PartTwo.xcscheme new file mode 100644 index 0000000..7b83b68 --- /dev/null +++ b/PartTwo/PartTwo.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcschemes/PartTwo.xcscheme @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PartTwo/PartTwo.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcschemes/xcschememanagement.plist b/PartTwo/PartTwo.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..8d9c097 --- /dev/null +++ b/PartTwo/PartTwo.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,32 @@ + + + + + SchemeUserState + + PartTwo.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8DD103431BA66E0900CE483B + + primary + + + 8DD1035C1BA66E0900CE483B + + primary + + + 8DD103671BA66E0900CE483B + + primary + + + + + diff --git a/PartTwo/PartTwo/Base.lproj/Main.storyboard b/PartTwo/PartTwo/Base.lproj/Main.storyboard index f56d2f3..ccdf21c 100644 --- a/PartTwo/PartTwo/Base.lproj/Main.storyboard +++ b/PartTwo/PartTwo/Base.lproj/Main.storyboard @@ -1,13 +1,14 @@ - + - + + - + @@ -15,11 +16,29 @@ + + + + + + + + + + + + + + + + + + diff --git a/PartTwo/PartTwo/CustomView.h b/PartTwo/PartTwo/CustomView.h new file mode 100644 index 0000000..bdf7748 --- /dev/null +++ b/PartTwo/PartTwo/CustomView.h @@ -0,0 +1,16 @@ +// +// CustomView.h +// PartTwo +// +// Created by Daniel Distant on 9/18/15. +// Copyright © 2015 Mike Kavouras. All rights reserved. +// + +#import +#import "CustomViewDelegate.h" + +@interface CustomView : UIView + +@property (nonatomic, weak) id delegate; + +@end diff --git a/PartTwo/PartTwo/CustomView.m b/PartTwo/PartTwo/CustomView.m new file mode 100644 index 0000000..f89b444 --- /dev/null +++ b/PartTwo/PartTwo/CustomView.m @@ -0,0 +1,42 @@ +// +// CustomView.m +// PartTwo +// +// Created by Daniel Distant on 9/18/15. +// Copyright © 2015 Mike Kavouras. All rights reserved. +// + +#import "CustomView.h" + +@implementation CustomView + +-(void)socialMediaViewDidTapLikeButton:(CustomView *)view { + [self.delegate socialMediaViewDidTapLikeButton:view]; +} + +-(void)socialMediaViewDidTapCommentButton:(CustomView *)view { + [self.delegate socialMediaViewDidTapCommentButton:view]; +} + +-(void)socialMediaViewDidTapShareButton:(CustomView *)view { + [self.delegate socialMediaViewDidTapShareButton:view]; +} + +- (IBAction)likeButtonTapped:(id)sender { + CustomView *view = [[CustomView alloc] init]; + [self socialMediaViewDidTapLikeButton:view]; +} + +- (IBAction)commentButtonTapped:(id)sender { + CustomView *view = [[CustomView alloc] init]; + [self socialMediaViewDidTapCommentButton:view]; +} + +- (IBAction)shareButtonTapped:(id)sender { + CustomView *view = [[CustomView alloc] init]; + [self socialMediaViewDidTapShareButton:view]; +} + + + +@end diff --git a/PartTwo/PartTwo/CustomView.xib b/PartTwo/PartTwo/CustomView.xib new file mode 100644 index 0000000..307c451 --- /dev/null +++ b/PartTwo/PartTwo/CustomView.xib @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PartTwo/PartTwo/CustomViewDelegate.h b/PartTwo/PartTwo/CustomViewDelegate.h new file mode 100644 index 0000000..9d7aeff --- /dev/null +++ b/PartTwo/PartTwo/CustomViewDelegate.h @@ -0,0 +1,27 @@ +// +// CustomViewDelegate.h +// PartTwo +// +// Created by Daniel Distant on 9/18/15. +// Copyright © 2015 Mike Kavouras. All rights reserved. +// + +#import +@class CustomView; + +@protocol CustomViewDelegate + +-(void)socialMediaViewDidTapLikeButton:(CustomView *)view; + +-(void)socialMediaViewDidTapCommentButton:(CustomView *)view; + +-(void)socialMediaViewDidTapShareButton:(CustomView *)view; + +@optional + +-(void) changeToBlueColor; +-(void) changeToRedColor; +-(void) changeToGreenColor; + + +@end diff --git a/PartTwo/PartTwo/ViewController.h b/PartTwo/PartTwo/ViewController.h index cb5d98b..9157f46 100644 --- a/PartTwo/PartTwo/ViewController.h +++ b/PartTwo/PartTwo/ViewController.h @@ -7,8 +7,10 @@ // #import +#import "CustomViewDelegate.h" +#import "CustomView.h" -@interface ViewController : UIViewController +@interface ViewController : UIViewController @end diff --git a/PartTwo/PartTwo/ViewController.m b/PartTwo/PartTwo/ViewController.m index adca251..fba6ffe 100644 --- a/PartTwo/PartTwo/ViewController.m +++ b/PartTwo/PartTwo/ViewController.m @@ -8,7 +8,10 @@ #import "ViewController.h" + @interface ViewController () +@property (weak, nonatomic) IBOutlet UIView *customViewContainer; + @end @@ -16,12 +19,51 @@ @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. + + CustomView *customView = [[CustomView alloc] init]; + + NSArray *views = [[NSBundle mainBundle] loadNibNamed:@"CustomView" owner:self options:nil]; + customView = [views firstObject]; + [self.customViewContainer addSubview: customView]; + customView.frame = self.customViewContainer.bounds; + customView.delegate = self; +} + +-(void)socialMediaViewDidTapLikeButton:(CustomView *)view { + self.view.layer.backgroundColor = [UIColor blueColor].CGColor; + NSLog(@"changed to blue"); } -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. +-(void)socialMediaViewDidTapCommentButton:(CustomView *)view { + self.view.layer.backgroundColor = [UIColor greenColor].CGColor; + NSLog(@"changed to green"); + } +-(void)socialMediaViewDidTapShareButton:(CustomView *)view { + self.view.layer.backgroundColor = [UIColor redColor].CGColor; + NSLog(@"changed to red"); + +} + +-(void)sendString:(NSString *)string { + + NSLog(@"%@", string); +} + + + + + + + + + + + + + + + + @end diff --git a/PickAPic/.DS_Store b/PickAPic/.DS_Store new file mode 100644 index 0000000..5442ae6 Binary files /dev/null and b/PickAPic/.DS_Store differ diff --git a/PickAPic/PickAPic.xcodeproj/project.pbxproj b/PickAPic/PickAPic.xcodeproj/project.pbxproj index 049896b..734bcac 100644 --- a/PickAPic/PickAPic.xcodeproj/project.pbxproj +++ b/PickAPic/PickAPic.xcodeproj/project.pbxproj @@ -207,6 +207,7 @@ TargetAttributes = { 8D1F73BB1BA66AE50040D369 = { CreatedOnToolsVersion = 7.0; + DevelopmentTeam = N2DCZ2U592; }; 8D1F73D41BA66AE50040D369 = { CreatedOnToolsVersion = 7.0; @@ -411,11 +412,14 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = PickAPic/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.2; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.PickAPic; + PRODUCT_BUNDLE_IDENTIFIER = com.danieldistant.PickAPic; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; }; name = Debug; }; @@ -423,11 +427,14 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = PickAPic/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.2; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.PickAPic; + PRODUCT_BUNDLE_IDENTIFIER = com.danieldistant.PickAPic; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; }; name = Release; }; diff --git a/PickAPic/PickAPic.xcodeproj/project.xcworkspace/xcshareddata/PickAPic.xccheckout b/PickAPic/PickAPic.xcodeproj/project.xcworkspace/xcshareddata/PickAPic.xccheckout new file mode 100644 index 0000000..fdcabdf --- /dev/null +++ b/PickAPic/PickAPic.xcodeproj/project.xcworkspace/xcshareddata/PickAPic.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + E463923F-CC72-4C1B-8E09-1196F91D5056 + IDESourceControlProjectName + project + IDESourceControlProjectOriginsDictionary + + 30574ED234DE2144597F5C1E54D4E002E32C4ECC + https://github.com/accesscode-2-2/unit-2-hw-0.git + + IDESourceControlProjectPath + PickAPic/PickAPic.xcodeproj/project.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + 30574ED234DE2144597F5C1E54D4E002E32C4ECC + ../../.. + + IDESourceControlProjectURL + https://github.com/accesscode-2-2/unit-2-hw-0.git + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + 30574ED234DE2144597F5C1E54D4E002E32C4ECC + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 30574ED234DE2144597F5C1E54D4E002E32C4ECC + IDESourceControlWCCName + unit-2-hw-0 + + + + diff --git a/PickAPic/PickAPic.xcodeproj/project.xcworkspace/xcuserdata/danieldistant.xcuserdatad/UserInterfaceState.xcuserstate b/PickAPic/PickAPic.xcodeproj/project.xcworkspace/xcuserdata/danieldistant.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..6a59f9f Binary files /dev/null and b/PickAPic/PickAPic.xcodeproj/project.xcworkspace/xcuserdata/danieldistant.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/PickAPic/PickAPic.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcschemes/PickAPic.xcscheme b/PickAPic/PickAPic.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcschemes/PickAPic.xcscheme new file mode 100644 index 0000000..682c3c8 --- /dev/null +++ b/PickAPic/PickAPic.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcschemes/PickAPic.xcscheme @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PickAPic/PickAPic.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcschemes/xcschememanagement.plist b/PickAPic/PickAPic.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..bb91a10 --- /dev/null +++ b/PickAPic/PickAPic.xcodeproj/xcuserdata/danieldistant.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,32 @@ + + + + + SchemeUserState + + PickAPic.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8D1F73BB1BA66AE50040D369 + + primary + + + 8D1F73D41BA66AE50040D369 + + primary + + + 8D1F73DF1BA66AE50040D369 + + primary + + + + + diff --git a/PickAPic/PickAPic/Base.lproj/Main.storyboard b/PickAPic/PickAPic/Base.lproj/Main.storyboard index f055f71..e10b7d3 100644 --- a/PickAPic/PickAPic/Base.lproj/Main.storyboard +++ b/PickAPic/PickAPic/Base.lproj/Main.storyboard @@ -16,12 +16,61 @@ - + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/PickAPic/PickAPic/ViewController.m b/PickAPic/PickAPic/ViewController.m index acd6613..e4913e2 100644 --- a/PickAPic/PickAPic/ViewController.m +++ b/PickAPic/PickAPic/ViewController.m @@ -8,11 +8,46 @@ #import "ViewController.h" -@interface ViewController () - +@interface ViewController () +@property (weak, nonatomic) IBOutlet UIButton *cameraRollButton; +@property (weak, nonatomic) IBOutlet UIImageView *pictureImageView; +@property (nonatomic) UIImagePickerController *imagePicker; @end @implementation ViewController +- (IBAction)cameraRollButtonTapped:(id)sender { + + _imagePicker = [[UIImagePickerController alloc] init]; + _imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + _imagePicker.delegate = self; + [_imagePicker setAllowsEditing:NO]; + [self presentViewController:_imagePicker animated:YES completion:nil]; +} + +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { + + picker = _imagePicker; + UIImage *imageChosen = info[UIImagePickerControllerOriginalImage]; + _pictureImageView.image = imageChosen; +// _pictureImageView.contentScaleFactor + [self dismissViewControllerAnimated:YES completion:nil]; +} + +-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { + + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (IBAction)takePhotoButtonTapped:(id)sender { + + _imagePicker = [[UIImagePickerController alloc] init]; + _imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; + _imagePicker.delegate = self; + [_imagePicker setAllowsEditing:YES]; + [self presentViewController:_imagePicker animated:YES completion:nil]; + +} + @end