Skip to content
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
27 changes: 20 additions & 7 deletions GestureKeyboard.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
A50F7DAB1CE7693800E0D492 /* graffiti.plist in Resources */ = {isa = PBXBuildFile; fileRef = D4B4ABBC1947520800052189 /* graffiti.plist */; };
A50F7DAD1CE769C600E0D492 /* graffiti.plist in Resources */ = {isa = PBXBuildFile; fileRef = D4B4ABBC1947520800052189 /* graffiti.plist */; };
D460B2B81943CF7600A5D298 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D460B2B71943CF7600A5D298 /* AppDelegate.swift */; };
D460B2BA1943CF7600A5D298 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D460B2B91943CF7600A5D298 /* ViewController.swift */; };
D460B2BD1943CF7600A5D298 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D460B2BB1943CF7600A5D298 /* Main.storyboard */; };
Expand Down Expand Up @@ -35,7 +37,6 @@
D49E329E1946BAEE001B9BB1 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D460B2ED1944D6F300A5D298 /* CoreGraphics.framework */; };
D49E329F1946BAFC001B9BB1 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D460B2EB1944D6A600A5D298 /* UIKit.framework */; };
D49E32B41946E176001B9BB1 /* graffiti_strokes.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = D49E32B31946E176001B9BB1 /* graffiti_strokes.jpeg */; };
D4B4ABBD1947520800052189 /* graffiti.plist in Resources */ = {isa = PBXBuildFile; fileRef = D4B4ABBC1947520800052189 /* graffiti.plist */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -316,7 +317,9 @@
D460B2AA1943CF7600A5D298 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0600;
LastSwiftMigration = 0730;
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = TouchCentric;
TargetAttributes = {
D460B2B11943CF7600A5D298 = {
Expand Down Expand Up @@ -359,7 +362,7 @@
D460B2BD1943CF7600A5D298 /* Main.storyboard in Resources */,
D460B2BF1943CF7600A5D298 /* Images.xcassets in Resources */,
D49E32B41946E176001B9BB1 /* graffiti_strokes.jpeg in Resources */,
D4B4ABBD1947520800052189 /* graffiti.plist in Resources */,
A50F7DAD1CE769C600E0D492 /* graffiti.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -374,6 +377,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A50F7DAB1CE7693800E0D492 /* graffiti.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -465,6 +469,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -479,11 +484,11 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
METAL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_MODULE_NAME = GestureKeyboard;
SDKROOT = iphoneos8.0;
SDKROOT = iphoneos;
SWIFT_OBJC_BRIDGING_HEADER = "CMUnistrokeGestureRecognizer/GestureKeyboard-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -518,11 +523,11 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
METAL_ENABLE_DEBUG_INFO = NO;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_MODULE_NAME = GestureKeyboard;
SDKROOT = iphoneos8.0;
SDKROOT = iphoneos;
SWIFT_OBJC_BRIDGING_HEADER = "CMUnistrokeGestureRecognizer/GestureKeyboard-Bridging-Header.h";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
Expand All @@ -534,8 +539,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = GestureKeyboard/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.touchcentric.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -545,8 +552,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = GestureKeyboard/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.touchcentric.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand All @@ -566,6 +575,7 @@
INFOPLIST_FILE = GestureKeyboardTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
METAL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.touchcentric.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
};
Expand All @@ -582,6 +592,7 @@
INFOPLIST_FILE = GestureKeyboardTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
METAL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.touchcentric.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
};
Expand All @@ -599,6 +610,7 @@
INFOPLIST_FILE = GestureKeyboardExtension/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
METAL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = "${PRODUCT_NAME}";
PRODUCT_NAME = "com.touchcentric.GestureKeyboard.$(TARGET_NAME:rfc1034identifier)";
SKIP_INSTALL = YES;
};
Expand All @@ -612,6 +624,7 @@
INFOPLIST_FILE = GestureKeyboardExtension/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
METAL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "${PRODUCT_NAME}";
PRODUCT_NAME = "com.touchcentric.GestureKeyboard.$(TARGET_NAME:rfc1034identifier)";
SKIP_INSTALL = YES;
};
Expand Down
4 changes: 2 additions & 2 deletions GestureKeyboard/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
/*func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
// Override point for customization after application launch.
return true
}
}*/

func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
Expand Down
15 changes: 7 additions & 8 deletions GestureKeyboard/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6154.17" systemVersion="13D65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6153.11"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -13,19 +14,18 @@
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" image="graffiti_strokes.jpeg" translatesAutoresizingMaskIntoConstraints="NO" id="Le6-3M-QYz">
<rect key="frame" x="40" y="0.0" width="400" height="480"/>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="graffiti_strokes.jpeg" translatesAutoresizingMaskIntoConstraints="NO" id="Le6-3M-QYz">
<rect key="frame" x="187.5" y="187.5" width="225" height="225"/>
</imageView>
</subviews>
<color key="backgroundColor" red="0.80000001192092896" green="0.80000001192092896" blue="0.80000001192092896" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="centerY" secondItem="Le6-3M-QYz" secondAttribute="centerY" id="8a1-Pb-MGy"/>
<constraint firstAttribute="centerX" secondItem="Le6-3M-QYz" secondAttribute="centerX" id="uWi-RC-BG0"/>
</constraints>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
</view>
<connections>
<outlet property="imageView" destination="Le6-3M-QYz" id="OKi-A5-Xba"/>
Expand All @@ -44,10 +44,9 @@
<viewControllerLayoutGuide type="bottom" id="Er0-V4-hg5"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="0Kh-ri-ppo">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ylv-jz-krq" userLabel="First Responder" sceneMemberID="firstResponder"/>
Expand Down
20 changes: 20 additions & 0 deletions GestureKeyboard/Images.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,31 @@
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "29x29",
Expand Down Expand Up @@ -44,6 +59,11 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
Expand Down
39 changes: 19 additions & 20 deletions GestureKeyboard/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.touchcentric.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -22,6 +22,24 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>IsASCIICapable</key>
<false/>
<key>PrefersRightToLeft</key>
<false/>
<key>PrimaryLanguage</key>
<string>en-US</string>
<key>RequestsOpenAccess</key>
<false/>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.keyboard-service</string>
<key>NSExtensionPrincipalClass</key>
<string>KeyboardViewController</string>
</dict>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
Expand All @@ -32,24 +50,5 @@
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>IsASCIICapable</key>
<false/>
<key>PrefersRightToLeft</key>
<false/>
<key>PrimaryLanguage</key>
<string>en-US</string>
<key>RequestsOpenAccess</key>
<false/>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.keyboard-service</string>
<key>NSExtensionPrincipalClass</key>
<string>KeyboardViewController</string>
</dict>

</dict>
</plist>
46 changes: 21 additions & 25 deletions GestureKeyboard/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,23 @@ import UIKit

class ViewController: UIViewController {

@IBOutlet var imageView : UIImageView
@IBOutlet var imageView : UIImageView?

@IBOutlet var label : UILabel

var plist:String = NSBundle.mainBundle().pathForResource("graffiti", ofType: "plist")
@IBOutlet var label : UILabel?

override func viewDidLoad() {
super.viewDidLoad()

var a = CMUnistrokeGestureRecognizer(target: self, action: "gotGesture:" )
var dict = NSDictionary(contentsOfFile: plist) // COMPILER BUG: as Dictionary<String, String[]>
var keys:String[] = dict.allKeys as String[]

for letter:String in keys {
var path = UIBezierPath()

guard let plist = NSBundle.mainBundle().pathForResource("graffiti", ofType: "plist") else {return}

let a = CMUnistrokeGestureRecognizer(target: self, action: #selector(ViewController.gotGesture(_:)) )
guard let dict = NSDictionary(contentsOfFile: plist) else {return}

for (letter, points) in dict {
let path = UIBezierPath()
var first = true
var points = dict[letter] as String[]
for p in points {
var cgp = CGPointFromString(p)
for p in points as! [String] {
let cgp = CGPointFromString(p)
if (first) {
path.moveToPoint(cgp)
first = false
Expand All @@ -39,11 +37,11 @@ class ViewController: UIViewController {
}
}
path.closePath();
a.registerUnistrokeWithName( letter, bezierPath: path)
a.registerUnistrokeWithName(letter as! String, bezierPath: path)
}


var drawView = UIView() as UIView
let drawView = UIView() as UIView
drawView.frame = CGRectMake(0, 0, 120, 120)
drawView.center = self.view.center
drawView.center.y = drawView.center.y + 180
Expand All @@ -56,21 +54,19 @@ class ViewController: UIViewController {
}

func gotGesture( r : CMUnistrokeGestureRecognizer ) {
var path = r.strokePath
var name = r.result.recognizedStrokeName

println("gotGesture: \(name)")

label.text = label.text + name;

_ = r.strokePath
let name = r.result.recognizedStrokeName

print("gotGesture: \(name)")

if let l = label {
l.text = (l.text ?? "") + name;
}
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}


}

2 changes: 1 addition & 1 deletion GestureKeyboardExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_NAME}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
Loading