Update Cocoapods

This commit is contained in:
Eugene Bistolas 2021-08-16 12:12:57 -10:00
parent bf21826add
commit fa302d8b22
21 changed files with 495 additions and 579 deletions

View File

@ -1,19 +1,26 @@
<img width=443 src="Resources/readme-images/BonMot-logo.png" alt="BonMot Logo" />
[![Swift 4.2 + 5.0](https://img.shields.io/badge/Swift-4.2%20+%205.0-orange.svg?style=flat)](https://swift.org)
[![Swift 5.0](https://img.shields.io/badge/Swift-%205.0-orange.svg?style=flat)](https://swift.org)
[![CircleCI](https://img.shields.io/circleci/project/github/Rightpoint/BonMot/master.svg)](https://circleci.com/gh/Rightpoint/BonMot)
[![Version](https://img.shields.io/cocoapods/v/BonMot.svg?style=flat)](http://cocoapods.org/pods/BonMot)
[![License](https://img.shields.io/cocoapods/l/BonMot.svg?style=flat)](http://cocoapods.org/pods/BonMot)
[![Platform](https://img.shields.io/cocoapods/p/BonMot.svg?style=flat)](http://cocoapods.org/pods/BonMot)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Swift Package Manager compatible](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange?style=flat)](https://swift.org/package-manager/)
[![codecov](https://codecov.io/gh/Rightpoint/BonMot/branch/master/graph/badge.svg)](https://codecov.io/gh/Rightpoint/BonMot)
BonMot (pronounced *Bon Mo*, French for *good word*) is a Swift attributed string library. It abstracts away the complexities of the iOS, macOS, tvOS, and watchOS typography tools, freeing you to focus on making your text beautiful.
To run the example project, run `pod try BonMot`, or clone the repo, open `BonMot.xcodeproj`, and run the **Example-iOS** target.
### Note
If you are migrating a project from BonMot 3 to BonMot 4, please see the [Migration Guide](#bonmot-3--4-migration-guide).
### AttributedString
BonMot has been [sherlocked](https://en.wikipedia.org/wiki/Sherlock_(software)#Sherlocked_as_a_term)! If you're targeting iOS 15 or higher, you may want to check out [AttributedString](https://developer.apple.com/documentation/foundation/attributedstring) instead. If you're an existing user of BonMot using Xcode 13, you may want to add the following `typealias` somewhere in your project to avoid a conflict with `Foundation.StringStyle`:
```swift
typealias StringStyle = BonMot.StringStyle
```
There is also currently a [known issue](https://github.com/Rightpoint/BonMot/issues/415) in Xcode 13 Beta 2 that will cause crashes when deploying to older OS versions.
# Usage
@ -179,7 +186,7 @@ If you want more manual control over the adaptation process and are targeting iO
The `.control` and `.body` behaviors both scale the same, except that when enabling the "Larger Dynamic Type" accessibility setting, `.body` grows unbounded. Here is a graph of the default behaviors of the [system Dynamic Type styles](https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography#dynamic-type-sizes):
<img width=443 src="Resources/readme-images/ios-type-scaling-behavior.png" alt="Graph of iOS Dynamic Type scaling behavior, showing that Control text tops out at the XXL size, but Body text keeps growing all the way up to AccessibilityXXL" />
<img width=443 src="Resources/readme-images/ios-type-scaling-behavior.png" alt="Graph of iOS Dynamic Type scaling behavior, showing that most text tops out at the XXL size, but Body, Large Title, and Title 1 text keeps growing all the way up through AccessibilityXXXL" />
## Storyboard and XIB Integration
@ -309,7 +316,7 @@ In BonMot 3, you may have stored `BONChain`s for later use. You can accomplish t
##### BonMot 3
```swift
struct Constants {
enum Constants {
static let myChain = BONChain()
.color(myColor)
@ -328,7 +335,7 @@ let attrString = myChain.string("some string").attributedString
##### BonMot 4
```swift
struct Constants {
enum Constants {
static let myStyle = StringStyle(
.color(myColor),
@ -346,6 +353,15 @@ let attrString = "some string".styled(with: Constants.myStyle)
# Installation
## Swift Package Manager
BonMot is available through [Swift Package Manager](https://swift.org/package-manager/). To install
it through Xcode, go to `File -> Swift Packages -> Add Package Dependency...` and paste the repository URL:
```
https://github.com/Rightpoint/BonMot.git
```
## CocoaPods
BonMot is available through [CocoaPods](http://cocoapods.org). To install
@ -371,7 +387,7 @@ Contributors are expected to abide by the [Contributor Covenant Code of Conduct]
# Author
Zev Eisenberg: [zeisenberg@rightpoint.com](mailto:zeisenberg@rightpoint.com), [@ZevEisenberg](https://twitter.com/zeveisenberg)
Zev Eisenberg: [@ZevEisenberg](https://twitter.com/zeveisenberg)
Logo by Jon Lopkin: [@jonlopkin](https://twitter.com/jonlopkin)

View File

@ -15,102 +15,11 @@
// This file declares extensions to system types to provide a compatible API
// between Swift iOS, macOS, watchOS, and tvOS.
#if swift(>=4.2)
#else
extension NSAttributedString {
public typealias Key = NSAttributedStringKey
}
#endif
#if os(OSX)
#if swift(>=4.2)
#else
public typealias NSLineBreakMode = NSParagraphStyle.LineBreakMode
#endif
#else
public extension NSParagraphStyle {
typealias LineBreakMode = NSLineBreakMode
}
#if os(iOS) || os(tvOS) || os(watchOS)
#if swift(>=4.2)
#else
extension UIFontDescriptor {
public typealias SymbolicTraits = UIFontDescriptorSymbolicTraits
}
#endif
extension NSAttributedString.Key {
#if swift(>=4.2)
#else
static let accessibilitySpeechPunctuation = NSAttributedString.Key(UIAccessibilitySpeechAttributePunctuation)
static let accessibilitySpeechLanguage = NSAttributedString.Key(UIAccessibilitySpeechAttributeLanguage)
static let accessibilitySpeechPitch = NSAttributedString.Key(UIAccessibilitySpeechAttributePitch)
@available(iOS 11.0, tvOS 11.0, watchOS 4.0, *)
static let accessibilitySpeechIPANotation = NSAttributedString.Key(UIAccessibilitySpeechAttributeIPANotation)
@available(iOS 11.0, tvOS 11.0, watchOS 4.0, *)
static let accessibilitySpeechQueueAnnouncement = NSAttributedString.Key(UIAccessibilitySpeechAttributeQueueAnnouncement)
@available(iOS 11.0, tvOS 11.0, watchOS 4.0, *)
static let accessibilityTextHeadingLevel = NSAttributedString.Key(UIAccessibilityTextAttributeHeadingLevel)
#endif
}
#endif
#if os(iOS) || os(tvOS)
#if swift(>=4.2)
#else
public extension NSLayoutConstraint {
typealias Attribute = NSLayoutAttribute
typealias Relation = NSLayoutRelation
}
extension UIFont {
public typealias TextStyle = UIFontTextStyle
}
extension UIContentSizeCategory {
static var didChangeNotification: NSNotification.Name {
return NSNotification.Name.UIContentSizeCategoryDidChange
}
}
extension UIViewController {
var children: [UIViewController] {
return childViewControllers
}
}
extension UIApplication {
public typealias LaunchOptionsKey = UIApplicationLaunchOptionsKey
}
#endif
#endif
#endif
#if swift(>=4.1)
#else
extension Array {
func compactMap<ElementOfResult>(_ transform: (Element) throws -> ElementOfResult?) rethrows -> [ElementOfResult] {
return try flatMap(transform)
}
}
#endif

View File

@ -25,7 +25,7 @@ public protocol Composable {
/// - Parameters:
/// - attributedString: The attributed string to which to append the
/// receiver.
/// - baseStyle: Additional attribues to apply to the receiver before
/// - baseStyle: Additional attributes to apply to the receiver before
/// appending it to the passed attributed string.
func append(to attributedString: NSMutableAttributedString, baseStyle: StringStyle)
@ -38,7 +38,7 @@ public protocol Composable {
/// - Parameters:
/// - attributedString: The attributed string to which to append the
/// receiver.
/// - baseStyle: Additional attribues to apply to the receiver before
/// - baseStyle: Additional attributes to apply to the receiver before
/// appending it to the passed attributed string.
/// - isLastElement: Whether the receiver is the final element that is
/// being appended to an attributed string. Used in cases

View File

@ -91,7 +91,7 @@
/// will line up when arranged in columns.
case monospaced
/// Proportionally spaced numbers, also known as "proprotional figures",
/// Proportionally spaced numbers, also known as "proportional figures",
/// are of variable width. This makes them look better in most cases,
/// but they should be avoided when numbers need to line up in columns.
case proportional
@ -115,12 +115,12 @@
/// Diagonal Fractions, when written on paper, are written on one line
/// with the numerator diagonally above and to the left of the
/// demoninator, with the slash ("/") between them.
/// denominator, with the slash ("/") between them.
case diagonal
/// Vertical Fractions, when written on paper, are written on one line
/// with the numerator directly above the
/// demoninator, with a line lying horizontally between them.
/// denominator, with a line lying horizontally between them.
case vertical
public func featureSettings() -> [(type: Int, selector: Int)] {
@ -143,7 +143,7 @@
/// No vertical position adjustment is applied.
case normal
/// Superscript (superior) glpyh variants are used, as in footnotes¹.
/// Superscript (superior) glyph variants are used, as in footnotes¹.
case superscript
/// Subscript (inferior) glyph variants are used: v.

View File

@ -30,7 +30,7 @@ extension NSAttributedString {
for unicode in scalars {
let replacementString: String?
switch Special(rawValue: unicode) {
switch Special(rawValue: String(unicode)) {
case .space?:
replacementString = nil
case .objectReplacementCharacter?:

View File

@ -10,7 +10,7 @@
/// in `Special` are either non-printing (like the various space characters) or
/// visually ambiguous when viewed with a monospace code font (like the dashes
/// and hyphens).
public enum Special: UnicodeScalar {
public enum Special: String, CaseIterable {
// Keep the cases sorted by unichar value when adding new cases.
case tab = "\u{0009}"
@ -86,33 +86,9 @@ extension Special {
}
/// All of the enum values contained in `Special`.
public static var all: [Special] = [
.tab,
.lineFeed,
.verticalTab,
.formFeed,
.carriageReturn,
.space,
.nextLine,
.noBreakSpace,
.enSpace,
.emSpace,
.figureSpace,
.thinSpace,
.hairSpace,
.zeroWidthSpace,
.nonBreakingHyphen,
.figureDash,
.enDash,
.emDash,
.horizontalEllipsis,
.lineSeparator,
.paragraphSeparator,
.leftToRightOverride,
.narrowNoBreakSpace,
.wordJoiner,
.minusSign,
.objectReplacementCharacter,
]
/// Property kept here for backward compatibility
@available(*, deprecated, renamed: "allCases")
@inlinable
public static var all: [Special] { allCases }
}

View File

@ -69,6 +69,7 @@ extension StringStyle {
case baseWritingDirection(NSWritingDirection)
case lineHeightMultiple(CGFloat)
case paragraphSpacingBefore(CGFloat)
case allowsDefaultTighteningForTruncation(Bool)
/// Values from 0 to 1 will result in varying levels of hyphenation,
/// with higher values resulting in more aggressive (i.e. more frequent)
@ -155,8 +156,8 @@ extension StringStyle {
return style
}
//swiftlint:disable function_body_length
//swiftlint:disable cyclomatic_complexity
// swiftlint:disable function_body_length
// swiftlint:disable cyclomatic_complexity
/// Update the style with the specified style part.
///
/// - Parameter stylePart: The style part with which to update the receiver.
@ -219,84 +220,57 @@ extension StringStyle {
self.add(stringStyle: style)
case let .emphasis(emphasis):
self.emphasis = emphasis
default:
// interaction between `#if` and `switch` is disappointing. This case
// is in `default:` to remove a warning that default won't be accessed
// on some platforms.
switch stylePart {
case let .hyphenationFactor(hyphenationFactor):
self.hyphenationFactor = hyphenationFactor
default:
#if os(iOS) || os(tvOS) || os(watchOS)
switch stylePart {
case let .speaksPunctuation(speaksPunctuation):
self.speaksPunctuation = speaksPunctuation
return
case let .speakingLanguage(speakingLanguage):
self.speakingLanguage = speakingLanguage
return
case let .speakingPitch(speakingPitch):
self.speakingPitch = speakingPitch
return
case let .speakingPronunciation(speakingPronunciation):
self.speakingPronunciation = speakingPronunciation
return
case let .shouldQueueSpeechAnnouncement(shouldQueueSpeechAnnouncement):
self.shouldQueueSpeechAnnouncement = shouldQueueSpeechAnnouncement
return
case let .headingLevel(headingLevel):
self.headingLevel = headingLevel
return
default:
break
}
#endif
#if os(OSX) || os(iOS) || os(tvOS)
switch stylePart {
case let .numberCase(numberCase):
self.numberCase = numberCase
case let .numberSpacing(numberSpacing):
self.numberSpacing = numberSpacing
case let .fractions(fractions):
self.fractions = fractions
case let .superscript(superscript):
self.superscript = superscript
case let .`subscript`(`subscript`):
self.`subscript` = `subscript`
case let .ordinals(ordinals):
self.ordinals = ordinals
case let .scientificInferiors(scientificInferiors):
self.scientificInferiors = scientificInferiors
case let .smallCaps(smallCaps):
self.smallCaps.insert(smallCaps)
case let .stylisticAlternates(stylisticAlternates):
self.stylisticAlternates.add(other: stylisticAlternates)
case let .contextualAlternates(contextualAlternates):
self.contextualAlternates.add(other: contextualAlternates)
case let .fontFeature(featureProvider):
self.fontFeatureProviders.append(featureProvider)
default:
#if os(iOS) || os(tvOS)
switch stylePart {
case let .adapt(style):
self.adaptations.append(style)
case let .textStyle(textStyle):
self.font = UIFont.bon_preferredFont(forTextStyle: textStyle, compatibleWith: nil)
default:
fatalError("StylePart \(stylePart) should have been caught by an earlier case.")
}
#else
fatalError("StylePart \(stylePart) should have been caught by an earlier case.")
#endif
}
#else
fatalError("StylePart \(stylePart) should have been caught by an earlier case.")
#endif
}
case let .hyphenationFactor(hyphenationFactor):
self.hyphenationFactor = hyphenationFactor
case let .allowsDefaultTighteningForTruncation(allowsDefaultTighteningForTruncation):
self.allowsDefaultTighteningForTruncation = allowsDefaultTighteningForTruncation
#if os(iOS) || os(tvOS) || os(watchOS)
case let .speaksPunctuation(speaksPunctuation):
self.speaksPunctuation = speaksPunctuation
case let .speakingLanguage(speakingLanguage):
self.speakingLanguage = speakingLanguage
case let .speakingPitch(speakingPitch):
self.speakingPitch = speakingPitch
case let .speakingPronunciation(speakingPronunciation):
self.speakingPronunciation = speakingPronunciation
case let .shouldQueueSpeechAnnouncement(shouldQueueSpeechAnnouncement):
self.shouldQueueSpeechAnnouncement = shouldQueueSpeechAnnouncement
case let .headingLevel(headingLevel):
self.headingLevel = headingLevel
#endif
#if os(OSX) || os(iOS) || os(tvOS)
case let .numberCase(numberCase):
self.numberCase = numberCase
case let .numberSpacing(numberSpacing):
self.numberSpacing = numberSpacing
case let .fractions(fractions):
self.fractions = fractions
case let .superscript(superscript):
self.superscript = superscript
case let .`subscript`(`subscript`):
self.`subscript` = `subscript`
case let .ordinals(ordinals):
self.ordinals = ordinals
case let .scientificInferiors(scientificInferiors):
self.scientificInferiors = scientificInferiors
case let .smallCaps(smallCaps):
self.smallCaps.insert(smallCaps)
case let .stylisticAlternates(stylisticAlternates):
self.stylisticAlternates.add(other: stylisticAlternates)
case let .contextualAlternates(contextualAlternates):
self.contextualAlternates.add(other: contextualAlternates)
case let .fontFeature(featureProvider):
self.fontFeatureProviders.append(featureProvider)
#endif
#if os(iOS) || os(tvOS)
case let .adapt(style):
self.adaptations.append(style)
case let .textStyle(textStyle):
self.font = UIFont.bon_preferredFont(forTextStyle: textStyle, compatibleWith: nil)
#endif
}
}
//swiftlint:enable function_body_length
//swiftlint:enable cyclomatic_complexity
// swiftlint:enable function_body_length
// swiftlint:enable cyclomatic_complexity
}

View File

@ -39,6 +39,7 @@ public struct StringStyle {
public var lineHeightMultiple: CGFloat?
public var paragraphSpacingBefore: CGFloat?
public var hyphenationFactor: Float?
public var allowsDefaultTighteningForTruncation: Bool?
#if os(iOS) || os(tvOS) || os(watchOS)
public var speaksPunctuation: Bool?
@ -122,6 +123,7 @@ extension StringStyle {
paragraph.lineHeightMultiple = lineHeightMultiple ?? paragraph.lineHeightMultiple
paragraph.paragraphSpacingBefore = paragraphSpacingBefore ?? paragraph.paragraphSpacingBefore
paragraph.hyphenationFactor = hyphenationFactor ?? paragraph.hyphenationFactor
paragraph.allowsDefaultTighteningForTruncation = allowsDefaultTighteningForTruncation ?? paragraph.allowsDefaultTighteningForTruncation
if paragraph != NSParagraphStyle.default {
theAttributes.update(possibleValue: paragraph, forKey: .paragraphStyle)
@ -273,6 +275,7 @@ extension StringStyle {
lineHeightMultiple = theStringStyle.lineHeightMultiple ?? lineHeightMultiple
paragraphSpacingBefore = theStringStyle.paragraphSpacingBefore ?? paragraphSpacingBefore
hyphenationFactor = theStringStyle.hyphenationFactor ?? hyphenationFactor
allowsDefaultTighteningForTruncation = theStringStyle.allowsDefaultTighteningForTruncation ?? allowsDefaultTighteningForTruncation
#if os(iOS) || os(tvOS) || os(OSX)
fontFeatureProviders.append(contentsOf: theStringStyle.fontFeatureProviders)
@ -372,7 +375,7 @@ public extension StringStyle {
extension NSParagraphStyle {
//swiftlint:disable cyclomatic_complexity
// swiftlint:disable cyclomatic_complexity
/// Update the passed `NSParagraphStyle`'s properties with the value in this
/// the receiver (only if the supplied `NSParagraphStyle`'s value for a
/// given property is the default value).
@ -396,9 +399,10 @@ extension NSParagraphStyle {
if paragraph.paragraphSpacingBefore == defaults.paragraphSpacingBefore { paragraph.paragraphSpacingBefore = paragraphSpacingBefore }
if paragraph.hyphenationFactor == defaults.hyphenationFactor { paragraph.hyphenationFactor = hyphenationFactor }
if paragraph.tabStops == defaults.tabStops { paragraph.tabStops = tabStops }
if paragraph.allowsDefaultTighteningForTruncation == defaults.allowsDefaultTighteningForTruncation { paragraph.allowsDefaultTighteningForTruncation = allowsDefaultTighteningForTruncation }
return paragraph
}
//swiftlint:enable cyclomatic_complexity
// swiftlint:enable cyclomatic_complexity
}

View File

@ -209,7 +209,7 @@
extension StylisticAlternates: FontFeatureProvider {
//swiftlint:disable:next cyclomatic_complexity
// swiftlint:disable:next cyclomatic_complexity
public func featureSettings() -> [(type: Int, selector: Int)] {
var selectors = [Int]()

View File

@ -64,7 +64,7 @@ extension Tab {
let string = attributedString.string as NSString
// Lookup the range this paragraph is operating on.
// This is the range from `range` to the preceeding newline or the start of the string.
// This is the range from `range` to the preceding newline or the start of the string.
let precedingRange = NSRange(location: 0, length: NSMaxRange(range))
var leadingNewline = string.rangeOfCharacter(from: CharacterSet.newlines, options: [.backwards], range: precedingRange).location
leadingNewline = (leadingNewline == NSNotFound) ? 0 : leadingNewline + 1

View File

@ -62,11 +62,7 @@ extension UITextView {
if let attributedText = attributedText {
self.attributedText = attributedText.adapted(to: traitCollection)
}
#if swift(>=4.2)
typingAttributes = NSAttributedString.adapt(attributes: typingAttributes, to: traitCollection)
#else
typingAttributes = NSAttributedString.adapt(attributes: typingAttributes.withTypedKeys(), to: traitCollection).withStringKeys
#endif
typingAttributes = NSAttributedString.adapt(attributes: typingAttributes, to: traitCollection)
}
}
@ -93,38 +89,13 @@ extension UITextField {
if let attributedPlaceholder = attributedPlaceholder {
self.attributedPlaceholder = attributedPlaceholder.adapted(to: traitCollection)
}
#if swift(>=4.2)
defaultTextAttributes = NSAttributedString.adapt(attributes: defaultTextAttributes, to: traitCollection)
#else
defaultTextAttributes = NSAttributedString.adapt(attributes: defaultTextAttributes.withTypedKeys(), to: traitCollection).withStringKeys
#endif
defaultTextAttributes = NSAttributedString.adapt(attributes: defaultTextAttributes, to: traitCollection)
// Fix an issue where shrinking or growing text would stay the same width, but add whitespace.
setNeedsDisplay()
}
}
// Extension is here to work around [SR-631](https://bugs.swift.org/browse/SR-631),
// which requires new types declared in extensions to be built before they can
// themselves be extended. This is fixed in Xcode 10, so we can revert this when
// we stop supporting Xcode 9. (Another workaround is to reorder the files in
// the Compile Sources build phase, but since this is a library, we do not own
// that build phase in all projects that we are used in. We could have renamed
// Compatibility.swift to _Compatibility.swift and trusted CocoaPods to sort
// built files alphabetically, but we're opting to use the more reliable method
// of just putting the extension in the file where it's used.
#if os(iOS) || os(tvOS)
#if swift(>=4.2)
#else
extension UIControl {
typealias State = UIControlState
}
#endif
#endif
// MARK: - AdaptableTextContainer for UIButton
extension UIButton {
@ -146,20 +117,8 @@ extension UISegmentedControl {
// `UISegmentedControl` has terrible generics ([NSObject: AnyObject]? or [AnyHashable: Any]?) on
/// `titleTextAttributes`, so use a helper in Swift 3+
@nonobjc final func bon_titleTextAttributes(for state: UIControl.State) -> StyleAttributes {
let attributes = titleTextAttributes(for: state) ?? [:]
var result: StyleAttributes = [:]
for value in attributes {
#if swift(>=4.2)
result[value.key] = value
#else
guard let string = value.key as? StyleAttributes.Key else {
fatalError("Can not convert key \(value.key) to String")
}
result[string] = value
#endif
}
return result
@nonobjc final func bon_titleTextAttributes(for state: UIControl.State) -> StyleAttributes? {
titleTextAttributes(for: state)
}
/// Adapt `attributedTitle`, for all control states, to the specified trait collection.
@ -168,7 +127,7 @@ extension UISegmentedControl {
@objc(bon_updateTextForTraitCollection:)
public func adaptText(forTraitCollection traitCollection: UITraitCollection) {
for state in UIControl.State.commonStates {
let attributes = bon_titleTextAttributes(for: state)
guard let attributes = bon_titleTextAttributes(for: state) else { continue }
let newAttributes = NSAttributedString.adapt(attributes: attributes, to: traitCollection)
setTitleTextAttributes(newAttributes, for: state)
}
@ -218,7 +177,7 @@ extension UIToolbar {
// MARK: - AdaptableTextContainer for UIViewController
extension UIViewController {
/// Adapt the attributed text of teh bar items in the navigation item or in
/// Adapt the attributed text of the bar items in the navigation item or in
/// the toolbar to the specified trait collection.
///
/// - parameter traitCollection: The new trait collection.
@ -246,19 +205,14 @@ extension UIBarItem {
/// Adapt `titleTextAttributes` to the specified trait collection.
///
/// - note: This extension does not conform to `AdaptableTextContainer`
/// because `UIBarIterm` is not a view or view controller.
/// because `UIBarItem` is not a view or view controller.
/// - parameter traitCollection: the new trait collection.
@objc(bon_updateTextForTraitCollection:)
public func adaptText(forTraitCollection traitCollection: UITraitCollection) {
for state in UIControl.State.commonStates {
let attributes = titleTextAttributes(for: state) ?? [:]
#if swift(>=4.2)
let newAttributes = NSAttributedString.adapt(attributes: attributes, to: traitCollection)
setTitleTextAttributes(newAttributes, for: state)
#else
let newAttributes = NSAttributedString.adapt(attributes: attributes.withTypedKeys(), to: traitCollection)
setTitleTextAttributes(newAttributes, for: state)
#endif
let newAttributes = NSAttributedString.adapt(attributes: attributes, to: traitCollection)
setTitleTextAttributes(newAttributes, for: state)
}
}

View File

@ -10,37 +10,72 @@
import UIKit
/// A few default font scaling behaviors.
public enum AdaptiveStyle {
public struct AdaptiveStyle {
public enum Behavior {
case control
case body
case preferred
case fontMetrics
case above(size: CGFloat, useFontNamed: String)
case below(size: CGFloat, useFontNamed: String)
}
public let behavior: Behavior
// These two values are used only in the fontMetrics case. They should be associated enum values, but marking enum
// cases as @available is not supported: https://github.com/apple/swift/pull/36327
public let textStyle: BonMotTextStyle?
public let maxPointSize: CGFloat?
init(behavior: Behavior, textStyle: BonMotTextStyle? = nil, maxPointSize: CGFloat? = nil) {
self.behavior = behavior
self.textStyle = textStyle
self.maxPointSize = maxPointSize
}
/// Scale the font up or down based on the Dynamic Type slider, but do not
/// grow into the Accessibility ranges.
case control
public static var control: AdaptiveStyle {
AdaptiveStyle(behavior: .control)
}
/// Scale the font up or down based on the Dynamic Type slider,
/// including Accessibility sizes.
case body
public static var body: AdaptiveStyle {
AdaptiveStyle(behavior: .body)
}
/// Enable automatic scaling of fonts obtained using the `preferredFont()`
/// family of methods.
case preferred
public static var preferred: AdaptiveStyle {
AdaptiveStyle(behavior: .preferred)
}
/// Enable automatic scaling of fonts obtained using `UIFontMetrics`
/// available on iOS 11+ based on the provided `textStyle` and optional
/// `maxPointSize`. If `maxPointSize` is `nil` the font will grow unbounded.
@available(iOS 11, tvOS 11, *)
case fontMetrics(textStyle: BonMotTextStyle, maxPointSize: CGFloat?)
public static func fontMetrics(textStyle: BonMotTextStyle, maxPointSize: CGFloat?) -> AdaptiveStyle {
AdaptiveStyle(behavior: .fontMetrics, textStyle: textStyle, maxPointSize: maxPointSize)
}
/// If the text is scaled above `size`, substitute the font named
/// `useFontNamed`, but using all the same attributes as the original font.
/// This style may be combined with other scaling behaviors such as `control`
/// and `body`.
case above(size: CGFloat, useFontNamed: String)
public static func above(size: CGFloat, useFontNamed fontName: String) -> AdaptiveStyle {
AdaptiveStyle(behavior: .above(size: size, useFontNamed: fontName))
}
/// If the text is scaled below `size`, substitute the font named
/// `useFontNamed`, but using all the same attributes as the original font.
/// This style may be combined with other scaling behaviors such as `control`
/// and `body`.
case below(size: CGFloat, useFontNamed: String)
public static func below(size: CGFloat, useFontNamed fontName: String) -> AdaptiveStyle {
AdaptiveStyle(behavior: .below(size: size, useFontNamed: fontName))
}
}
@ -70,7 +105,7 @@ extension AdaptiveStyle: AdaptiveStyleTransformation {
let pointSize = font.pointSize
let contentSizeCategory = traitCollection.bon_preferredContentSizeCategory
var styleAttributes = theAttributes
switch self {
switch behavior {
case .control:
font = UIFont(descriptor: font.fontDescriptor, size: AdaptiveStyle.adapt(designatedSize: pointSize, for: contentSizeCategory))
case .body:
@ -82,9 +117,9 @@ extension AdaptiveStyle: AdaptiveStyleTransformation {
else {
print("No text style in the font, can not adapt")
}
case .fontMetrics(let style, let maxPointSize):
case .fontMetrics:
if #available(iOS 11, tvOS 11, *) {
let metrics = UIFontMetrics(forTextStyle: style)
let metrics = UIFontMetrics(forTextStyle: textStyle ?? .body)
if let maxPointSize = maxPointSize {
font = metrics.scaledFont(for: font, maximumPointSize: maxPointSize, compatibleWith: traitCollection)
}
@ -131,12 +166,12 @@ extension AdaptiveStyle {
/// - Parameters:
/// - size: The size the font was designed for at `UIContentSizeCategory.large`.
/// - contentSizeCategory: The content size category to scale to.
/// - minimiumSize: The smallest size the font can be. Defaults to 11, or
/// - minimumSize: The smallest size the font can be. Defaults to 11, or
/// `designatedSize` if `designatedSize` is less than 11.
/// - Returns: The new point size, scaled to the specified content size
public static func adapt(designatedSize size: CGFloat, for contentSizeCategory: BonMotContentSizeCategory, minimiumSize: CGFloat = 11) -> CGFloat {
public static func adapt(designatedSize size: CGFloat, for contentSizeCategory: BonMotContentSizeCategory, minimumSize: CGFloat = 11) -> CGFloat {
let shift = min(shiftTable[contentSizeCategory] ?? 0, CGFloat(6))
let minSize = min(minimiumSize, size)
let minSize = min(minimumSize, size)
return max(size + shift, minSize)
}
@ -146,16 +181,54 @@ extension AdaptiveStyle {
/// - Parameters:
/// - size: The size the font was designed for at `UIContentSizeCategory.large`.
/// - contentSizeCategory: The content size category to scale to.
/// - minimiumSize: The smallest size the font can be. Defaults to 11.
/// - minimumSize: The smallest size the font can be. Defaults to 11.
/// - Returns: The new point size, scaled to the specified contentSize.
public static func adaptBody(designatedSize size: CGFloat, for contentSizeCategory: BonMotContentSizeCategory, minimiumSize: CGFloat = 11) -> CGFloat {
public static func adaptBody(designatedSize size: CGFloat, for contentSizeCategory: BonMotContentSizeCategory, minimumSize: CGFloat = 11) -> CGFloat {
let shift = shiftTable[contentSizeCategory] ?? 0
let minSize = min(minimiumSize, size)
let minSize = min(minimumSize, size)
return max(size + shift, minSize)
}
}
extension AdaptiveStyle { // Deprecated - search the code and remove other deprecations when you remove this
/// The default scaling function. Grows by 2 points for each
/// step above Large, and shrinks by 1 point for each step below Large.
/// This function does not create larger values for content size category
/// values in the Accessibility range of content size categories.
///
/// - Parameters:
/// - size: The size the font was designed for at `UIContentSizeCategory.large`.
/// - contentSizeCategory: The content size category to scale to.
/// - minimiumSize: The smallest size the font can be. Defaults to `designatedSize` if `designatedSize` is less
/// than the supplied size.
/// - Returns: The new point size, scaled to the specified content size
@available(*, deprecated, renamed: "adapt(designatedSize:for:minimumSize:)")
public static func adapt(designatedSize size: CGFloat, for contentSizeCategory: BonMotContentSizeCategory, minimiumSize minimumSize: CGFloat) -> CGFloat {
// removed default value of minimiumSize so that call sites that don't pass anything will use the new implementation
let shift = min(shiftTable[contentSizeCategory] ?? 0, CGFloat(6))
let minSize = min(minimumSize, size)
return max(size + shift, minSize)
}
/// A scaling function for "body" elements. Continues to grow for content
/// size category values in the Accessibility range.
///
/// - Parameters:
/// - size: The size the font was designed for at `UIContentSizeCategory.large`.
/// - contentSizeCategory: The content size category to scale to.
/// - minimiumSize: The smallest size the font can be.
/// - Returns: The new point size, scaled to the specified contentSize.
@available(*, deprecated, renamed: "adaptBody(designatedSize:for:minimumSize:)")
public static func adaptBody(designatedSize size: CGFloat, for contentSizeCategory: BonMotContentSizeCategory, minimiumSize minimumSize: CGFloat) -> CGFloat {
// removed default value of minimiumSize so that call sites that don't pass anything will use the new implementation
let shift = shiftTable[contentSizeCategory] ?? 0
let minSize = min(minimumSize, size)
return max(size + shift, minSize)
}
}
extension AdaptiveStyle: EmbeddedTransformation {
struct Key {
@ -176,7 +249,7 @@ extension AdaptiveStyle: EmbeddedTransformation {
}
var asDictionary: StyleAttributes {
switch self {
switch behavior {
case let .above(size, family):
return [
EmbeddedTransformationHelpers.Key.type: Value.above,
@ -195,10 +268,10 @@ extension AdaptiveStyle: EmbeddedTransformation {
return [EmbeddedTransformationHelpers.Key.type: Value.body]
case .preferred:
return [EmbeddedTransformationHelpers.Key.type: Value.preferred]
case .fontMetrics(let textStyle, let maxPointSize):
case .fontMetrics:
var attributes: StyleAttributes = [
EmbeddedTransformationHelpers.Key.type: Value.fontMetrics,
EmbeddedTransformationHelpers.Key.textStyle: textStyle,
EmbeddedTransformationHelpers.Key.textStyle: textStyle ?? .body,
]
if let maxPointSize = maxPointSize {
attributes[EmbeddedTransformationHelpers.Key.maxPointSize] = maxPointSize

View File

@ -9,7 +9,7 @@
import Foundation
/// Defines a transformation to be performed on an `NSMutableAttributedString`.
/// It is used for adative transformations that need to know about the content
/// It is used for adaptive transformations that need to know about the content
/// of the string in order to be performed. These are applied after the
/// `AdaptiveStyleTransformation`s are applied.
internal protocol AttributedStringTransformation {

View File

@ -18,7 +18,7 @@ extension NSAttributedString {
/// - Parameters:
/// - theAttributes: The attributes to transform.
/// - traitCollection: The trait collection to which to adapt the attributes.
/// - Returns: Attributes with fonts updated to the specified contect size category.
/// - Returns: Attributes with fonts updated to the specified content size category.
public static func adapt(attributes theAttributes: StyleAttributes, to traitCollection: UITraitCollection) -> StyleAttributes {
let adaptations: [AdaptiveStyleTransformation] = EmbeddedTransformationHelpers.transformations(from: theAttributes)
var styleAttributes = theAttributes
@ -73,7 +73,9 @@ extension StringStyle {
// MARK: - Deprecations
extension NSAttributedString {
@available(*, deprecated, renamed: "adapted(to:)") public final func adapt(to traitCollection: UITraitCollection) -> NSAttributedString {
// Deprecated - search the code and remove other deprecations when you remove this
@available(*, deprecated, renamed: "adapted(to:)")
public final func adapt(to traitCollection: UITraitCollection) -> NSAttributedString {
return adapted(to: traitCollection)
}

View File

@ -65,11 +65,7 @@ extension UITextField {
StyleableUIElementHelpers.setAssociatedStyle(on: self, style: newValue)
styledText = text
let attributes = (bonMotStyle?.attributes(adaptedTo: traitCollection) ?? [:])
#if swift(>=4.2)
defaultTextAttributes = attributes
#else
defaultTextAttributes = attributes.withStringKeys
#endif
defaultTextAttributes = attributes
}
}
@ -125,17 +121,13 @@ extension UITextView {
/// A string style. Stored via associated objects.
/// - note: The style is applied to both the `attributedText` and
/// `typingAtributes`. If you plan on styling them differently, use
/// `typingAttributes`. If you plan on styling them differently, use
/// attributed strings directly.
public final var bonMotStyle: StringStyle? {
get { return StyleableUIElementHelpers.getAssociatedStyle(from: self) }
set {
StyleableUIElementHelpers.setAssociatedStyle(on: self, style: newValue)
#if swift(>=4.2)
typingAttributes = newValue?.attributes(adaptedTo: traitCollection) ?? typingAttributes
#else
typingAttributes = newValue?.attributes(adaptedTo: traitCollection).withStringKeys ?? typingAttributes
#endif
typingAttributes = newValue?.attributes(adaptedTo: traitCollection) ?? typingAttributes
styledText = text
}
}

View File

@ -173,7 +173,7 @@ public class TextAlignmentConstraint: NSLayoutConstraint {
}
// Can't use block-based KVO until we can use \NSLayoutConstraint.firstItem
//swiftlint:disable:next block_based_kvo
// swiftlint:disable:next block_based_kvo
public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
guard context == &TextAlignmentConstraintKVOContext else {
super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)

View File

@ -57,7 +57,7 @@ extension UIViewController {
final func notifyContainedAdaptiveContentSizeContainers() {
if let view = viewIfLoaded {
if view.window == nil {
view.notifyContainedAdaptiveContentSizeContainers()
view.notifyContainedAdaptiveContentSizeContainers(with: traitCollection)
}
}
for viewController in children {
@ -72,9 +72,9 @@ extension UIViewController {
extension UIView {
/// Notify any subviews, then notify the receiver if it conforms to `AdaptableTextContainer`.
final func notifyContainedAdaptiveContentSizeContainers() {
final func notifyContainedAdaptiveContentSizeContainers(with traitCollection: UITraitCollection? = nil) {
for view in subviews {
view.notifyContainedAdaptiveContentSizeContainers()
view.notifyContainedAdaptiveContentSizeContainers(with: traitCollection ?? self.traitCollection)
}
if responds(to: #selector(AdaptableTextContainer.adaptText(forTraitCollection:))) {
perform(#selector(AdaptableTextContainer.adaptText(forTraitCollection:)), with: traitCollection)

View File

@ -33,7 +33,7 @@ extension NSAttributedString {
/// specify styling options.
/// - styler: An optional custom styler to perform extra style operations.
/// - options: XML parsing options.
/// - Returns: A styled attriubted string.
/// - Returns: A styled attriubuted string.
/// - Throws: Any errors encountered by the XML parser.
public static func composed(ofXML fragment: String, baseStyle: StringStyle? = nil, styler: XMLStyler? = nil, options: XMLParsingOptions = []) throws -> NSAttributedString {
let builder = XMLBuilder(
@ -96,7 +96,7 @@ extension Special {
/// Rules describing how to insert values from `Special` into attributed strings.
public static var insertionRules: [XMLStyleRule] {
let rulePairs: [[XMLStyleRule]] = all.map {
let rulePairs: [[XMLStyleRule]] = allCases.map {
let elementName = "BON:\($0.name)"
// Add the insertion rule and a style rule so we don't look up the style and generate a warning
return [XMLStyleRule.enter(element: elementName, insert: $0), XMLStyleRule.style(elementName, StringStyle())]
@ -116,12 +116,22 @@ public enum XMLStyleRule {
/// A name/style pairing.
case style(String, StringStyle)
/// A name with a block that returns style based on `attributes` dictionary.
case styleBlock(String, ([String: String]) -> StringStyle)
/// A `Composable` to insert before entering tags whose name equals `element`.
case enter(element: String, insert: Composable)
/// A block that returns `Composable` to insert before entering tags whose name equals `element`, based on
/// `attributes` dictionary.
case enterBlock(element: String, insert: ([String: String]) -> Composable)
/// A `Composable` to insert before exiting tags whose name equals `element`.
case exit(element: String, insert: Composable)
/// A block that returns `Composable` to insert before exiting tags whose name equals `element`.
case exitBlock(element: String, insert: () -> Composable)
/// An `XMLStyler` implementation for handling `XMLStyleRule`s.
struct Styler: XMLStyler {
@ -132,6 +142,8 @@ public enum XMLStyleRule {
switch rule {
case let .style(string, style) where string == name:
return style
case let .styleBlock(string, block) where string == name:
return block(attributes)
default:
break
}
@ -149,6 +161,8 @@ public enum XMLStyleRule {
switch rule {
case let .enter(string, composable) where string == name:
return composable
case let .enterBlock(string, block) where string == name:
return block(attributes)
default: break
}
}
@ -160,6 +174,8 @@ public enum XMLStyleRule {
switch rule {
case let .exit(string, composable) where string == name:
return composable
case let .exitBlock(string, block) where string == name:
return block()
default: break
}
}

View File

@ -7,7 +7,7 @@ PODS:
- AFNetworking/Security (3.2.1)
- AFNetworking/Serialization (3.2.1)
- blurhash (0.0.1)
- BonMot (5.6.0)
- BonMot (6.0.0)
- CGRPCZlib (1.0.0)
- CNIOAtomics (2.27.0)
- CNIOBoringSSL (2.10.5)
@ -386,7 +386,7 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS:
AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
blurhash: 4b3b2b8909cf41ab59fa349788654b8387284ff4
BonMot: 2217a66e5ddc6a8d2ffb759fe8c85a8528e0d3e7
BonMot: fb2b6a2209cb3149aca37b7131d49c051c04ae86
CGRPCZlib: b0c9d704a12fa667f1824ffff20688f191945989
CNIOAtomics: 43316aa185f4bd639aa0a9cd49741151bbe8de7f
CNIOBoringSSL: 7ff9c35139a115f93269915b9555044d741b2ac9

View File

@ -24147,6 +24147,64 @@
};
name = "Testable Release";
};
0ED5D40DC636BE4ED802F249618B68AE /* Testable Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 19882184750DF2751885B5C3132F22A7 /* BonMot.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = NO;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
EXCLUDED_ARCHS = armv7;
GCC_PREFIX_HEADER = "Target Support Files/BonMot/BonMot-prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"TESTABLE_BUILD=1",
);
INFOPLIST_FILE = "Target Support Files/BonMot/BonMot-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULEMAP_FILE = "Target Support Files/BonMot/BonMot.modulemap";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
"-DTESTABLE_BUILD",
);
OTHER_SWIFT_FLAGS = "$(inherited) -DTESTABLE_BUILD";
PRODUCT_MODULE_NAME = BonMot;
PRODUCT_NAME = BonMot;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WARNING_CFLAGS = (
"$(inherited)",
"-Werror=incompatible-pointer-types",
"-Werror=protocol",
"-Werror=incomplete-implementation",
"-Werror=objc-literal-conversion",
"-Werror=objc-property-synthesis",
"-Werror=objc-protocol-property-synthesis",
);
};
name = "Testable Release";
};
0EF34516B3F19FA5B63F3C0052C7BF02 /* Testable Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 93DCBC572F2DB92B0ECAE96E8934C20D /* SignalArgon2.unit-tests.release.xcconfig */;
@ -25562,6 +25620,54 @@
};
name = Debug;
};
2617F6611788F5A351BAD2A29524D9CC /* Profiling */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 19882184750DF2751885B5C3132F22A7 /* BonMot.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = NO;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = armv7;
GCC_PREFIX_HEADER = "Target Support Files/BonMot/BonMot-prefix.pch";
INFOPLIST_FILE = "Target Support Files/BonMot/BonMot-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULEMAP_FILE = "Target Support Files/BonMot/BonMot.modulemap";
ONLY_ACTIVE_ARCH = YES;
PRODUCT_MODULE_NAME = BonMot;
PRODUCT_NAME = BonMot;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WARNING_CFLAGS = (
"$(inherited)",
"-Werror=incompatible-pointer-types",
"-Werror=protocol",
"-Werror=incomplete-implementation",
"-Werror=objc-literal-conversion",
"-Werror=objc-property-synthesis",
"-Werror=objc-protocol-property-synthesis",
);
};
name = Profiling;
};
2762B3F033969860FDDBB78339292229 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 52310452C39E06EE31C273AACEFE6A9C /* CGRPCZlib.release.xcconfig */;
@ -29910,53 +30016,6 @@
};
name = Profiling;
};
6F43B9FFE925C5B01E2F72288F65BC2F /* App Store Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 19882184750DF2751885B5C3132F22A7 /* BonMot.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = NO;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = armv7;
GCC_PREFIX_HEADER = "Target Support Files/BonMot/BonMot-prefix.pch";
INFOPLIST_FILE = "Target Support Files/BonMot/BonMot-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULEMAP_FILE = "Target Support Files/BonMot/BonMot.modulemap";
PRODUCT_MODULE_NAME = BonMot;
PRODUCT_NAME = BonMot;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WARNING_CFLAGS = (
"$(inherited)",
"-Werror=incompatible-pointer-types",
"-Werror=protocol",
"-Werror=incomplete-implementation",
"-Werror=objc-literal-conversion",
"-Werror=objc-property-synthesis",
"-Werror=objc-protocol-property-synthesis",
);
};
name = "App Store Release";
};
6F8E5FD4F889D15759F00E58CCE6013C /* Testable Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 298E1FA015DDE9A5C6E87D551E90CD32 /* SignalCoreKit.release.xcconfig */;
@ -30105,64 +30164,6 @@
};
name = "App Store Release";
};
71E77A2438E2C5303045026C164BC5F8 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 2680BD4F6F3BF47282B3D0260B19C629 /* BonMot.debug.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = NO;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
EXCLUDED_ARCHS = armv7;
GCC_PREFIX_HEADER = "Target Support Files/BonMot/BonMot-prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"TESTABLE_BUILD=1",
);
GCC_WARN_INHIBIT_ALL_WARNINGS = YES;
INFOPLIST_FILE = "Target Support Files/BonMot/BonMot-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULEMAP_FILE = "Target Support Files/BonMot/BonMot.modulemap";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
"-DTESTABLE_BUILD",
);
OTHER_SWIFT_FLAGS = "$(inherited) -DTESTABLE_BUILD -suppress-warnings";
PRODUCT_MODULE_NAME = BonMot;
PRODUCT_NAME = BonMot;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WARNING_CFLAGS = (
"$(inherited)",
"-Werror=incompatible-pointer-types",
"-Werror=protocol",
"-Werror=incomplete-implementation",
"-Werror=objc-literal-conversion",
"-Werror=objc-property-synthesis",
"-Werror=objc-protocol-property-synthesis",
);
};
name = Debug;
};
7222D5A0A68464F9B7F10CFA41B13A79 /* App Store Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F36BCE57F5BE3BC38A1A96604CAC69BC /* YYImage.release.xcconfig */;
@ -31413,6 +31414,53 @@
};
name = Release;
};
8203E8BF31FD5E2A063326FC50DAA839 /* App Store Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 19882184750DF2751885B5C3132F22A7 /* BonMot.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = NO;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = armv7;
GCC_PREFIX_HEADER = "Target Support Files/BonMot/BonMot-prefix.pch";
INFOPLIST_FILE = "Target Support Files/BonMot/BonMot-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULEMAP_FILE = "Target Support Files/BonMot/BonMot.modulemap";
PRODUCT_MODULE_NAME = BonMot;
PRODUCT_NAME = BonMot;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WARNING_CFLAGS = (
"$(inherited)",
"-Werror=incompatible-pointer-types",
"-Werror=protocol",
"-Werror=incomplete-implementation",
"-Werror=objc-literal-conversion",
"-Werror=objc-property-synthesis",
"-Werror=objc-protocol-property-synthesis",
);
};
name = "App Store Release";
};
8322DD267874EC4A038E946F7F466903 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D1AFDBC7302C3D5B7B86FA752CEF0AD1 /* SwiftNIOConcurrencyHelpers.release.xcconfig */;
@ -32793,64 +32841,6 @@
};
name = "App Store Release";
};
92119E59D354FDC9BCB944D5AC9D3616 /* Testable Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 19882184750DF2751885B5C3132F22A7 /* BonMot.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = NO;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
EXCLUDED_ARCHS = armv7;
GCC_PREFIX_HEADER = "Target Support Files/BonMot/BonMot-prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"TESTABLE_BUILD=1",
);
INFOPLIST_FILE = "Target Support Files/BonMot/BonMot-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULEMAP_FILE = "Target Support Files/BonMot/BonMot.modulemap";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
"-DTESTABLE_BUILD",
);
OTHER_SWIFT_FLAGS = "$(inherited) -DTESTABLE_BUILD";
PRODUCT_MODULE_NAME = BonMot;
PRODUCT_NAME = BonMot;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WARNING_CFLAGS = (
"$(inherited)",
"-Werror=incompatible-pointer-types",
"-Werror=protocol",
"-Werror=incomplete-implementation",
"-Werror=objc-literal-conversion",
"-Werror=objc-property-synthesis",
"-Werror=objc-protocol-property-synthesis",
);
};
name = "Testable Release";
};
9270523A3D52F061B2BD11A865C2AA92 /* Testable Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 219A6636DCD20118B8290DABFA320623 /* SwiftNIOHTTP1.release.xcconfig */;
@ -33445,54 +33435,6 @@
};
name = "App Store Release";
};
A3017E9AEAA03AE74474C10BA7416F27 /* Profiling */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 19882184750DF2751885B5C3132F22A7 /* BonMot.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = NO;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = armv7;
GCC_PREFIX_HEADER = "Target Support Files/BonMot/BonMot-prefix.pch";
INFOPLIST_FILE = "Target Support Files/BonMot/BonMot-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULEMAP_FILE = "Target Support Files/BonMot/BonMot.modulemap";
ONLY_ACTIVE_ARCH = YES;
PRODUCT_MODULE_NAME = BonMot;
PRODUCT_NAME = BonMot;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WARNING_CFLAGS = (
"$(inherited)",
"-Werror=incompatible-pointer-types",
"-Werror=protocol",
"-Werror=incomplete-implementation",
"-Werror=objc-literal-conversion",
"-Werror=objc-property-synthesis",
"-Werror=objc-protocol-property-synthesis",
);
};
name = Profiling;
};
A553ADC91920170B4EF20A52709DB13B /* App Store Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 93DCBC572F2DB92B0ECAE96E8934C20D /* SignalArgon2.unit-tests.release.xcconfig */;
@ -34143,53 +34085,6 @@
};
name = "Testable Release";
};
B081E3106C598788EDFF7B2FB6920673 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 19882184750DF2751885B5C3132F22A7 /* BonMot.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = NO;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = armv7;
GCC_PREFIX_HEADER = "Target Support Files/BonMot/BonMot-prefix.pch";
INFOPLIST_FILE = "Target Support Files/BonMot/BonMot-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULEMAP_FILE = "Target Support Files/BonMot/BonMot.modulemap";
PRODUCT_MODULE_NAME = BonMot;
PRODUCT_NAME = BonMot;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WARNING_CFLAGS = (
"$(inherited)",
"-Werror=incompatible-pointer-types",
"-Werror=protocol",
"-Werror=incomplete-implementation",
"-Werror=objc-literal-conversion",
"-Werror=objc-property-synthesis",
"-Werror=objc-protocol-property-synthesis",
);
};
name = Release;
};
B3B92F62B42C92602D12EB257DEE0CB4 /* App Store Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1BAC64707B1A88B8E412A3589BA3A78A /* SignalMetadataKit.unit-tests.release.xcconfig */;
@ -34774,6 +34669,53 @@
};
name = "Testable Release";
};
BB2DAFF48EF63A81D7FB97481E2C6048 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 19882184750DF2751885B5C3132F22A7 /* BonMot.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = NO;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = armv7;
GCC_PREFIX_HEADER = "Target Support Files/BonMot/BonMot-prefix.pch";
INFOPLIST_FILE = "Target Support Files/BonMot/BonMot-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULEMAP_FILE = "Target Support Files/BonMot/BonMot.modulemap";
PRODUCT_MODULE_NAME = BonMot;
PRODUCT_NAME = BonMot;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WARNING_CFLAGS = (
"$(inherited)",
"-Werror=incompatible-pointer-types",
"-Werror=protocol",
"-Werror=incomplete-implementation",
"-Werror=objc-literal-conversion",
"-Werror=objc-property-synthesis",
"-Werror=objc-protocol-property-synthesis",
);
};
name = Release;
};
BB3DE43EA3223A28380FC6CB80F73CF9 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 98849973DD84209765F32A999A55C742 /* SwiftNIOTransportServices.release.xcconfig */;
@ -34869,6 +34811,64 @@
};
name = Debug;
};
BB9FAC2707348E398192577B6C6100E2 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 2680BD4F6F3BF47282B3D0260B19C629 /* BonMot.debug.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = NO;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
EXCLUDED_ARCHS = armv7;
GCC_PREFIX_HEADER = "Target Support Files/BonMot/BonMot-prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"TESTABLE_BUILD=1",
);
GCC_WARN_INHIBIT_ALL_WARNINGS = YES;
INFOPLIST_FILE = "Target Support Files/BonMot/BonMot-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MODULEMAP_FILE = "Target Support Files/BonMot/BonMot.modulemap";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
"-DTESTABLE_BUILD",
);
OTHER_SWIFT_FLAGS = "$(inherited) -DTESTABLE_BUILD -suppress-warnings";
PRODUCT_MODULE_NAME = BonMot;
PRODUCT_NAME = BonMot;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WARNING_CFLAGS = (
"$(inherited)",
"-Werror=incompatible-pointer-types",
"-Werror=protocol",
"-Werror=incomplete-implementation",
"-Werror=objc-literal-conversion",
"-Werror=objc-property-synthesis",
"-Werror=objc-protocol-property-synthesis",
);
};
name = Debug;
};
BBF8E0796017F486F6BD4967F374A12E /* Testable Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = EA61E6D13095050AAC598457C469CD69 /* SignalArgon2.release.xcconfig */;
@ -39449,11 +39449,11 @@
EBAF0176DA76634D02397BD80DC087AD /* Build configuration list for PBXNativeTarget "BonMot" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6F43B9FFE925C5B01E2F72288F65BC2F /* App Store Release */,
71E77A2438E2C5303045026C164BC5F8 /* Debug */,
A3017E9AEAA03AE74474C10BA7416F27 /* Profiling */,
B081E3106C598788EDFF7B2FB6920673 /* Release */,
92119E59D354FDC9BCB944D5AC9D3616 /* Testable Release */,
8203E8BF31FD5E2A063326FC50DAA839 /* App Store Release */,
BB9FAC2707348E398192577B6C6100E2 /* Debug */,
2617F6611788F5A351BAD2A29524D9CC /* Profiling */,
BB2DAFF48EF63A81D7FB97481E2C6048 /* Release */,
0ED5D40DC636BE4ED802F249618B68AE /* Testable Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;

View File

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.6.0</string>
<string>6.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>