Skip to content

Commit d37f585

Browse files
committed
Merge pull request #29 from cemolcay/fix/cemolcay-customlayout-keymenu
Fix/cemolcay customlayout keymenu
2 parents cdeff91 + 116d129 commit d37f585

File tree

4 files changed

+15
-20
lines changed

4 files changed

+15
-20
lines changed

Keyboard/DefaultKeyboard/CustomKeyboard.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import UIKit
2020

2121
// MARK: - CustomKeyboard
2222
public class CustomKeyboard: UIView, KeyboardLayoutDelegate {
23-
public var keyButtonPopupContainer: UIView?
24-
2523
public var shiftToggleInterval: NSTimeInterval = 0.5
2624
private var shiftToggleTimer: NSTimer?
2725
private var shiftCanBeToggled: Bool = false

Keyboard/DefaultKeyboard/CustomKeyboardLayout.swift

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ public var CustomKeyboardChildRowStyle = KeyboardRowStyle(
3232

3333
// MARK: - Button Style
3434
public var CustomKeyboardKeyButtonStyle = KeyboardButtonStyle(keyPopType: .Default)
35-
public var CustomKeyboardLeftKeyButtonStyle = KeyboardButtonStyle(keyPopType: .Left)
36-
public var CustomKeyboardRightKeyButtonStyle = KeyboardButtonStyle(keyPopType: .Right)
3735
public var CustomKeyboardLowercaseKeyButtonStyle = KeyboardButtonStyle(textOffsetY: -2, keyPopType: .Default)
38-
public var CustomKeyboardLowercaseLeftKeyButtonStyle = KeyboardButtonStyle(textOffsetY: -2, keyPopType: .Left)
39-
public var CustomKeyboardLowercaseRightKeyButtonStyle = KeyboardButtonStyle(textOffsetY: -2, keyPopType: .Right)
4036
public var CustomKeyboardSpaceButtonStyle = KeyboardButtonStyle(font: UIFont.systemFontOfSize(15))
4137

4238
public var CustomKeyboardBackspaceButtonStyle = KeyboardButtonStyle(
@@ -103,7 +99,7 @@ public enum CustomKeyboardLayout {
10399
KeyboardRow(
104100
style: CustomKeyboardRowStyle,
105101
characters: [
106-
KeyboardButton(type: .Key("Q"), style: CustomKeyboardLeftKeyButtonStyle),
102+
KeyboardButton(type: .Key("Q"), style: CustomKeyboardKeyButtonStyle),
107103
KeyboardButton(type: .Key("W"), style: CustomKeyboardKeyButtonStyle),
108104
KeyboardButton(type: .Key("E"), style: CustomKeyboardKeyButtonStyle),
109105
KeyboardButton(type: .Key("R"), style: CustomKeyboardKeyButtonStyle),
@@ -112,7 +108,7 @@ public enum CustomKeyboardLayout {
112108
KeyboardButton(type: .Key("U"), style: CustomKeyboardKeyButtonStyle),
113109
KeyboardButton(type: .Key("I"), style: CustomKeyboardKeyButtonStyle),
114110
KeyboardButton(type: .Key("O"), style: CustomKeyboardKeyButtonStyle),
115-
KeyboardButton(type: .Key("P"), style: CustomKeyboardRightKeyButtonStyle),
111+
KeyboardButton(type: .Key("P"), style: CustomKeyboardKeyButtonStyle),
116112
]
117113
),
118114
KeyboardRow(
@@ -191,7 +187,7 @@ public enum CustomKeyboardLayout {
191187
KeyboardRow(
192188
style: CustomKeyboardRowStyle,
193189
characters: [
194-
KeyboardButton(type: .Key("q"), style: CustomKeyboardLowercaseLeftKeyButtonStyle),
190+
KeyboardButton(type: .Key("q"), style: CustomKeyboardKeyButtonStyle),
195191
KeyboardButton(type: .Key("w"), style: CustomKeyboardLowercaseKeyButtonStyle),
196192
KeyboardButton(type: .Key("e"), style: CustomKeyboardLowercaseKeyButtonStyle),
197193
KeyboardButton(type: .Key("r"), style: CustomKeyboardLowercaseKeyButtonStyle),
@@ -200,7 +196,7 @@ public enum CustomKeyboardLayout {
200196
KeyboardButton(type: .Key("u"), style: CustomKeyboardLowercaseKeyButtonStyle),
201197
KeyboardButton(type: .Key("i"), style: CustomKeyboardLowercaseKeyButtonStyle),
202198
KeyboardButton(type: .Key("o"), style: CustomKeyboardLowercaseKeyButtonStyle),
203-
KeyboardButton(type: .Key("p"), style: CustomKeyboardLowercaseRightKeyButtonStyle),
199+
KeyboardButton(type: .Key("p"), style: CustomKeyboardKeyButtonStyle),
204200
]
205201
),
206202
KeyboardRow(
@@ -279,7 +275,7 @@ public enum CustomKeyboardLayout {
279275
KeyboardRow(
280276
style: CustomKeyboardRowStyle,
281277
characters: [
282-
KeyboardButton(type: .Key("1"), style: CustomKeyboardLeftKeyButtonStyle),
278+
KeyboardButton(type: .Key("1"), style: CustomKeyboardKeyButtonStyle),
283279
KeyboardButton(type: .Key("2"), style: CustomKeyboardKeyButtonStyle),
284280
KeyboardButton(type: .Key("3"), style: CustomKeyboardKeyButtonStyle),
285281
KeyboardButton(type: .Key("4"), style: CustomKeyboardKeyButtonStyle),
@@ -288,13 +284,13 @@ public enum CustomKeyboardLayout {
288284
KeyboardButton(type: .Key("7"), style: CustomKeyboardKeyButtonStyle),
289285
KeyboardButton(type: .Key("8"), style: CustomKeyboardKeyButtonStyle),
290286
KeyboardButton(type: .Key("9"), style: CustomKeyboardKeyButtonStyle),
291-
KeyboardButton(type: .Key("0"), style: CustomKeyboardRightKeyButtonStyle),
287+
KeyboardButton(type: .Key("0"), style: CustomKeyboardKeyButtonStyle),
292288
]
293289
),
294290
KeyboardRow(
295291
style: CustomKeyboardRowStyle,
296292
characters: [
297-
KeyboardButton(type: .Key("-"), style: CustomKeyboardLeftKeyButtonStyle),
293+
KeyboardButton(type: .Key("-"), style: CustomKeyboardKeyButtonStyle),
298294
KeyboardButton(type: .Key("/"), style: CustomKeyboardKeyButtonStyle),
299295
KeyboardButton(type: .Key(":"), style: CustomKeyboardKeyButtonStyle),
300296
KeyboardButton(type: .Key(";"), style: CustomKeyboardKeyButtonStyle),
@@ -303,7 +299,7 @@ public enum CustomKeyboardLayout {
303299
KeyboardButton(type: .Key("$"), style: CustomKeyboardKeyButtonStyle),
304300
KeyboardButton(type: .Key("&"), style: CustomKeyboardKeyButtonStyle),
305301
KeyboardButton(type: .Key("@"), style: CustomKeyboardKeyButtonStyle),
306-
KeyboardButton(type: .Key("\""), style: CustomKeyboardRightKeyButtonStyle),
302+
KeyboardButton(type: .Key("\""), style: CustomKeyboardKeyButtonStyle),
307303
]
308304
),
309305
KeyboardRow(
@@ -366,7 +362,7 @@ public enum CustomKeyboardLayout {
366362
KeyboardRow(
367363
style: CustomKeyboardRowStyle,
368364
characters: [
369-
KeyboardButton(type: .Key("["), style: CustomKeyboardLeftKeyButtonStyle),
365+
KeyboardButton(type: .Key("["), style: CustomKeyboardKeyButtonStyle),
370366
KeyboardButton(type: .Key("]"), style: CustomKeyboardKeyButtonStyle),
371367
KeyboardButton(type: .Key("{"), style: CustomKeyboardKeyButtonStyle),
372368
KeyboardButton(type: .Key("}"), style: CustomKeyboardKeyButtonStyle),
@@ -375,13 +371,13 @@ public enum CustomKeyboardLayout {
375371
KeyboardButton(type: .Key("^"), style: CustomKeyboardKeyButtonStyle),
376372
KeyboardButton(type: .Key("*"), style: CustomKeyboardKeyButtonStyle),
377373
KeyboardButton(type: .Key("+"), style: CustomKeyboardKeyButtonStyle),
378-
KeyboardButton(type: .Key("="), style: CustomKeyboardRightKeyButtonStyle),
374+
KeyboardButton(type: .Key("="), style: CustomKeyboardKeyButtonStyle),
379375
]
380376
),
381377
KeyboardRow(
382378
style: CustomKeyboardRowStyle,
383379
characters: [
384-
KeyboardButton(type: .Key("_"), style: CustomKeyboardLeftKeyButtonStyle),
380+
KeyboardButton(type: .Key("_"), style: CustomKeyboardKeyButtonStyle),
385381
KeyboardButton(type: .Key("\\"), style: CustomKeyboardKeyButtonStyle),
386382
KeyboardButton(type: .Key("|"), style: CustomKeyboardKeyButtonStyle),
387383
KeyboardButton(type: .Key("~"), style: CustomKeyboardKeyButtonStyle),
@@ -390,7 +386,7 @@ public enum CustomKeyboardLayout {
390386
KeyboardButton(type: .Key(""), style: CustomKeyboardKeyButtonStyle),
391387
KeyboardButton(type: .Key("£"), style: CustomKeyboardKeyButtonStyle),
392388
KeyboardButton(type: .Key("¥"), style: CustomKeyboardKeyButtonStyle),
393-
KeyboardButton(type: .Key(""), style: CustomKeyboardRightKeyButtonStyle),
389+
KeyboardButton(type: .Key(""), style: CustomKeyboardKeyButtonStyle),
394390
]
395391
),
396392
KeyboardRow(

Keyboard/KeyboardLayoutEngine/KeyboardButton.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ public class KeyboardButton: UIView {
208208
if view.viewWithTag(KeyboardButtonPopupViewTag) != nil { return }
209209
let popup = createKeyPop()
210210
popup.tag = KeyboardButtonPopupViewTag
211+
popup.frame.origin = convertPoint(popup.frame.origin, toView: view)
211212
view.addSubview(popup)
212213
} else {
213214
if let popup = view.viewWithTag(KeyboardButtonPopupViewTag) {

KeyboardLayoutEngine.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "KeyboardLayoutEngine"
19-
s.version = "0.8.4"
19+
s.version = "0.8.6"
2020
s.summary = "⌨️ Simplest custom keyboard generator for iOS ever!"
2121

2222
# This description is used to generate tags and improve search results.
@@ -336,7 +336,7 @@ optional func defaultKeyboardDidPressReturnButton(defaultKeyboard: DefaultKeyboa
336336
# Supports git, hg, bzr, svn and HTTP.
337337
#
338338

339-
s.source = { :git => "https://github.com/cemolcay/KeyboardLayoutEngine.git", :tag => "0.8.4" }
339+
s.source = { :git => "https://github.com/cemolcay/KeyboardLayoutEngine.git", :tag => "0.8.6" }
340340

341341

342342
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

0 commit comments

Comments
 (0)