Skip to content

Commit

Permalink
Use natural text alignment instead of left
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsaidi committed Sep 14, 2020
1 parent 0132898 commit 83b7948
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
8 changes: 8 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Release Notes


## 3.1.3

This version fixes a bug that caused regular items to not apply right to left text alignment if the device locale requested it.

* `ActionSheetItemCell` now uses `.natural` instead of `.left` by default.
* The standard appearance doesn't apply `.left` to the base cell or section titles.


## 3.1.2

This version updates all external test dependencies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,8 @@ open class ActionSheetAppearance {
Apply action sheet text alignments.
*/
open func applyTextAlignments() {
item.itemTextAlignment = .left
button.itemTextAlignment = .center
title.itemTextAlignment = .center
sectionTitle.itemTextAlignment = .left
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ open class ActionSheetItemCell: UITableViewCell {
// MARK: - Appearance Properties

@objc public dynamic var height: Double = 0
@objc public dynamic var itemTextAlignment: NSTextAlignment = .left
@objc public dynamic var itemTextAlignment: NSTextAlignment = .natural

@objc public dynamic var titleColor: UIColor?
@objc public dynamic var titleFont: UIFont?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class ActionSheetItemCellTests: QuickSpec {
}
}


describe("refreshing") {

it("aborts if cell has no item reference") {
Expand Down Expand Up @@ -59,7 +58,7 @@ class ActionSheetItemCellTests: QuickSpec {
expect(cell.textLabel?.font).to(be(cell.titleFont))
expect(cell.textLabel?.text).to(equal("foo"))
expect(cell.textLabel?.textColor).to(equal(.yellow))
expect(cell.textLabel?.textAlignment).to(equal(.left))
expect(cell.textLabel?.textAlignment).to(equal(.natural))
expect(cell.detailTextLabel?.font).toNot(beNil())
expect(cell.detailTextLabel?.font).to(be(cell.subtitleFont))
expect(cell.detailTextLabel?.text).to(equal("bar"))
Expand Down

0 comments on commit 83b7948

Please sign in to comment.