Skip to content

Commit

Permalink
Included coach mark files with sample
Browse files Browse the repository at this point in the history
  • Loading branch information
ddoria921 committed Apr 5, 2014
1 parent cbb9b31 commit 984d69f
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 26 deletions.
Binary file added .DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions Coach Marks.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
93299DC418EBEA2700D8E660 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93299DA618EBEA2700D8E660 /* UIKit.framework */; };
93299DCC18EBEA2700D8E660 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 93299DCA18EBEA2700D8E660 /* InfoPlist.strings */; };
93299DCE18EBEA2700D8E660 /* Coach_MarksTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 93299DCD18EBEA2700D8E660 /* Coach_MarksTests.m */; };
935EE4C418F07520001F039E /* DDBubble.m in Sources */ = {isa = PBXBuildFile; fileRef = 935EE4BF18F07520001F039E /* DDBubble.m */; };
935EE4C518F07520001F039E /* DDCircleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 935EE4C118F07520001F039E /* DDCircleView.m */; };
935EE4C618F07520001F039E /* DDCoachMarksView.m in Sources */ = {isa = PBXBuildFile; fileRef = 935EE4C318F07520001F039E /* DDCoachMarksView.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -53,6 +56,12 @@
93299DC918EBEA2700D8E660 /* Coach MarksTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Coach MarksTests-Info.plist"; sourceTree = "<group>"; };
93299DCB18EBEA2700D8E660 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
93299DCD18EBEA2700D8E660 /* Coach_MarksTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Coach_MarksTests.m; sourceTree = "<group>"; };
935EE4BE18F07520001F039E /* DDBubble.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDBubble.h; sourceTree = "<group>"; };
935EE4BF18F07520001F039E /* DDBubble.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDBubble.m; sourceTree = "<group>"; };
935EE4C018F07520001F039E /* DDCircleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDCircleView.h; sourceTree = "<group>"; };
935EE4C118F07520001F039E /* DDCircleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDCircleView.m; sourceTree = "<group>"; };
935EE4C218F07520001F039E /* DDCoachMarksView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDCoachMarksView.h; sourceTree = "<group>"; };
935EE4C318F07520001F039E /* DDCoachMarksView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDCoachMarksView.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -117,6 +126,12 @@
93299DB418EBEA2700D8E660 /* Main.storyboard */,
93299DB718EBEA2700D8E660 /* ViewController.h */,
93299DB818EBEA2700D8E660 /* ViewController.m */,
935EE4BE18F07520001F039E /* DDBubble.h */,
935EE4BF18F07520001F039E /* DDBubble.m */,
935EE4C018F07520001F039E /* DDCircleView.h */,
935EE4C118F07520001F039E /* DDCircleView.m */,
935EE4C218F07520001F039E /* DDCoachMarksView.h */,
935EE4C318F07520001F039E /* DDCoachMarksView.m */,
93299DBA18EBEA2700D8E660 /* Images.xcassets */,
93299DA918EBEA2700D8E660 /* Supporting Files */,
);
Expand Down Expand Up @@ -249,8 +264,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
935EE4C618F07520001F039E /* DDCoachMarksView.m in Sources */,
93299DB918EBEA2700D8E660 /* ViewController.m in Sources */,
935EE4C418F07520001F039E /* DDBubble.m in Sources */,
93299DB318EBEA2700D8E660 /* AppDelegate.m in Sources */,
935EE4C518F07520001F039E /* DDCircleView.m in Sources */,
93299DAF18EBEA2700D8E660 /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -456,6 +474,7 @@
93299DD318EBEA2700D8E660 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
93299DD418EBEA2700D8E660 /* Build configuration list for PBXNativeTarget "Coach MarksTests" */ = {
isa = XCConfigurationList;
Expand All @@ -464,6 +483,7 @@
93299DD618EBEA2700D8E660 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>4AE21C2A-7EAF-4A8F-9043-CF0E1B9D203E</string>
<string>1F5699E3-A15B-449D-AE18-78A0476EAA3F</string>
<key>IDESourceControlProjectName</key>
<string>Coach Marks</string>
<key>IDESourceControlProjectOriginsDictionary</key>
Expand Down
Binary file not shown.
Binary file added Coach Marks/.DS_Store
Binary file not shown.
13 changes: 11 additions & 2 deletions Coach Marks/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5023" systemVersion="13A603" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies>
<scenes>
<!--class Prefix:identifier View Controller-->
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="ViewController" sceneMemberID="viewController">
Expand All @@ -15,13 +15,22 @@
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="BackgroundImage" translatesAutoresizingMaskIntoConstraints="NO" id="88J-DK-Xa4">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<resources>
<image name="BackgroundImage" width="640" height="1136"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
Expand Down
2 changes: 1 addition & 1 deletion Coach Marks/DDBubble.m
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ - (void)animate
delay:0.3
options:(UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse)
animations:^ {
self.transform = CGAffineTransformMakeTranslation(0, -4);
self.transform = CGAffineTransformMakeTranslation(0, -5);
}
completion:^(BOOL finished) {
}];
Expand Down
6 changes: 2 additions & 4 deletions Coach Marks/DDCircleView.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,17 @@ - (void)animateSwipeRight
animations:^{
// Slide Right
self.transform = CGAffineTransformMakeTranslation(260, 0);
// Fade Out
self.alpha = 0.0f;

}
completion:^(BOOL finished) {
// End
[UIView animateWithDuration:0.5
animations:^{
// Fade Out
//self.alpha = 0.0f;
self.alpha = 0.0f;
}
completion:^(BOOL finished) {
// End
// Repeat
[self performSelector:@selector(animateSwipeRight)];
}];
}];
Expand Down
17 changes: 0 additions & 17 deletions Coach Marks/DDCoachMarksView.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ - (void)setup {
UISwipeGestureRecognizer *swipeGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:nil];
[self addGestureRecognizer:swipeGestureRecognizer];
[self addGestureRecognizer:tapGestureRecognizer];

// show skip button
UIButton *skipButton = [UIButton buttonWithType:UIButtonTypeSystem];
skipButton.frame = CGRectMake(150, 500, 100, 50);
[skipButton setTitle:@"Skip" forState:UIControlStateNormal];
[skipButton addTarget:self action:@selector(skipButtonTapped) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:skipButton];

// Hide until unvoked
self.hidden = YES;
Expand Down Expand Up @@ -157,16 +150,6 @@ - (void)userDidTap:(UITapGestureRecognizer *)recognizer {
[self goToCoachMarkIndexed:(markIndex+1)];
}

#pragma mark - Tapped Button

- (void)skipButtonTapped
{
// set all coach mark user defualts to seen

// go to end of current coach marks
[self goToCoachMarkIndexed:self.coachMarks.count];
}

#pragma mark - Navigation

- (void)start {
Expand Down
Binary file added Coach Marks/Images.xcassets/.DS_Store
Binary file not shown.
31 changes: 30 additions & 1 deletion Coach Marks/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "ViewController.h"
#import "DDCoachMarksView.h"

@interface ViewController ()

Expand All @@ -17,7 +18,35 @@ @implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

NSArray *coachMarksDetails = @[
@{
@"rect": [NSValue valueWithCGRect:CGRectMake(6, 24, 40, 40)],
@"caption": @"Synchronize your mail",
@"shape": @"circle"
},
@{
@"rect": [NSValue valueWithCGRect:CGRectMake(275, 24, 40, 40)],
@"caption": @"Create a new message",
@"shape": @"circle",
},
@{
@"rect": [NSValue valueWithCGRect:CGRectMake(0, 125, 320, 60)],
@"caption": @"Swipe for more options",
@"shape": @"square",
@"swipe": @"YES"
},
];

DDCoachMarksView *coachMarks = [[DDCoachMarksView alloc] initWithFrame:self.view.bounds coachMarks:coachMarksDetails];

[self.view addSubview:coachMarks];
[coachMarks start];
}

- (void)didReceiveMemoryWarning
Expand Down
2 changes: 2 additions & 0 deletions Coach Marks/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

22 changes: 22 additions & 0 deletions Coach MarksTests/Coach MarksTests-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>Doria.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
2 changes: 2 additions & 0 deletions Coach MarksTests/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

0 comments on commit 984d69f

Please sign in to comment.