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
import UIKit | |
import SwiftKeychainWrapper | |
class ViewController: UIViewController { | |
@IBOutlet weak var passwordTextField: UITextField! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} |
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
import UIKit | |
import SwiftKeychainWrapper | |
class ViewController: UIViewController { | |
@IBOutlet weak var passwordTextField: UITextField! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} |
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
import UIKit | |
import SwiftKeychainWrapper | |
class ViewController: UIViewController { | |
@IBOutlet weak var passwordTextField: UITextField! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} |
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
#import “ViewController.h” | |
#import “zLetterGestureRecognizer.h” | |
@interface ViewController () | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
[self.view addGestureRecognizer:[[ZLetterGestureRecognizer alloc] initWithTarget:self action:@selector(zLetterMade:)]]; |
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
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event | |
{ | |
[super touchesEnded:touches withEvent:event]; | |
[self reset]; | |
} | |
-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event | |
{ | |
self.state = UIGestureRecognizerStateCancelled; | |
[self reset]; | |
} |
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
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event | |
{ | |
[super touchesMoved:touches withEvent:event]; //A | |
if ((self.state == UIGestureRecognizerStateFailed) || (self.state == UIGestureRecognizerStateRecognized)) { //B | |
return; | |
} | |
UIView *superView = [self.view superview]; //C | |
CGPoint currentPoint = [touches.anyObject locationInView:superView]; | |
CGPoint previousPoint = [touches.anyObject previousLocationInView:superView]; | |
if ((self.strokePart == 0) && ((currentPoint.x — self.firstTap.x) > 20.00) && (currentPoint.x > previousPoint.x) && |
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
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { | |
[super touchesBegan:touches withEvent:event]; | |
self.strokePrecision = 10.0; //A | |
if (touches.count > 1) { | |
self.state = UIGestureRecognizerStateFailed; // B | |
return; | |
} | |
self.firstTap = [touches.anyObject locationInView: self.view.superview]; //C | |
} |
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
[[NSNotificationCenter defaultCenter] removeObserver:someObserver]; | |
//However to remove one particular notification from being observed it is best to use the following. | |
[[NSNotificationCenter defaultCenter] removeObserver:self name:notificationName object:nil]; |
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
NSDictionary* userInfoDictionary = @{@”name”: @”Bob Smith”}; | |
[[NSNotificationCenter defaultCenter] postNotificationName:@”SomeActionIsComplete” object:nil userInfo:userInfoDictionary]; |
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
[[NSNotificationCenter defaultCenter] addObserverForName:@”SomeActionIsComplete” object:nil queue:nil usingBlock:^(NSNotification *note) | |
{ | |
NSLog(@”The action I was waiting for is complete!!!”); | |
[self dismissViewControllerAnimated:YES completion:nil]; | |
}]; |
NewerOlder