What's new
FormatStyle: ISBN.FormatStyle conforms to FormatStyle and ParseableFormatStyle, enabling idiomatic use across SwiftUI, UIKit, and anywhere format styles are accepted:
let isbn = ISBN("9780201896831")!
isbn.formatted() // "978-0-201-89683-1"
Text(isbn, format: .isbn) // SwiftUI
TextField("ISBN", value: $isbn, format: .isbn)Canonical hyphenation: isbn.hyphenated produces the correctly hyphenated ISBN-13 using the International ISBN Agency's range table (287 registration groups).
LosslessStringConvertible: String(isbn) now works as a cleaner alternative to String(describing: isbn).
Breaking changes
ASINClassification.init(classifying:)has been renamed toASINClassification.init(of:).- The package now declares minimum platform versions (iOS 15+, macOS 12+, watchOS 8+, tvOS 12+, visionOS 1+) and requires
Foundation.
Migration
- ASINClassification(classifying: asin)
+ ASINClassification(of: asin)
- String(describing: isbn)
+ String(isbn)