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 */
8932E2FA1BACDE370028A720 /* SocialMediaView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8932E2F91BACDE370028A720 /* 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 */
8932E2F71BACDE1B0028A720 /* protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = protocol.h; sourceTree = "<group>"; };
8932E2F81BACDE370028A720 /* SocialMediaView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocialMediaView.h; sourceTree = "<group>"; };
8932E2F91BACDE370028A720 /* SocialMediaView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SocialMediaView.m; 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 @@ -105,6 +109,9 @@
8DD1034B1BA66E0900CE483B /* AppDelegate.m */,
8DD1034D1BA66E0900CE483B /* ViewController.h */,
8DD1034E1BA66E0900CE483B /* ViewController.m */,
8932E2F81BACDE370028A720 /* SocialMediaView.h */,
8932E2F91BACDE370028A720 /* SocialMediaView.m */,
8932E2F71BACDE1B0028A720 /* protocol.h */,
8DD103501BA66E0900CE483B /* Main.storyboard */,
8DD103531BA66E0900CE483B /* Assets.xcassets */,
8DD103551BA66E0900CE483B /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -272,6 +279,7 @@
files = (
8DD1034F1BA66E0900CE483B /* ViewController.m in Sources */,
8DD1034C1BA66E0900CE483B /* AppDelegate.m in Sources */,
8932E2FA1BACDE370028A720 /* 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
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD103431BA66E0900CE483B"
BuildableName = "PartTwo.app"
BlueprintName = "PartTwo"
ReferencedContainer = "container:PartTwo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD1035C1BA66E0900CE483B"
BuildableName = "PartTwoTests.xctest"
BlueprintName = "PartTwoTests"
ReferencedContainer = "container:PartTwo.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD103671BA66E0900CE483B"
BuildableName = "PartTwoUITests.xctest"
BlueprintName = "PartTwoUITests"
ReferencedContainer = "container:PartTwo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD103431BA66E0900CE483B"
BuildableName = "PartTwo.app"
BlueprintName = "PartTwo"
ReferencedContainer = "container:PartTwo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD103431BA66E0900CE483B"
BuildableName = "PartTwo.app"
BlueprintName = "PartTwo"
ReferencedContainer = "container:PartTwo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DD103431BA66E0900CE483B"
BuildableName = "PartTwo.app"
BlueprintName = "PartTwo"
ReferencedContainer = "container:PartTwo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>PartTwo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>8DD103431BA66E0900CE483B</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>8DD1035C1BA66E0900CE483B</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>8DD103671BA66E0900CE483B</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
53 changes: 50 additions & 3 deletions PartTwo/PartTwo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,22 +1,69 @@
<?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 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="6aN-GP-SPW" customClass="SocialMediaView">
<rect key="frame" x="175" y="175" width="250" height="250"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F7H-ik-NIf">
<rect key="frame" x="105" y="165" width="40" height="30"/>
<state key="normal" title="Share"/>
<connections>
<action selector="shareButtonTapped:" destination="6aN-GP-SPW" eventType="touchUpInside" id="Y6c-7I-5Gb"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pXr-Wy-FA6">
<rect key="frame" x="110" y="55" width="30" height="30"/>
<state key="normal" title="Like"/>
<connections>
<action selector="likeButtonTapped:" destination="6aN-GP-SPW" eventType="touchUpInside" id="9Tm-FR-ZpS"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="UXp-D7-Eve">
<rect key="frame" x="91" y="110" width="67" height="30"/>
<state key="normal" title="Comment"/>
<connections>
<action selector="commentButtonTapped:" destination="6aN-GP-SPW" eventType="touchUpInside" id="bQj-09-RKm"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="0.94748263888888884" green="0.94748263888888884" blue="0.94748263888888884" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="250" id="5JQ-Va-CM9"/>
<constraint firstItem="UXp-D7-Eve" firstAttribute="centerY" secondItem="6aN-GP-SPW" secondAttribute="centerY" id="8mb-h1-asP"/>
<constraint firstItem="pXr-Wy-FA6" firstAttribute="centerX" secondItem="6aN-GP-SPW" secondAttribute="centerX" id="DoD-Nz-TiU"/>
<constraint firstItem="F7H-ik-NIf" firstAttribute="top" secondItem="UXp-D7-Eve" secondAttribute="bottom" constant="25" id="H2K-zd-aPC"/>
<constraint firstItem="UXp-D7-Eve" firstAttribute="centerX" secondItem="6aN-GP-SPW" secondAttribute="centerX" id="Vgm-Or-sQE"/>
<constraint firstItem="F7H-ik-NIf" firstAttribute="centerX" secondItem="6aN-GP-SPW" secondAttribute="centerX" id="hkj-gP-Ao9"/>
<constraint firstItem="UXp-D7-Eve" firstAttribute="top" secondItem="pXr-Wy-FA6" secondAttribute="bottom" constant="25" id="u5B-Td-LAO"/>
<constraint firstAttribute="width" constant="250" id="u66-Eo-f0m"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="6aN-GP-SPW" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="5oV-Xr-e9b"/>
<constraint firstItem="6aN-GP-SPW" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="RgX-QT-iMv"/>
</constraints>
</view>
<connections>
<outlet property="SocialMediaView" destination="6aN-GP-SPW" id="uK4-BM-o8n"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
Expand Down
17 changes: 17 additions & 0 deletions PartTwo/PartTwo/SocialMediaView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// SocialMediaView.h
// PartTwo
//
// Created by Lauren Caponong on 9/18/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

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


@interface SocialMediaView : UIView

@property (nonatomic, weak) id <protocol> 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 Lauren Caponong on 9/18/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

#import "SocialMediaView.h"


@implementation SocialMediaView

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

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

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

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

#import "ViewController.h"
#import "protocol.h"
#import "SocialMediaView.h"

@interface ViewController ()
@interface ViewController () <protocol>

@property (weak, nonatomic) IBOutlet SocialMediaView *SocialMediaView;

@end



@implementation ViewController

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

self.SocialMediaView.delegate = self;

}


- (void)socialMediaViewDidTapLikeButton:(SocialMediaView *)view {

self.view.backgroundColor = [UIColor blueColor];
NSLog(@"You like this");
}


- (void)socialMediaViewDidTapCommentButton:(SocialMediaView *)view {

self.view.backgroundColor = [UIColor greenColor];
NSLog(@"You comment on this");
}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
- (void)socialMediaViewDidTapShareButton:(SocialMediaView *)view {

self.view.backgroundColor = [UIColor purpleColor];
NSLog(@"You share this!");
}

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

#import <Foundation/Foundation.h>

@class SocialMediaView;

@protocol protocol <NSObject>

- (void)socialMediaViewDidTapLikeButton:(SocialMediaView *)view;
- (void)socialMediaViewDidTapCommentButton:(SocialMediaView *)view;
- (void)socialMediaViewDidTapShareButton:(SocialMediaView *)view;

@end
Binary file not shown.
Loading