Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add alignment property to TextField #53

Merged
merged 1 commit into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BlueprintUI.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'BlueprintUI'
s.version = '0.5.0'
s.version = '0.5.1'
s.summary = 'Swift library for declarative UI construction'
s.homepage = 'https://github.com/square/blueprint'
s.license = 'Apache License, Version 2.0'
Expand Down
2 changes: 1 addition & 1 deletion BlueprintUICommonControls.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'BlueprintUICommonControls'
s.version = '0.5.0'
s.version = '0.5.1'
s.summary = 'UIKit-backed elements for Blueprint'
s.homepage = 'https://github.com/square/blueprint'
s.license = 'Apache License, Version 2.0'
Expand Down
2 changes: 2 additions & 0 deletions BlueprintUICommonControls/Sources/TextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public struct TextField: Element {
public var onChange: ((String) -> Void)? = nil
public var secure: Bool = false
public var isEnabled: Bool = true
public var textAlignment: NSTextAlignment = .left

public var clearButtonMode: UITextField.ViewMode = .never

Expand Down Expand Up @@ -41,6 +42,7 @@ public struct TextField: Element {
configuration[\.onChange] = onChange
configuration[\.isSecureTextEntry] = secure
configuration[\.isEnabled] = isEnabled
configuration[\.textAlignment] = textAlignment

configuration[\.clearButtonMode] = clearButtonMode

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions BlueprintUICommonControls/Tests/Sources/TextFieldTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ class TextFieldTests: XCTestCase {
size: CGSize(width: 200, height: 44),
identifier: "disabled")
}

do {
var field = TextField(text: "Right Aligned")
field.textAlignment = .right
compareSnapshot(
of: field,
size: CGSize(width: 200, height: 44),
identifier: "right-aligned")
}

}

Expand Down
10 changes: 5 additions & 5 deletions SampleApp/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- BlueprintUI (0.5.0)
- BlueprintUI/Tests (0.5.0)
- BlueprintUICommonControls (0.5.0):
- BlueprintUI (0.5.1)
- BlueprintUI/Tests (0.5.1)
- BlueprintUICommonControls (0.5.1):
- BlueprintUI

DEPENDENCIES:
Expand All @@ -16,8 +16,8 @@ EXTERNAL SOURCES:
:path: "../BlueprintUICommonControls.podspec"

SPEC CHECKSUMS:
BlueprintUI: 62a611a458898294179d2a309a510994b24bcfb1
BlueprintUICommonControls: 6ee3f53410aa98484202bfdef1443fc1162b4c06
BlueprintUI: e5f89d442f225e1865aa8f153dc9da3f1adcbfc4
BlueprintUICommonControls: d70a7f34ee88242d3b5e13e81de92ca326c95bec

PODFILE CHECKSUM: e9562cee84054ca8676daa6bfce31541238548f0

Expand Down