Skip to content

Wrap String constants in enum Strings namespace#52

Merged
dadachi merged 1 commit intosubstrate-v2from
substrate-v2--wrap-string-constants-with-enum
Apr 28, 2026
Merged

Wrap String constants in enum Strings namespace#52
dadachi merged 1 commit intosubstrate-v2from
substrate-v2--wrap-string-constants-with-enum

Conversation

@dadachi
Copy link
Copy Markdown
Contributor

@dadachi dadachi commented Apr 28, 2026

Summary

  • Convert the large extension String block in Constants.swift to a caseless enum Strings namespace, matching the existing NativeAppTemplateConstants idiom in the same file.
  • Inline the two cardDateString / cardTimeString literals in DateFormatter+Extensions.swift and drop the small extension they lived in.
  • Update call sites across the app and tests from String.foo to Strings.foo, including dot-shorthand uses for message:, text:, buttonTitle:, and ?.message == parameters.

Mirrors upstream nativeapptemplate/NativeAppTemplate-iOS#62, adapted to this Free fork (which does not have the Account/Invitation surface and keeps the existing image() / isAlphanumeric() String helpers because tests still depend on them).

Test plan

  • make lint passes (SwiftLint + SwiftFormat, 0 violations)
  • xcodebuild build succeeds for iPhone simulator (generic)
  • xcodebuild test succeeds on iPhone 17 simulator (all tests pass)
  • Smoke-test app: messages still render (success/error toasts), tab labels, Back to Start Screen button on permission error

🤖 Generated with Claude Code

Convert the large `extension String` block in `Constants.swift` to a
caseless `enum Strings` namespace, matching the existing
`NativeAppTemplateConstants` idiom in the same file. Inline the
two `cardDateString`/`cardTimeString` literals in
`DateFormatter+Extensions.swift` and remove the small extension
they lived in. Update call sites across the app and tests from
`String.foo` to `Strings.foo`, including dot-shorthand uses for
`message:`, `text:`, `buttonTitle:`, and `?.message ==` parameters.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dadachi dadachi merged commit 3e034f1 into substrate-v2 Apr 28, 2026
2 checks passed
@dadachi dadachi deleted the substrate-v2--wrap-string-constants-with-enum branch April 28, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant