From b15bb4c44f31f5ab95bc4fb8caaa8a59ec1b9020 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Date: Tue, 16 Apr 2024 17:52:27 +0200 Subject: [PATCH] Move # section to end of AZ list (PLAYRTS-5499) (#455) --- Application/Sources/Helpers/Extensions.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Application/Sources/Helpers/Extensions.swift b/Application/Sources/Helpers/Extensions.swift index 73f0f0185..21188bf27 100644 --- a/Application/Sources/Helpers/Extensions.swift +++ b/Application/Sources/Helpers/Extensions.swift @@ -193,7 +193,11 @@ extension Collection { return "#" } } - return dictionary.sorted { $0.key < $1.key } + let hashGroup = dictionary["#"] + return dictionary + .filter { $0.key != "#" } + .sorted { $0.key < $1.key } + .appending(contentsOf: hashGroup.map { [(Character("#"), $0)] } ?? []) } }