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
35 changes: 27 additions & 8 deletions PartTwo/PartTwo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
/* Begin PBXBuildFile section */
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 */; };
8DD103521BA66E0900CE483B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DD103501BA66E0900CE483B /* Main.storyboard */; };
8DD103541BA66E0900CE483B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8DD103531BA66E0900CE483B /* Assets.xcassets */; };
8DD103571BA66E0900CE483B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DD103551BA66E0900CE483B /* LaunchScreen.storyboard */; };
8DD103621BA66E0900CE483B /* PartTwoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DD103611BA66E0900CE483B /* PartTwoTests.m */; };
8DD1036D1BA66E0900CE483B /* PartTwoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DD1036C1BA66E0900CE483B /* PartTwoUITests.m */; };
AB5C55A31BAD00D300326F61 /* BackgroundViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB5C55A21BAD00D300326F61 /* BackgroundViewController.m */; };
AB5C55A71BAD017D00326F61 /* CustomView.m in Sources */ = {isa = PBXBuildFile; fileRef = AB5C55A61BAD017D00326F61 /* CustomView.m */; };
AB5C55A91BAD01CC00326F61 /* CustomView.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB5C55A81BAD01CC00326F61 /* CustomView.xib */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -39,8 +41,6 @@
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>"; };
8DD1034B1BA66E0900CE483B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
8DD1034D1BA66E0900CE483B /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
8DD1034E1BA66E0900CE483B /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
8DD103511BA66E0900CE483B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
8DD103531BA66E0900CE483B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
8DD103561BA66E0900CE483B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand All @@ -51,6 +51,12 @@
8DD103681BA66E0900CE483B /* PartTwoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PartTwoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
8DD1036C1BA66E0900CE483B /* PartTwoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PartTwoUITests.m; sourceTree = "<group>"; };
8DD1036E1BA66E0900CE483B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
AB5C55A11BAD00D300326F61 /* BackgroundViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackgroundViewController.h; sourceTree = "<group>"; };
AB5C55A21BAD00D300326F61 /* BackgroundViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BackgroundViewController.m; sourceTree = "<group>"; };
AB5C55A41BAD00F800326F61 /* CustomViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomViewDelegate.h; sourceTree = "<group>"; };
AB5C55A51BAD017D00326F61 /* CustomView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomView.h; sourceTree = "<group>"; };
AB5C55A61BAD017D00326F61 /* CustomView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomView.m; sourceTree = "<group>"; };
AB5C55A81BAD01CC00326F61 /* CustomView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CustomView.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -103,8 +109,12 @@
children = (
8DD1034A1BA66E0900CE483B /* AppDelegate.h */,
8DD1034B1BA66E0900CE483B /* AppDelegate.m */,
8DD1034D1BA66E0900CE483B /* ViewController.h */,
8DD1034E1BA66E0900CE483B /* ViewController.m */,
AB5C55A11BAD00D300326F61 /* BackgroundViewController.h */,
AB5C55A21BAD00D300326F61 /* BackgroundViewController.m */,
AB5C55A41BAD00F800326F61 /* CustomViewDelegate.h */,
AB5C55A51BAD017D00326F61 /* CustomView.h */,
AB5C55A61BAD017D00326F61 /* CustomView.m */,
AB5C55A81BAD01CC00326F61 /* CustomView.xib */,
8DD103501BA66E0900CE483B /* Main.storyboard */,
8DD103531BA66E0900CE483B /* Assets.xcassets */,
8DD103551BA66E0900CE483B /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -244,6 +254,7 @@
buildActionMask = 2147483647;
files = (
8DD103571BA66E0900CE483B /* LaunchScreen.storyboard in Resources */,
AB5C55A91BAD01CC00326F61 /* CustomView.xib in Resources */,
8DD103541BA66E0900CE483B /* Assets.xcassets in Resources */,
8DD103521BA66E0900CE483B /* Main.storyboard in Resources */,
);
Expand All @@ -270,8 +281,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8DD1034F1BA66E0900CE483B /* ViewController.m in Sources */,
8DD1034C1BA66E0900CE483B /* AppDelegate.m in Sources */,
AB5C55A71BAD017D00326F61 /* CustomView.m in Sources */,
AB5C55A31BAD00D300326F61 /* BackgroundViewController.m in Sources */,
8DD103491BA66E0900CE483B /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -412,7 +424,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = PartTwo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.PartTwo;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -424,7 +436,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = PartTwo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.PartTwo;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -436,6 +448,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = PartTwoTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.PartTwoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -448,6 +461,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = PartTwoTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.PartTwoTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -459,6 +473,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = PartTwoUITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.PartTwoUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -471,6 +486,7 @@
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = PartTwoUITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.PartTwoUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -498,6 +514,7 @@
8DD103731BA66E0900CE483B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8DD103741BA66E0900CE483B /* Build configuration list for PBXNativeTarget "PartTwoTests" */ = {
isa = XCConfigurationList;
Expand All @@ -506,6 +523,7 @@
8DD103761BA66E0900CE483B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8DD103771BA66E0900CE483B /* Build configuration list for PBXNativeTarget "PartTwoUITests" */ = {
isa = XCConfigurationList;
Expand All @@ -514,6 +532,7 @@
8DD103791BA66E0900CE483B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
13 changes: 13 additions & 0 deletions PartTwo/PartTwo/BackgroundViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// BackgroundViewController.h
// PartTwo
//
// Created by Bereket on 9/18/15.
// Copyright (c) 2015 Mike Kavouras. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface BackgroundViewController : UIViewController

@end
64 changes: 64 additions & 0 deletions PartTwo/PartTwo/BackgroundViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//
// BackgroundViewController.m
// PartTwo
//
// Created by Bereket on 9/18/15.
// Copyright (c) 2015 Mike Kavouras. All rights reserved.
//

#import "BackgroundViewController.h"
#import "CustomView.h"
#import "CustomViewDelegate.h"

@interface BackgroundViewController () <CustomViewDelegate>

@property (strong, nonatomic) IBOutlet UIView *customViewContainer;

@property (nonatomic) CustomView *customView;
@end

@implementation BackgroundViewController

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

NSArray *views = [[NSBundle mainBundle] loadNibNamed:@"CustomView" owner:self options:nil];
self.customView = [views firstObject];

[self.customViewContainer addSubview:self.customView];
self.customView.frame = self.customViewContainer.bounds;

self.customView.delegate = self;


}


- (void)socialMediaViewDidTapLikeButton:(CustomView *)view {
self.view.backgroundColor = [UIColor blueColor];
}
- (void)socialMediaViewDidTapCommentButton:(CustomView *)view {
self.view.backgroundColor = [UIColor greenColor];
}
- (void)socialMediaViewDidTapShareButton:(CustomView *)view{
self.view.backgroundColor = [UIColor redColor];
}


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

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/

@end
23 changes: 19 additions & 4 deletions PartTwo/PartTwo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
<?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="7706" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<scenes>
<!--View Controller-->
<!--Background View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="BackgroundViewController" 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="8ky-UX-ah7">
<rect key="frame" x="197" y="127" width="207" height="346"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="centerX" secondItem="8ky-UX-ah7" secondAttribute="centerX" id="ZLT-vm-bMj"/>
<constraint firstItem="8ky-UX-ah7" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="107" id="eQv-cD-LtX"/>
<constraint firstAttribute="centerY" secondItem="8ky-UX-ah7" secondAttribute="centerY" id="rbj-gP-4Td"/>
<constraint firstItem="8ky-UX-ah7" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="197" id="tF9-PS-dKZ"/>
</constraints>
</view>
<connections>
<outlet property="customViewContainer" destination="8ky-UX-ah7" id="1Ow-MU-djI"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
Expand Down
16 changes: 16 additions & 0 deletions PartTwo/PartTwo/CustomView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// CustomView.h
// PartTwo
//
// Created by Bereket on 9/18/15.
// Copyright (c) 2015 Mike Kavouras. All rights reserved.
//

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

@interface CustomView : UIView

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

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

#import "CustomView.h"

@implementation CustomView

- (IBAction)likeButton:(id)sender {
[self.delegate socialMediaViewDidTapLikeButton:self];
}

- (IBAction)commentButton:(id)sender {
[self.delegate socialMediaViewDidTapCommentButton:self];
}

- (IBAction)shareButton:(id)sender {
[self.delegate socialMediaViewDidTapShareButton:self];
}


@end
52 changes: 52 additions & 0 deletions PartTwo/PartTwo/CustomView.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="CustomView">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZF3-YS-uEA">
<rect key="frame" x="275" y="361" width="51" height="30"/>
<state key="normal" title="SHARE">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="shareButton:" destination="iN0-l3-epB" eventType="touchUpInside" id="onJ-94-j7z"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ONU-CN-Q7V">
<rect key="frame" x="261" y="285" width="79" height="30"/>
<state key="normal" title="COMMENT">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="commentButton:" destination="iN0-l3-epB" eventType="touchUpInside" id="7Ck-te-N9h"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="s0w-hb-VQO">
<rect key="frame" x="277" y="200" width="32" height="30"/>
<state key="normal" title="LIKE">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="likeButton:" destination="iN0-l3-epB" eventType="touchUpInside" id="Tog-JC-jkH"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="ZF3-YS-uEA" firstAttribute="top" secondItem="ONU-CN-Q7V" secondAttribute="bottom" constant="46" id="9Sb-Ai-lgW"/>
<constraint firstItem="ONU-CN-Q7V" firstAttribute="top" secondItem="s0w-hb-VQO" secondAttribute="bottom" constant="55" id="BOT-F9-ddb"/>
<constraint firstAttribute="centerX" secondItem="ONU-CN-Q7V" secondAttribute="centerX" id="Gsf-zC-Ews"/>
<constraint firstItem="s0w-hb-VQO" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="277" id="bGS-26-YKF"/>
<constraint firstAttribute="centerY" secondItem="ONU-CN-Q7V" secondAttribute="centerY" id="ryT-rU-qXw"/>
<constraint firstAttribute="centerX" secondItem="ZF3-YS-uEA" secondAttribute="centerX" id="tML-sY-nes"/>
</constraints>
</view>
</objects>
</document>
Loading