Skip to content

luximetr/AnyFormatKitSwiftUI

Repository files navigation

AnyFormatKitSwiftUI: Simple text formatting for SwiftUI

CI Status Pod Version License Platform SwiftPM compatible Swift SwiftUI

Text formatting framework written for SwiftUI and based on AnyFormatKit.

Demo

Phone number example

Currency example

Card number example

Placeholder number number example

Requirements

  • iOS 13.0+
  • Swift 4.0+
  • Xcode 11.0+

Installation

Swift Package Manager

AnyFormatKit is available with Swift Package Manager. Once you have your Swift package set up, than simply add AnyFormatKitSwiftUI to the dependencies value of your Package.swift

dependencies: [
    .package(url: "https://github.com/luximetr/AnyFormatKitSwiftUI.git", .upToNextMajor(from: "0.5.3"))
]

CocoaPods

AnyFormatKitSwiftUI is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'AnyFormatKitSwiftUI', '~> 0.5.3'

Then, run the following command:

$ pod install

Usage

import SwiftUI
import AnyFormatKitSwiftUI

struct ContentView: View {
    @State var text = ""
    
    var body: some View {
        FormatTextField(
            unformattedText: $text,
            textPattern: "### (###) ###-##-##"
        )
    }
}

For more details look example

TextField types

Features

Features
🚴 Formatting text during typing
#️⃣ Set format using '#' characters like '### ##-###'
😛 Supporting emojis
💲 Formatting money amount
🅿️ Formatting with placeholders

Author

luximetr, luximetr.notification@gmail.com

Say thank you

License

AnyFormatKitSwiftUI is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published