├── .gitignore ├── README.markdown ├── iOS Keyboards Example ├── iOS Custom Keyboards.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── kulpreet.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── kulpreet.xcuserdatad │ │ └── xcschemes │ │ ├── iOS Custom Keyboards.xcscheme │ │ └── xcschememanagement.plist └── iOS Custom Keyboards │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── UTAppDelegate.h │ ├── UTAppDelegate.m │ ├── UTViewController.h │ ├── UTViewController.m │ ├── en.lproj │ ├── InfoPlist.strings │ ├── MainStoryboard_iPad.storyboard │ └── MainStoryboard_iPhone.storyboard │ ├── iOS Custom Keyboards-Info.plist │ ├── iOS Custom Keyboards-Prefix.pch │ └── main.m ├── iPad ├── Images │ ├── Keyboard_Blank.png │ ├── Keyboard_Blank@2x.png │ ├── Keyboard_Blank_iOS7.png │ ├── Keyboard_Blank_iOS7@2x.png │ ├── Keyboard_Shift.png │ ├── Keyboard_Shift@2x.png │ ├── Keyboard_Shift_iOS7.png │ └── Keyboard_Shift_iOS7@2x.png ├── PKCustomKeyboard.h ├── PKCustomKeyboard.m └── PKCustomKeyboard.xib └── iPhone:iPod ├── Images ├── delete.png ├── delete@2x.png ├── delete_iOS7.png ├── delete_iOS7@2x.png ├── glow.png ├── iOS7_Keyboard.png ├── iOS7_Keyboard@2x.png ├── iOS_Keyboard.png ├── iOS_Keyboard@2x.png ├── return.png └── return@2x.png ├── PMCustomKeyboard.h ├── PMCustomKeyboard.m └── PMCustomKeyboard.xib /.gitignore: -------------------------------------------------------------------------------- 1 | ##### 2 | # OS X temporary files that should never be committed 3 | 4 | .DS_Store 5 | *.swp 6 | *.lock 7 | profile 8 | 9 | 10 | #### 11 | # Xcode temporary files that should never be committed 12 | # 13 | # NB: NIB/XIB files still exist even on Storyboard projects, so we want this... 14 | 15 | *~.nib 16 | 17 | 18 | #### 19 | # Xcode build files - 20 | # 21 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData" 22 | 23 | DerivedData/ 24 | 25 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build" 26 | 27 | build/ 28 | 29 | 30 | ##### 31 | # Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups) 32 | # 33 | # This is complicated: 34 | # 35 | # SOMETIMES you need to put this file in version control. 36 | # Apple designed it poorly - if you use "custom executables", they are 37 | # saved in this file. 38 | # 99% of projects do NOT use those, so they do NOT want to version control this file. 39 | # ..but if you're in the 1%, comment out the line "*.pbxuser" 40 | 41 | *.pbxuser 42 | *.mode1v3 43 | *.mode2v3 44 | *.perspectivev3 45 | # NB: also, whitelist the default ones, some projects need to use these 46 | !default.pbxuser 47 | !default.mode1v3 48 | !default.mode2v3 49 | !default.perspectivev3 50 | 51 | 52 | #### 53 | # Xcode 4 - semi-personal settings, often included in workspaces 54 | # 55 | # You can safely ignore the xcuserdata files - but do NOT ignore the files next to them 56 | # 57 | 58 | xcuserdata 59 | *.xcuserstate 60 | *.xccheckout 61 | 62 | #### 63 | # XCode 4 workspaces - more detailed 64 | # 65 | # Workspaces are important! They are a core feature of Xcode - don't exclude them :) 66 | # 67 | # Workspace layout is quite spammy. For reference: 68 | # 69 | # (root)/ 70 | # (project-name).xcodeproj/ 71 | # project.pbxproj 72 | # project.xcworkspace/ 73 | # contents.xcworkspacedata 74 | # xcuserdata/ 75 | # (your name)/xcuserdatad/ 76 | # xcuserdata/ 77 | # (your name)/xcuserdatad/ 78 | # 79 | # 80 | # 81 | # Xcode 4 workspaces - SHARED 82 | # 83 | # This is UNDOCUMENTED (google: "developer.apple.com xcshareddata" - 0 results 84 | # But if you're going to kill personal workspaces, at least keep the shared ones... 85 | # 86 | # 87 | !xcshareddata 88 | 89 | 90 | #### 91 | # Xcode 4 - Deprecated classes 92 | # 93 | # Allegedly, if you manually "deprecate" your classes, they get moved here. 94 | # 95 | # We're using source-control, so this is a "feature" that we do not want! 96 | 97 | *.moved-aside 98 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | Custom Keyboards for iOS 2 | ========= 3 | 4 | #### An easily customizable iOS keyboard #### 5 | 6 | Custom Keyboards for iOS allows you to create a keyboard `inputView` that looks and feels just like the iPad or iPhone/iPod touch keyboard. It is particularly useful for developers who are looking to add keyboard input for language that is not natively supported by iOS. The included example project is for a Punjabi keyboard. 7 | 8 | ## Installation & Usage 9 | 10 | ### Setup 11 | 12 | Add the `iPad` and/or `iPhone:iPod` directory to your target in Xcode. `PKCustomKeyboard.h` contains all of the customizable constants for the iPad keyboard. `PMCustomKeyboard.h` contains all of the customizable constants for the iPhone/iPod touch keyboard. Characters in the `kChar` array can start or end with ◌ (U+25CC) and the ◌ will not appear when inputted into the textView. This is particularly useful for diacritical characters. 13 | 14 | Make sure to import `PKCustomKeyboard.h` and `PMCustomKeyboard.h` into your view controller's header file. 15 | 16 | ### Usage 17 | Insert the following into the `viewDidLoad` of your view controller or wherever else you see fit. You can `setTextView` to any `UITextView` or `UITextField` that you want the keyboard to appear for. 18 | 19 | ```objective-c 20 | 21 | if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ) 22 | { 23 | PMCustomKeyboard *customKeyboard = [[PMCustomKeyboard alloc] init]; 24 | [customKeyboard setTextView:self.textView]; 25 | 26 | } 27 | else { 28 | PKCustomKeyboard *customKeyboard = [[PKCustomKeyboard alloc] init]; 29 | [customKeyboard setTextView:self.textView]; 30 | } 31 | 32 | ``` 33 | 34 | ## License 35 | Copyright (c) 2012 Kulpreet Chilana 36 | 37 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 38 | 39 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 40 | 41 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 42 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A36611631649D4B500088AF4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A36611621649D4B500088AF4 /* UIKit.framework */; }; 11 | A36611651649D4B500088AF4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A36611641649D4B500088AF4 /* Foundation.framework */; }; 12 | A36611671649D4B500088AF4 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A36611661649D4B500088AF4 /* CoreGraphics.framework */; }; 13 | A366116D1649D4B500088AF4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A366116B1649D4B500088AF4 /* InfoPlist.strings */; }; 14 | A366116F1649D4B500088AF4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A366116E1649D4B500088AF4 /* main.m */; }; 15 | A36611731649D4B500088AF4 /* UTAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A36611721649D4B500088AF4 /* UTAppDelegate.m */; }; 16 | A36611751649D4B500088AF4 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = A36611741649D4B500088AF4 /* Default.png */; }; 17 | A36611771649D4B500088AF4 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A36611761649D4B500088AF4 /* Default@2x.png */; }; 18 | A36611791649D4B500088AF4 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A36611781649D4B500088AF4 /* Default-568h@2x.png */; }; 19 | A366117C1649D4B500088AF4 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A366117A1649D4B500088AF4 /* MainStoryboard_iPhone.storyboard */; }; 20 | A366117F1649D4B500088AF4 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A366117D1649D4B500088AF4 /* MainStoryboard_iPad.storyboard */; }; 21 | A36611821649D4B500088AF4 /* UTViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A36611811649D4B500088AF4 /* UTViewController.m */; }; 22 | A36D56F6189325BF00A2F078 /* Keyboard_Blank.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56DB189325BF00A2F078 /* Keyboard_Blank.png */; }; 23 | A36D56F7189325BF00A2F078 /* Keyboard_Blank@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56DC189325BF00A2F078 /* Keyboard_Blank@2x.png */; }; 24 | A36D56F8189325BF00A2F078 /* Keyboard_Blank_iOS7.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56DD189325BF00A2F078 /* Keyboard_Blank_iOS7.png */; }; 25 | A36D56F9189325BF00A2F078 /* Keyboard_Blank_iOS7@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56DE189325BF00A2F078 /* Keyboard_Blank_iOS7@2x.png */; }; 26 | A36D56FA189325BF00A2F078 /* Keyboard_Shift.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56DF189325BF00A2F078 /* Keyboard_Shift.png */; }; 27 | A36D56FB189325BF00A2F078 /* Keyboard_Shift@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56E0189325BF00A2F078 /* Keyboard_Shift@2x.png */; }; 28 | A36D56FC189325BF00A2F078 /* Keyboard_Shift_iOS7.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56E1189325BF00A2F078 /* Keyboard_Shift_iOS7.png */; }; 29 | A36D56FD189325BF00A2F078 /* Keyboard_Shift_iOS7@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56E2189325BF00A2F078 /* Keyboard_Shift_iOS7@2x.png */; }; 30 | A36D56FE189325BF00A2F078 /* PKCustomKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = A36D56E4189325BF00A2F078 /* PKCustomKeyboard.m */; }; 31 | A36D56FF189325BF00A2F078 /* PKCustomKeyboard.xib in Resources */ = {isa = PBXBuildFile; fileRef = A36D56E5189325BF00A2F078 /* PKCustomKeyboard.xib */; }; 32 | A36D5700189325BF00A2F078 /* delete.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56E8189325BF00A2F078 /* delete.png */; }; 33 | A36D5701189325BF00A2F078 /* delete@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56E9189325BF00A2F078 /* delete@2x.png */; }; 34 | A36D5702189325BF00A2F078 /* delete_iOS7.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56EA189325BF00A2F078 /* delete_iOS7.png */; }; 35 | A36D5703189325BF00A2F078 /* delete_iOS7@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56EB189325BF00A2F078 /* delete_iOS7@2x.png */; }; 36 | A36D5704189325BF00A2F078 /* glow.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56EC189325BF00A2F078 /* glow.png */; }; 37 | A36D5705189325BF00A2F078 /* iOS7_Keyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56ED189325BF00A2F078 /* iOS7_Keyboard.png */; }; 38 | A36D5706189325BF00A2F078 /* iOS7_Keyboard@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56EE189325BF00A2F078 /* iOS7_Keyboard@2x.png */; }; 39 | A36D5707189325BF00A2F078 /* iOS_Keyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56EF189325BF00A2F078 /* iOS_Keyboard.png */; }; 40 | A36D5708189325BF00A2F078 /* iOS_Keyboard@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56F0189325BF00A2F078 /* iOS_Keyboard@2x.png */; }; 41 | A36D5709189325BF00A2F078 /* return.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56F1189325BF00A2F078 /* return.png */; }; 42 | A36D570A189325BF00A2F078 /* return@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A36D56F2189325BF00A2F078 /* return@2x.png */; }; 43 | A36D570B189325BF00A2F078 /* PMCustomKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = A36D56F4189325BF00A2F078 /* PMCustomKeyboard.m */; }; 44 | A36D570C189325BF00A2F078 /* PMCustomKeyboard.xib in Resources */ = {isa = PBXBuildFile; fileRef = A36D56F5189325BF00A2F078 /* PMCustomKeyboard.xib */; }; 45 | /* End PBXBuildFile section */ 46 | 47 | /* Begin PBXFileReference section */ 48 | A366115E1649D4B500088AF4 /* iOS Custom Keyboards.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS Custom Keyboards.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | A36611621649D4B500088AF4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 50 | A36611641649D4B500088AF4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 51 | A36611661649D4B500088AF4 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 52 | A366116A1649D4B500088AF4 /* iOS Custom Keyboards-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "iOS Custom Keyboards-Info.plist"; sourceTree = ""; }; 53 | A366116C1649D4B500088AF4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 54 | A366116E1649D4B500088AF4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 55 | A36611701649D4B500088AF4 /* iOS Custom Keyboards-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "iOS Custom Keyboards-Prefix.pch"; sourceTree = ""; }; 56 | A36611711649D4B500088AF4 /* UTAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UTAppDelegate.h; sourceTree = ""; }; 57 | A36611721649D4B500088AF4 /* UTAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UTAppDelegate.m; sourceTree = ""; }; 58 | A36611741649D4B500088AF4 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 59 | A36611761649D4B500088AF4 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 60 | A36611781649D4B500088AF4 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 61 | A366117B1649D4B500088AF4 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; 62 | A366117E1649D4B500088AF4 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; 63 | A36611801649D4B500088AF4 /* UTViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UTViewController.h; sourceTree = ""; }; 64 | A36611811649D4B500088AF4 /* UTViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UTViewController.m; sourceTree = ""; }; 65 | A36D56DB189325BF00A2F078 /* Keyboard_Blank.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Keyboard_Blank.png; sourceTree = ""; }; 66 | A36D56DC189325BF00A2F078 /* Keyboard_Blank@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Keyboard_Blank@2x.png"; sourceTree = ""; }; 67 | A36D56DD189325BF00A2F078 /* Keyboard_Blank_iOS7.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Keyboard_Blank_iOS7.png; sourceTree = ""; }; 68 | A36D56DE189325BF00A2F078 /* Keyboard_Blank_iOS7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Keyboard_Blank_iOS7@2x.png"; sourceTree = ""; }; 69 | A36D56DF189325BF00A2F078 /* Keyboard_Shift.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Keyboard_Shift.png; sourceTree = ""; }; 70 | A36D56E0189325BF00A2F078 /* Keyboard_Shift@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Keyboard_Shift@2x.png"; sourceTree = ""; }; 71 | A36D56E1189325BF00A2F078 /* Keyboard_Shift_iOS7.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Keyboard_Shift_iOS7.png; sourceTree = ""; }; 72 | A36D56E2189325BF00A2F078 /* Keyboard_Shift_iOS7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Keyboard_Shift_iOS7@2x.png"; sourceTree = ""; }; 73 | A36D56E3189325BF00A2F078 /* PKCustomKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PKCustomKeyboard.h; sourceTree = ""; }; 74 | A36D56E4189325BF00A2F078 /* PKCustomKeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PKCustomKeyboard.m; sourceTree = ""; }; 75 | A36D56E5189325BF00A2F078 /* PKCustomKeyboard.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PKCustomKeyboard.xib; sourceTree = ""; }; 76 | A36D56E8189325BF00A2F078 /* delete.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = delete.png; sourceTree = ""; }; 77 | A36D56E9189325BF00A2F078 /* delete@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "delete@2x.png"; sourceTree = ""; }; 78 | A36D56EA189325BF00A2F078 /* delete_iOS7.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = delete_iOS7.png; sourceTree = ""; }; 79 | A36D56EB189325BF00A2F078 /* delete_iOS7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "delete_iOS7@2x.png"; sourceTree = ""; }; 80 | A36D56EC189325BF00A2F078 /* glow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = glow.png; sourceTree = ""; }; 81 | A36D56ED189325BF00A2F078 /* iOS7_Keyboard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = iOS7_Keyboard.png; sourceTree = ""; }; 82 | A36D56EE189325BF00A2F078 /* iOS7_Keyboard@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "iOS7_Keyboard@2x.png"; sourceTree = ""; }; 83 | A36D56EF189325BF00A2F078 /* iOS_Keyboard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = iOS_Keyboard.png; sourceTree = ""; }; 84 | A36D56F0189325BF00A2F078 /* iOS_Keyboard@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "iOS_Keyboard@2x.png"; sourceTree = ""; }; 85 | A36D56F1189325BF00A2F078 /* return.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = return.png; sourceTree = ""; }; 86 | A36D56F2189325BF00A2F078 /* return@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "return@2x.png"; sourceTree = ""; }; 87 | A36D56F3189325BF00A2F078 /* PMCustomKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PMCustomKeyboard.h; sourceTree = ""; }; 88 | A36D56F4189325BF00A2F078 /* PMCustomKeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PMCustomKeyboard.m; sourceTree = ""; }; 89 | A36D56F5189325BF00A2F078 /* PMCustomKeyboard.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PMCustomKeyboard.xib; sourceTree = ""; }; 90 | /* End PBXFileReference section */ 91 | 92 | /* Begin PBXFrameworksBuildPhase section */ 93 | A366115B1649D4B500088AF4 /* Frameworks */ = { 94 | isa = PBXFrameworksBuildPhase; 95 | buildActionMask = 2147483647; 96 | files = ( 97 | A36611631649D4B500088AF4 /* UIKit.framework in Frameworks */, 98 | A36611651649D4B500088AF4 /* Foundation.framework in Frameworks */, 99 | A36611671649D4B500088AF4 /* CoreGraphics.framework in Frameworks */, 100 | ); 101 | runOnlyForDeploymentPostprocessing = 0; 102 | }; 103 | /* End PBXFrameworksBuildPhase section */ 104 | 105 | /* Begin PBXGroup section */ 106 | A36611531649D4B500088AF4 = { 107 | isa = PBXGroup; 108 | children = ( 109 | A36D56D9189325BF00A2F078 /* iPad */, 110 | A36D56E6189325BF00A2F078 /* iPhone:iPod */, 111 | A36611681649D4B500088AF4 /* iOS Custom Keyboards */, 112 | A36611611649D4B500088AF4 /* Frameworks */, 113 | A366115F1649D4B500088AF4 /* Products */, 114 | ); 115 | sourceTree = ""; 116 | }; 117 | A366115F1649D4B500088AF4 /* Products */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | A366115E1649D4B500088AF4 /* iOS Custom Keyboards.app */, 121 | ); 122 | name = Products; 123 | sourceTree = ""; 124 | }; 125 | A36611611649D4B500088AF4 /* Frameworks */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | A36611621649D4B500088AF4 /* UIKit.framework */, 129 | A36611641649D4B500088AF4 /* Foundation.framework */, 130 | A36611661649D4B500088AF4 /* CoreGraphics.framework */, 131 | ); 132 | name = Frameworks; 133 | sourceTree = ""; 134 | }; 135 | A36611681649D4B500088AF4 /* iOS Custom Keyboards */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | A36611711649D4B500088AF4 /* UTAppDelegate.h */, 139 | A36611721649D4B500088AF4 /* UTAppDelegate.m */, 140 | A366117A1649D4B500088AF4 /* MainStoryboard_iPhone.storyboard */, 141 | A366117D1649D4B500088AF4 /* MainStoryboard_iPad.storyboard */, 142 | A36611801649D4B500088AF4 /* UTViewController.h */, 143 | A36611811649D4B500088AF4 /* UTViewController.m */, 144 | A36611691649D4B500088AF4 /* Supporting Files */, 145 | ); 146 | path = "iOS Custom Keyboards"; 147 | sourceTree = ""; 148 | }; 149 | A36611691649D4B500088AF4 /* Supporting Files */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | A366116A1649D4B500088AF4 /* iOS Custom Keyboards-Info.plist */, 153 | A366116B1649D4B500088AF4 /* InfoPlist.strings */, 154 | A366116E1649D4B500088AF4 /* main.m */, 155 | A36611701649D4B500088AF4 /* iOS Custom Keyboards-Prefix.pch */, 156 | A36611741649D4B500088AF4 /* Default.png */, 157 | A36611761649D4B500088AF4 /* Default@2x.png */, 158 | A36611781649D4B500088AF4 /* Default-568h@2x.png */, 159 | ); 160 | name = "Supporting Files"; 161 | sourceTree = ""; 162 | }; 163 | A36D56D9189325BF00A2F078 /* iPad */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | A36D56DA189325BF00A2F078 /* Images */, 167 | A36D56E3189325BF00A2F078 /* PKCustomKeyboard.h */, 168 | A36D56E4189325BF00A2F078 /* PKCustomKeyboard.m */, 169 | A36D56E5189325BF00A2F078 /* PKCustomKeyboard.xib */, 170 | ); 171 | name = iPad; 172 | path = ../iPad; 173 | sourceTree = ""; 174 | }; 175 | A36D56DA189325BF00A2F078 /* Images */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | A36D56DB189325BF00A2F078 /* Keyboard_Blank.png */, 179 | A36D56DC189325BF00A2F078 /* Keyboard_Blank@2x.png */, 180 | A36D56DD189325BF00A2F078 /* Keyboard_Blank_iOS7.png */, 181 | A36D56DE189325BF00A2F078 /* Keyboard_Blank_iOS7@2x.png */, 182 | A36D56DF189325BF00A2F078 /* Keyboard_Shift.png */, 183 | A36D56E0189325BF00A2F078 /* Keyboard_Shift@2x.png */, 184 | A36D56E1189325BF00A2F078 /* Keyboard_Shift_iOS7.png */, 185 | A36D56E2189325BF00A2F078 /* Keyboard_Shift_iOS7@2x.png */, 186 | ); 187 | path = Images; 188 | sourceTree = ""; 189 | }; 190 | A36D56E6189325BF00A2F078 /* iPhone:iPod */ = { 191 | isa = PBXGroup; 192 | children = ( 193 | A36D56E7189325BF00A2F078 /* Images */, 194 | A36D56F3189325BF00A2F078 /* PMCustomKeyboard.h */, 195 | A36D56F4189325BF00A2F078 /* PMCustomKeyboard.m */, 196 | A36D56F5189325BF00A2F078 /* PMCustomKeyboard.xib */, 197 | ); 198 | name = "iPhone:iPod"; 199 | path = "../iPhone:iPod"; 200 | sourceTree = ""; 201 | }; 202 | A36D56E7189325BF00A2F078 /* Images */ = { 203 | isa = PBXGroup; 204 | children = ( 205 | A36D56E8189325BF00A2F078 /* delete.png */, 206 | A36D56E9189325BF00A2F078 /* delete@2x.png */, 207 | A36D56EA189325BF00A2F078 /* delete_iOS7.png */, 208 | A36D56EB189325BF00A2F078 /* delete_iOS7@2x.png */, 209 | A36D56EC189325BF00A2F078 /* glow.png */, 210 | A36D56ED189325BF00A2F078 /* iOS7_Keyboard.png */, 211 | A36D56EE189325BF00A2F078 /* iOS7_Keyboard@2x.png */, 212 | A36D56EF189325BF00A2F078 /* iOS_Keyboard.png */, 213 | A36D56F0189325BF00A2F078 /* iOS_Keyboard@2x.png */, 214 | A36D56F1189325BF00A2F078 /* return.png */, 215 | A36D56F2189325BF00A2F078 /* return@2x.png */, 216 | ); 217 | path = Images; 218 | sourceTree = ""; 219 | }; 220 | /* End PBXGroup section */ 221 | 222 | /* Begin PBXNativeTarget section */ 223 | A366115D1649D4B500088AF4 /* iOS Custom Keyboards */ = { 224 | isa = PBXNativeTarget; 225 | buildConfigurationList = A36611851649D4B500088AF4 /* Build configuration list for PBXNativeTarget "iOS Custom Keyboards" */; 226 | buildPhases = ( 227 | A366115A1649D4B500088AF4 /* Sources */, 228 | A366115B1649D4B500088AF4 /* Frameworks */, 229 | A366115C1649D4B500088AF4 /* Resources */, 230 | ); 231 | buildRules = ( 232 | ); 233 | dependencies = ( 234 | ); 235 | name = "iOS Custom Keyboards"; 236 | productName = "iOS Custom Keyboards"; 237 | productReference = A366115E1649D4B500088AF4 /* iOS Custom Keyboards.app */; 238 | productType = "com.apple.product-type.application"; 239 | }; 240 | /* End PBXNativeTarget section */ 241 | 242 | /* Begin PBXProject section */ 243 | A36611551649D4B500088AF4 /* Project object */ = { 244 | isa = PBXProject; 245 | attributes = { 246 | CLASSPREFIX = UT; 247 | LastUpgradeCheck = 0450; 248 | ORGANIZATIONNAME = "Kulpreet Chilana"; 249 | }; 250 | buildConfigurationList = A36611581649D4B500088AF4 /* Build configuration list for PBXProject "iOS Custom Keyboards" */; 251 | compatibilityVersion = "Xcode 3.2"; 252 | developmentRegion = English; 253 | hasScannedForEncodings = 0; 254 | knownRegions = ( 255 | en, 256 | ); 257 | mainGroup = A36611531649D4B500088AF4; 258 | productRefGroup = A366115F1649D4B500088AF4 /* Products */; 259 | projectDirPath = ""; 260 | projectRoot = ""; 261 | targets = ( 262 | A366115D1649D4B500088AF4 /* iOS Custom Keyboards */, 263 | ); 264 | }; 265 | /* End PBXProject section */ 266 | 267 | /* Begin PBXResourcesBuildPhase section */ 268 | A366115C1649D4B500088AF4 /* Resources */ = { 269 | isa = PBXResourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | A36D5700189325BF00A2F078 /* delete.png in Resources */, 273 | A36D5706189325BF00A2F078 /* iOS7_Keyboard@2x.png in Resources */, 274 | A36D56FD189325BF00A2F078 /* Keyboard_Shift_iOS7@2x.png in Resources */, 275 | A36D5708189325BF00A2F078 /* iOS_Keyboard@2x.png in Resources */, 276 | A36D5701189325BF00A2F078 /* delete@2x.png in Resources */, 277 | A366116D1649D4B500088AF4 /* InfoPlist.strings in Resources */, 278 | A36D5705189325BF00A2F078 /* iOS7_Keyboard.png in Resources */, 279 | A36611751649D4B500088AF4 /* Default.png in Resources */, 280 | A36D56F9189325BF00A2F078 /* Keyboard_Blank_iOS7@2x.png in Resources */, 281 | A36D56FF189325BF00A2F078 /* PKCustomKeyboard.xib in Resources */, 282 | A36D56F7189325BF00A2F078 /* Keyboard_Blank@2x.png in Resources */, 283 | A36D5702189325BF00A2F078 /* delete_iOS7.png in Resources */, 284 | A36D56FB189325BF00A2F078 /* Keyboard_Shift@2x.png in Resources */, 285 | A36D56FC189325BF00A2F078 /* Keyboard_Shift_iOS7.png in Resources */, 286 | A36D56F8189325BF00A2F078 /* Keyboard_Blank_iOS7.png in Resources */, 287 | A36611771649D4B500088AF4 /* Default@2x.png in Resources */, 288 | A36611791649D4B500088AF4 /* Default-568h@2x.png in Resources */, 289 | A36D56F6189325BF00A2F078 /* Keyboard_Blank.png in Resources */, 290 | A36D5703189325BF00A2F078 /* delete_iOS7@2x.png in Resources */, 291 | A36D5709189325BF00A2F078 /* return.png in Resources */, 292 | A36D570A189325BF00A2F078 /* return@2x.png in Resources */, 293 | A36D5704189325BF00A2F078 /* glow.png in Resources */, 294 | A36D5707189325BF00A2F078 /* iOS_Keyboard.png in Resources */, 295 | A366117C1649D4B500088AF4 /* MainStoryboard_iPhone.storyboard in Resources */, 296 | A366117F1649D4B500088AF4 /* MainStoryboard_iPad.storyboard in Resources */, 297 | A36D56FA189325BF00A2F078 /* Keyboard_Shift.png in Resources */, 298 | A36D570C189325BF00A2F078 /* PMCustomKeyboard.xib in Resources */, 299 | ); 300 | runOnlyForDeploymentPostprocessing = 0; 301 | }; 302 | /* End PBXResourcesBuildPhase section */ 303 | 304 | /* Begin PBXSourcesBuildPhase section */ 305 | A366115A1649D4B500088AF4 /* Sources */ = { 306 | isa = PBXSourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | A36D56FE189325BF00A2F078 /* PKCustomKeyboard.m in Sources */, 310 | A366116F1649D4B500088AF4 /* main.m in Sources */, 311 | A36611731649D4B500088AF4 /* UTAppDelegate.m in Sources */, 312 | A36D570B189325BF00A2F078 /* PMCustomKeyboard.m in Sources */, 313 | A36611821649D4B500088AF4 /* UTViewController.m in Sources */, 314 | ); 315 | runOnlyForDeploymentPostprocessing = 0; 316 | }; 317 | /* End PBXSourcesBuildPhase section */ 318 | 319 | /* Begin PBXVariantGroup section */ 320 | A366116B1649D4B500088AF4 /* InfoPlist.strings */ = { 321 | isa = PBXVariantGroup; 322 | children = ( 323 | A366116C1649D4B500088AF4 /* en */, 324 | ); 325 | name = InfoPlist.strings; 326 | sourceTree = ""; 327 | }; 328 | A366117A1649D4B500088AF4 /* MainStoryboard_iPhone.storyboard */ = { 329 | isa = PBXVariantGroup; 330 | children = ( 331 | A366117B1649D4B500088AF4 /* en */, 332 | ); 333 | name = MainStoryboard_iPhone.storyboard; 334 | sourceTree = ""; 335 | }; 336 | A366117D1649D4B500088AF4 /* MainStoryboard_iPad.storyboard */ = { 337 | isa = PBXVariantGroup; 338 | children = ( 339 | A366117E1649D4B500088AF4 /* en */, 340 | ); 341 | name = MainStoryboard_iPad.storyboard; 342 | sourceTree = ""; 343 | }; 344 | /* End PBXVariantGroup section */ 345 | 346 | /* Begin XCBuildConfiguration section */ 347 | A36611831649D4B500088AF4 /* Debug */ = { 348 | isa = XCBuildConfiguration; 349 | buildSettings = { 350 | ALWAYS_SEARCH_USER_PATHS = NO; 351 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 352 | CLANG_CXX_LIBRARY = "libc++"; 353 | CLANG_ENABLE_OBJC_ARC = YES; 354 | CLANG_WARN_EMPTY_BODY = YES; 355 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 356 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 357 | COPY_PHASE_STRIP = NO; 358 | GCC_C_LANGUAGE_STANDARD = gnu99; 359 | GCC_DYNAMIC_NO_PIC = NO; 360 | GCC_OPTIMIZATION_LEVEL = 0; 361 | GCC_PREPROCESSOR_DEFINITIONS = ( 362 | "DEBUG=1", 363 | "$(inherited)", 364 | ); 365 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 366 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 367 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 368 | GCC_WARN_UNUSED_VARIABLE = YES; 369 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 370 | ONLY_ACTIVE_ARCH = YES; 371 | SDKROOT = iphoneos; 372 | TARGETED_DEVICE_FAMILY = "1,2"; 373 | }; 374 | name = Debug; 375 | }; 376 | A36611841649D4B500088AF4 /* Release */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | ALWAYS_SEARCH_USER_PATHS = NO; 380 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 381 | CLANG_CXX_LIBRARY = "libc++"; 382 | CLANG_ENABLE_OBJC_ARC = YES; 383 | CLANG_WARN_EMPTY_BODY = YES; 384 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 385 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 386 | COPY_PHASE_STRIP = YES; 387 | GCC_C_LANGUAGE_STANDARD = gnu99; 388 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 389 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 390 | GCC_WARN_UNUSED_VARIABLE = YES; 391 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 392 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 393 | SDKROOT = iphoneos; 394 | TARGETED_DEVICE_FAMILY = "1,2"; 395 | VALIDATE_PRODUCT = YES; 396 | }; 397 | name = Release; 398 | }; 399 | A36611861649D4B500088AF4 /* Debug */ = { 400 | isa = XCBuildConfiguration; 401 | buildSettings = { 402 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 403 | GCC_PREFIX_HEADER = "iOS Custom Keyboards/iOS Custom Keyboards-Prefix.pch"; 404 | INFOPLIST_FILE = "iOS Custom Keyboards/iOS Custom Keyboards-Info.plist"; 405 | PRODUCT_NAME = "$(TARGET_NAME)"; 406 | WRAPPER_EXTENSION = app; 407 | }; 408 | name = Debug; 409 | }; 410 | A36611871649D4B500088AF4 /* Release */ = { 411 | isa = XCBuildConfiguration; 412 | buildSettings = { 413 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 414 | GCC_PREFIX_HEADER = "iOS Custom Keyboards/iOS Custom Keyboards-Prefix.pch"; 415 | INFOPLIST_FILE = "iOS Custom Keyboards/iOS Custom Keyboards-Info.plist"; 416 | PRODUCT_NAME = "$(TARGET_NAME)"; 417 | WRAPPER_EXTENSION = app; 418 | }; 419 | name = Release; 420 | }; 421 | /* End XCBuildConfiguration section */ 422 | 423 | /* Begin XCConfigurationList section */ 424 | A36611581649D4B500088AF4 /* Build configuration list for PBXProject "iOS Custom Keyboards" */ = { 425 | isa = XCConfigurationList; 426 | buildConfigurations = ( 427 | A36611831649D4B500088AF4 /* Debug */, 428 | A36611841649D4B500088AF4 /* Release */, 429 | ); 430 | defaultConfigurationIsVisible = 0; 431 | defaultConfigurationName = Release; 432 | }; 433 | A36611851649D4B500088AF4 /* Build configuration list for PBXNativeTarget "iOS Custom Keyboards" */ = { 434 | isa = XCConfigurationList; 435 | buildConfigurations = ( 436 | A36611861649D4B500088AF4 /* Debug */, 437 | A36611871649D4B500088AF4 /* Release */, 438 | ); 439 | defaultConfigurationIsVisible = 0; 440 | defaultConfigurationName = Release; 441 | }; 442 | /* End XCConfigurationList section */ 443 | }; 444 | rootObject = A36611551649D4B500088AF4 /* Project object */; 445 | } 446 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards.xcodeproj/project.xcworkspace/xcuserdata/kulpreet.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iOS Keyboards Example/iOS Custom Keyboards.xcodeproj/project.xcworkspace/xcuserdata/kulpreet.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards.xcodeproj/xcuserdata/kulpreet.xcuserdatad/xcschemes/iOS Custom Keyboards.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards.xcodeproj/xcuserdata/kulpreet.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | iOS Custom Keyboards.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | A366115D1649D4B500088AF4 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iOS Keyboards Example/iOS Custom Keyboards/Default-568h@2x.png -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iOS Keyboards Example/iOS Custom Keyboards/Default.png -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iOS Keyboards Example/iOS Custom Keyboards/Default@2x.png -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/UTAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // UTAppDelegate.h 3 | // iOS Custom Keyboards 4 | // 5 | // Created by Kulpreet Chilana on 11/6/12. 6 | // Copyright (c) 2012 Kulpreet Chilana. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UTAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/UTAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // UTAppDelegate.m 3 | // iOS Custom Keyboards 4 | // 5 | // Created by Kulpreet Chilana on 11/6/12. 6 | // Copyright (c) 2012 Kulpreet Chilana. All rights reserved. 7 | // 8 | 9 | #import "UTAppDelegate.h" 10 | 11 | @implementation UTAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/UTViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UTViewController.h 3 | // iOS Custom Keyboards 4 | // 5 | // Created by Kulpreet Chilana on 11/6/12. 6 | // Copyright (c) 2012 Kulpreet Chilana. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "PKCustomKeyboard.h" 11 | #import "PMCustomKeyboard.h" 12 | 13 | @interface UTViewController : UIViewController 14 | 15 | @property (strong, nonatomic) IBOutlet UITextView *textView; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/UTViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // UTViewController.m 3 | // iOS Custom Keyboards 4 | // 5 | // Created by Kulpreet Chilana on 11/6/12. 6 | // Copyright (c) 2012 Kulpreet Chilana. All rights reserved. 7 | // 8 | 9 | #import "UTViewController.h" 10 | 11 | @interface UTViewController () 12 | 13 | @end 14 | 15 | @implementation UTViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | 21 | if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ) 22 | { 23 | PMCustomKeyboard *customKeyboard = [[PMCustomKeyboard alloc] init]; 24 | [customKeyboard setTextView:self.textView]; 25 | 26 | } 27 | else { 28 | PKCustomKeyboard *customKeyboard = [[PKCustomKeyboard alloc] init]; 29 | [customKeyboard setTextView:self.textView]; 30 | } 31 | } 32 | 33 | - (void)didReceiveMemoryWarning 34 | { 35 | [super didReceiveMemoryWarning]; 36 | // Dispose of any resources that can be recreated. 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/en.lproj/MainStoryboard_iPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/en.lproj/MainStoryboard_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/iOS Custom Keyboards-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.kulpreet.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | MainStoryboard_iPhone 29 | UIMainStoryboardFile~ipad 30 | MainStoryboard_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/iOS Custom Keyboards-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'iOS Custom Keyboards' target in the 'iOS Custom Keyboards' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /iOS Keyboards Example/iOS Custom Keyboards/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // iOS Custom Keyboards 4 | // 5 | // Created by Kulpreet Chilana on 11/6/12. 6 | // Copyright (c) 2012 Kulpreet Chilana. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "UTAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([UTAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /iPad/Images/Keyboard_Blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPad/Images/Keyboard_Blank.png -------------------------------------------------------------------------------- /iPad/Images/Keyboard_Blank@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPad/Images/Keyboard_Blank@2x.png -------------------------------------------------------------------------------- /iPad/Images/Keyboard_Blank_iOS7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPad/Images/Keyboard_Blank_iOS7.png -------------------------------------------------------------------------------- /iPad/Images/Keyboard_Blank_iOS7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPad/Images/Keyboard_Blank_iOS7@2x.png -------------------------------------------------------------------------------- /iPad/Images/Keyboard_Shift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPad/Images/Keyboard_Shift.png -------------------------------------------------------------------------------- /iPad/Images/Keyboard_Shift@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPad/Images/Keyboard_Shift@2x.png -------------------------------------------------------------------------------- /iPad/Images/Keyboard_Shift_iOS7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPad/Images/Keyboard_Shift_iOS7.png -------------------------------------------------------------------------------- /iPad/Images/Keyboard_Shift_iOS7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPad/Images/Keyboard_Shift_iOS7@2x.png -------------------------------------------------------------------------------- /iPad/PKCustomKeyboard.h: -------------------------------------------------------------------------------- 1 | // 2 | // PKCustomKeyboard.h 3 | // PunjabiKeyboard 4 | // 5 | // Created by Kulpreet Chilana on 7/19/12. 6 | // Copyright (c) 2012 Kulpreet Chilana. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface PKCustomKeyboard : UIView 13 | 14 | @property (strong, nonatomic) IBOutlet UIImageView *keyboardBackground; 15 | @property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *characterKeys; 16 | @property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *altButtons; 17 | @property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *shiftButtons; 18 | @property (strong, nonatomic) IBOutlet UIButton *returnButton; 19 | @property (strong, nonatomic) IBOutlet UIButton *deleteButton; 20 | @property (strong, nonatomic) IBOutlet UIButton *dismissButton; 21 | @property (strong) id textView; 22 | 23 | - (IBAction)returnPressed:(id)sender; 24 | - (IBAction)shiftPressed:(id)sender; 25 | - (IBAction)altPressed:(id)sender; 26 | - (IBAction)dismissPressed:(id)sender; 27 | - (IBAction)deletePressed:(id)sender; 28 | - (IBAction)characterPressed:(id)sender; 29 | - (IBAction)unShift; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /iPad/PKCustomKeyboard.m: -------------------------------------------------------------------------------- 1 | // 2 | // PKCustomKeyboard.m 3 | // PunjabiKeyboard 4 | // 5 | // Created by Kulpreet Chilana on 7/19/12. 6 | // Copyright (c) 2012 Kulpreet Chilana. All rights reserved. 7 | // 8 | 9 | #import "PKCustomKeyboard.h" 10 | 11 | @interface PKCustomKeyboard () 12 | 13 | @property (nonatomic, assign, getter=isShifted) BOOL shifted; 14 | 15 | @end 16 | 17 | @implementation PKCustomKeyboard 18 | @synthesize textView = _textView; 19 | 20 | #define kFont [UIFont fontWithName:@"GurmukhiMN" size:25] 21 | #define kAltLabel @"!?੧੨੩" 22 | #define kReturnLabel @"ਅਗਲਾ" 23 | #define kChar @[ @"◌ੌ", @"◌ੈ", @"◌ਾ", @"◌ੀ", @"◌ੂ", @"ਬ", @"ਹ", @"ਗ", @"ਦ", @"ਜ", @"ਡ", @"◌ੋ", @"◌ੇ", @"◌੍", @"ਿ◌", @"◌ੁ", @"ਪ", @"ਰ", @"ਕ", @"ਤ", @"ਚ", @"ਟ", @"◌ਂ", @"ੜ", @"ਮ", @"ਨ", @"ਵ", @"ਲ", @"ਸ", @"ਯ", @",", @".", @" " ] 24 | #define kChar_shift @[ @"ਔ", @"ਐ", @"ਆ", @"ਈ", @"ਊ", @"ਭ", @"ਙ", @"ਘ", @"ਧ", @"ਝ", @"ਢ", @"ਓ", @"ਏ", @"ਅ", @"ਇ", @"ਉ", @"ਫ", @"ੜ", @"ਖ", @"ਥ", @"ਛ", @"ਠ", @"◌ੰ", @"◌ੱ", @"ਣ", @"ਫ਼", @"ਜ਼", @"ਲ਼", @"ਸ਼", @"ਞ", @"॥", @"।", @" " ] 25 | #define kChar_alt @[ @"੧", @"੨", @"੩", @"੪", @"੫", @"੬", @"੭", @"੮", @"੯", @"੦", @"ੴ", @"-", @"/", @":", @";", @"(", @")", @"$", @"£", @"₹", @"&", @"@", @"ਖ਼", @"ਗ਼", @"ੳ", @"ੲ", @".", @",", @"?", @"!", @"\'", @"\"", @" " ] 26 | 27 | - (id)init { 28 | UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation]; 29 | CGRect frame; 30 | 31 | if(UIDeviceOrientationIsLandscape(orientation)) 32 | frame = CGRectMake(0, 0, 1024, 352); 33 | else 34 | frame = CGRectMake(0, 0, 768, 264); 35 | 36 | self = [super initWithFrame:frame]; 37 | 38 | if (self) { 39 | NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"PKCustomKeyboard" owner:self options:nil]; 40 | [[nib objectAtIndex:0] setFrame:frame]; 41 | self = [nib objectAtIndex:0]; 42 | } 43 | 44 | NSMutableArray *buttons = [NSMutableArray arrayWithArray:self.characterKeys]; 45 | [buttons addObjectsFromArray:self.altButtons]; 46 | [buttons addObject:self.returnButton]; 47 | [buttons addObject:self.dismissButton]; 48 | [buttons addObject:self.deleteButton]; 49 | 50 | 51 | for (UIButton *b in buttons) { 52 | [b setBackgroundImage:[PKCustomKeyboard imageFromColor:[UIColor colorWithWhite:0.5 alpha:0.5]] 53 | forState:UIControlStateHighlighted]; 54 | b.layer.cornerRadius = 7.0; 55 | b.layer.masksToBounds = YES; 56 | b.layer.borderWidth = 0; 57 | } 58 | 59 | for (UIButton *b in self.altButtons) 60 | [b setTitle:kAltLabel forState:UIControlStateNormal]; 61 | 62 | [self.returnButton setTitle:kReturnLabel forState:UIControlStateNormal]; 63 | self.returnButton.titleLabel.adjustsFontSizeToFitWidth = YES; 64 | 65 | [self loadCharactersWithArray:kChar]; 66 | 67 | // Keyboard Customization for iOS 7 68 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { 69 | [self.keyboardBackground setImage:[UIImage imageNamed:@"Keyboard_Blank_iOS7.png"]]; 70 | for (UIButton *b in self.shiftButtons) { 71 | [b setShowsTouchWhenHighlighted:NO]; 72 | } 73 | for (UIButton *b in buttons) { 74 | [b setBackgroundImage:[PKCustomKeyboard imageFromColor:[UIColor colorWithWhite:0.7 alpha:0.5]] 75 | forState:UIControlStateHighlighted]; 76 | b.layer.cornerRadius = 6.0; 77 | b.titleLabel.shadowOffset = CGSizeMake(0, 0); 78 | } 79 | } 80 | 81 | return self; 82 | } 83 | 84 | -(void)setTextView:(id)textView { 85 | 86 | if ([textView isKindOfClass:[UITextView class]]) 87 | [(UITextView *)textView setInputView:self]; 88 | else if ([textView isKindOfClass:[UITextField class]]) 89 | [(UITextField *)textView setInputView:self]; 90 | 91 | _textView = textView; 92 | } 93 | 94 | -(id)textView { 95 | return _textView; 96 | } 97 | 98 | -(void)loadCharactersWithArray:(NSArray *)a { 99 | int i = 0; 100 | for (UIButton *b in self.characterKeys) { 101 | [b setTitle:[a objectAtIndex:i] forState:UIControlStateNormal]; 102 | if ([b.titleLabel.text characterAtIndex:0] < 128 && ![[b.titleLabel.text substringToIndex:1] isEqualToString:@"◌"]) 103 | [b.titleLabel setFont:[UIFont systemFontOfSize:28]]; 104 | else 105 | [b.titleLabel setFont:kFont]; 106 | i++; 107 | } 108 | } 109 | 110 | - (BOOL) enableInputClicksWhenVisible { 111 | return YES; 112 | } 113 | 114 | /* IBActions for Keyboard Buttons */ 115 | 116 | - (IBAction)returnPressed:(id)sender 117 | { 118 | [[UIDevice currentDevice] playInputClick]; 119 | 120 | if ([self.textView isKindOfClass:[UITextView class]]) 121 | { 122 | [self.textView insertText:@"\n"]; 123 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification object:self.textView]; 124 | } 125 | else if ([self.textView isKindOfClass:[UITextField class]]) 126 | { 127 | if ([[(UITextField *)self.textView delegate] respondsToSelector:@selector(textFieldShouldReturn:)]) 128 | { 129 | [[(UITextField *)self.textView delegate] textFieldShouldReturn:(UITextField *)self.textView]; 130 | } 131 | } 132 | } 133 | 134 | - (IBAction)shiftPressed:(id)sender { 135 | [[UIDevice currentDevice] playInputClick]; 136 | if (!self.isShifted) { 137 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { 138 | [self.keyboardBackground setImage:[UIImage imageNamed:@"Keyboard_Shift_iOS7.png"]]; 139 | } 140 | else { 141 | [self.keyboardBackground setImage:[UIImage imageNamed:@"Keyboard_Shift.png"]]; 142 | } 143 | [self loadCharactersWithArray:kChar_shift]; 144 | for (UIButton *b in self.altButtons) 145 | [b setTitle:kAltLabel forState:UIControlStateNormal]; 146 | } 147 | } 148 | 149 | - (IBAction)unShift { 150 | if (self.isShifted) { 151 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { 152 | [self.keyboardBackground setImage:[UIImage imageNamed:@"Keyboard_Blank_iOS7.png"]]; 153 | } 154 | else { 155 | [self.keyboardBackground setImage:[UIImage imageNamed:@"Keyboard_Blank.png"]]; 156 | } 157 | [self loadCharactersWithArray:kChar]; 158 | } 159 | if (!self.isShifted) 160 | self.shifted = YES; 161 | else 162 | self.shifted = NO; 163 | } 164 | 165 | - (IBAction)altPressed:(id)sender { 166 | [[UIDevice currentDevice] playInputClick]; 167 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { 168 | [self.keyboardBackground setImage:[UIImage imageNamed:@"Keyboard_Blank_iOS7.png"]]; 169 | } 170 | else { 171 | [self.keyboardBackground setImage:[UIImage imageNamed:@"Keyboard_Blank.png"]]; 172 | } 173 | self.shifted = NO; 174 | UIButton *button = (UIButton *)sender; 175 | 176 | if ([button.titleLabel.text isEqualToString:kAltLabel]) { 177 | [self loadCharactersWithArray:kChar_alt]; 178 | for (UIButton *b in self.altButtons) 179 | [b setTitle:[kChar objectAtIndex:18] forState:UIControlStateNormal]; 180 | } 181 | else { 182 | [self loadCharactersWithArray:kChar]; 183 | for (UIButton *b in self.altButtons) 184 | [b setTitle:kAltLabel forState:UIControlStateNormal]; 185 | } 186 | } 187 | 188 | - (IBAction)dismissPressed:(id)sender { 189 | [[UIDevice currentDevice] playInputClick]; 190 | 191 | if ([self.textView isKindOfClass:[UITextView class]]) 192 | [(UITextView *)self.textView resignFirstResponder]; 193 | 194 | else if ([self.textView isKindOfClass:[UITextField class]]) 195 | [(UITextField *)self.textView resignFirstResponder]; 196 | } 197 | 198 | - (IBAction)deletePressed:(id)sender { 199 | [[UIDevice currentDevice] playInputClick]; 200 | [self.textView deleteBackward]; 201 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification 202 | object:self.textView]; 203 | if ([self.textView isKindOfClass:[UITextView class]]) 204 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification object:self.textView]; 205 | else if ([self.textView isKindOfClass:[UITextField class]]) 206 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextFieldTextDidChangeNotification object:self.textView]; 207 | } 208 | 209 | - (IBAction)characterPressed:(id)sender { 210 | [[UIDevice currentDevice] playInputClick]; 211 | UIButton *button = (UIButton *)sender; 212 | NSString *character = [NSString stringWithString:button.titleLabel.text]; 213 | 214 | if ([[character substringToIndex:1] isEqualToString:@"◌"]) 215 | character = [character substringFromIndex:1]; 216 | 217 | else if ([[character substringFromIndex:character.length - 1] isEqualToString:@"◌"]) 218 | character = [character substringToIndex:character.length - 1]; 219 | 220 | [self.textView insertText:character]; 221 | 222 | if (self.isShifted) 223 | [self unShift]; 224 | 225 | if ([self.textView isKindOfClass:[UITextView class]]) 226 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification object:self.textView]; 227 | else if ([self.textView isKindOfClass:[UITextField class]]) 228 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextFieldTextDidChangeNotification object:self.textView]; 229 | } 230 | 231 | /* UI Utilities */ 232 | 233 | + (UIImage *) imageFromColor:(UIColor *)color { 234 | CGRect rect = CGRectMake(0, 0, 1, 1); 235 | UIGraphicsBeginImageContext(rect.size); 236 | CGContextRef context = UIGraphicsGetCurrentContext(); 237 | CGContextSetFillColorWithColor(context, [color CGColor]); 238 | CGContextFillRect(context, rect); 239 | UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); 240 | UIGraphicsEndImageContext(); 241 | return img; 242 | } 243 | 244 | @end 245 | -------------------------------------------------------------------------------- /iPad/PKCustomKeyboard.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 34 | 50 | 66 | 82 | 98 | 114 | 130 | 146 | 162 | 178 | 194 | 210 | 226 | 242 | 258 | 274 | 290 | 306 | 322 | 338 | 354 | 370 | 386 | 403 | 419 | 435 | 451 | 467 | 483 | 499 | 515 | 531 | 547 | 563 | 580 | 596 | 612 | 628 | 644 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | -------------------------------------------------------------------------------- /iPhone:iPod/Images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPhone:iPod/Images/delete.png -------------------------------------------------------------------------------- /iPhone:iPod/Images/delete@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPhone:iPod/Images/delete@2x.png -------------------------------------------------------------------------------- /iPhone:iPod/Images/delete_iOS7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPhone:iPod/Images/delete_iOS7.png -------------------------------------------------------------------------------- /iPhone:iPod/Images/delete_iOS7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPhone:iPod/Images/delete_iOS7@2x.png -------------------------------------------------------------------------------- /iPhone:iPod/Images/glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPhone:iPod/Images/glow.png -------------------------------------------------------------------------------- /iPhone:iPod/Images/iOS7_Keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPhone:iPod/Images/iOS7_Keyboard.png -------------------------------------------------------------------------------- /iPhone:iPod/Images/iOS7_Keyboard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPhone:iPod/Images/iOS7_Keyboard@2x.png -------------------------------------------------------------------------------- /iPhone:iPod/Images/iOS_Keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPhone:iPod/Images/iOS_Keyboard.png -------------------------------------------------------------------------------- /iPhone:iPod/Images/iOS_Keyboard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPhone:iPod/Images/iOS_Keyboard@2x.png -------------------------------------------------------------------------------- /iPhone:iPod/Images/return.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPhone:iPod/Images/return.png -------------------------------------------------------------------------------- /iPhone:iPod/Images/return@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kulpreetchilana/Custom-iOS-Keyboards/ad9362b82f8d79fc0eefce38bfd71c52dc0911b2/iPhone:iPod/Images/return@2x.png -------------------------------------------------------------------------------- /iPhone:iPod/PMCustomKeyboard.h: -------------------------------------------------------------------------------- 1 | // 2 | // PMCustomKeyboard.h 3 | // PunjabiKeyboard 4 | // 5 | // Created by Kulpreet Chilana on 7/31/12. 6 | // Copyright (c) 2012 Kulpreet Chilana. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface PMCustomKeyboard : UIView 13 | 14 | @property (strong, nonatomic) IBOutlet UIImageView *keyboardBackground; 15 | @property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *characterKeys; 16 | @property (strong, nonatomic) IBOutlet UIButton *shiftButton; 17 | @property (strong, nonatomic) IBOutlet UIButton *altButton; 18 | @property (strong, nonatomic) IBOutlet UIButton *returnButton; 19 | @property (strong, nonatomic) IBOutlet UIButton *deleteButton; 20 | @property (strong) id textView; 21 | @property (strong, nonatomic) IBOutlet UIButton *spaceButton; 22 | 23 | - (IBAction)returnPressed:(id)sender; 24 | - (IBAction)characterPressed:(id)sender; 25 | - (IBAction)shiftPressed:(id)sender; 26 | - (IBAction)altPressed:(id)sender; 27 | - (IBAction)deletePressed:(id)sender; 28 | - (IBAction)unShift; 29 | - (IBAction)spacePressed:(id)sender; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /iPhone:iPod/PMCustomKeyboard.m: -------------------------------------------------------------------------------- 1 | // 2 | // PMCustomKeyboard.m 3 | // PunjabiKeyboard 4 | // 5 | // Created by Kulpreet Chilana on 7/31/12. 6 | // Copyright (c) 2012 Kulpreet Chilana. All rights reserved. 7 | // 8 | 9 | #import "PMCustomKeyboard.h" 10 | 11 | #define kFont [UIFont fontWithName:@"GurmukhiMN" size:22] 12 | #define kAltLabel @"੧੨੩" 13 | #define kReturnLabel @"ਨਵੀਂ ਪੰਕਤੀ" 14 | #define kSpaceLabel @"ਖਾਲੀ ਥਾਂ" 15 | #define kChar @[ @"◌ੌ", @"◌ੈ", @"◌ਾ", @"◌ੀ", @"◌ੂ", @"ਬ", @"ਹ", @"ਗ", @"ਦ", @"ਜ", @"ਡ", @"◌ੋ", @"◌ੇ", @"◌੍", @"ਿ◌", @"◌ੁ", @"ਪ", @"ਰ", @"ਕ", @"ਤ", @"ਚ", @"ਟ", @"◌ਂ", @"ੜ", @"ਮ", @"ਨ", @"ਵ", @"ਲ", @"ਸ", @"ਯ" ] 16 | #define kChar_shift @[ @"ਔ", @"ਐ", @"ਆ", @"ਈ", @"ਊ", @"ਭ", @"ਙ", @"ਘ", @"ਧ", @"ਝ", @"ਢ", @"ਓ", @"ਏ", @"ਅ", @"ਇ", @"ਉ", @"ਫ", @"ੜ", @"ਖ", @"ਥ", @"ਛ", @"ਠ", @"◌ੰ", @"◌ੱ", @"ਣ", @"ਫ਼", @"ਜ਼", @"ਲ਼", @"ਸ਼", @"ਞ" ] 17 | #define kChar_alt @[ @"੧", @"੨", @"੩", @"੪", @"੫", @"੬", @"੭", @"੮", @"੯", @"੦", @"ੴ", @"-", @"/", @":", @";", @"(", @")", @"$", @"₹", @"&", @"@", @"\"", @"ਖ਼", @"ਗ਼", @"।", @"॥", @".", @",", @"?", @"!" ] 18 | 19 | enum { 20 | PKNumberPadViewImageLeft = 0, 21 | PKNumberPadViewImageInner, 22 | PKNumberPadViewImageRight, 23 | PKNumberPadViewImageMax 24 | }; 25 | 26 | @interface PMCustomKeyboard () 27 | 28 | @property (nonatomic, assign, getter=isShifted) BOOL shifted; 29 | 30 | @end 31 | 32 | @implementation PMCustomKeyboard 33 | @synthesize textView = _textView; 34 | 35 | - (id)init { 36 | UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; 37 | CGRect frame; 38 | 39 | if(UIDeviceOrientationIsLandscape(orientation)) 40 | frame = CGRectMake(0, 0, 480, 162); 41 | else 42 | frame = CGRectMake(0, 0, 320, 216); 43 | 44 | self = [super initWithFrame:frame]; 45 | 46 | if (self) { 47 | NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"PMCustomKeyboard" owner:self options:nil]; 48 | [[nib objectAtIndex:0] setFrame:frame]; 49 | self = [nib objectAtIndex:0]; 50 | } 51 | 52 | [self.altButton setTitle:kAltLabel forState:UIControlStateNormal]; 53 | 54 | [self.returnButton setTitle:kReturnLabel forState:UIControlStateNormal]; 55 | self.returnButton.titleLabel.adjustsFontSizeToFitWidth = YES; 56 | 57 | [self loadCharactersWithArray:kChar]; 58 | 59 | [self.spaceButton setBackgroundImage:[PMCustomKeyboard imageFromColor:[UIColor colorWithWhite:0.4 alpha:0.5]] 60 | forState:UIControlStateHighlighted]; 61 | self.spaceButton.layer.cornerRadius = 7.0; 62 | self.spaceButton.layer.masksToBounds = YES; 63 | self.spaceButton.layer.borderWidth = 0; 64 | [self.spaceButton setTitle:kSpaceLabel forState:UIControlStateNormal]; 65 | 66 | 67 | // Keyboard Customization for iOS 7 68 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { 69 | [self.keyboardBackground setImage:[UIImage imageNamed:@"iOS7_Keyboard"]]; 70 | self.spaceButton.layer.cornerRadius = 4.0; 71 | [self.spaceButton.titleLabel setFont:[UIFont fontWithName:@"GurmukhiMN" size:18]]; 72 | [self.spaceButton.titleLabel setShadowOffset:CGSizeMake(0, 0)]; 73 | [self.returnButton.titleLabel setFont:[UIFont fontWithName:@"GurmukhiMN" size:18]]; 74 | [self.altButton.titleLabel setFont:[UIFont fontWithName:@"GurmukhiMN" size:18]]; 75 | [self.altButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 76 | [self.altButton setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted]; 77 | [self.shiftButton setShowsTouchWhenHighlighted:NO]; 78 | [self.deleteButton setImage:[UIImage imageNamed:@"delete_iOS7"] forState:UIControlStateHighlighted]; 79 | [self.spaceButton setBackgroundImage:[PMCustomKeyboard imageFromColor:[UIColor colorWithRed:0.725 green:0.741 blue:0.757 alpha:1.000]] forState:UIControlStateHighlighted]; 80 | self.returnButton.layer.cornerRadius = 4.0; 81 | self.returnButton.layer.masksToBounds = YES; 82 | self.returnButton.layer.borderWidth = 0; 83 | [self.returnButton setBackgroundImage:[PMCustomKeyboard imageFromColor:[UIColor whiteColor]] forState:UIControlStateHighlighted]; 84 | //[self.returnButton setEnabled:NO]; 85 | //[self.returnButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal]; 86 | [self.returnButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 87 | [self.returnButton setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted]; 88 | [self.spaceButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 89 | 90 | } 91 | 92 | return self; 93 | } 94 | 95 | -(void)setTextView:(id)textView { 96 | if ([textView isKindOfClass:[UITextView class]]) { 97 | [(UITextView *)textView setInputView:self]; 98 | /*[[NSNotificationCenter defaultCenter] addObserver:self 99 | selector:@selector(checkShouldEnableReturnButton:) 100 | name:UITextViewTextDidChangeNotification 101 | object:textView];*/ 102 | } 103 | else if ([textView isKindOfClass:[UITextField class]]) { 104 | [(UITextField *)textView setInputView:self]; 105 | /*[[NSNotificationCenter defaultCenter] addObserver:self 106 | selector:@selector(checkShouldEnableReturnButton:) 107 | name:UITextFieldTextDidChangeNotification 108 | object:textView];*/ 109 | } 110 | 111 | _textView = textView; 112 | } 113 | 114 | -(void)checkShouldEnableReturnButton:(NSNotification *)notification { 115 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { 116 | if ([self.textView isKindOfClass:[UITextView class]]) { 117 | UITextView *textView = (UITextView *)self.textView; 118 | if (textView.text.length > 0) { 119 | [self.returnButton setEnabled:YES]; 120 | [self.returnButton setBackgroundImage:[PMCustomKeyboard imageFromColor:[UIColor colorWithRed:0.082 green:0.478 blue:0.984 alpha:1.000]] forState:UIControlStateNormal]; 121 | [self.returnButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 122 | } 123 | else { 124 | [self.returnButton setEnabled:NO]; 125 | [self.returnButton setBackgroundImage:nil forState:UIControlStateNormal]; 126 | [self.returnButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal]; 127 | } 128 | } 129 | else if ([self.textView isKindOfClass:[UITextField class]]) { 130 | UITextField *textField = (UITextField *)self.textView; 131 | if (textField.text.length > 0) { 132 | [self.returnButton setEnabled:YES]; 133 | [self.returnButton setBackgroundImage:[PMCustomKeyboard imageFromColor:[UIColor colorWithRed:0.082 green:0.478 blue:0.984 alpha:1.000]] forState:UIControlStateNormal]; 134 | [self.returnButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 135 | } 136 | else { 137 | [self.returnButton setEnabled:NO]; 138 | [self.returnButton setBackgroundImage:nil forState:UIControlStateNormal]; 139 | [self.returnButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal]; 140 | } 141 | } 142 | } 143 | } 144 | 145 | -(id)textView { 146 | return _textView; 147 | } 148 | 149 | -(void)loadCharactersWithArray:(NSArray *)a { 150 | int i = 0; 151 | for (UIButton *b in self.characterKeys) { 152 | [b setTitle:[a objectAtIndex:i] forState:UIControlStateNormal]; 153 | if ([b.titleLabel.text characterAtIndex:0] < 128 && ![[b.titleLabel.text substringToIndex:1] isEqualToString:@"◌"]) 154 | [b.titleLabel setFont:[UIFont systemFontOfSize:22]]; 155 | else 156 | [b.titleLabel setFont:kFont]; 157 | i++; 158 | } 159 | } 160 | 161 | - (BOOL) enableInputClicksWhenVisible { 162 | return YES; 163 | } 164 | 165 | /* IBActions for Keyboard Buttons */ 166 | 167 | - (IBAction)returnPressed:(id)sender 168 | { 169 | [[UIDevice currentDevice] playInputClick]; 170 | 171 | if ([self.textView isKindOfClass:[UITextView class]]) 172 | { 173 | [self.textView insertText:@"\n"]; 174 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification object:self.textView]; 175 | } 176 | else if ([self.textView isKindOfClass:[UITextField class]]) 177 | { 178 | if ([[(UITextField *)self.textView delegate] respondsToSelector:@selector(textFieldShouldReturn:)]) 179 | { 180 | [[(UITextField *)self.textView delegate] textFieldShouldReturn:(UITextField *)self.textView]; 181 | } 182 | } 183 | } 184 | 185 | - (IBAction)shiftPressed:(id)sender { 186 | [[UIDevice currentDevice] playInputClick]; 187 | if (!self.isShifted) { 188 | [self.shiftButton setBackgroundImage:[UIImage imageNamed:@"glow.png"] forState:UIControlStateNormal]; 189 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { 190 | [self.shiftButton setBackgroundImage:[UIImage imageNamed:@"shift.png"] forState:UIControlStateNormal]; 191 | } 192 | [self loadCharactersWithArray:kChar_shift]; 193 | [self.altButton setTitle:kAltLabel forState:UIControlStateNormal]; 194 | } 195 | } 196 | 197 | - (IBAction)unShift { 198 | if (self.isShifted) { 199 | [self.shiftButton setBackgroundImage:nil forState:UIControlStateNormal]; 200 | [self loadCharactersWithArray:kChar]; 201 | } 202 | if (!self.isShifted) 203 | self.shifted = YES; 204 | else 205 | self.shifted = NO; 206 | } 207 | 208 | - (IBAction)spacePressed:(id)sender { 209 | [[UIDevice currentDevice] playInputClick]; 210 | 211 | [self.textView insertText:@" "]; 212 | 213 | if (self.isShifted) 214 | [self unShift]; 215 | 216 | if ([self.textView isKindOfClass:[UITextView class]]) 217 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification object:self.textView]; 218 | else if ([self.textView isKindOfClass:[UITextField class]]) 219 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextFieldTextDidChangeNotification object:self.textView]; 220 | } 221 | 222 | - (IBAction)altPressed:(id)sender { 223 | [[UIDevice currentDevice] playInputClick]; 224 | [self.shiftButton setBackgroundImage:nil forState:UIControlStateNormal]; 225 | self.shifted = NO; 226 | UIButton *button = (UIButton *)sender; 227 | 228 | if ([button.titleLabel.text isEqualToString:kAltLabel]) { 229 | [self loadCharactersWithArray:kChar_alt]; 230 | [self.altButton setTitle:[kChar objectAtIndex:18] forState:UIControlStateNormal]; 231 | } 232 | else { 233 | [self loadCharactersWithArray:kChar]; 234 | [self.altButton setTitle:kAltLabel forState:UIControlStateNormal]; 235 | } 236 | } 237 | 238 | - (IBAction)deletePressed:(id)sender { 239 | [[UIDevice currentDevice] playInputClick]; 240 | [self.textView deleteBackward]; 241 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification 242 | object:self.textView]; 243 | if ([self.textView isKindOfClass:[UITextView class]]) 244 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification object:self.textView]; 245 | else if ([self.textView isKindOfClass:[UITextField class]]) 246 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextFieldTextDidChangeNotification object:self.textView]; 247 | } 248 | 249 | - (IBAction)characterPressed:(id)sender { 250 | UIButton *button = (UIButton *)sender; 251 | NSString *character = [NSString stringWithString:button.titleLabel.text]; 252 | 253 | if ([[character substringToIndex:1] isEqualToString:@"◌"]) 254 | character = [character substringFromIndex:1]; 255 | 256 | else if ([[character substringFromIndex:character.length - 1] isEqualToString:@"◌"]) 257 | character = [character substringToIndex:character.length - 1]; 258 | 259 | [self.textView insertText:character]; 260 | 261 | if (self.isShifted) 262 | [self unShift]; 263 | 264 | if ([self.textView isKindOfClass:[UITextView class]]) 265 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextViewTextDidChangeNotification object:self.textView]; 266 | else if ([self.textView isKindOfClass:[UITextField class]]) 267 | [[NSNotificationCenter defaultCenter] postNotificationName:UITextFieldTextDidChangeNotification object:self.textView]; 268 | } 269 | 270 | - (void)addPopupToButton:(UIButton *)b { 271 | UIImageView *keyPop = nil; 272 | UILabel *text = [[UILabel alloc] initWithFrame:CGRectMake(15, 10, 52, 60)]; 273 | 274 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { 275 | if (b == [self.characterKeys objectAtIndex:0] || b == [self.characterKeys objectAtIndex:11]) { 276 | keyPop = [[UIImageView alloc] initWithImage:[self createiOS7KeytopImageWithKind:PKNumberPadViewImageRight]]; 277 | keyPop.frame = CGRectMake(-16, -71, keyPop.frame.size.width, keyPop.frame.size.height); 278 | } 279 | else if (b == [self.characterKeys objectAtIndex:10] || b == [self.characterKeys objectAtIndex:21]) { 280 | keyPop = [[UIImageView alloc] initWithImage:[self createiOS7KeytopImageWithKind:PKNumberPadViewImageLeft]]; 281 | keyPop.frame = CGRectMake(-38, -71, keyPop.frame.size.width, keyPop.frame.size.height); 282 | } 283 | else { 284 | keyPop = [[UIImageView alloc] initWithImage:[self createiOS7KeytopImageWithKind:PKNumberPadViewImageInner]]; 285 | keyPop.frame = CGRectMake(-27, -71, keyPop.frame.size.width, keyPop.frame.size.height); 286 | } 287 | 288 | } 289 | else { 290 | if (b == [self.characterKeys objectAtIndex:0] || b == [self.characterKeys objectAtIndex:11]) { 291 | keyPop = [[UIImageView alloc] initWithImage:[self createKeytopImageWithKind:PKNumberPadViewImageRight]]; 292 | keyPop.frame = CGRectMake(-16, -71, keyPop.frame.size.width, keyPop.frame.size.height); 293 | } 294 | else if (b == [self.characterKeys objectAtIndex:10] || b == [self.characterKeys objectAtIndex:21]) { 295 | keyPop = [[UIImageView alloc] initWithImage:[self createKeytopImageWithKind:PKNumberPadViewImageLeft]]; 296 | keyPop.frame = CGRectMake(-38, -71, keyPop.frame.size.width, keyPop.frame.size.height); 297 | } 298 | else { 299 | keyPop = [[UIImageView alloc] initWithImage:[self createKeytopImageWithKind:PKNumberPadViewImageInner]]; 300 | keyPop.frame = CGRectMake(-27, -71, keyPop.frame.size.width, keyPop.frame.size.height); 301 | } 302 | 303 | } 304 | 305 | if ([b.titleLabel.text characterAtIndex:0] < 128 && ![[b.titleLabel.text substringToIndex:1] isEqualToString:@"◌"]) 306 | [text setFont:[UIFont systemFontOfSize:44]]; 307 | else 308 | [text setFont:[UIFont fontWithName:kFont.fontName size:44]]; 309 | 310 | [text setTextAlignment:NSTextAlignmentCenter]; 311 | [text setBackgroundColor:[UIColor clearColor]]; 312 | [text setAdjustsFontSizeToFitWidth:YES]; 313 | [text setText:b.titleLabel.text]; 314 | 315 | keyPop.layer.shadowColor = [UIColor colorWithWhite:0.1 alpha:1.0].CGColor; 316 | keyPop.layer.shadowOffset = CGSizeMake(0, 2.0); 317 | keyPop.layer.shadowOpacity = 0.30; 318 | keyPop.layer.shadowRadius = 3.0; 319 | keyPop.clipsToBounds = NO; 320 | 321 | [keyPop addSubview:text]; 322 | [b addSubview:keyPop]; 323 | } 324 | 325 | - (void)touchesBegan: (NSSet *)touches withEvent: (UIEvent *)event { 326 | CGPoint location = [[touches anyObject] locationInView:self]; 327 | 328 | for (UIButton *b in self.characterKeys) { 329 | if ([b subviews].count > 1) { 330 | [[[b subviews] objectAtIndex:1] removeFromSuperview]; 331 | } 332 | if(CGRectContainsPoint(b.frame, location)) 333 | { 334 | [self addPopupToButton:b]; 335 | [[UIDevice currentDevice] playInputClick]; 336 | } 337 | } 338 | } 339 | 340 | -(void)touchesMoved: (NSSet *)touches withEvent: (UIEvent *)event { 341 | CGPoint location = [[touches anyObject] locationInView:self]; 342 | 343 | for (UIButton *b in self.characterKeys) { 344 | if ([b subviews].count > 1) { 345 | [[[b subviews] objectAtIndex:1] removeFromSuperview]; 346 | } 347 | if(CGRectContainsPoint(b.frame, location)) 348 | { 349 | [self addPopupToButton:b]; 350 | } 351 | } 352 | } 353 | 354 | 355 | -(void) touchesEnded: (NSSet *)touches withEvent: (UIEvent *)event{ 356 | CGPoint location = [[touches anyObject] locationInView:self]; 357 | 358 | for (UIButton *b in self.characterKeys) { 359 | if ([b subviews].count > 1) { 360 | [[[b subviews] objectAtIndex:1] removeFromSuperview]; 361 | } 362 | if(CGRectContainsPoint(b.frame, location)) 363 | { 364 | [self characterPressed:b]; 365 | } 366 | } 367 | } 368 | 369 | /* UI Utilities */ 370 | 371 | + (UIImage *) imageFromColor:(UIColor *)color { 372 | CGRect rect = CGRectMake(0, 0, 1, 1); 373 | UIGraphicsBeginImageContext(rect.size); 374 | CGContextRef context = UIGraphicsGetCurrentContext(); 375 | CGContextSetFillColorWithColor(context, [color CGColor]); 376 | CGContextFillRect(context, rect); 377 | UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); 378 | UIGraphicsEndImageContext(); 379 | return img; 380 | } 381 | 382 | #define _UPPER_WIDTH (52.0 * [[UIScreen mainScreen] scale]) 383 | #define _LOWER_WIDTH (32.0 * [[UIScreen mainScreen] scale]) 384 | 385 | #define _PAN_UPPER_RADIUS (7.0 * [[UIScreen mainScreen] scale]) 386 | #define _PAN_LOWER_RADIUS (7.0 * [[UIScreen mainScreen] scale]) 387 | 388 | #define _PAN_UPPDER_WIDTH (_UPPER_WIDTH-_PAN_UPPER_RADIUS*2) 389 | #define _PAN_UPPER_HEIGHT (61.0 * [[UIScreen mainScreen] scale]) 390 | 391 | #define _PAN_LOWER_WIDTH (_LOWER_WIDTH-_PAN_LOWER_RADIUS*2) 392 | #define _PAN_LOWER_HEIGHT (30.0 * [[UIScreen mainScreen] scale]) 393 | 394 | #define _PAN_UL_WIDTH ((_UPPER_WIDTH-_LOWER_WIDTH)/2) 395 | 396 | #define _PAN_MIDDLE_HEIGHT (11.0 * [[UIScreen mainScreen] scale]) 397 | 398 | #define _PAN_CURVE_SIZE (7.0 * [[UIScreen mainScreen] scale]) 399 | 400 | #define _PADDING_X (15 * [[UIScreen mainScreen] scale]) 401 | #define _PADDING_Y (10 * [[UIScreen mainScreen] scale]) 402 | #define _WIDTH (_UPPER_WIDTH + _PADDING_X*2) 403 | #define _HEIGHT (_PAN_UPPER_HEIGHT + _PAN_MIDDLE_HEIGHT + _PAN_LOWER_HEIGHT + _PADDING_Y*2) 404 | 405 | 406 | #define _OFFSET_X -25 * [[UIScreen mainScreen] scale]) 407 | #define _OFFSET_Y 59 * [[UIScreen mainScreen] scale]) 408 | 409 | 410 | - (UIImage *)createKeytopImageWithKind:(int)kind 411 | { 412 | CGMutablePathRef path = CGPathCreateMutable(); 413 | 414 | CGPoint p = CGPointMake(_PADDING_X, _PADDING_Y); 415 | CGPoint p1 = CGPointZero; 416 | CGPoint p2 = CGPointZero; 417 | 418 | p.x += _PAN_UPPER_RADIUS; 419 | CGPathMoveToPoint(path, NULL, p.x, p.y); 420 | 421 | p.x += _PAN_UPPDER_WIDTH; 422 | CGPathAddLineToPoint(path, NULL, p.x, p.y); 423 | 424 | p.y += _PAN_UPPER_RADIUS; 425 | CGPathAddArc(path, NULL, 426 | p.x, p.y, 427 | _PAN_UPPER_RADIUS, 428 | 3.0*M_PI/2.0, 429 | 4.0*M_PI/2.0, 430 | false); 431 | 432 | p.x += _PAN_UPPER_RADIUS; 433 | p.y += _PAN_UPPER_HEIGHT - _PAN_UPPER_RADIUS - _PAN_CURVE_SIZE; 434 | CGPathAddLineToPoint(path, NULL, p.x, p.y); 435 | 436 | p1 = CGPointMake(p.x, p.y + _PAN_CURVE_SIZE); 437 | switch (kind) { 438 | case PKNumberPadViewImageLeft: 439 | p.x -= _PAN_UL_WIDTH*2; 440 | break; 441 | 442 | case PKNumberPadViewImageInner: 443 | p.x -= _PAN_UL_WIDTH; 444 | break; 445 | 446 | case PKNumberPadViewImageRight: 447 | break; 448 | } 449 | 450 | p.y += _PAN_MIDDLE_HEIGHT + _PAN_CURVE_SIZE*2; 451 | p2 = CGPointMake(p.x, p.y - _PAN_CURVE_SIZE); 452 | CGPathAddCurveToPoint(path, NULL, 453 | p1.x, p1.y, 454 | p2.x, p2.y, 455 | p.x, p.y); 456 | 457 | p.y += _PAN_LOWER_HEIGHT - _PAN_CURVE_SIZE - _PAN_LOWER_RADIUS; 458 | CGPathAddLineToPoint(path, NULL, p.x, p.y); 459 | 460 | p.x -= _PAN_LOWER_RADIUS; 461 | CGPathAddArc(path, NULL, 462 | p.x, p.y, 463 | _PAN_LOWER_RADIUS, 464 | 4.0*M_PI/2.0, 465 | 1.0*M_PI/2.0, 466 | false); 467 | 468 | p.x -= _PAN_LOWER_WIDTH; 469 | p.y += _PAN_LOWER_RADIUS; 470 | CGPathAddLineToPoint(path, NULL, p.x, p.y); 471 | 472 | p.y -= _PAN_LOWER_RADIUS; 473 | CGPathAddArc(path, NULL, 474 | p.x, p.y, 475 | _PAN_LOWER_RADIUS, 476 | 1.0*M_PI/2.0, 477 | 2.0*M_PI/2.0, 478 | false); 479 | 480 | p.x -= _PAN_LOWER_RADIUS; 481 | p.y -= _PAN_LOWER_HEIGHT - _PAN_LOWER_RADIUS - _PAN_CURVE_SIZE; 482 | CGPathAddLineToPoint(path, NULL, p.x, p.y); 483 | 484 | p1 = CGPointMake(p.x, p.y - _PAN_CURVE_SIZE); 485 | 486 | switch (kind) { 487 | case PKNumberPadViewImageLeft: 488 | break; 489 | 490 | case PKNumberPadViewImageInner: 491 | p.x -= _PAN_UL_WIDTH; 492 | break; 493 | 494 | case PKNumberPadViewImageRight: 495 | p.x -= _PAN_UL_WIDTH*2; 496 | break; 497 | } 498 | 499 | p.y -= _PAN_MIDDLE_HEIGHT + _PAN_CURVE_SIZE*2; 500 | p2 = CGPointMake(p.x, p.y + _PAN_CURVE_SIZE); 501 | CGPathAddCurveToPoint(path, NULL, 502 | p1.x, p1.y, 503 | p2.x, p2.y, 504 | p.x, p.y); 505 | 506 | p.y -= _PAN_UPPER_HEIGHT - _PAN_UPPER_RADIUS - _PAN_CURVE_SIZE; 507 | CGPathAddLineToPoint(path, NULL, p.x, p.y); 508 | 509 | p.x += _PAN_UPPER_RADIUS; 510 | CGPathAddArc(path, NULL, 511 | p.x, p.y, 512 | _PAN_UPPER_RADIUS, 513 | 2.0*M_PI/2.0, 514 | 3.0*M_PI/2.0, 515 | false); 516 | //---- 517 | CGContextRef context; 518 | UIGraphicsBeginImageContext(CGSizeMake(_WIDTH, 519 | _HEIGHT)); 520 | context = UIGraphicsGetCurrentContext(); 521 | CGContextTranslateCTM(context, 0.0, _HEIGHT); 522 | CGContextScaleCTM(context, 1.0, -1.0); 523 | 524 | CGContextAddPath(context, path); 525 | CGContextClip(context); 526 | 527 | //---- 528 | 529 | // draw gradient 530 | CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceGray(); 531 | CGFloat components[] = { 532 | 0.95f, 1.0f, 533 | 0.85f, 1.0f, 534 | 0.675f, 1.0f, 535 | 0.8f, 1.0f}; 536 | 537 | 538 | size_t count = sizeof(components)/ (sizeof(CGFloat)* 2); 539 | 540 | CGRect frame = CGPathGetBoundingBox(path); 541 | CGPoint startPoint = frame.origin; 542 | CGPoint endPoint = frame.origin; 543 | endPoint.y = frame.origin.y + frame.size.height; 544 | 545 | CGGradientRef gradientRef = 546 | CGGradientCreateWithColorComponents(colorSpaceRef, components, NULL, count); 547 | 548 | CGContextDrawLinearGradient(context, 549 | gradientRef, 550 | startPoint, 551 | endPoint, 552 | kCGGradientDrawsAfterEndLocation); 553 | 554 | CGGradientRelease(gradientRef); 555 | CGColorSpaceRelease(colorSpaceRef); 556 | 557 | CGImageRef imageRef = CGBitmapContextCreateImage(context); 558 | UIImage * image = [UIImage imageWithCGImage:imageRef scale:[[UIScreen mainScreen] scale] orientation:UIImageOrientationDown]; 559 | CGImageRelease(imageRef); 560 | 561 | UIGraphicsEndImageContext(); 562 | 563 | CFRelease(path); 564 | 565 | return image; 566 | } 567 | 568 | #define __UPPER_WIDTH (52.0 * [[UIScreen mainScreen] scale]) 569 | #define __LOWER_WIDTH (24.0 * [[UIScreen mainScreen] scale]) 570 | 571 | #define __PAN_UPPER_RADIUS (10.0 * [[UIScreen mainScreen] scale]) 572 | #define __PAN_LOWER_RADIUS (5.0 * [[UIScreen mainScreen] scale]) 573 | 574 | #define __PAN_UPPDER_WIDTH (__UPPER_WIDTH-__PAN_UPPER_RADIUS*2) 575 | #define __PAN_UPPER_HEIGHT (52.0 * [[UIScreen mainScreen] scale]) 576 | 577 | #define __PAN_LOWER_WIDTH (__LOWER_WIDTH-__PAN_LOWER_RADIUS*2) 578 | #define __PAN_LOWER_HEIGHT (47.0 * [[UIScreen mainScreen] scale]) 579 | 580 | #define __PAN_UL_WIDTH ((__UPPER_WIDTH-__LOWER_WIDTH)/2) 581 | 582 | #define __PAN_MIDDLE_HEIGHT (2.0 * [[UIScreen mainScreen] scale]) 583 | 584 | #define __PAN_CURVE_SIZE (10.0 * [[UIScreen mainScreen] scale]) 585 | 586 | #define __PADDING_X (15 * [[UIScreen mainScreen] scale]) 587 | #define __PADDING_Y (10 * [[UIScreen mainScreen] scale]) 588 | #define __WIDTH (__UPPER_WIDTH + __PADDING_X*2) 589 | #define __HEIGHT (__PAN_UPPER_HEIGHT + __PAN_MIDDLE_HEIGHT + __PAN_LOWER_HEIGHT + __PADDING_Y*2) 590 | 591 | 592 | #define __OFFSET_X -25 * [[UIScreen mainScreen] scale]) 593 | #define __OFFSET_Y 59 * [[UIScreen mainScreen] scale]) 594 | 595 | 596 | - (UIImage *)createiOS7KeytopImageWithKind:(int)kind 597 | { 598 | CGMutablePathRef path = CGPathCreateMutable(); 599 | 600 | CGPoint p = CGPointMake(__PADDING_X, __PADDING_Y); 601 | CGPoint p1 = CGPointZero; 602 | CGPoint p2 = CGPointZero; 603 | 604 | p.x += __PAN_UPPER_RADIUS; 605 | CGPathMoveToPoint(path, NULL, p.x, p.y); 606 | 607 | p.x += __PAN_UPPDER_WIDTH; 608 | CGPathAddLineToPoint(path, NULL, p.x, p.y); 609 | 610 | p.y += __PAN_UPPER_RADIUS; 611 | CGPathAddArc(path, NULL, 612 | p.x, p.y, 613 | __PAN_UPPER_RADIUS, 614 | 3.0*M_PI/2.0, 615 | 4.0*M_PI/2.0, 616 | false); 617 | 618 | p.x += __PAN_UPPER_RADIUS; 619 | p.y += __PAN_UPPER_HEIGHT - __PAN_UPPER_RADIUS - __PAN_CURVE_SIZE; 620 | CGPathAddLineToPoint(path, NULL, p.x, p.y); 621 | 622 | p1 = CGPointMake(p.x, p.y + __PAN_CURVE_SIZE); 623 | switch (kind) { 624 | case PKNumberPadViewImageLeft: 625 | p.x -= __PAN_UL_WIDTH*2; 626 | break; 627 | 628 | case PKNumberPadViewImageInner: 629 | p.x -= __PAN_UL_WIDTH; 630 | break; 631 | 632 | case PKNumberPadViewImageRight: 633 | break; 634 | } 635 | 636 | p.y += __PAN_MIDDLE_HEIGHT + __PAN_CURVE_SIZE*2; 637 | p2 = CGPointMake(p.x, p.y - __PAN_CURVE_SIZE); 638 | CGPathAddCurveToPoint(path, NULL, 639 | p1.x, p1.y, 640 | p2.x, p2.y, 641 | p.x, p.y); 642 | 643 | p.y += __PAN_LOWER_HEIGHT - __PAN_CURVE_SIZE - __PAN_LOWER_RADIUS; 644 | CGPathAddLineToPoint(path, NULL, p.x, p.y); 645 | 646 | p.x -= __PAN_LOWER_RADIUS; 647 | CGPathAddArc(path, NULL, 648 | p.x, p.y, 649 | __PAN_LOWER_RADIUS, 650 | 4.0*M_PI/2.0, 651 | 1.0*M_PI/2.0, 652 | false); 653 | 654 | p.x -= __PAN_LOWER_WIDTH; 655 | p.y += __PAN_LOWER_RADIUS; 656 | CGPathAddLineToPoint(path, NULL, p.x, p.y); 657 | 658 | p.y -= __PAN_LOWER_RADIUS; 659 | CGPathAddArc(path, NULL, 660 | p.x, p.y, 661 | __PAN_LOWER_RADIUS, 662 | 1.0*M_PI/2.0, 663 | 2.0*M_PI/2.0, 664 | false); 665 | 666 | p.x -= __PAN_LOWER_RADIUS; 667 | p.y -= __PAN_LOWER_HEIGHT - __PAN_LOWER_RADIUS - __PAN_CURVE_SIZE; 668 | CGPathAddLineToPoint(path, NULL, p.x, p.y); 669 | 670 | p1 = CGPointMake(p.x, p.y - __PAN_CURVE_SIZE); 671 | 672 | switch (kind) { 673 | case PKNumberPadViewImageLeft: 674 | break; 675 | 676 | case PKNumberPadViewImageInner: 677 | p.x -= __PAN_UL_WIDTH; 678 | break; 679 | 680 | case PKNumberPadViewImageRight: 681 | p.x -= __PAN_UL_WIDTH*2; 682 | break; 683 | } 684 | 685 | p.y -= __PAN_MIDDLE_HEIGHT + __PAN_CURVE_SIZE*2; 686 | p2 = CGPointMake(p.x, p.y + __PAN_CURVE_SIZE); 687 | CGPathAddCurveToPoint(path, NULL, 688 | p1.x, p1.y, 689 | p2.x, p2.y, 690 | p.x, p.y); 691 | 692 | p.y -= __PAN_UPPER_HEIGHT - __PAN_UPPER_RADIUS - __PAN_CURVE_SIZE; 693 | CGPathAddLineToPoint(path, NULL, p.x, p.y); 694 | 695 | p.x += __PAN_UPPER_RADIUS; 696 | CGPathAddArc(path, NULL, 697 | p.x, p.y, 698 | __PAN_UPPER_RADIUS, 699 | 2.0*M_PI/2.0, 700 | 3.0*M_PI/2.0, 701 | false); 702 | //---- 703 | CGContextRef context; 704 | UIGraphicsBeginImageContext(CGSizeMake(__WIDTH, 705 | __HEIGHT)); 706 | context = UIGraphicsGetCurrentContext(); 707 | 708 | switch (kind) { 709 | case PKNumberPadViewImageLeft: 710 | CGContextTranslateCTM(context, 6.0, __HEIGHT); 711 | break; 712 | 713 | case PKNumberPadViewImageInner: 714 | CGContextTranslateCTM(context, 0.0, __HEIGHT); 715 | break; 716 | 717 | case PKNumberPadViewImageRight: 718 | CGContextTranslateCTM(context, -6.0, __HEIGHT); 719 | break; 720 | } 721 | CGContextScaleCTM(context, 1.0, -1.0); 722 | 723 | CGContextAddPath(context, path); 724 | CGContextClip(context); 725 | 726 | //---- 727 | 728 | CGRect frame = CGPathGetBoundingBox(path); 729 | CGContextSetFillColorWithColor(context, [[UIColor colorWithRed:0.973 green:0.976 blue:0.976 alpha:1.000] CGColor]); 730 | CGContextFillRect(context, frame); 731 | 732 | CGImageRef imageRef = CGBitmapContextCreateImage(context); 733 | 734 | UIImage * image = [UIImage imageWithCGImage:imageRef scale:[[UIScreen mainScreen] scale] orientation:UIImageOrientationDown]; 735 | CGImageRelease(imageRef); 736 | 737 | UIGraphicsEndImageContext(); 738 | 739 | 740 | CFRelease(path); 741 | 742 | return image; 743 | } 744 | 745 | 746 | @end 747 | 748 | -------------------------------------------------------------------------------- /iPhone:iPod/PMCustomKeyboard.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 32 | 46 | 60 | 74 | 88 | 102 | 116 | 130 | 144 | 158 | 172 | 186 | 200 | 214 | 228 | 242 | 256 | 270 | 284 | 298 | 312 | 326 | 340 | 354 | 368 | 382 | 396 | 410 | 424 | 438 | 455 | 472 | 489 | 506 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | --------------------------------------------------------------------------------