Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add namespace to KIFTypist to avoid collision with the original KIFTypist #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/
dist/
xcuserdata
*.xccheckout
31 changes: 22 additions & 9 deletions PublicAutomation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/* Begin PBXBuildFile section */
C194253C15D838BD004FC314 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C194253B15D838BD004FC314 /* Foundation.framework */; };
C194255215D83B49004FC314 /* UIAutomationBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = C194254E15D839EC004FC314 /* UIAutomationBridge.m */; };
C194256315D94610004FC314 /* KIFTypist.m in Sources */ = {isa = PBXBuildFile; fileRef = C194256215D9460F004FC314 /* KIFTypist.m */; };
C194256315D94610004FC314 /* PA_KIFTypist.m in Sources */ = {isa = PBXBuildFile; fileRef = C194256215D9460F004FC314 /* PA_KIFTypist.m */; };
C194256715D9516B004FC314 /* UIAutomationBridge.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = C194254D15D839EC004FC314 /* UIAutomationBridge.h */; };
C1FFB24915DCCECC00CACB04 /* PALoader.m in Sources */ = {isa = PBXBuildFile; fileRef = C1FFB24815DCCECC00CACB04 /* PALoader.m */; };
/* End PBXBuildFile section */
Expand All @@ -35,8 +35,8 @@
C194254D15D839EC004FC314 /* UIAutomationBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIAutomationBridge.h; sourceTree = "<group>"; };
C194254E15D839EC004FC314 /* UIAutomationBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIAutomationBridge.m; sourceTree = "<group>"; };
C194255015D83A1D004FC314 /* LoadableCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoadableCategory.h; sourceTree = "<group>"; };
C194256115D9460F004FC314 /* KIFTypist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KIFTypist.h; sourceTree = "<group>"; };
C194256215D9460F004FC314 /* KIFTypist.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KIFTypist.m; sourceTree = "<group>"; };
C194256115D9460F004FC314 /* PA_KIFTypist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PA_KIFTypist.h; sourceTree = "<group>"; };
C194256215D9460F004FC314 /* PA_KIFTypist.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PA_KIFTypist.m; sourceTree = "<group>"; };
C194256415D949CE004FC314 /* CGGeometry-KIFAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CGGeometry-KIFAdditions.h"; sourceTree = "<group>"; };
C1FFB24815DCCECC00CACB04 /* PALoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PALoader.m; sourceTree = "<group>"; };
F8D883FA18229E9400CC7C38 /* PALogging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PALogging.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -85,8 +85,8 @@
C1FFB24815DCCECC00CACB04 /* PALoader.m */,
F8D883FA18229E9400CC7C38 /* PALogging.h */,
C194256415D949CE004FC314 /* CGGeometry-KIFAdditions.h */,
C194256115D9460F004FC314 /* KIFTypist.h */,
C194256215D9460F004FC314 /* KIFTypist.m */,
C194256115D9460F004FC314 /* PA_KIFTypist.h */,
C194256215D9460F004FC314 /* PA_KIFTypist.m */,
C194255015D83A1D004FC314 /* LoadableCategory.h */,
C194254D15D839EC004FC314 /* UIAutomationBridge.h */,
C194254E15D839EC004FC314 /* UIAutomationBridge.m */,
Expand Down Expand Up @@ -130,7 +130,7 @@
C194252F15D838BD004FC314 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0460;
LastUpgradeCheck = 0610;
ORGANIZATIONNAME = ThoughtWorks;
};
buildConfigurationList = C194253215D838BD004FC314 /* Build configuration list for PBXProject "PublicAutomation" */;
Expand All @@ -156,7 +156,7 @@
buildActionMask = 2147483647;
files = (
C194255215D83B49004FC314 /* UIAutomationBridge.m in Sources */,
C194256315D94610004FC314 /* KIFTypist.m in Sources */,
C194256315D94610004FC314 /* PA_KIFTypist.m in Sources */,
C1FFB24915DCCECC00CACB04 /* PALoader.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -168,13 +168,16 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -184,10 +187,14 @@
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
Expand All @@ -196,17 +203,23 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
SDKROOT = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//
// KIFTypist.h
// PA_KIFTypist.h
// KIF
//
// Created by Pete Hodgson on 8/12/12.
//
//

@interface KIFTypist : NSObject
@interface PA_KIFTypist : NSObject
+ (UIWindow *) keyboardWindow;
+ (BOOL)enterCharacter:(NSString *)characterString;
+ (BOOL)enterText:(NSString *)text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
//
//

#import "KIFTypist.h"
#import "PA_KIFTypist.h"

#import "UIAutomationBridge.h"
#import "CGGeometry-KIFAdditions.h"
#import "PALogging.h"

const NSTimeInterval KEYSTROKE_DELAY = 0.05f;

@interface KIFTypist()
@interface PA_KIFTypist()
+ (NSString *)_representedKeyboardStringForCharacter:(NSString *)characterString;
+ (BOOL)_enterCharacter:(NSString *)characterString history:(NSMutableDictionary *)history;

+ (NSArray *)_subviewsOfView:(UIView *)view withClassNamePrefix:(NSString *)prefix;
@end

@implementation KIFTypist
@implementation PA_KIFTypist

// Listed from UIApplication+KIFAdditions
+ (UIWindow *)keyboardWindow;
Expand Down Expand Up @@ -53,7 +53,7 @@ + (BOOL)enterText:(NSString *)text;
for (NSUInteger characterIndex = 0; characterIndex < [text length]; characterIndex++) {
NSString *characterString = [text substringWithRange:NSMakeRange(characterIndex, 1)];

if (![KIFTypist enterCharacter:characterString]) {
if (![PA_KIFTypist enterCharacter:characterString]) {
return NO;
}
}
Expand Down
6 changes: 3 additions & 3 deletions PublicAutomation/UIAutomationBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//
#import "UIAutomationBridge.h"
#import "UIAutomation.h"
#import "KIFTypist.h"
#import "PA_KIFTypist.h"
#import "PALogging.h"

#import "CGGeometry-KIFAdditions.h"
Expand All @@ -27,12 +27,12 @@ + (UIATarget *)uiat{
}

+ (BOOL) checkForKeyboard {
return [KIFTypist keyboardWindow] != nil;
return [PA_KIFTypist keyboardWindow] != nil;
}

+ (BOOL) typeIntoKeyboard:(NSString *)string {
DLog(@"typing into keyboard: %@", string );
return [KIFTypist enterText:string];
return [PA_KIFTypist enterText:string];
}

+ (CGPoint) tapView:(UIView *)view {
Expand Down