Archives

  • Localization with SwiftUI

    I have been performing a bit of localization lately on a project and was looking for a way to reduce human errors due to mistyped localization keys. The best method I found was to create a separate Translation.swift file to storage all the i18n code. Here I extend the LocalizedStringKey struct with my own project […]

    Jul 6th, 2020 • Filed under Apple, iOS, Swift, SwiftUIPrint View
  • Extending iOS 13 UIColor

    iOS 13 comes with a new color scheme, and to access the old system colors, you will need to reach for UIColor and maybe create a Color object, like so: let ourColor = Color(UIColor.systemGray5) Extending the UIColor class is made easy by switch extension. extension UIColor { var asColor: Color { return Color(self) } } […]

    Jun 2nd, 2020 • Filed under Apple, iOS, Swift, SwiftUIPrint View
Archive for the ‘Swift’ Category