Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

began declarations; implemented gesture recognizers

  • Loading branch information...
commit 43bcc59f5f831a8831930a1b0abe0c408ecc24e4 1 parent 6b063ea
@alist alist authored
View
32 swyp.h
@@ -0,0 +1,32 @@
+/*
+ * swyp.h
+ * swyp
+ *
+ * Created by Alexander List on 7/28/11.
+ * Copyright 2011 ExoMachina. Some rights reserved -- see included 'license' file.
+ *
+ */
+
+
+#define DEBUG_MODE_ENABLED 1
+
+// Developer conviniences
+#define SRELS RELEASE_SAFELY
+#define RELEASE_SAFELY(__POINTER) { [__POINTER release]; __POINTER = nil; }
+
+#define deviceIsPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
+#define ArrayHasItems(array) (array != nil && [array count] > 0)
+#define StringHasText(string) (string != nil && [string length] > 0)
+#define SetHasItems(set) (set != nil && [set count] > 0)
+
+#define euclideanDistance(pointOne, pointTwo) sqrt(pow((pointOne.x - pointTwo.x),2) + pow((pointOne.y - pointTwo.y),2))
+
+#if DEBUG_MODE_ENABLED == 1
+#if CONFIGURATION == Debug
+ #define EXOLog NSLog
+ #else
+ #error verbose outputs of EXOLog -- DEBUG_MODE_ENABLED = 1 for non-debug build
+ #endif
+#else
+ #define EXOLog(format, ...)
+#endif
View
24 swyp.xcodeproj/project.pbxproj
@@ -9,8 +9,6 @@
/* Begin PBXBuildFile section */
680FC03713E0C3CD00509CF2 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 680FC03613E0C3CD00509CF2 /* CFNetwork.framework */; };
680FC03913E0C3D600509CF2 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 680FC03813E0C3D600509CF2 /* Security.framework */; };
- 680FC04E13E0C40100509CF2 /* SecKeyWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 680FC04C13E0C40100509CF2 /* SecKeyWrapper.h */; };
- 680FC04F13E0C40100509CF2 /* SecKeyWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 680FC04D13E0C40100509CF2 /* SecKeyWrapper.m */; };
680FC05213E0C63700509CF2 /* swypInfoRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 680FC05013E0C63700509CF2 /* swypInfoRef.h */; };
680FC05313E0C63700509CF2 /* swypInfoRef.m in Sources */ = {isa = PBXBuildFile; fileRef = 680FC05113E0C63700509CF2 /* swypInfoRef.m */; };
680FC05613E0CA8D00509CF2 /* swypWorkspaceViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 680FC05413E0CA8D00509CF2 /* swypWorkspaceViewController.h */; };
@@ -21,6 +19,9 @@
680FC08513E0D00700509CF2 /* swypServerCandidate.m in Sources */ = {isa = PBXBuildFile; fileRef = 680FC08313E0D00700509CF2 /* swypServerCandidate.m */; };
680FC0BC13E0D62100509CF2 /* swypFileTypeString.h in Headers */ = {isa = PBXBuildFile; fileRef = 680FC0BA13E0D62100509CF2 /* swypFileTypeString.h */; };
680FC0BD13E0D62100509CF2 /* swypFileTypeString.m in Sources */ = {isa = PBXBuildFile; fileRef = 680FC0BB13E0D62100509CF2 /* swypFileTypeString.m */; };
+ 680FC1F713E2407E00509CF2 /* swyp.h in Headers */ = {isa = PBXBuildFile; fileRef = 680FC1F613E2407E00509CF2 /* swyp.h */; };
+ 680FC4F013E2473E00509CF2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 680FC4EF13E2473E00509CF2 /* UIKit.framework */; };
+ 680FC5B713E251DA00509CF2 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 680FC5B613E251DA00509CF2 /* CoreFoundation.framework */; };
68B18DF913E0B23200D094A9 /* swypConnectionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 68B18DF713E0B23200D094A9 /* swypConnectionManager.h */; };
68B18DFA13E0B23200D094A9 /* swypConnectionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 68B18DF813E0B23200D094A9 /* swypConnectionManager.m */; };
68B18DFD13E0B29200D094A9 /* swypBonjourServiceAdvertiser.h in Headers */ = {isa = PBXBuildFile; fileRef = 68B18DFB13E0B29200D094A9 /* swypBonjourServiceAdvertiser.h */; };
@@ -76,6 +77,9 @@
680FC08313E0D00700509CF2 /* swypServerCandidate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = swypServerCandidate.m; sourceTree = "<group>"; };
680FC0BA13E0D62100509CF2 /* swypFileTypeString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swypFileTypeString.h; sourceTree = "<group>"; };
680FC0BB13E0D62100509CF2 /* swypFileTypeString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = swypFileTypeString.m; sourceTree = "<group>"; };
+ 680FC1F613E2407E00509CF2 /* swyp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swyp.h; sourceTree = "<group>"; };
+ 680FC4EF13E2473E00509CF2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 680FC5B613E251DA00509CF2 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
68B18DF713E0B23200D094A9 /* swypConnectionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swypConnectionManager.h; sourceTree = "<group>"; };
68B18DF813E0B23200D094A9 /* swypConnectionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = swypConnectionManager.m; sourceTree = "<group>"; };
68B18DFB13E0B29200D094A9 /* swypBonjourServiceAdvertiser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swypBonjourServiceAdvertiser.h; sourceTree = "<group>"; };
@@ -125,6 +129,8 @@
AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */,
680FC03713E0C3CD00509CF2 /* CFNetwork.framework in Frameworks */,
680FC03913E0C3D600509CF2 /* Security.framework in Frameworks */,
+ 680FC4F013E2473E00509CF2 /* UIKit.framework in Frameworks */,
+ 680FC5B713E251DA00509CF2 /* CoreFoundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -142,6 +148,7 @@
0867D691FE84028FC02AAC07 /* swyp */ = {
isa = PBXGroup;
children = (
+ 680FC1F513E2405C00509CF2 /* Other Logic */,
68B18DF613E0B20000D094A9 /* Content */,
68B18DED13E0B14500D094A9 /* Communications */,
68B18DEC13E0B11300D094A9 /* View Components */,
@@ -156,6 +163,8 @@
0867D69AFE84028FC02AAC07 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 680FC5B613E251DA00509CF2 /* CoreFoundation.framework */,
+ 680FC4EF13E2473E00509CF2 /* UIKit.framework */,
680FC03613E0C3CD00509CF2 /* CFNetwork.framework */,
AACBBE490F95108600F1A2B1 /* Foundation.framework */,
680FC03813E0C3D600509CF2 /* Security.framework */,
@@ -193,6 +202,14 @@
name = "For Reference Only";
sourceTree = "<group>";
};
+ 680FC1F513E2405C00509CF2 /* Other Logic */ = {
+ isa = PBXGroup;
+ children = (
+ 680FC1F613E2407E00509CF2 /* swyp.h */,
+ );
+ name = "Other Logic";
+ sourceTree = "<group>";
+ };
68B18DE913E0B08F00D094A9 /* Streams */ = {
isa = PBXGroup;
children = (
@@ -345,12 +362,12 @@
68B18E4013E0B4B800D094A9 /* swypInputToOutputStreamConnector.h in Headers */,
68B18E5313E0B52000D094A9 /* swypEncryptingTransform.h in Headers */,
68B18E5713E0B53C00D094A9 /* swypUnencryptingTransform.h in Headers */,
- 680FC04E13E0C40100509CF2 /* SecKeyWrapper.h in Headers */,
680FC05213E0C63700509CF2 /* swypInfoRef.h in Headers */,
680FC05613E0CA8D00509CF2 /* swypWorkspaceViewController.h in Headers */,
680FC08013E0CFF900509CF2 /* swypClientCandidate.h in Headers */,
680FC08413E0D00700509CF2 /* swypServerCandidate.h in Headers */,
680FC0BC13E0D62100509CF2 /* swypFileTypeString.h in Headers */,
+ 680FC1F713E2407E00509CF2 /* swyp.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -425,7 +442,6 @@
68B18E4113E0B4B800D094A9 /* swypInputToOutputStreamConnector.m in Sources */,
68B18E5413E0B52000D094A9 /* swypEncryptingTransform.m in Sources */,
68B18E5813E0B53C00D094A9 /* swypUnencryptingTransform.m in Sources */,
- 680FC04F13E0C40100509CF2 /* SecKeyWrapper.m in Sources */,
680FC05313E0C63700509CF2 /* swypInfoRef.m in Sources */,
680FC05713E0CA8D00509CF2 /* swypWorkspaceViewController.m in Sources */,
680FC08113E0CFF900509CF2 /* swypClientCandidate.m in Sources */,
View
2  swypConcatenatedInputStream.h
@@ -29,7 +29,7 @@
@property (nonatomic, readonly) NSArray * queuedStreams;
@property (nonatomic, assign) BOOL closeStreamAtQueueEnd;
-@property (nonatomic, assign) swypConcatenatedInputStreamDelegate delegate;
+@property (nonatomic, assign) id<swypConcatenatedInputStreamDelegate> delegate;
//NSInputStream array
-(id) initWithInputStreamArray: (NSArray*)inputStreams;
View
17 swypConnectionManager.h
@@ -12,7 +12,7 @@
#import "swypBonjourServiceAdvertiser.h"
#import "swypHandshakeManager.h"
-@class swypConnectionManagerDelegate;
+@class swypConnectionManager;
@protocol swypConnectionManagerDelegate <NSObject>
-(void) swypConnectionSessionWasCreated:(swypConnectionSession*)session withConnectionManager:(swypConnectionManager*)manager;
@@ -39,4 +39,19 @@
@property (nonatomic, assign) id<swypConnectionManagerDelegate> delegate;
+/*
+ Begin listening, allow new connections, etc.
+ The swyp window has been opened.
+*/
+-(void) beginServices;
+/*
+ Stop listening, disallow new connections, terminate existing swypConnectionSessions, etc.
+ The swyp window has probably been closed.
+*/
+-(void) stopServices;
+
+-(void) swypInOccuredWithSwypInfoRef: (swypInfoRef*)inInfo;
+-(void) swypOutBeganWithSwypInfoRef: (swypInfoRef*)outInfo;
+-(void) swypOutEndedWithSwypInfoRef: (swypInfoRef*)outInfo;
+-(void) swypOutFailedWithSwypInfoRef: (swypInfoRef*)outInfo;
@end
View
2  swypConnectionManager.m
@@ -9,5 +9,5 @@
#import "swypConnectionManager.h"
@implementation swypConnectionManager
-
+@synthesize delegate = _delegate, activeConnectionSessions = _activeConnectionSessions;
@end
View
7 swypConnectionSession.h
@@ -43,7 +43,7 @@ typedef enum {
UIColor * _sessionHueColor;
swypCryptoSession * _cryptoSession;
- swypCandidate * _swypCandidate;
+ swypCandidate * _representedCandidate;
swypConnectionSessionStatus _connectionStatus;
@@ -56,6 +56,9 @@ typedef enum {
}
@property (nonatomic, readonly) swypConnectionSessionStatus connectionStatus;
@property (nonatomic, retain) UIColor* sessionHueColor;
+@property (nonatomic, readonly) swypCandidate * representedCandidate;
+
+-(id) initWithSwypCandidate: (swypCandidate*)candidate;
-(void) addDataDelegate:(id<swypConnectionSessionDataDelegate>)delegate;
-(void) removeDataDelegate:(id<swypConnectionSessionDataDelegate>)delegate;
@@ -72,6 +75,6 @@ typedef enum {
*/
-(void) beginSendingFileStreamWithTag:(NSString*)tag type:(swypFileTypeString*)fileType dataStreamForSend:(NSInputStream*)stream length:(NSUInteger)streamLength;
/* same as above, a convinience method for those who wish to use data already in-memory */
--(void) beginSendingDataWithTag:(NSString*)tag type:(swypContentTypeString:NSString*)type dataForSend:(NSData*)sendData;
+-(void) beginSendingDataWithTag:(NSString*)tag type:(swypFileTypeString*)type dataForSend:(NSData*)sendData;
@end
View
1  swypConnectionSession.m
@@ -10,5 +10,6 @@
@implementation swypConnectionSession
+@synthesize representedCandidate = _representedCandidate, connectionStatus = _connectionStatus, sessionHueColor = _sessionHueColor;
@end
View
2  swypGestureRecognizer.h
@@ -12,6 +12,6 @@
@interface swypGestureRecognizer : UIPanGestureRecognizer {
swypInfoRef * _recognizedGestureInfoRef;
}
--(swypInfoRef) swypGestureInfo; //reset with gesture recognizer
+-(swypInfoRef*) swypGestureInfo; //reset with gesture recognizer
@end
View
41 swypGestureRecognizer.m
@@ -7,8 +7,47 @@
//
#import "swypGestureRecognizer.h"
-
+#import <UIKit/UIGestureRecognizerSubclass.h>
@implementation swypGestureRecognizer
+- (void)reset{
+ [super reset];
+
+ SRELS(_recognizedGestureInfoRef);
+}
+
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
+ [super touchesBegan:touches withEvent:event];
+
+ self.state = UIGestureRecognizerStatePossible;
+
+ if (_recognizedGestureInfoRef == nil){
+ _recognizedGestureInfoRef = [[swypInfoRef alloc] init];
+ }
+ [_recognizedGestureInfoRef setStartDate:[NSDate date]];
+ [_recognizedGestureInfoRef setStartPoint:[self locationInView:self.view]];
+}
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
+ [super touchesMoved:touches withEvent:event];
+
+ self.state = UIGestureRecognizerStatePossible; //don't let it set recognized until you're ready
+}
+- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
+ [super touchesEnded:touches withEvent:event];
+
+ [_recognizedGestureInfoRef setEndDate:[NSDate date]];
+ [_recognizedGestureInfoRef setEndPoint:[self locationInView:self.view]];
+}
+- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event{
+ [super touchesCancelled:touches withEvent:event];
+}
+
+-(void) dealloc{
+ SRELS(_recognizedGestureInfoRef);
+
+ [super dealloc];
+}
+
@end
+
View
1  swypHandshakeManager.h
@@ -10,6 +10,7 @@
#import <Foundation/Foundation.h>
#import "swypInfoRef.h"
+#import "swypCryptoManager.h"
#import "swypClientCandidate.h"
#import "swypServerCandidate.h"
#import "swypConnectionSession.h"
View
42 swypInGestureRecognizer.m
@@ -7,8 +7,48 @@
//
#import "swypInGestureRecognizer.h"
-
+#import <UIKit/UIGestureRecognizerSubclass.h>
@implementation swypInGestureRecognizer
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
+ [super touchesBegan:touches withEvent:event];
+
+ CGPoint firstPoint = [[self swypGestureInfo] startPoint];
+ CGRect viewRect = self.view.frame;
+ CGRect invalidSwypInRect = CGRectInset(viewRect, 40, 40);
+ if (CGRectContainsPoint(invalidSwypInRect, firstPoint) == YES){
+ self.state = UIGestureRecognizerStateFailed;
+ }else {
+ self.state = UIGestureRecognizerStateBegan;
+ }
+
+}
+
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
+ [super touchesMoved:touches withEvent:event];
+
+ CGPoint firstPoint = [[self swypGestureInfo] startPoint];
+
+ CGPoint viewCenterPoint = self.view.center;
+ CGPoint currentPoint = CGPointApplyAffineTransform(firstPoint, CGAffineTransformMakeTranslation([self translationInView:self.view].x, [self translationInView:self.view].x));
+
+ double firstEuclid, currentEuclid, euclidDelta;
+ firstEuclid = euclideanDistance(viewCenterPoint, firstPoint);
+ currentEuclid = euclideanDistance(viewCenterPoint, currentPoint);
+ euclidDelta = currentEuclid - firstEuclid; //positive values move away from the center point
+
+ if (euclidDelta > 10){
+ self.state = UIGestureRecognizerStateFailed;
+ }else if (euclidDelta < -40){
+ [[self swypGestureInfo] setEndDate:[NSDate date]];
+ [[self swypGestureInfo] setEndPoint:currentPoint];
+ [[self swypGestureInfo] setVelocity: euclideanDistance([self velocityInView:self.view], CGPointZero)]; //pythag
+ self.state = UIGestureRecognizerStateRecognized;
+ }else {
+ self.state = UIGestureRecognizerStateChanged;
+ }
+
+}
+
@end
View
46 swypOutGestureRecognizer.m
@@ -7,8 +7,52 @@
//
#import "swypOutGestureRecognizer.h"
-
+#import <UIKit/UIGestureRecognizerSubclass.h>
@implementation swypOutGestureRecognizer
+- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
+ [super touchesEnded:touches withEvent:event];
+
+ CGPoint lastPoint = [[self swypGestureInfo] endPoint];
+ CGRect viewRect = self.view.frame;
+ CGRect validSwypOutRect = CGRectInset(viewRect, 30, 30);
+ if (CGRectContainsPoint(validSwypOutRect, lastPoint) == YES){
+ [[self swypGestureInfo] setEndDate:[NSDate date]];
+ [[self swypGestureInfo] setEndPoint:lastPoint];
+ [[self swypGestureInfo] setVelocity: euclideanDistance([self velocityInView:self.view], CGPointZero)]; //pythag
+ self.state = UIGestureRecognizerStateRecognized;
+ }else {
+ self.state = UIGestureRecognizerStateFailed;
+ }
+}
+
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
+ [super touchesMoved:touches withEvent:event];
+
+ CGPoint firstPoint = [[self swypGestureInfo] startPoint];
+
+ CGPoint viewCenterPoint = self.view.center;
+ CGPoint currentPoint = CGPointApplyAffineTransform(firstPoint, CGAffineTransformMakeTranslation([self translationInView:self.view].x, [self translationInView:self.view].x));
+
+ double firstEuclid, currentEuclid, euclidDelta;
+ firstEuclid = euclideanDistance(viewCenterPoint, firstPoint);
+ currentEuclid = euclideanDistance(viewCenterPoint, currentPoint);
+ euclidDelta = currentEuclid - firstEuclid; //positive values move away from the center point
+
+ if (euclidDelta < -10){
+ self.state = UIGestureRecognizerStateFailed;
+ }else if (euclidDelta > 10){
+ if (self.state == UIGestureRecognizerStateBegan){
+ self.state = UIGestureRecognizerStateChanged;
+ }else if (self.state == UIGestureRecognizerStateChanged) {
+ self.state = UIGestureRecognizerStateChanged;
+ }else if (self.state == UIGestureRecognizerStatePossible) {
+ self.state = UIGestureRecognizerStateBegan;
+ }
+ }else{
+ self.state = UIGestureRecognizerStatePossible;
+ }
+
+}
@end
View
2  swypTransformInputStream.h
@@ -39,7 +39,7 @@
don't need to transform all data passed in transformData:inRange:
if bytes remaining >transformationChunkSize, or if inputStreamIsFinished == YES, transformData:: will be called until all bytes are transformed
*/
--(void) didYeildTransformedData:(NSData)transformedData fromSource:(NSData*)sourceData withRange:(NSRange)range;
+-(void) didYeildTransformedData:(NSData*)transformedData fromSource:(NSData*)sourceData withRange:(NSRange)range;
//
// these are just scratch-pads, know your stuff before modifying them
View
2  swypUnencryptingTransform.h
@@ -7,7 +7,7 @@
//
#import <Foundation/Foundation.h>
-
+#import "swypTransformInputStream.h"
@interface swypUnencryptingTransform: swypTransformInputStream {
NSData * _sessionAESKey;
View
7 swypWorkspaceViewController.h
@@ -10,11 +10,16 @@
#import "swypContentInteractionManager.h"
#import "swypConnectionManager.h"
-@interface swypWorkspaceViewController : NSObject <swypConnectionManagerDelegate> {
+@interface swypWorkspaceViewController : UIViewController <swypConnectionManagerDelegate, UIGestureRecognizerDelegate> {
swypContentInteractionManager * _contentManager;
swypConnectionManager * _connectionManager;
+ NSString * _workspaceID;
}
+@property (nonatomic, readonly) NSString * workspaceID;
+@property (nonatomic, readonly) swypConnectionManager* connectionManager;
+@property (nonatomic, readonly) swypContentInteractionManager* contentManager;
+
-(id) initWithContentWorkspaceID:(NSString*)workspaceID;
@end
View
76 swypWorkspaceViewController.m
@@ -7,8 +7,82 @@
//
#import "swypWorkspaceViewController.h"
-
+#import "swypInGestureRecognizer.h"
+#import "swypOutGestureRecognizer.h"
@implementation swypWorkspaceViewController
+@synthesize workspaceID = _workspaceID, connectionManager = _connectionManager, contentManager = _contentManager;
+
+#pragma mark -
+#pragma mark swypConnectionManager
+-(swypConnectionManager*) connectionManager{
+ if (_connectionManager == nil){
+ _connectionManager = [[swypConnectionManager alloc] init];
+ [_connectionManager setDelegate:self];
+ }
+
+ return _connectionManager;
+}
+
+-(void) swypConnectionSessionWasCreated:(swypConnectionSession*)session withConnectionManager:(swypConnectionManager*)manager{
+ UIView *symbolView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
+ [symbolView setBackgroundColor:[session sessionHueColor]];
+ [symbolView setCenter:[[[session representedCandidate] matchedLocalSwypInfo]endPoint]];
+
+ [self.view addSubview:symbolView];
+
+ SRELS(symbolView);
+}
+-(void) swypConnectionSessionWasInvalidated:(swypConnectionSession*)session withConnectionManager:(swypConnectionManager*)manager error:(NSError*)error{
+
+}
+
+#pragma mark workspaceInteraction
+
+
+
+#pragma mark -
+#pragma mark UIGestureRecognizerDelegate
+-(void) swypInGestureChanged:(swypInGestureRecognizer*)recognizer{
+
+}
+
+-(void) swypOutGestureChanged:(swypOutGestureRecognizer*)recognizer{
+ if (recognizer.state == UIGestureRecognizerStateBegan){
+
+ }
+}
+
+
+#pragma mark UIViewController
+-(id) initWithContentWorkspaceID:(NSString*)workspaceID{
+ if (self = [super initWithNibName:nil bundle:nil]){
+ [self setModalPresentationStyle: UIModalPresentationFullScreen];
+ [self setModalTransitionStyle: UIModalTransitionStyleCrossDissolve];
+
+ }
+ return self;
+}
+-(void) viewDidLoad{
+ [super viewDidLoad];
+
+ [self.view setBackgroundColor:[UIColor blackColor]];
+ [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
+ [[self connectionManager] beginServices];
+
+ swypInGestureRecognizer* swypInRecognizer = [[swypInGestureRecognizer alloc] initWithTarget:self action:@selector(swypInGestureChanged:)];
+ [swypInRecognizer setDelegate:self];
+ [self.view addGestureRecognizer:swypInRecognizer];
+ SRELS(swypInRecognizer);
+ swypOutGestureRecognizer* swypOutRecognizer = [[swypOutGestureRecognizer alloc] initWithTarget:self action:@selector(swypOutGestureChanged:)];
+ [swypInRecognizer setDelegate:self];
+ [self.view addGestureRecognizer:swypOutRecognizer];
+ SRELS(swypOutRecognizer);
+
+}
+-(void) dealloc{
+
+ [super dealloc];
+}
@end
View
3  swyp_Prefix.pch
@@ -3,5 +3,8 @@
//
#ifdef __OBJC__
+ #import <CoreFoundation/CoreFoundation.h>
#import <Foundation/Foundation.h>
+ #import <UIKit/UIKit.h>
+ #import "swyp.h"
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.