Giter Site home page Giter Site logo

easyattributer's Introduction

EasyAttributer

Version License Platform

Easy Attributer is a library that generates attributed string by matched regexes.

This is how EasyAttributer works:

Features

  • Support custom regex.
  • High performance.
  • Easy to use

Requirements

  • iOS 11.0+
  • Swift 5.0+

Installation

Cocoapod

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website.

You can install Cocoapods with the following command:

$ gem install cocoapods

To integrate EasyAttributer into your Xcode project using CocoaPods, specify it in your Podfile.

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target <'Your target name'> do
    pod 'EasyAttributer'
end

Basic usage

Before anything review project UnitTests and example.

  1. Create instance of EasyAttributer.
  2. Pass your custom regexes to EasyAttributer instance.
  3. Call transform(:_) method.
  4. Finish :)

Documention

EasyAttributer

EasyAttributer is a type that accepts an array of 'ESRegexBehavior' and transforms it into your custom attributed string.

public struct EasyAttributer

transform(:_)

Return the none-mutable attributed string and attributes your regex matches.

  • Parameters:
    • text: text that transformer searches for regex patterns.
    • matchAttribute: A callback that calls on every match. Use this to attribute to your matches.
public func transform(text: String, attribute matchAttribute: @escaping (ESTextResult) -> [NSAttributedString.Key : Any]) throws -> NSAttributedString?

EsRegexBehavior

A regex behavior type. Create your regex by conforming to this protocol.

public protocol ESRegexBehavior

Support

Hey there! I'm fueled by coffee and code โ˜•๏ธ If you're enjoying my work, consider buying me a coffee to keep me motivated and productive. Your caffeine-powered contribution will keep me going and help me to develop even better projects. Thanks for keeping me caffeinated and inspired!

TRC20 USDT address TFZ4XoNo6F2kz6PUgk5SBmWoGULoB67vWV

Author

sadeq, [email protected]

License

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

easyattributer's People

Contributors

sadeghgoo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

easyattributer's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.