Skip to content

Native iOS (Swift) Support #82

Description

@stefashkaa

Feature Title

Native iOS (Swift) Support with SPM Distribution

Description

Parent: #79

Add a native Swift implementation to support iOS apps directly, with behavior aligned to @desource/phone-mask core metadata and formatting rules.

Use Case

iOS-native teams need the same phone formatting/validation logic as web clients and future RN support, without bridging through JS runtime.

Proposed Solution

  • Publish a Swift package (SPM) (working name: PhoneMaskKit).
  • Core API should include:
    • Format by country
    • Extract raw digits
    • Validate completeness against mask variants
    • Country switching helpers
  • Optional UI adapters:
    • UIKit (UITextField integration)
    • SwiftUI example wrapper
  • Include cross-platform parity fixtures against core package outputs.

Alternatives Considered

  • Wrap web package inside WebView/JS bridge (not ideal for native UX/performance).

Examples from Other Libraries

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions