Skip to content

Make the alignment of the title editable #198

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# _BulletinBoard_ Changelog
## Unreleased
### New Features
- Make the alignment of the title editable
[#198](https://github.com/alexisakers/BulletinBoard/pull/198)

## 🔖 v5.0.0
### Changes
Expand Down
1 change: 0 additions & 1 deletion Sources/InterfaceBuilder/BLTNInterfaceBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import UIKit
open func makeTitleLabel(isNextToCloseButton: Bool) -> BLTNTitleLabelContainer {

let titleLabel = UILabel()
titleLabel.textAlignment = .center
titleLabel.textColor = appearance.titleTextColor
titleLabel.accessibilityTraits.insert(.header)
titleLabel.numberOfLines = 2
Expand Down
4 changes: 4 additions & 0 deletions Sources/Models/BLTNPageItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import UIKit
/// The title of the page.
@objc public let title: String

/// The alignment of the title.
@objc public var titleAlignment: NSTextAlignment = .center

/**
* An image to display below the title.
*
Expand Down Expand Up @@ -181,6 +184,7 @@ import UIKit
let isNextToCloseButton = isDismissable && requiresCloseButton
let titleView = interfaceBuilder.makeTitleLabel(isNextToCloseButton: isNextToCloseButton)
titleView.label.text = title
titleView.label.textAlignment = titleAlignment

self.titleLabel = titleView
contentViews.append(titleView)
Expand Down