Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions PartTwo/PartTwo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
45A741261BABF879007F7E60 /* SocialMediaView.m in Sources */ = {isa = PBXBuildFile; fileRef = 45A741251BABF879007F7E60 /* SocialMediaView.m */; 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 */; };
Expand Down Expand Up @@ -35,6 +36,9 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
45A741241BABF879007F7E60 /* SocialMediaView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocialMediaView.h; sourceTree = "<group>"; };
45A741251BABF879007F7E60 /* SocialMediaView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SocialMediaView.m; sourceTree = "<group>"; };
45A7412A1BABF901007F7E60 /* SocialMediaDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocialMediaDelegate.h; sourceTree = "<group>"; };
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 = "<group>"; };
8DD1034A1BA66E0900CE483B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -103,6 +107,9 @@
children = (
8DD1034A1BA66E0900CE483B /* AppDelegate.h */,
8DD1034B1BA66E0900CE483B /* AppDelegate.m */,
45A741241BABF879007F7E60 /* SocialMediaView.h */,
45A741251BABF879007F7E60 /* SocialMediaView.m */,
45A7412A1BABF901007F7E60 /* SocialMediaDelegate.h */,
8DD1034D1BA66E0900CE483B /* ViewController.h */,
8DD1034E1BA66E0900CE483B /* ViewController.m */,
8DD103501BA66E0900CE483B /* Main.storyboard */,
Expand Down Expand Up @@ -272,6 +279,7 @@
files = (
8DD1034F1BA66E0900CE483B /* ViewController.m in Sources */,
8DD1034C1BA66E0900CE483B /* AppDelegate.m in Sources */,
45A741261BABF879007F7E60 /* SocialMediaView.m in Sources */,
8DD103491BA66E0900CE483B /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -498,6 +506,7 @@
8DD103731BA66E0900CE483B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8DD103741BA66E0900CE483B /* Build configuration list for PBXNativeTarget "PartTwoTests" */ = {
isa = XCConfigurationList;
Expand All @@ -506,6 +515,7 @@
8DD103761BA66E0900CE483B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8DD103771BA66E0900CE483B /* Build configuration list for PBXNativeTarget "PartTwoUITests" */ = {
isa = XCConfigurationList;
Expand All @@ -514,6 +524,7 @@
8DD103791BA66E0900CE483B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
57 changes: 54 additions & 3 deletions PartTwo/PartTwo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,22 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
<viewController storyboardIdentifier="ViewController" id="BYZ-38-t0r" customClass="ViewController" 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>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nxe-Vt-cQj" customClass="SocialMediaView">
<rect key="frame" x="150" y="150" width="300" height="300"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QI7-SA-ZxB">
<rect key="frame" x="0.0" y="135" width="300" height="30"/>
<state key="normal" title="Like"/>
<connections>
<action selector="likeButtonTapped:" destination="nxe-Vt-cQj" eventType="touchUpInside" id="AEi-Kp-92e"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4aE-Na-yLT">
<rect key="frame" x="0.0" y="173" width="300" height="30"/>
<state key="normal" title="Share"/>
<connections>
<action selector="shareButtonTapped:" destination="nxe-Vt-cQj" eventType="touchUpInside" id="oFh-xY-Zh8"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="W35-Ia-0qp">
<rect key="frame" x="0.0" y="97" width="300" height="30"/>
<state key="normal" title="Comment"/>
<connections>
<action selector="commentButtonTapped:" destination="nxe-Vt-cQj" eventType="touchUpInside" id="Dw5-4W-Zas"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="0.64739188762626265" green="0.64739188762626265" blue="0.64739188762626265" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="W35-Ia-0qp" firstAttribute="leading" secondItem="nxe-Vt-cQj" secondAttribute="leading" id="9uv-hM-qWm"/>
<constraint firstAttribute="height" constant="300" id="AbA-oN-L5F"/>
<constraint firstItem="QI7-SA-ZxB" firstAttribute="centerY" secondItem="nxe-Vt-cQj" secondAttribute="centerY" id="BGC-XL-EfS"/>
<constraint firstItem="QI7-SA-ZxB" firstAttribute="leading" secondItem="nxe-Vt-cQj" secondAttribute="leading" id="HUy-DZ-y2G"/>
<constraint firstAttribute="trailing" secondItem="4aE-Na-yLT" secondAttribute="trailing" id="KZd-vW-DQU"/>
<constraint firstItem="4aE-Na-yLT" firstAttribute="leading" secondItem="nxe-Vt-cQj" secondAttribute="leading" id="NOa-HL-wDe"/>
<constraint firstItem="QI7-SA-ZxB" firstAttribute="top" secondItem="W35-Ia-0qp" secondAttribute="bottom" constant="8" id="RrP-lU-TlD"/>
<constraint firstItem="QI7-SA-ZxB" firstAttribute="centerX" secondItem="nxe-Vt-cQj" secondAttribute="centerX" id="cCI-y4-8Lf"/>
<constraint firstItem="4aE-Na-yLT" firstAttribute="top" secondItem="QI7-SA-ZxB" secondAttribute="bottom" constant="8" id="iRs-AB-DjP"/>
<constraint firstAttribute="trailing" secondItem="QI7-SA-ZxB" secondAttribute="trailing" id="tlx-VE-6kb"/>
<constraint firstAttribute="trailing" secondItem="W35-Ia-0qp" secondAttribute="trailing" id="uWE-VF-va7"/>
<constraint firstAttribute="width" constant="300" id="yY5-j0-W6c"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="nxe-Vt-cQj" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="EVS-n4-FjP"/>
<constraint firstItem="nxe-Vt-cQj" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="aYI-nv-RQ8"/>
</constraints>
</view>
<connections>
<outlet property="socialMediaView" destination="nxe-Vt-cQj" id="VWb-jJ-jsB"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
Expand Down
19 changes: 19 additions & 0 deletions PartTwo/PartTwo/SocialMediaDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// SocialMediaDelegate.h
// PartTwo
//
// Created by Chris David on 9/18/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

#import <Foundation/Foundation.h>

@class SocialMediaView;

@protocol SocialMediaDelegate <NSObject>

- (void)tapLikeButton:(SocialMediaView *)view;
- (void)tapCommentButton:(SocialMediaView *)view;
- (void)tapShareButton:(SocialMediaView *)view;

@end
16 changes: 16 additions & 0 deletions PartTwo/PartTwo/SocialMediaView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// SocialMediaView.h
// PartTwo
//
// Created by Chris David on 9/18/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SocialMediaDelegate.h"

@interface SocialMediaView : UIView

@property (nonatomic, weak) id <SocialMediaDelegate> delegate;

@end
26 changes: 26 additions & 0 deletions PartTwo/PartTwo/SocialMediaView.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// SocialMediaView.m
// PartTwo
//
// Created by Chris David on 9/18/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

#import "SocialMediaView.h"

@implementation SocialMediaView


- (IBAction)commentButtonTapped:(UIButton *)sender {
[self.delegate tapCommentButton:self];
}

- (IBAction)likeButtonTapped:(UIButton *)sender {
[self.delegate tapLikeButton:self];
}

- (IBAction)shareButtonTapped:(UIButton *)sender {
[self.delegate tapShareButton:self];
}

@end
26 changes: 21 additions & 5 deletions PartTwo/PartTwo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,37 @@
//

#import "ViewController.h"
#import "SocialMediaView.h"
#import "SocialMediaDelegate.h"

@interface ViewController () <SocialMediaDelegate>


@property (strong, nonatomic) IBOutlet SocialMediaView *socialMediaView;

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.socialMediaView.delegate = self;
}

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

- (void)tapCommentButton:(SocialMediaView *)view{
self.view.backgroundColor = [UIColor greenColor];
}

- (void)tapLikeButton:(SocialMediaView *)view{
self.view.backgroundColor = [UIColor blueColor];
}

- (void)tapShareButton:(SocialMediaView *)view{
self.view.backgroundColor = [UIColor redColor];
}


@end
4 changes: 4 additions & 0 deletions PickAPic/PickAPic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
45A174111BA79918008525C7 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 45A174101BA79918008525C7 /* MobileCoreServices.framework */; };
8D1F73C11BA66AE50040D369 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D1F73C01BA66AE50040D369 /* main.m */; };
8D1F73C41BA66AE50040D369 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D1F73C31BA66AE50040D369 /* AppDelegate.m */; };
8D1F73C71BA66AE50040D369 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D1F73C61BA66AE50040D369 /* ViewController.m */; };
Expand Down Expand Up @@ -35,6 +36,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
45A174101BA79918008525C7 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
8D1F73BC1BA66AE50040D369 /* PickAPic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PickAPic.app; sourceTree = BUILT_PRODUCTS_DIR; };
8D1F73C01BA66AE50040D369 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
8D1F73C21BA66AE50040D369 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
Expand All @@ -58,6 +60,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
45A174111BA79918008525C7 /* MobileCoreServices.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -81,6 +84,7 @@
8D1F73B31BA66AE50040D369 = {
isa = PBXGroup;
children = (
45A174101BA79918008525C7 /* MobileCoreServices.framework */,
8D1F73BE1BA66AE50040D369 /* PickAPic */,
8D1F73D81BA66AE50040D369 /* PickAPicTests */,
8D1F73E31BA66AE50040D369 /* PickAPicUITests */,
Expand Down
5 changes: 3 additions & 2 deletions PickAPic/PickAPic/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8154"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand Down
Loading