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
Binary file added PartTwo/.DS_Store
Binary file not shown.
11 changes: 11 additions & 0 deletions PartTwo/PartTwo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
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 */; };
D9E987E41BA9C2F100DD7F6D /* SocialMediaView.m in Sources */ = {isa = PBXBuildFile; fileRef = D9E987E31BA9C2F100DD7F6D /* SocialMediaView.m */; settings = {ASSET_TAGS = (); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -51,6 +52,9 @@
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>"; };
D9E987E21BA9C2F100DD7F6D /* SocialMediaView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocialMediaView.h; sourceTree = "<group>"; };
D9E987E31BA9C2F100DD7F6D /* SocialMediaView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SocialMediaView.m; sourceTree = "<group>"; };
D9E987E51BA9C56500DD7F6D /* SocialMediaViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocialMediaViewDelegate.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -105,6 +109,9 @@
8DD1034B1BA66E0900CE483B /* AppDelegate.m */,
8DD1034D1BA66E0900CE483B /* ViewController.h */,
8DD1034E1BA66E0900CE483B /* ViewController.m */,
D9E987E21BA9C2F100DD7F6D /* SocialMediaView.h */,
D9E987E31BA9C2F100DD7F6D /* SocialMediaView.m */,
D9E987E51BA9C56500DD7F6D /* SocialMediaViewDelegate.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 */,
D9E987E41BA9C2F100DD7F6D /* 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,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>
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="stU-TQ-twe" customClass="SocialMediaView">
<rect key="frame" x="200" y="200" width="200" height="200"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="e0M-Q2-dYm">
<rect key="frame" x="85" y="85" width="30" height="30"/>
<state key="normal" title="Like"/>
<connections>
<action selector="likeButtonTapped:" destination="stU-TQ-twe" eventType="touchUpInside" id="ryB-p1-01F"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CI0-Sf-B6W">
<rect key="frame" x="67" y="35" width="67" height="30"/>
<state key="normal" title="Comment"/>
<connections>
<action selector="commentButtonTapped:" destination="stU-TQ-twe" eventType="touchUpInside" id="KbN-JD-adT"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xC0-gb-W06">
<rect key="frame" x="80" y="135" width="40" height="30"/>
<state key="normal" title="Share"/>
<connections>
<action selector="shareButtonTapped:" destination="stU-TQ-twe" eventType="touchUpInside" id="m3Q-wF-I5a"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="200" id="3uA-mb-M0a"/>
<constraint firstItem="xC0-gb-W06" firstAttribute="top" secondItem="e0M-Q2-dYm" secondAttribute="bottom" constant="20" id="IAz-on-3Rr"/>
<constraint firstItem="e0M-Q2-dYm" firstAttribute="top" secondItem="CI0-Sf-B6W" secondAttribute="bottom" constant="20" id="N7X-Fd-G12"/>
<constraint firstItem="e0M-Q2-dYm" firstAttribute="centerY" secondItem="stU-TQ-twe" secondAttribute="centerY" id="Zfo-CZ-WLV"/>
<constraint firstItem="e0M-Q2-dYm" firstAttribute="centerX" secondItem="stU-TQ-twe" secondAttribute="centerX" id="cPs-FK-3jX"/>
<constraint firstItem="xC0-gb-W06" firstAttribute="centerX" secondItem="stU-TQ-twe" secondAttribute="centerX" id="rCp-X0-YMf"/>
<constraint firstItem="CI0-Sf-B6W" firstAttribute="centerX" secondItem="stU-TQ-twe" secondAttribute="centerX" id="w7D-b9-j6T"/>
<constraint firstAttribute="width" constant="200" id="yZf-eF-0HY"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="stU-TQ-twe" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="iOy-Z7-uyt"/>
<constraint firstItem="stU-TQ-twe" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="vjd-cx-ACW"/>
</constraints>
</view>
<connections>
<outlet property="socialMediaView" destination="stU-TQ-twe" id="lJh-Py-IWU"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
Expand Down
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 Xiulan Shi on 9/16/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

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

@interface SocialMediaView : UIView

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

@end
28 changes: 28 additions & 0 deletions PartTwo/PartTwo/SocialMediaView.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// SocialMediaView.m
// PartTwo
//
// Created by Xiulan Shi on 9/16/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
17 changes: 17 additions & 0 deletions PartTwo/PartTwo/SocialMediaViewDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// SocialMediaViewDelegate.h
// PartTwo
//
// Created by Xiulan Shi on 9/16/15.
// Copyright © 2015 Mike Kavouras. All rights reserved.
//

#import <Foundation/Foundation.h>
@class SocialMediaView;
@protocol SocialMediaViewDelegate <NSObject>

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

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

#import "ViewController.h"
#import "SocialMediaView.h"
#import "SocialMediaViewDelegate.h"

@interface ViewController ()
@interface ViewController () <SocialMediaViewDelegate>

@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)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
- (void)socialMediaViewDidTapLikeButton:(SocialMediaView *)view {

self.view.backgroundColor = [UIColor blueColor];

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

self.view.backgroundColor = [UIColor greenColor];

}
- (void)socialMediaViewDidTapShareButton:(SocialMediaView *)view {

self.view.backgroundColor = [UIColor redColor];
}

@end
Binary file added PickAPic/.DS_Store
Binary file not shown.
Binary file not shown.
Loading