Urgent.News

What's breaking now, across thousands of outlets.

Culture

How I made a Clash of Clans layout filter by town hall level in SwiftUI

I'm making a small free iOS app with base layouts for Clash of Clans, and one of the first tasks seemed simple: to show the player only the bases that match his town hall. What went wrong in the first version? Initially, I stored the town hall level as a string (TH16, TH17). The sorting was broken: TH9 was coming after TH17. I switched to Int and a separate calculated header for the interface.…

Translated from Russian Read in Russian

A developer created a free iOS app called Base Layouts: War & Farm Maps for Clash of Clans. The app allows users to view base layouts suitable for their town hall level. The developer encountered issues with sorting town hall levels when stored as strings, but resolved this by storing them as integers. The app's filter feature allows users to select a town hall level and layout type, and it remembers the last selected level using @AppStorage. The developer is seeking advice on how to organize filters in SwiftUI lists.

Written by urgent.news from Dev.to's report — not a translation of it. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Culture

More from Thursday 29 October →