-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
469d4bc
commit acfc0ad
Showing
18 changed files
with
1,457 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
// | ||
// MKParentalGateTouchCancelView.h | ||
// iPhoneMK Sample App | ||
// | ||
// Created by Michael Kamprath on 10/20/13. | ||
// Copyright 2013 Michael F. Kamprath | ||
// [email protected] | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#import "MKTouchTrackingView.h" | ||
|
||
@class MKParentalGateTouchCancelView; | ||
|
||
@protocol MKParentalGateTouchCancelDelegate <NSObject> | ||
|
||
@required | ||
-(void)handleCancelTouchDown:(MKParentalGateTouchCancelView*)inTouchCancelView; | ||
-(void)handleCancelTouchUp:(MKParentalGateTouchCancelView*)inTouchCancelView; | ||
|
||
@end | ||
|
||
@interface MKParentalGateTouchCancelView : MKTouchTrackingView | ||
@property (weak,nonatomic) id<MKParentalGateTouchCancelDelegate> delegate; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,32 @@ | ||
// | ||
// MKParentalGateTouchCancelView.m | ||
// iPhoneMK Sample App | ||
// | ||
// Created by Michael Kamprath on 10/20/13. | ||
// Copyright 2013 Michael F. Kamprath | ||
// [email protected] | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#ifndef __has_feature | ||
#define __has_feature(x) 0 | ||
#endif | ||
#ifndef __has_extension | ||
#define __has_extension __has_feature // Compatibility with pre-3.0 compilers. | ||
#endif | ||
|
||
#if !(__has_feature(objc_arc) && __clang_major__ >= 3) | ||
#error "MKParentalGate is designed to be used with ARC. Please add '-fobjc-arc' to the compiler flags of MKParentalGateViewController.m." | ||
#endif // __has_feature(objc_arc) | ||
|
||
#import "MKParentalGateTouchCancelView.h" | ||
|
||
|
@@ -19,13 +41,35 @@ - (id)initWithFrame:(CGRect)frame | |
return self; | ||
} | ||
|
||
/* | ||
// Only override drawRect: if you perform custom drawing. | ||
// An empty implementation adversely affects performance during animation. | ||
- (void)drawRect:(CGRect)rect | ||
{ | ||
// Drawing code | ||
-(id)initWithCoder:(NSCoder *)aDecoder { | ||
self = [super initWithCoder:aDecoder]; | ||
if (self) { | ||
} | ||
return self; | ||
} | ||
*/ | ||
|
||
-(void)touchInViewBegan { | ||
if (nil != self.delegate ) { | ||
[self.delegate handleCancelTouchDown:self]; | ||
} | ||
} | ||
|
||
-(void)touchTrackedIntoView { | ||
if (nil != self.delegate ) { | ||
[self.delegate handleCancelTouchDown:self]; | ||
} | ||
} | ||
|
||
-(void)touchUpInView { | ||
if (nil != self.delegate ) { | ||
[self.delegate handleCancelTouchUp:self]; | ||
} | ||
} | ||
|
||
-(void)touchTrackedOutOfView { | ||
if (nil != self.delegate ) { | ||
[self.delegate handleCancelTouchUp:self]; | ||
} | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
// | ||
// MKParentalGateTouchTargetView.h | ||
// iPhoneMK Sample App | ||
// | ||
// Created by Michael Kamprath on 10/19/13. | ||
// Copyright 2013 Michael F. Kamprath | ||
// [email protected] | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#import "MKTouchTrackingAnimationView.h" | ||
|
@@ -20,9 +31,12 @@ | |
|
||
@interface MKParentalGateTouchTargetView : MKTouchTrackingAnimationView | ||
|
||
- (id)initWithFrame:(CGRect)frame stopIcon:(UIImage*)inStopIcon goIcon:(UIImage*)inGoIcon delegate:(id<MKParentalGateTouchTargetDelegate>)inDelegate; | ||
- (id)initWithFrame:(CGRect)frame stopIcon:(UIImage*)inStopIcon delegate:(id<MKParentalGateTouchTargetDelegate>)inDelegate; | ||
|
||
-(void)resetAnimationLayerFrame; | ||
|
||
-(void)startAnimation; | ||
-(void)stopAnimation; | ||
-(void)pauseAnimation; | ||
-(void)resumeAnimation; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,45 @@ | ||
// | ||
// MKParentalGateTouchTargetView.m | ||
// iPhoneMK Sample App | ||
// | ||
// Created by Michael Kamprath on 10/19/13. | ||
// Copyright 2013 Michael F. Kamprath | ||
// [email protected] | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#ifndef __has_feature | ||
#define __has_feature(x) 0 | ||
#endif | ||
#ifndef __has_extension | ||
#define __has_extension __has_feature // Compatibility with pre-3.0 compilers. | ||
#endif | ||
|
||
#if !(__has_feature(objc_arc) && __clang_major__ >= 3) | ||
#error "MKParentalGate is designed to be used with ARC. Please add '-fobjc-arc' to the compiler flags of MKParentalGateViewController.m." | ||
#endif // __has_feature(objc_arc) | ||
|
||
#import "MKParentalGateTouchTargetView.h" | ||
@interface MKParentalGateTouchTargetView () | ||
@property (strong,nonatomic) UIImage* goIcon; | ||
@property (strong,nonatomic) UIImage* stopIcon; | ||
@property (weak,nonatomic) id<MKParentalGateTouchTargetDelegate> delegate; | ||
@end | ||
|
||
@implementation MKParentalGateTouchTargetView | ||
|
||
- (id)initWithFrame:(CGRect)frame stopIcon:(UIImage*)inStopIcon goIcon:(UIImage*)inGoIcon delegate:(id<MKParentalGateTouchTargetDelegate>)inDelegate; | ||
- (id)initWithFrame:(CGRect)frame stopIcon:(UIImage*)inStopIcon delegate:(id<MKParentalGateTouchTargetDelegate>)inDelegate; | ||
{ | ||
self = [super initWithFrame:frame]; | ||
if (self) { | ||
self.goIcon = inGoIcon; | ||
self.stopIcon = inStopIcon; | ||
self.delegate = inDelegate; | ||
|
||
|
@@ -40,12 +60,20 @@ - (void)drawRect:(CGRect)rect | |
} | ||
*/ | ||
|
||
-(void)resetAnimationLayerFrame { | ||
self.animationLayer.frame = CGRectMake(0, 0, self.animationLayer.frame.size.width, self.animationLayer.frame.size.height); | ||
} | ||
|
||
#pragma mark - Animation | ||
|
||
-(void)startAnimation { | ||
[self.animationLayer startAnimating]; | ||
} | ||
|
||
-(void)stopAnimation { | ||
[self.animationLayer stopAnimatingImmeditely:YES]; | ||
} | ||
|
||
-(void)pauseAnimation { | ||
[self.animationLayer pauseAnimation]; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
// | ||
// MKParentalGateViewController.h | ||
// iPhoneMK Sample App | ||
// | ||
// Created by Michael Kamprath on 10/19/13. | ||
// Copyright 2013 Michael F. Kamprath | ||
// [email protected] | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "MKParentalGate.h" | ||
|
||
@interface MKParentalGateViewController : UIViewController | ||
|
||
- (id)initWithStopIcon:(UIImage*)inStopIcon goIcon:(UIImage*)inGoIcon successBlock:(MKParentalGateSuccessBlock)inSuccessBlock failureBlock:(MKParentalGateFailureBlock)inFailureBlock; | ||
|
||
-(id)initWithStopIcon:(UIImage*)inStopIcon successBlock:(MKParentalGateSuccessBlock)inSuccessBlock failureBlock:(MKParentalGateFailureBlock)inFailureBlock title:(NSString*)inTitle explanatoryMessage:(NSString*)inMessage; | ||
@end |
Oops, something went wrong.