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

Delegates #24

Open
wants to merge 2 commits 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions PartTwo/CustomViewDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// CustomViewDelegate.h
// PartTwo
//
// Created by Natalia Estrella on 9/18/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

#import <Foundation/Foundation.h>

@class CustomView;


@protocol CustomViewDelegate <NSObject>

- (void)socialMediaViewDidTapLikeButton:(CustomView *)view;

- (void)socialMediaViewDidTapCommentButton:(CustomView *)view;

- (void)socialMediaViewDidTapShareButton:(CustomView *)view;

@end
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 */
5104D5711BABBFD000606B78 /* CustomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5104D5701BABBFD000606B78 /* CustomView.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 */
5104D56F1BABBFD000606B78 /* CustomView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomView.h; sourceTree = "<group>"; };
5104D5701BABBFD000606B78 /* CustomView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomView.m; sourceTree = "<group>"; };
5104D5721BABC9DF00606B78 /* CustomViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomViewDelegate.h; path = ../CustomViewDelegate.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 @@ -105,6 +109,9 @@
8DD1034B1BA66E0900CE483B /* AppDelegate.m */,
8DD1034D1BA66E0900CE483B /* ViewController.h */,
8DD1034E1BA66E0900CE483B /* ViewController.m */,
5104D56F1BABBFD000606B78 /* CustomView.h */,
5104D5701BABBFD000606B78 /* CustomView.m */,
5104D5721BABC9DF00606B78 /* CustomViewDelegate.h */,
8DD103501BA66E0900CE483B /* Main.storyboard */,
8DD103531BA66E0900CE483B /* Assets.xcassets */,
8DD103551BA66E0900CE483B /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -271,6 +278,7 @@
buildActionMask = 2147483647;
files = (
8DD1034F1BA66E0900CE483B /* ViewController.m in Sources */,
5104D5711BABBFD000606B78 /* CustomView.m in Sources */,
8DD1034C1BA66E0900CE483B /* AppDelegate.m in Sources */,
8DD103491BA66E0900CE483B /* main.m in Sources */,
);
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,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
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>
5 changes: 3 additions & 2 deletions PartTwo/PartTwo/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="14E46" 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
83 changes: 79 additions & 4 deletions PartTwo/PartTwo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,25 +1,100 @@
<?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="14E46" 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"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6NW-jw-gFa" customClass="CustomView">
<rect key="frame" x="200" y="150" width="200" height="300"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="04b-HM-Hgb">
<rect key="frame" x="0.0" y="100" width="200" height="100"/>
<state key="normal" title="LIKE"/>
<connections>
<action selector="likeButtonTapped:" destination="6NW-jw-gFa" eventType="touchUpInside" id="X0M-Fx-Ani"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xKw-Oq-BxR">
<rect key="frame" x="0.0" y="0.0" width="200" height="100"/>
<state key="normal" title="COMMENT"/>
<connections>
<action selector="commentButtonTapped:" destination="6NW-jw-gFa" eventType="touchUpInside" id="JMA-Mo-AZ2"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SpS-PY-5fe">
<rect key="frame" x="0.0" y="200" width="200" height="100"/>
<state key="normal" title="SHARE"/>
<connections>
<action selector="shareButtonTapped:" destination="6NW-jw-gFa" eventType="touchUpInside" id="Anv-Ef-CdS"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="0.85796349419999995" blue="0.86445043210000005" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="04b-HM-Hgb" firstAttribute="centerY" secondItem="6NW-jw-gFa" secondAttribute="centerY" id="0yF-U9-v2G"/>
<constraint firstAttribute="width" constant="400" id="BDW-b1-rdN"/>
<constraint firstItem="SpS-PY-5fe" firstAttribute="top" secondItem="04b-HM-Hgb" secondAttribute="bottom" id="Crc-74-6RQ"/>
<constraint firstItem="SpS-PY-5fe" firstAttribute="height" secondItem="xKw-Oq-BxR" secondAttribute="height" id="LHw-N7-ouT"/>
<constraint firstAttribute="height" constant="150" id="Pqr-O3-IUI"/>
<constraint firstItem="04b-HM-Hgb" firstAttribute="top" secondItem="xKw-Oq-BxR" secondAttribute="bottom" id="QpE-rp-dt9"/>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="150" id="T2s-pJ-1Jk"/>
<constraint firstAttribute="trailing" secondItem="xKw-Oq-BxR" secondAttribute="trailing" id="TPi-nZ-PL6"/>
<constraint firstItem="xKw-Oq-BxR" firstAttribute="top" secondItem="6NW-jw-gFa" secondAttribute="top" id="YAM-7r-eiC"/>
<constraint firstItem="xKw-Oq-BxR" firstAttribute="leading" secondItem="6NW-jw-gFa" secondAttribute="leading" id="aEJ-hC-fCM"/>
<constraint firstAttribute="trailing" secondItem="SpS-PY-5fe" secondAttribute="trailing" id="d9J-jD-6Rl"/>
<constraint firstItem="SpS-PY-5fe" firstAttribute="leading" secondItem="6NW-jw-gFa" secondAttribute="leading" id="g2W-2J-KPY"/>
<constraint firstItem="04b-HM-Hgb" firstAttribute="width" secondItem="xKw-Oq-BxR" secondAttribute="width" id="hxW-c5-0XH"/>
<constraint firstAttribute="width" constant="200" id="iNY-3c-PfL"/>
<constraint firstItem="SpS-PY-5fe" firstAttribute="width" secondItem="xKw-Oq-BxR" secondAttribute="width" id="n7s-hl-rCT"/>
<constraint firstItem="xKw-Oq-BxR" firstAttribute="centerX" secondItem="6NW-jw-gFa" secondAttribute="centerX" id="nVJ-CY-M6J"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="400" id="nlm-1Y-Umj"/>
<constraint firstItem="04b-HM-Hgb" firstAttribute="centerX" secondItem="6NW-jw-gFa" secondAttribute="centerX" id="tUy-ny-d5N"/>
<constraint firstItem="SpS-PY-5fe" firstAttribute="centerX" secondItem="6NW-jw-gFa" secondAttribute="centerX" id="tkJ-e6-4hs"/>
<constraint firstAttribute="bottom" secondItem="SpS-PY-5fe" secondAttribute="bottom" id="u0y-eB-tHC"/>
<constraint firstItem="04b-HM-Hgb" firstAttribute="height" secondItem="xKw-Oq-BxR" secondAttribute="height" id="xOl-sF-UOU"/>
<constraint firstAttribute="height" constant="300" id="yLc-wx-ZvL"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="BDW-b1-rdN"/>
<exclude reference="Pqr-O3-IUI"/>
<exclude reference="T2s-pJ-1Jk"/>
<exclude reference="nlm-1Y-Umj"/>
</mask>
</variation>
<connections>
<outlet property="commentButton" destination="xKw-Oq-BxR" id="7na-SU-c6i"/>
<outlet property="likeButton" destination="04b-HM-Hgb" id="iPW-5r-hHw"/>
<outlet property="shareButton" destination="SpS-PY-5fe" id="YZc-kV-KTa"/>
</connections>
</view>
</subviews>
<color key="backgroundColor" red="1" green="0.97914456839999997" blue="0.28653356969999999" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="6NW-jw-gFa" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="aDJ-qQ-3JY"/>
<constraint firstItem="6NW-jw-gFa" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="hWR-bl-jDG"/>
</constraints>
</view>
<connections>
<outlet property="customView" destination="6NW-jw-gFa" id="dxz-b1-Y2R"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="245" y="238"/>
</scene>
</scenes>
</document>
17 changes: 17 additions & 0 deletions PartTwo/PartTwo/CustomView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// CustomView.h
// PartTwo
//
// Created by Natalia Estrella on 9/17/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

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

@interface CustomView : UIView

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


@end
Loading