From 84535ecb8bc73c8ab1efc3aea98a94bae0e1ab18 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Tue, 18 Mar 2025 16:36:45 +0000 Subject: [PATCH] Fix an issue rendering pills in some forks. (#3913) --- ElementX/Sources/Other/InfoPlistReader.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ElementX/Sources/Other/InfoPlistReader.swift b/ElementX/Sources/Other/InfoPlistReader.swift index df1686ab9..bc5d256f7 100644 --- a/ElementX/Sources/Other/InfoPlistReader.swift +++ b/ElementX/Sources/Other/InfoPlistReader.swift @@ -104,9 +104,14 @@ struct InfoPlistReader { let exportedTypes: [[String: Any]] = infoPlistValue(forKey: Keys.utExportedTypeDeclarationsKey) guard let mentionPills = exportedTypes.first(where: { $0[Keys.utDescriptionKey] as? String == Values.mentionPills }), let utType = mentionPills[Keys.utTypeIdentifierKey] as? String else { - fatalError("Add properly \(Values.mentionPills) exported type into your target's Info.plst") + fatalError("Add properly \(Values.mentionPills) exported type into your target's Info.plist") } - return utType + + // The pills type is formed from the baseBundleIdentifier, however weirdly, if a fork sets that with a value + // that includes one or more uppercase characters, pill rendering breaks. If we lowercase the type identifier + // the bug is fixed, even though the value used in the fork's Info.plist no longer matches the value returned. + // Maybe in the future the fork should set their own PILLS_UT_TYPE_IDENTIFIER, but for now this works 🤷‍♂️🤷‍♂️🤷‍♂️ + return utType.lowercased() } // MARK: - Private