Easiest way to create an attributed UITextView (with support for multiple links and from html)

Overview

AttributedTextView

Issues Documentation Stars

Version Swift Package Manager Carthage compatible Language Platform License

Git Twitter LinkedIn Website eMail

Easiest way to create an attributed UITextView (with support for multiple links and html).

See the demo app and the playground for detailed information how to use AttributedTextView

Requirements

  • iOS 8.0+
  • Xcode 8.0+

Usage

General usage

In interfacebuilder put an UITextView on the canvas and set the base class to AttributedTextView and create a referencing outlet to the a property in your viewController. In the samples below we have called this property textView1. Always assign to the attributer property when you want to set something.

Paragraph styling

You do have to be aware that the paragraph functions will only be applied after calling the .paragraphApplyStyling function. On start the paragraph styling will use default styling. After each range change (what happens after .all, .match* or .append) the styling will be reset to the default.

The active range

Styling will always be applied on the active range. When executing a function on a string, then that complete string will become the active range. If you use .append to add an other string, then that latest string will become the active range. When using the + sign then that will replaced by an append on 2 Attributer objects. All functions on those objects will first be performed before the append will be executed. So if you do an .all then still only one of the strings will be tha active range. You can use brackets to influence the order of execution.

For instance here all text will be size 20

("red".red + "blue".blue).all.size(20)

And here only the text blue will be size 20

"red".red + "blue".blue.all.size(20)

And like this all text will be size 20

"red".red.append("blue").blue.all.size(20)

Clickable links

When using AttributedTextView and creating links with .makeInteract, then you have to be aware that it will also automatically set the following properties which are needed for links to work.

isUserInteractionEnabled = true
isSelectable = true
isEditable = false

Sample code

Here is a sample of some basic functions:

textView1.attributer =
    "1. ".red
    .append("This is the first test. ").green
    .append("Click on ").black
    .append("evict.nl").makeInteract { _ in
        UIApplication.shared.open(URL(string: "http://evict.nl")!, options: [:], completionHandler: { completed in })
    }.underline
    .append(" for testing links. ").black
    .append("Next test").underline.makeInteract { _ in
        print("NEXT")
    }
    .all.font(UIFont(name: "SourceSansPro-Regular", size: 16))
    .setLinkColor(UIColor.purple) 

animated

Some more attributes and now using + instead of .append:

textView1.attributer =
    "2. red, ".red.underline.underline(0x00ff00)
    + "green, ".green.fontName("Helvetica").size(30)
    + "cyan, ".cyan.size(22)
    + "orange, ".orange.kern(10)
    + "blue, ".blue.strikethrough(3).baselineOffset(8)
    + "black.".shadow(color: UIColor.gray, offset: CGSize(width: 2, height: 3), blurRadius: 3.0)

animated

A match and matchAll sample:

textView1.attributer = "It is this or it is that where the word is is selected".size(20)
    .match("is").underline.underline(UIColor.red)
    .matchAll("is").strikethrough(4)

animated

A hashtags and mentions sample:

textView1.attributer = "@test: What #hashtags do we have in @evermeer #AtributedTextView library"
    .matchHashtags.underline
    .matchMentions
    .makeInteract { link in
        UIApplication.shared.open(URL(string: "https://twitter.com\(link.replacingOccurrences(of: "@", with: ""))")!, options: [:], completionHandler: { completed in })
    }

animated

A html sample:

textView1.attributer = "My name is: <b>Edwin</b><br/>With a bulet list<br/><ul><li>item 1</li><li>item 2</li></ul>".html

animated

Some other text formating samples:

textView1.attributer =  (
    "test stroke".strokeWidth(2).strokeColor(UIColor.red)
    + "test stroke 2\n".strokeWidth(2).strokeColor(UIColor.blue)
    + "test strikethrough".strikethrough(2).strikethroughColor(UIColor.red)
    + " test strikethrough 2\n".strikethrough(2).strikethroughColor(UIColor.yellow)
    + "letterpress ".letterpress
    + " obliquenes\n".obliqueness(0.4).backgroundColor(UIColor.cyan)
    + "expansion\n".expansion(0.8)
    ).all.size(24)

animated

Paragraph formatting:

textView1.attributer = (
    "The quick brown fox jumps over the lazy dog.\nPack my box with five dozen liquor jugs.\nSeveral fabulous dixieland jazz groups played with quick tempo."
    .paragraphLineHeightMultiple(5)
    .paragraphLineSpacing(6)
    .paragraphMinimumLineHeight(15)
    .paragraphMaximumLineHeight(50)
    .paragraphLineSpacing(10)
    .paragraphLineBreakModeWordWrapping
    .paragraphFirstLineHeadIndent(20)
    .paragraphApplyStyling
    ).all.size(12)

Use the attributedText functionality on a UILabel

You can also use the Attributer for your UILabel. You only can't use the makeInteract function:

let myUILabel = UILabel()
myUILabel.attributedText = ("Just ".red + "some ".green + "text.".orange).attributedText

Extending AttributedTextView

In the demo app you can see how you can extend the AttributedTextView with a custom property / function that will perform multiple actions. Here is a simple sample that will show you how you can create a myTitle property that will set multiple attributes:

extension Attributer {
    open var myTitle: Attributer {
        get {
            return self.fontName("Arial").size(28).color(0xffaa66).kern(5)
        }
    }
}

public extension String {
    var myTitle: Attributer {
        get {
            return attributer.myTitle
        }
    }
}

Decorating the Attributed object

In the demo app there is also a sample that shows you how you could decorate an Attributed object with default styling.

        attributedTextView.attributer = decorate(4) { content in return content
            + "This is our custom title".myTitle
        }

The decorate function can then look something like this:

    func decorate(_ id: Int, _ builder: ((_ content: Attributer) -> Attributer)) -> Attributer {
        var b = "Sample \(id + 1):\n\n".red
        b = builder(b) // Now add the content
        return b
    }

Creating your own custom label

There is also an AttributedLabel class which derives from UILabel which makes it easy to create your own custom control that includes support for interfacebuilder. If you put a lable on a form in interfacebuilder and set it's class to your subclass (AttributedLabelSubclassDemo in the sample below) Then you will see the text formated in interface building according to what you have implemented in the configureAttributedLabel function. Here is a sample where a highlightText property is added so that a text can be constructed where that part is highlighted.

import AttributedTextView
import UIKit

@IBDesignable open class AttributedLabelSubclassDemo: AttributedLabel {

    // Add this field in interfacebuilder and make sure the interface is updated after changes
    @IBInspectable var highlightText: String? {
        didSet { configureAttributedLabel() }
    }

    // Configure our custom styling.
    override open func configureAttributedLabel() {
        self.numberOfLines = 0
        if let highlightText = self.highlightText {
            self.attributedText = self.text?.green.match(highlightText).red.attributedText
        } else {
            self.attributedText = self.text?.green.attributedText
        }
        layoutIfNeeded()
    }
}

In the demo app there is also a lable subclass for an icon list like this: animated

You can find the code here: Icon bulet list code

Creating your own custom textview

You could do the same as a label with the AttributedTextView (see previous paragraph). In the sample below 2 properties are entered into interfacebuilder the linkText is the part of the text what will be clickable and linkUrl will be the webpage that will be opened.

import AttributedTextView
import UIKit

@IBDesignable class AttributedTextViewSubclassDemo: AttributedTextView {

    // Add this field in interfacebuilder and make sure the interface is updated after changes
    @IBInspectable var linkText: String? {
        didSet { configureAttributedTextView() }
    }

    // Add this field in interfacebuilder and make sure the interface is updated after changes
    @IBInspectable var linkUrl: String? {
        didSet { configureAttributedTextView() }
    }

    // Configure our custom styling.
    override func configureAttributedTextView() {
        if let text = self.text, let linkText = self.linkText, let linkUrl = self.linkUrl {
            self.attributer = text.green.match(linkText).makeInteract { _ in
                UIApplication.shared.open(URL(string: linkUrl)!, options: [:], completionHandler: { completed in })
            }
        } else {
            self.attributer = (self.text ?? "").green
        }
        layoutIfNeeded()
    }
}

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build AttributedTextView 0.1.0+.

To integrate AttributedTextView into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'AttributedTextView', '~> 0.5.1'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate AttributedTextView into your Xcode project using Carthage, specify it in your Cartfile:

github "evermeer/AttributedTextView" ~> 0.5.1

Swift Package Manager

To use AttributedTextView as a Swift Package Manager package just add the following in your Package.swift file.

import PackageDescription

let package = Package(
name: "HelloAttributedTextView",
dependencies: [
.Package(url: "https://github.com/evermeer/AttributedTextView.git", "0.5.1")
]
)

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate AttributedTextView into your project manually.

Git Submodules

  • Open up Terminal, cd into your top-level project directory, and run the following command "if" your project is not initialized as a git repository:
$ git init
  • Add AttributedTextView as a git submodule by running the following command:
$ git submodule add https://github.com/evermeer/AttributedTextView.git
$ git submodule update --init --recursive
  • Open the new AttributedTextView folder, and drag the AttributedTextView.xcodeproj into the Project Navigator of your application's Xcode project.

It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter.

  • Select the AttributedTextView.xcodeproj in the Project Navigator and verify the deployment target matches that of your application target.
  • Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.
  • In the tab bar at the top of that window, open the "General" panel.
  • Click on the + button under the "Embedded Binaries" section.
  • You will see two different AttributedTextView.xcodeproj folders each with two different versions of the AttributedTextView.framework nested inside a Products folder.

It does not matter which Products folder you choose from.

  • Select the AttributedTextView.framework.

  • And that's it!

The AttributedTextView.framework is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device.

Embeded Binaries

  • Download the latest release from https://github.com/evermeer/AttributedTextView/releases
  • Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.
  • In the tab bar at the top of that window, open the "General" panel.
  • Click on the + button under the "Embedded Binaries" section.
  • Add the downloaded AttributedTextView.framework.
  • And that's it!

License

AttributedTextView is released under the MIT license. See LICENSE for details.

My other libraries:

Also see my other public source iOS libraries:

  • EVReflection - Reflection based (Dictionary, CKRecord, JSON and XML) object mapping with extensions for Alamofire and Moya with RxSwift or ReactiveSwift
  • EVCloudKitDao - Simplified access to Apple's CloudKit
  • EVFaceTracker - Calculate the distance and angle of your device with regards to your face in order to simulate a 3D effect
  • EVURLCache - a NSURLCache subclass for handling all web requests that use NSURLReques
  • AlamofireOauth2 - A swift implementation of OAuth2 using Alamofire
  • EVWordPressAPI - Swift Implementation of the WordPress (Jetpack) API using AlamofireOauth2, AlomofireJsonToObjects and EVReflection (work in progress)
  • PassportScanner - Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.
  • AttributedTextView - Easiest way to create an attributed UITextView with support for multiple links (url, hashtags, mentions).
Comments
  • can't set dotted underline.

    can't set dotted underline.

    Hello there, This is i tried,

    attributedTextView.attributer = decorate(7) { content in return (content + (
                "The quick brown fox jumps over the lazy dog.\nPack my box with five dozen liquor jugs.\nSeveral fabulous dixieland jazz groups played with quick tempo.".brown
                    .match("brown fox").underline.makeInteract { (link) in
                        print("TODO: open terms of user screen")
                    }
                    .match("fabulous dixieland").underline(.patternDot).makeInteract { (link) in
                        print("TODO: open privacy policy")
                    }.all.paragraphAlignRight.paragraphApplyStyling
                ))
            }
    
    fixed? 
    opened by vatsal1992 6
  • Disable selection for textView

    Disable selection for textView

    Is it possible you can help not enabling selection on textView when setting attributer ? In some scenario, text selection is really annoying and undesirable as we just want users be able to click and press (with textSelection enabled, it often pop up with some selected text when user long press)

    opened by 10000TB 4
  • Setting of attributer changes selectable and editable

    Setting of attributer changes selectable and editable

    Assigning a new text to the attributer always changes the current values of the editable and selectable attributes as well. Is it really necessary to change the attributes in the attributer setter?

    One can re-set those attributes after an assignment, but I would prefer not to do this all the time.

    fixed? 
    opened by ankraft 4
  • "/r" break matchLinks()

    I get user agreement from server and show it to user in UITextView with highlighted links. Last link is being highlighted incorrectly. After some research I discovered that problem cause "\r" symbol in text. There are small code snippets that illustrate issue:

    1

    let rules = "http://serverurl.com/api.html"
    textView.attributer = rules
            .matchLinks.makeInteract({ link in
                print("\(link)")
            })
    

    iphone 7 e2 80 93 ios 10 3 2814e8301 29 2017-07-25 13-21-07 Everything is correct

    2

    let rules = "http://serverurl.com/api.html\r\nhttp://serverurl.com/api2.html"
    textView.attributer = rules
            .matchLinks.makeInteract({ link in
                print("\(link)")
            })
    

    iphone 7 e2 80 93 ios 10 3 2814e8301 29 2017-07-25 13-22-18 Last character is not highlighted

    3

    let rules = "http://serverurl.com/api.html\r\nhttp://serverurl.com/api2.html\r\nhttp://serverurl.com/api3.html"
    textView.attributer = rules
            .matchLinks.makeInteract({ link in
                print("\(link)")
            })
    

    iphone 7 e2 80 93 ios 10 3 2814e8301 29 2017-07-25 13-22-55 Last 2 characters are not highlighted

    opened by ziryanov 4
  • paragraphAlignRight or paragraphAlignCenter is not working

    paragraphAlignRight or paragraphAlignCenter is not working

    paragraphAlignRight is not working. Below I posted how I am using it.

            textView.attributer = "by_clicking_tou_pp".white
                .match(.terms_of_use).underline.makeInteract({ (link) in
                print("TODO: open terms of user screen")
            })
                .match(.privacy_policy).underline.makeInteract({ (link) in
                print("TODO: open privacy policy")
            }).paragraphAlignRight
    
    opened by ramunasjurgilas 4
  • WARN  | xcodebuild

    WARN | xcodebuild

    Hi, evermeer I am going to develop a JSON formatting library based on this library.

    s.dependency 'AttributedTextView', '~> 0.9'
    

    When I tries to push the podspec file, a Xcode warning message was shown.

    ➜  MGFormatter git:(master) pod trunk push MGFormatter.podspec                                
    Updating spec repo `master`
    
    CocoaPods 1.5.3 is available.
    To update use: `sudo gem install cocoapods`
    
    For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.5.3
    
    Validating podspec
     -> MGFormatter (0.1)
        - WARN  | xcodebuild:  AttributedTextView/Sources/Attributer.swift:531:62: warning: 'substring(with:)' is deprecated: Please use String slicing subscript.
    
    [!] The spec did not pass validation, due to 1 warning (but you can use `--allow-warnings` to ignore it).
    

    The same thing happens in the travis CI, line 640 https://travis-ci.org/lm2343635/MGFormatter/builds/393497738?utm_source=github_status&utm_medium=notification

    fixed? 
    opened by lm2343635 3
  • UITextViewDelegate should return values based on isEditable

    UITextViewDelegate should return values based on isEditable

    If the following UITextViewDelegate methods are not implemented they always return false. I think it would be much better if the return value was based on the TextView's isEditable property.

    textViewShouldBeginEditing(_ textView: UITextView) textViewShouldEndEditing(_ textView: UITextView) textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String)

    opened by maksg 2
  • Error when compiling in xcode 10 swift 4.2

    Error when compiling in xcode 10 swift 4.2

    i received this error when using this dependency on branch XCode10 does anyone have a idea how to solve this? would really appreciate it thanks "The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions""

    screen shot 2018-12-06 at 9 22 09 am
    opened by ljbdelacruz 2
  • More fonts in one AttributedTextView

    More fonts in one AttributedTextView

    Hello,

    I need to have more fonts in one AttributedTextView instance. For example:

    User1 followed ("myFontRegular") User2("myFontBold")

    I tried it to implement in many ways, but I found out that only first font is applied to whole text in AttributedTextView. Here is sample of my implementation:

            statusLabel.attributer =
                name.color(.charcoal).font(.graphik(15))
                .append(" followed ").color(.aluminium).font(.graphik(15))
                .append("\(post.follow_display_name ?? "some user")").makeInteract({ _ in
                    if let followId = post.follow_user_id {
                        self.callback?(.user, followId)
                    }
                })
                .setLinkColor(.darkGreen).font(.graphikBold(15))
    

    But result of this implementation is that whole text is in graphik font, not graphik and graphikBold. I tried to change sizes, and these are applied correctly, but different fons not. Is it somehow possible to achieve what I need by using AttributedTextView?

    Thanks,

    Vojta

    opened by vojtaBelovsky 2
  • systemFont with weight doesn't work

    systemFont with weight doesn't work

    I'm trying applying light font like this:

    let regular = UIFont.systemFont(ofSize: 15)
    let light = UIFont.systemFont(ofSize: 15, weight: UIFontWeightLight)
    label.attributedText = "regular ".font(regular)
                                             .append("light").font(light)
                                             .attributedText
    

    But both words are with the same font (regular).

    opened by ziryanov 2
  • How to match https

    How to match https

    Hi, basic question. If the api returns a string"Post your questions on our Pigeonhole link https://pigeonhole.at/learnhowtocode".. how can I match the entire https url?

    opened by vinamelody 1
  • <a href> </a> Anchor tags are not clickable (only detected as html link)

    Anchor tags are not clickable (only detected as html link)

    In The below example Anchor tags are detected as html link but not clickable <a href='https://www.someurlink?username=12345'>Vivek Gupta

    I used like below

    self.descriptionLabel.attributer = text.html.matchHashtags.makeInteract({ [weak self] (hashTag) in
                guard let slf = self else {return}
                slf.delegate?.tappedLink(string: hashTag)
                print(hashTag)
            }).matchMentions.makeInteract({ [weak self] (mentionsText) in
                guard let slf = self else {return}
                slf.delegate?.tappedLink(string: mentionsText)
                print(mentionsText)
            }).matchLinks.font(BrandManager.currentStyle.typography.boldFont(pts: 12)).makeInteract({ [weak self] (linkText) in
                guard let slf = self else {return}
                slf.delegate?.tappedLink(string: linkText)
                print(linkText)
            }).font(UIFont.regularFont(pts: 12)).setLinkColor(.red)
    

    the 'text' variable has html string.

    Has anyone got this issue. Please help.

    opened by vgupt122 2
  • Laggy scrolling with AttributedTextView inside tableViewCell

    Laggy scrolling with AttributedTextView inside tableViewCell

    Hi there,

    Seems like AttributedTextView.attributer.setter takes too much time while blocking main thread.

    screen shot 2018-03-31 at 12 49 29 pm

    Is there anything we can do to make it faster? Seems like right now, it requires main thread, so I can't simply put in a background thread :(

            let userName = "daurenmuratov"
            let comment = "\(userName):"
                .font(UIFont.systemFont(ofSize: 14, weight: .bold))
                .match(userName)
                .color(.black)
                .makeInteract({ (userLogin) in
                    print("Login pressed: \(userLogin)")
                })
                + (" \(text)")
                    .font(UIFont.systemFont(ofSize: 14))
                    .color(.gray)
                    .matchHashtags.color(.red)
                    .makeInteract({ (hashtag) in
                        print("Hashtag pressed: \(hashtag)")
                    })
                    .matchMentions
                    .makeInteract({ (mention) in
                        print("Mention pressed: \(mention)")
                    })
                    .matchLinks
                    .makeInteract({ (link) in
                        print("Link pressed \(link)")
                    })
                    .setLinkColor(.blue)
                textView.attributer = comment
    
    enhancement 
    opened by daurenm 3
Owner
Edwin Vermeer
Edwin Vermeer
An easier way to compose attributed strings

TextAttributes makes it easy to compose attributed strings. let attrs = TextAttributes() .font(name: "HelveticaNeue", size: 16) .foregroundCol

Damien 2.2k Dec 31, 2022
An easy way to add mentions to uitextview like Facebook and Instagram

OEMentions An easy way to add mentions to uitextview like Facebook and Instagram. It also include a tableview to show the users list to choose from. T

Omar Alessa 48 Oct 23, 2022
More powerful label, attributed string builder and text parser.

DDText More powerful label, attributed string builder and text parser. DDLabel More powerful label than UILabel, using TextKit. It supports features b

Daniel 16 Nov 8, 2022
µframework for Attributed strings.

Attributed µframework for Attributed strings. What is Attributed? Attributed aims to be a drop in replacement to the current version of the NSAttribut

Nicholas Maccharoli 754 Jan 9, 2023
BonMot is a Swift attributed string library

BonMot (pronounced Bon Mo, French for good word) is a Swift attributed string library. It abstracts away the complexities of the iOS, macOS, tvOS, and

Rightpoint 3.4k Dec 30, 2022
👩‍🎨 Elegant Attributed String composition in Swift sauce

Elegant Attributed String composition in Swift sauce SwiftRichString is a lightweight library which allows to create and manipulate attributed strings

Daniele Margutti 2.9k Jan 5, 2023
A Swifty API for attributed strings

SwiftyAttributes A Swifty API for attributed strings. With SwiftyAttributes, you can create attributed strings like so: let fancyString = "Hello World

Eddie Kaiger 1.5k Jan 5, 2023
Texstyle allows you to format iOS attributed strings easily.

Texstyle allows you to format attributed strings easily. Features Applying attributes with strong typing and autocompletion Cache for attributes Subst

Rosberry 79 Sep 9, 2022
A simple library for building attributed strings, for a more civilized age.

Veneer A simple library for building attributed strings, for a more civilized age. Veneer was created to make creating attributed strings easier to re

Wess Cope 26 Dec 27, 2022
A quick helper for setting attributed texts to UILabel.

UILabelAttributedTextHelper A quick helper for setting attributed texts to UILabel. Sample usage: label.setAttributedText( leadingText: "H

Glenn Posadas 5 Aug 24, 2022
Easy Attributed String Creator

The main idea of this project is to have an online tool to be able to visually add formatting to a text and get back a swift and/or objective-c code t

Andres Canal 283 Dec 27, 2022
AttributedText is a Swift µpackage that provides NSAttributedString rendering in SwiftUI by wrapping either an NSTextView or a UITextView depending on the platform.

AttributedText AttributedText is a Swift µpackage that provides NSAttributedString rendering in SwiftUI by wrapping either an NSTextView or a UITextVi

null 1 Jul 18, 2022
Easily show RichText(html) in SwiftUI

RichText LightMode DarkMode Code import SwiftUI

null 82 Jan 7, 2023
An Objective-C framework for converting Markdown to HTML.

MMMarkdown MMMarkdown is an Objective-C framework for converting Markdown to HTML. It is compatible with OS X 10.7+, iOS 8.0+, tvOS, and watchOS. Unli

Matt Diephouse 1.2k Dec 14, 2022
Methods to allow using HTML code with CoreText

DTCoreText This project aims to duplicate the methods present on Mac OSX which allow creation of NSAttributedString from HTML code on iOS. The project

Cocoanetics 6.2k Jan 6, 2023
`resultBuilder` support for `swift-markdown`

SwiftMarkdownBuilder resultBuilder support for swift-markdown. The default way to build Markdown in swift-markdown is to use varargs initializers, e.g

DocZ 9 May 31, 2022
A simple library that provides standard Unicode emoji support across all platforms

Twitter Emoji (Twemoji) A simple library that provides standard Unicode emoji support across all platforms. Twemoji v13.1 adheres to the Unicode 13.0

Twitter 15k Jan 8, 2023
A validator for postal codes with support for 200+ regions

PostalCodeValidator A validator for postal codes with support for 200+ regions. import Foundation import PostalCodeValidator if let validator = Posta

FormatterKit 211 Jun 17, 2022
PySwiftyRegex - Easily deal with Regex in Swift in a Pythonic way

PySwiftyRegex Easily deal with Regex in Swift in a Pythonic way.

Ce Zheng 232 Oct 12, 2022