Skip to content

Commit 700e639

Browse files
committed
[KeyboardLayoutEnigne] Fix styles
Bump podspec version.
1 parent 79adb52 commit 700e639

File tree

4 files changed

+48
-49
lines changed

4 files changed

+48
-49
lines changed

Keyboard/KeyboardLayoutEngine/KeyboardButton.swift

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -55,41 +55,41 @@ public struct KeyboardButtonStyle {
5555
public var keyPopContainerView: UIView?
5656

5757
public init(
58-
backgroundColor: UIColor = UIColor.whiteColor(),
59-
cornerRadius: CGFloat = 5,
60-
borderColor: UIColor = UIColor.clearColor(),
61-
borderWidth: CGFloat = 0,
62-
shadowEnabled: Bool = true,
63-
shadowColor: UIColor = UIColor.grayColor(),
64-
shadowOpacity: Float = 1,
65-
shadowOffset: CGSize = CGSize(width: 0, height: 1),
66-
shadowRadius: CGFloat = 0,
58+
backgroundColor: UIColor? = nil,
59+
cornerRadius: CGFloat? = nil,
60+
borderColor: UIColor? = nil,
61+
borderWidth: CGFloat? = nil,
62+
shadowEnabled: Bool? = nil,
63+
shadowColor: UIColor? = nil,
64+
shadowOpacity: Float? = nil,
65+
shadowOffset: CGSize? = nil,
66+
shadowRadius: CGFloat? = nil,
6767
shadowPath: UIBezierPath? = nil,
68-
textColor: UIColor = UIColor.blackColor(),
69-
font: UIFont = UIFont.systemFontOfSize(21),
70-
textOffsetY: CGFloat = 0,
68+
textColor: UIColor? = nil,
69+
font: UIFont? = nil,
70+
textOffsetY: CGFloat? = nil,
7171
imageSize: CGFloat? = nil,
7272
keyPopType: KeyPopType? = nil,
73-
keyPopWidthMultiplier: CGFloat = 1.5,
74-
keyPopHeightMultiplier: CGFloat = 1.1,
73+
keyPopWidthMultiplier: CGFloat? = nil,
74+
keyPopHeightMultiplier: CGFloat? = nil,
7575
keyPopContainerView: UIView? = nil) {
76-
self.backgroundColor = backgroundColor
77-
self.cornerRadius = cornerRadius
78-
self.borderColor = borderColor
79-
self.borderWidth = borderWidth
80-
self.shadowEnabled = shadowEnabled
81-
self.shadowColor = shadowColor
82-
self.shadowOpacity = shadowOpacity
83-
self.shadowOffset = shadowOffset
84-
self.shadowRadius = shadowRadius
76+
self.backgroundColor = backgroundColor ?? UIColor.whiteColor()
77+
self.cornerRadius = cornerRadius ?? 5
78+
self.borderColor = borderColor ?? UIColor.clearColor()
79+
self.borderWidth = borderWidth ?? 0
80+
self.shadowEnabled = shadowEnabled ?? true
81+
self.shadowColor = shadowColor ?? UIColor.grayColor()
82+
self.shadowOpacity = shadowOpacity ?? 1
83+
self.shadowOffset = shadowOffset ?? CGSize(width: 0, height: 1)
84+
self.shadowRadius = shadowRadius ?? 0
8585
self.shadowPath = shadowPath
86-
self.textColor = textColor
87-
self.font = font
88-
self.textOffsetY = textOffsetY
86+
self.textColor = textColor ?? UIColor.blackColor()
87+
self.font = font ?? UIFont.systemFontOfSize(21)
88+
self.textOffsetY = textOffsetY ?? 0
8989
self.imageSize = imageSize
9090
self.keyPopType = keyPopType
91-
self.keyPopWidthMultiplier = keyPopWidthMultiplier
92-
self.keyPopHeightMultiplier = keyPopHeightMultiplier
91+
self.keyPopWidthMultiplier = keyPopWidthMultiplier ?? 1.5
92+
self.keyPopHeightMultiplier = keyPopHeightMultiplier ?? 1.1
9393
self.keyPopContainerView = keyPopContainerView
9494
}
9595
}

Keyboard/KeyboardLayoutEngine/KeyboardLayout.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ public struct KeyboardLayoutStyle {
3838
public var backgroundColor: UIColor
3939

4040
public init(
41-
topPadding: CGFloat = 10,
42-
bottomPadding: CGFloat = 4,
43-
rowPadding: CGFloat = 12,
44-
rowPaddingLandscape: CGFloat = 6,
45-
backgroundColor: UIColor = UIColor(red: 208.0/255.0, green: 213.0/255.0, blue: 219.0/255.0, alpha: 1)) {
46-
self.topPadding = topPadding
47-
self.bottomPadding = bottomPadding
48-
self.rowPadding = rowPadding
49-
self.rowPaddingLandscape = rowPaddingLandscape
50-
self.backgroundColor = backgroundColor
41+
topPadding: CGFloat? = nil,
42+
bottomPadding: CGFloat? = nil,
43+
rowPadding: CGFloat? = nil,
44+
rowPaddingLandscape: CGFloat? = nil,
45+
backgroundColor: UIColor? = nil) {
46+
self.topPadding = topPadding ?? 10
47+
self.bottomPadding = bottomPadding ?? 4
48+
self.rowPadding = rowPadding ?? 12
49+
self.rowPaddingLandscape = rowPaddingLandscape ?? 6
50+
self.backgroundColor = backgroundColor ?? UIColor(red: 208.0/255.0, green: 213.0/255.0, blue: 219.0/255.0, alpha: 1)
5151
}
5252
}
5353

Keyboard/KeyboardLayoutEngine/KeyboardRow.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,27 @@ public struct KeyboardRowStyle {
2121
public var buttonHitTestEdgeInsests: UIEdgeInsets
2222

2323
public init(
24-
leadingPadding: CGFloat = 3,
24+
leadingPadding: CGFloat? = nil,
2525
leadingPaddingLandscape: CGFloat? = nil,
26-
trailingPadding: CGFloat = 3,
26+
trailingPadding: CGFloat? = nil,
2727
trailingPaddingLandscape: CGFloat? = nil,
2828
topPadding: CGFloat? = nil,
2929
topPaddingLandscape: CGFloat? = nil,
3030
bottomPadding: CGFloat? = nil,
3131
bottomPaddingLandscape: CGFloat? = nil,
32-
buttonsPadding: CGFloat = 6,
32+
buttonsPadding: CGFloat? = nil,
3333
buttonsPaddingLandscape: CGFloat? = nil,
34-
buttonHitTestEdgeInsests: UIEdgeInsets = UIEdgeInsets(top: -6, left: -6, bottom: -6, right: -6)) {
34+
buttonHitTestEdgeInsests: UIEdgeInsets? = nil) {
3535

36-
self.leadingPadding = leadingPadding
36+
self.leadingPadding = leadingPadding ?? 3
3737
self.leadingPaddingLandscape = leadingPaddingLandscape
38-
self.trailingPadding = trailingPadding
38+
self.trailingPadding = trailingPadding ?? 3
3939
self.trailingPaddingLandscape = trailingPaddingLandscape
4040
self.bottomPadding = bottomPadding
4141
self.bottomPaddingLandscape = bottomPaddingLandscape
42-
self.buttonsPadding = buttonsPadding
42+
self.buttonsPadding = buttonsPadding ?? 6
4343
self.buttonsPaddingLandscape = buttonsPaddingLandscape
44-
self.buttonHitTestEdgeInsests = buttonHitTestEdgeInsests
44+
self.buttonHitTestEdgeInsests = buttonHitTestEdgeInsests ?? UIEdgeInsets(top: -6, left: -6, bottom: -6, right: -6)
4545
}
4646
}
4747

KeyboardLayoutEngine.podspec

Lines changed: 2 additions & 3 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.8.2"
19+
s.version = "0.8.9
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.8.2" }
339+
s.source = { :git => "https://github.com/cemolcay/KeyboardLayoutEngine.git", :tag => "0.8.9" }
340340
341341
342342
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
@@ -389,6 +389,5 @@ optional func defaultKeyboardDidPressReturnButton(defaultKeyboard: DefaultKeyboa
389389
390390
# s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
391391
s.dependency "Shadow"
392-
s.dependency "ManualLayout"
393392

394393
end

0 commit comments

Comments
 (0)