diff --git a/Sources/OEVoice/extensions/AttributedString-extensions.swift b/Sources/OEVoice/extensions/AttributedString-extensions.swift index b9dd515..bcebabc 100644 --- a/Sources/OEVoice/extensions/AttributedString-extensions.swift +++ b/Sources/OEVoice/extensions/AttributedString-extensions.swift @@ -12,7 +12,7 @@ public extension AttributedString { /// Adds accessible phonetic pronunciation for specified phrases. /// - Parameter phrases: Dictionary of phrases and ipa pronunciations for those phrases /// - Returns: `AttributedString` with accessible phonetic pronunciations for specified phrases - func addAccessibilitySpeechPhoneticNotation(_ phrases: [String: String], voice: OEVoice = .default) -> Self { + func accessibilityIPA(_ phrases: [String: String]) -> Self { var attributedString = self phrases.forEach { phrase in diff --git a/Sources/OEVoice/extensions/String-extensions.swift b/Sources/OEVoice/extensions/String-extensions.swift index a4e520a..5028a40 100644 --- a/Sources/OEVoice/extensions/String-extensions.swift +++ b/Sources/OEVoice/extensions/String-extensions.swift @@ -60,3 +60,12 @@ public extension String { NSMutableAttributedString(string: self).accessibilityOldEnglishIPA(ipa, voice: voice) } } + +@available(iOS 15, *) +public extension String { + /// Adds accessible phonetic pronunciation for specified phrases. + /// - Parameter phrases: Dictionary of phrases and ipa pronunciations for those phrases + /// - Returns: `AttributedString` with accessible phonetic pronunciations for specified phrases + func accessibilityIPA(_ phrases: [String: String], voice: OEVoice = .default) -> AttributedString { AttributedString(self).accessibilityIPA(phrases) + } +}