Skip to content

Commit

Permalink
Release 4.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rwbutler committed Mar 16, 2022
1 parent a609394 commit 41e8284
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 34 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.3.2] - 2022-03-16
## Changed
- Fixed an issue concerning font colors in SwiftUI.

## [4.3.1] - 2021-11-09
## Changed
- Allow Color and Font for typography styles in SwiftUI to be nullable.
Expand Down
6 changes: 4 additions & 2 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Example/TypographyKit.xcodeproj/project.pbxproj
Expand Up @@ -611,7 +611,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = TypographyKit/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 4.3.1;
MARKETING_VERSION = 4.3.2;
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "com.rwbutler.TypographyKit-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -627,7 +627,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = TypographyKit/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 4.3.1;
MARKETING_VERSION = 4.3.2;
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "com.rwbutler.TypographyKit-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 1 addition & 1 deletion TypographyKit.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'TypographyKit'
s.version = '4.3.1'
s.version = '4.3.2'
s.summary = 'Consistent & accessible visual styling on iOS with support for Dynamic Type'
s.swift_version = '5.0'
s.description = <<-DESC
Expand Down
10 changes: 6 additions & 4 deletions TypographyKit/Classes/TypographyKitColorsViewController.swift
Expand Up @@ -49,7 +49,6 @@ class TypographyKitColorsViewController: UIViewController {
if viewControllerShouldDismiss() {
let isAnimated: Bool = navigationSettings?.animated ?? true
let isModal: Bool = navigationSettings?.isModal ?? (navigationController == nil)

if isModal {
dismiss(animated: isAnimated, completion: nil)
} else {
Expand All @@ -61,9 +60,12 @@ class TypographyKitColorsViewController: UIViewController {
}

@IBAction func changeStyle(_ sender: UISegmentedControl) {
guard #available(iOS 13, *) else { print("unavailable"); return}
guard #available(iOS 13, *) else {
return
}
let style = TypographyInterfaceStyle.allCases[sender.selectedSegmentIndex]
overrideUserInterfaceStyle = style.userInterfaceStyle
navigationController?.navigationBar.overrideUserInterfaceStyle = style.userInterfaceStyle
}
}

Expand Down Expand Up @@ -137,8 +139,8 @@ private extension TypographyKitColorsViewController {
private func configureHeader() {
guard #available(iOS 13, *) else { return }
headerView.removeAllSegments()
TypographyInterfaceStyle.allCases.enumerated().forEach { x in
let (index, style) = x
TypographyInterfaceStyle.allCases.enumerated().forEach { style in
let (index, style) = style
headerView.insertSegment(withTitle: style.rawValue.upperCamelCased(), at: index, animated: false)
}

Expand Down
21 changes: 16 additions & 5 deletions TypographyKit/Classes/TypographyKitViewController.swift
Expand Up @@ -92,19 +92,26 @@ class TypographyKitViewController: UITableViewController {
}

override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
guard #available(iOS 13, *) else { return nil }
guard #available(iOS 13, *) else {
return nil
}
return styleControl
}

override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
guard #available(iOS 13, *) else { return 0 }
guard #available(iOS 13, *) else {
return 0
}
return styleControl.frame.height
}

@objc func changeStyle(_ sender: UISegmentedControl) {
guard #available(iOS 13, *) else { return }
guard #available(iOS 13, *) else {
return
}
let style = TypographyInterfaceStyle.allCases[sender.selectedSegmentIndex]
overrideUserInterfaceStyle = style.userInterfaceStyle
navigationController?.navigationBar.overrideUserInterfaceStyle = UITraitCollection.current.userInterfaceStyle
tableView.reloadData()
}
}
Expand Down Expand Up @@ -140,7 +147,9 @@ private extension TypographyKitViewController {
}

private func configureHeader() {
guard #available(iOS 13, *) else { return }
guard #available(iOS 13, *) else {
return
}
styleControl.removeAllSegments()
TypographyInterfaceStyle.allCases.enumerated().forEach { item in
let (index, style) = item
Expand Down Expand Up @@ -180,7 +189,9 @@ private extension TypographyKitViewController {
let pdfData = NSMutableData()
UIGraphicsBeginPDFContextToData(pdfData, tableViewContentRect, nil)
UIGraphicsBeginPDFPage()
guard let pdfContext = UIGraphicsGetCurrentContext() else { return }
guard let pdfContext = UIGraphicsGetCurrentContext() else {
return
}
for section in 0..<tableView.numberOfSections {
for row in 0..<tableView.numberOfRows(inSection: section) {
let indexPath = IndexPath(row: row, section: section)
Expand Down

0 comments on commit 41e8284

Please sign in to comment.