Extendy
A set of useful string extensions.
Requirements
- iOS 11.0+
- Swift 5+
Installation
CocoaPods
Extendy is available through CocoaPods. To install it, simply add the following line to your Podfile:
Swift Package Manager
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler.
Once you have your Swift package set up, adding Extendy as a dependency is as easy as adding it to the dependencies
value of your Package.swift
.
Usage
String
- Apply masks for the string in specific range. The range compatible with
CountableRange
,ClosedRange
,PartialRangeFrom
,PartialRangeThrough
,PartialRangeUpTo
.
- Convert
String
toDouble
. IfString
is not compatible withDouble
the function will return 0.00.
- You can apply specific format for strings
Supported formats
-
Validate a number of credit card by Luhn algorithm.
-
Validate the string with specific pattern
- Simple date formatter (from one format to another)
- Get query items from
String
that corresponds toURL
type. Works for URLs with cyrillic domain names.
NSMutableAttributedString
- You can append two attributed strings with
+
- Apply attributes for mutable string
- Apply styles for string