A standalone, flexible API that provides a full-featured rich text editor for iOS applications.

Overview

Twitter Text Editor

A standalone, flexible API that provides a full featured rich text editor for iOS applications.

Twitter Text Editor

This provides a robust text attribute update logic, extended text editing events, and safe text input event handling in easy delegate based APIs. TwitterTextEditor supports recent versions of iOS.

Requirements

Twitter Text Editor requires macOS Catalina 10.15 or later and Xcode 11.0 and later for the development. At this moment, Twitter Text Editor supports iOS 11.0 and later also macCatalyst 13.0 and later.

Usage

Using Twitter Text Editor is straightforward if you're familiar with iOS development. See also Examples for actual usage, that contains Swift and Objective-C source code to show how to use Twitter Text Editor. See Examples/README.md as well.

Add Twitter Text Editor framework to your project

Add the following lines to your Package.swift or use Xcode “Add Package Dependency…” menu.

// In your `Package.swift`

dependencies: [
    .package(name: "TwitterTextEditor", url: "https://github.com/twitter/TwitterTextEditor", ...),
    ...
],
targets: [
    .target(
        name: ...,
        dependencies: [
            .product(name: "TwitterTextEditor", package: "TwitterTextEditor"),
            ...
        ]
    ),
    ...
]

Use with other dependency management tools

In case your project is not using Swift Package Manager, you can use Twitter Text Editor with other dependency management tools.

CocoaPods

To use Twitter Text Editor with CocoaPods, add next TwitterTextEditor.podspec in your project.

Pod::Spec.new do |spec|
  spec.name = "TwitterTextEditor"
  spec.version = "1.0.0" # Find the the version from the Git tags
  spec.authors = ""
  spec.summary = "TwitterTextEditor"
  spec.homepage = "https://github.com/twitter/TwitterTextEditor"
  spec.platform = :ios, "11.0"
  spec.source = {
    :git => "https://github.com/twitter/TwitterTextEditor.git", :tag => "#{spec.version}"
  }
  spec.source_files  = "Sources/TwitterTextEditor/*.swift"
end

Then, update Podfile in your project.

pod 'TwitterTextEditor', :podspec => 'path/to/TwitterTextEditor.podspec'

Carthage

To use Twitter Text Editor with Carthage, update Cartfile in your project.

github "twitter/TwitterTextEditor"

Then, run following commands. This will create Carthage/Build/iOS/TwitterTextEditor.framework.

$ carthage update
$ (cd Carthage/Checkouts/TwitterTextEditor && swift package generate-xcodeproj)
$ carthage build --platform iOS

Follow the instructions to add the framework and Run Script phase to your project.

Documentation

See documentation.

Use Twitter Text Editor in your project

Twitter Text Editor provides a single view, TextEditorView, that has a similar API to UITextView and provides the most of features as a property or a delegate callback.

Add it to your project as like the other views, and setup using each property or implement delegate callbacks.

// In your view controller

import TwitterTextEditor

final class MyViewController: UIViewController {
    // ...

    override func viewDidLoad() {
        super.viewDidLoad()
        // ...
        let textEditorView = TextEditorView()
        textEditorView.text = "Meow"
        textEditorView.textAttributesDelegate = self
        // ...
    }

    // ...
}

extension MyViewController: TextEditorViewTextAttributesDelegate {
    func textEditorView(_ textEditorView: TextEditorView,
                        updateAttributedString attributedString: NSAttributedString,
                        completion: @escaping (NSAttributedString?) -> Void)
    {
        // ...
    }
}

Contributing

See CONTRIBUTING.md for the details.

Security issues

Please report sensitive security issues via Twitter’s bug-bounty program rather than GitHub.

Comments
  • Expose inputView and reloadInputViews method

    Expose inputView and reloadInputViews method

    Problems

    Due to the internal UITextView marked private. We can not access the inputView on it.

    Solution

    Make an interface to expose the API. So that the client could use the inputView to customize input.

    Testing Delear an empty UIInputView and call the reloadInputViews(). It works.

            let textEditorView = TextEditorView()
            let inputView = UIInputView(frame: CGRect(x: 0, y: 0, width: 0, height: 300), inputViewStyle: .keyboard)
            inputView.allowsSelfSizing = true
            textEditorView.inputView = inputView
            textEditorView.reloadInputViews()
    
    opened by MainasuK 5
  • Bugfix: Setting TextEditorView.scrollView.delegate may broken some behaviour

    Bugfix: Setting TextEditorView.scrollView.delegate may broken some behaviour

    Problems

    We have public api scrollView in TextEditorView, and it is actually UITextView subclass. If someone set scrollView.delegate for observing scroll event, the TextEditorView will forgot UITextViewDelegate things.

    Solution

    Implement DelegateForwarder for controlling delegate method invoke target. DelegateForwarder forward UIScrollViewDelegate things to user side delegate, UITextViewDelegate things to internal implementation.

    Testing

    No plan 🙃

    Discussion We can implement same thing using Obj-C also, and I think it would be better performance around method dispatch.

    opened by tarunon 5
  • Reflect the default values in Settings.bundle in UserDefaults.

    Reflect the default values in Settings.bundle in UserDefaults.

    Problems

    In the current implementation, the value retrieved from UserDefaults is not True even if it appears True in Settings.app.

    Solution

    In this pull request, we give the Default Value of Settings.bundle as the Default Value of UserDefaults.

    Testing

    I tested this on my actual device iPad Pro.

    opened by griffin-stewie 5
  • UIScrollViewDelegates not called as expected

    UIScrollViewDelegates not called as expected

    Only certain start/end delegate methods of UIScrollViewDelegate are called.

    Digging into the code it seems like these should be getting triggered. It's possible I'm not setting this up right but it's confusing as I'm definitely getting a couple of the delegates firing (see details below). I've set a breakpoint on line 88 of TextViewDelegateForwarder and only the below selectors are fired.

    Steps to reproduce the behavior

    1. Conform a view controller that has TextEditorView as a subView to UIScrollViewDelegate.
    2. Implement UIScrollViewDelegate methods scrollViewWillBeginDragging, scrollViewDidEndDecelerating and scrollViewDidScroll.
    3. Assign TextEditorView's textView delegate to the conforming View Controller e.g. textEditorView.scrollView.delegate = self
    4. Test app and note that scrollViewWillBeginDragging and scrollViewDidEndDecelerating fire, but scrollViewDidScroll does not.

    Expected behavior

    When assigning the scroll view delegate, all UIScrollViewDelegate methods are called.

    Actual behavior

    Only scrollViewWillBeginDragging and scrollViewDidEndDecelerating fire.

    Environment

    • iOS 14.5, 14.6
    • iPhone 11 Pro simulator (but also on others)
    • Xcode v12.5
    • TwitterTextEditor v 1.1.0
    opened by wcrtr 4
  • Small README improvements and typo fixes

    Small README improvements and typo fixes

    It wouldn't be a new OS framework without README fixes for its first PR! 😄 I'd also like to say thank you for open sourcing this! UITextView is definitely tricky and I'm excited to try out some of the features here.

    Problems

    This PR seeks to improve the README phrasing and fixes some small phrasing typos. I hope this is helpful and not too nitpicky :)

    I removed some uses of the word "simple," as it doesn't provide any value and "simple" is always relative; using this framework would not be simple to someone unfamiliar with the delegate pattern for example.

    Solution

    I've updated the README with minor improvements.

    Testing

    No testing is necessary beyond a PR review.

    opened by kylebshr 3
  • Bump addressable from 2.7.0 to 2.8.0

    Bump addressable from 2.7.0 to 2.8.0

    Bumps addressable from 2.7.0 to 2.8.0.

    Changelog

    Sourced from addressable's changelog.

    Addressable 2.8.0

    • fixes ReDoS vulnerability in Addressable::Template#match
    • no longer replaces + with spaces in queries for non-http(s) schemes
    • fixed encoding ipv6 literals
    • the :compacted flag for normalized_query now dedupes parameters
    • fix broken escape_component alias
    • dropping support for Ruby 2.0 and 2.1
    • adding Ruby 3.0 compatibility for development tasks
    • drop support for rack-mount and remove Addressable::Template#generate
    • performance improvements
    • switch CI/CD to GitHub Actions
    Commits
    • 6469a23 Updating gemspec again
    • 2433638 Merge branch 'main' of github.com:sporkmonger/addressable into main
    • e9c76b8 Merge pull request #378 from ashmaroli/flat-map
    • 56c5cf7 Update the gemspec
    • c1fed1c Require a non-vulnerable rake
    • 0d8a312 Adding note about ReDoS vulnerability
    • 89c7613 Merge branch 'template-regexp' into main
    • cf8884f Note about alias fix
    • bb03f71 Merge pull request #371 from charleystran/add_missing_encode_component_doc_entry
    • 6d1d809 Adding note about :compacted normalization
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 2
  • Bump rexml from 3.2.4 to 3.2.5

    Bump rexml from 3.2.4 to 3.2.5

    Bumps rexml from 3.2.4 to 3.2.5.

    Changelog

    Sourced from rexml's changelog.

    3.2.5 - 2021-04-05 {#version-3-2-5}

    Improvements

    • Add more validations to XPath parser.

    • require "rexml/document" by default. [GitHub#36][Patch by Koichi ITO]

    • Don't add #dcloe method to core classes globally. [GitHub#37][Patch by Akira Matsuda]

    • Add more documentations. [Patch by Burdette Lamar]

    • Added REXML::Elements#parent. [GitHub#52][Patch by Burdette Lamar]

    Fixes

    Thanks

    • Koichi ITO

    • Akira Matsuda

    • Burdette Lamar

    • Juho Nurminen

    Commits
    • a622645 Add 3.2.5 entry
    • 3c137eb Fix a parser bug that some data may be ignored before DOCTYPE
    • 9b311e5 Fix a bug that invalid document declaration may be accepted
    • f9d88e4 Fix a bug that invalid document declaration may be generated
    • f7bab89 Fix a bug that invalid element end may be accepted
    • 6a250d2 Fix a bug that invalid element start may be accepted
    • 2fe62e2 Fix a bug that invalid notation declaration may be accepted
    • a659c63 Fix a bug that invalid notation declaration may be generated
    • 790dd11 Use ruby/setup-ruby (#66)
    • eda1b20 Clean up and enhance high-level RDoc (#65)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 2
  • Change Root.plist in Settings.bundle to have default value NO

    Change Root.plist in Settings.bundle to have default value NO

    Problems

    In the current implementation, the value retrieved from UserDefaults is not True even if it appears True in Settings.app.

    Solution

    I suggested this #3 . We discussed and decided that it would be simpler to set the default value to NO, so I changed the default value in Settings.bundle to NO.

    Testing

    I tested this on my actual device iPad Pro.

    opened by griffin-stewie 2
  • Added newline between method declaration and comments

    Added newline between method declaration and comments

    added newline between end of method declaration and start of comments to keep the rule.

    Problems Most of codes has new line after method declearation. But some codes has no new line between method and comments.

    Solution added newline between end of method declaration and start of comments.

    Testing run make correct

    opened by kyungkoo 2
  • Bump redcarpet from 3.5.0 to 3.5.1

    Bump redcarpet from 3.5.0 to 3.5.1

    Bumps redcarpet from 3.5.0 to 3.5.1.

    Release notes

    Sourced from redcarpet's releases.

    Redcarpet v3.5.1

    Fix a security vulnerability using :quote in combination with the :escape_html option.

    Reported by Johan Smits.

    Changelog

    Sourced from redcarpet's changelog.

    Version 3.5.1 (Security)

    • Fix a security vulnerability using :quote in combination with the :escape_html option.

      Reported by Johan Smits.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • One line summary of the issue

    One line summary of the issue

    Describe the details of the issue.

    Steps to reproduce the behavior

    • List all relevant steps to reproduce the observed behavior.

    Expected behavior

    As concisely as possible, describe the expected behavior.

    Actual behavior

    As concisely as possible, describe the observed behavior.

    Environment

    • Operating system name, version, and build number, such as “iOS 14.0.1 (18A393)”.
    • Hardware name and revision, such as “iPhone 11 Pro”.
    • Xcode version and build number, such as “12.0 (12A7209)”.
    • Any other dependencies, such as third-party keyboard and its version, if it’s applicable.
    opened by friend99w 0
  • Bump tzinfo from 1.2.9 to 2.0.5

    Bump tzinfo from 1.2.9 to 2.0.5

    Bumps tzinfo from 1.2.9 to 2.0.5.

    Release notes

    Sourced from tzinfo's releases.

    v2.0.5

    • Changed DateTime results to always use the proleptic Gregorian calendar. This affects DateTime results prior to 1582-10-15 and any arithmetic performed on the results that would produce a secondary result prior to 1582-10-15.
    • Added support for eager loading all the time zone and country data by calling either TZInfo::DataSource#eager_load! or TZInfo.eager_load!. Compatible with Ruby On Rails' eager_load_namespaces. #129.
    • Ignore the SECURITY file from Arch Linux's tzdata package. #134.

    TZInfo v2.0.5 on RubyGems.org

    v2.0.4

    • Fixed an incorrect InvalidTimezoneIdentifier exception raised when loading a zoneinfo file that includes rules specifying an additional transition to the final defined offset (for example, Africa/Casablanca in version 2018e of the Time Zone Database). #123.

    TZInfo v2.0.4 on RubyGems.org

    v2.0.3

    • Added support for handling "slim" format zoneinfo files that are produced by default by zic version 2020b and later. The POSIX-style TZ string is now used calculate DST transition times after the final defined transition in the file. #120.
    • Fixed TimeWithOffset#getlocal returning a TimeWithOffset with the timezone_offset still assigned when called with an offset argument on JRuby 9.3.
    • Rubinius is no longer supported.

    TZInfo v2.0.3 on RubyGems.org

    v2.0.2

    • Fixed 'wrong number of arguments' errors when running on JRuby 9.0. #114.
    • Fixed warnings when running on Ruby 2.8. #113.

    TZInfo v2.0.2 on RubyGems.org

    v2.0.1

    • Fixed "SecurityError: Insecure operation - require" exceptions when loading data with recent Ruby releases in safe mode. #100.
    • Fixed warnings when running on Ruby 2.7. #109.
    • Added a TZInfo::Timezone#=~ method that performs a regex match on the time zone identifier. #99.
    • Added a TZInfo::Country#=~ method that performs a regex match on the country code.

    TZInfo v2.0.1 on RubyGems.org

    v2.0.0

    Added

    • to_local and period_for instance methods have been added to TZInfo::Timezone. These are similar to utc_to_local and period_for_utc, but take the UTC offset of the given time into account.
    • abbreviation, dst?, base_utc_offset and observed_utc_offset instance methods have been added to TZInfo::Timezone, returning the abbreviation, whether daylight savings time is in effect and the UTC offset of the time zone at a specified time.
    • A TZInfo::Timestamp class has been added. It can be used with TZInfo::Timezone in place of a Time or DateTime.
    • local_time, local_datetime and local_timestamp instance methods have been added to TZInfo::Timezone. These methods construct local Time, DateTime and TZInfo::Timestamp instances with the correct UTC offset and abbreviation for the time zone.
    • Support for a (yet to be released) version 2 of tzinfo-data has been added, in addition to support for version 1. The new version will remove the (no longer needed) DateTime parameters from transition times, reduce memory consumption and improve the efficiency of loading timezone and country indexes.
    • A TZInfo::VERSION constant has been added, indicating the TZInfo version number.

    Changed

    • The minimum supported Ruby versions are now Ruby MRI 1.9.3, JRuby 1.7 (in 1.9 or later mode) and Rubinius 3.
    • Local times are now returned using the correct UTC offset (instead of using UTC). #49 and #52.
    • Local times are returned as instances of TimeWithOffset, DateTimeWithOffset or TZInfo::TimestampWithOffset. These classes subclass Time, DateTime and TZInfo::Timestamp respectively. They override the default behaviour of the base classes to return information about the observed offset at the indicated time. For example, the zone abbreviation is returned when using the %Z directive with strftime.
    • The transitions_up_to, offsets_up_to and strftime instance methods of TZInfo::Timezone now take the UTC offsets of given times into account (instead of ignoring them as was previously the case).
    • The TZInfo::TimezonePeriod class has been split into two subclasses: TZInfo::OffsetTimezonePeriod and TZInfo::TransitionsTimezonePeriod. TZInfo::OffsetTimezonePeriod is returned for time zones that only have a single offset. TZInfo::TransitionsTimezonePeriod is returned for periods that start or end with a transition.

    ... (truncated)

    Changelog

    Sourced from tzinfo's changelog.

    Version 2.0.5 - 19-Jul-2022

    • Changed DateTime results to always use the proleptic Gregorian calendar. This affects DateTime results prior to 1582-10-15 and any arithmetic performed on the results that would produce a secondary result prior to 1582-10-15.
    • Added support for eager loading all the time zone and country data by calling either TZInfo::DataSource#eager_load! or TZInfo.eager_load!. Compatible with Ruby On Rails' eager_load_namespaces. #129.
    • Ignore the SECURITY file from Arch Linux's tzdata package. #134.

    Version 2.0.4 - 16-Dec-2020

    • Fixed an incorrect InvalidTimezoneIdentifier exception raised when loading a zoneinfo file that includes rules specifying an additional transition to the final defined offset (for example, Africa/Casablanca in version 2018e of the Time Zone Database). #123.

    Version 2.0.3 - 8-Nov-2020

    • Added support for handling "slim" format zoneinfo files that are produced by default by zic version 2020b and later. The POSIX-style TZ string is now used calculate DST transition times after the final defined transition in the file. #120.
    • Fixed TimeWithOffset#getlocal returning a TimeWithOffset with the timezone_offset still assigned when called with an offset argument on JRuby 9.3.
    • Rubinius is no longer supported.

    Version 2.0.2 - 2-Apr-2020

    • Fixed 'wrong number of arguments' errors when running on JRuby 9.0. #114.
    • Fixed warnings when running on Ruby 2.8. #113.

    Version 2.0.1 - 24-Dec-2019

    • Fixed "SecurityError: Insecure operation - require" exceptions when loading data with recent Ruby releases in safe mode. #100.
    • Fixed warnings when running on Ruby 2.7. #109.
    • Added a TZInfo::Timezone#=~ method that performs a regex match on the time zone identifier. #99.
    • Added a TZInfo::Country#=~ method that performs a regex match on the country code.

    Version 2.0.0 - 26-Dec-2018

    ... (truncated)

    Commits
    • d9b289e Preparing v2.0.5.
    • 264c763 Add v0.3.61 and v1.2.10 from the 0.3 and 1.2 branches.
    • ca29f34 Fix relative path loading tests.
    • c4f177c Add a top level eager_load! method for Rails compatibility.
    • 94be919 Support preloading all data from a DataSource.
    • fe7ad26 Clarify that both files and directories are excluded.
    • d2883cf Tidy up of security file ignoring.
    • 6a4766e Merge pull request #133.
    • 5d53b59 Workaround for 'Permission denied - NUL' errors with JRuby on Windows.
    • 83450a1 ignore SECURITY file for Arch tzdata package
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump cocoapods-downloader from 1.4.0 to 1.6.3

    Bump cocoapods-downloader from 1.4.0 to 1.6.3

    Bumps cocoapods-downloader from 1.4.0 to 1.6.3.

    Release notes

    Sourced from cocoapods-downloader's releases.

    1.6.3

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.2

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.1

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.0

    Enhancements
    • None.
    Bug Fixes
    • Adds a check for command injections in the input for hg and git.
      orta #124

    1.5.1

    Enhancements
    • None.
    Bug Fixes
    • Fix "can't modify frozen string" errors when pods are integrated using the branch option
      buju77 #10920

    1.5.0

    ... (truncated)

    Changelog

    Sourced from cocoapods-downloader's changelog.

    1.6.3 (2022-04-01)

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.2 (2022-03-28)

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.1 (2022-03-23)

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.0 (2022-03-22)

    Enhancements
    • None.
    Bug Fixes
    • Adds a check for command injections in the input for hg and git.
      orta #124

    1.5.1 (2021-09-07)

    Enhancements
    • None.

    ... (truncated)

    Commits
    • c03e2ed Release 1.6.3
    • f75bccc Disable Bazaar tests due to macOS 12.3 not including python2
    • 52a0d54 Merge pull request #128 from CocoaPods/validate_before_dl
    • d27c983 Ensure that the git pre-processor doesn't accidentally bail also
    • 3adfe1f [CHANGELOG] Add empty Master section
    • 591167a Release 1.6.2
    • d2564c3 Merge pull request #127 from CocoaPods/validate_before_dl
    • 99fec61 Switches where we check for invalid input, to move it inside the download fun...
    • 96679f2 [CHANGELOG] Add empty Master section
    • 3a7c54b Release 1.6.1
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Access UITextViewDelegate method shouldInteractWithURL

    Access UITextViewDelegate method shouldInteractWithURL

    I'm looking to interact with UITextViewDelegate method func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool. Specifically say there's highlighted text such as a mention or a hashtag as part of the attributed string. If the user taps that text we'd want to route them to a page with the associated information.

    Is this possible? Or am I missing an alternative way to implement this behavior?

    And awesome job with this framework! Love the simplicity and safety of the API's it's been fun to try it out over the last couple weeks : )

    enhancement 
    opened by richard-ash 0
  • How do I add custom images

    How do I add custom images

    I was adding image attachments with NSTextAttachment in my custom textView.(Like below) let textAttachment = NSTextAttachment() textAttachment.bounds = CGRect(x: 0, y: (textView.font!.capHeight - image.size.height).rounded() / 2, width: image.size.width, height: image.size.height) textAttachment.image = image let attrStringWithImage = NSAttributedString(attachment: textAttachment) textView.textStorage.replaceCharacters(in: currentRange, with: attrStringWithImage) Is there a way to add images(don't care if is it an NSTextAttachment or a suffixedAttachment) on the textView with TwitterTextEditor?

    I found I can get hashtags with regex and place an UIImage or UIView after that hashtag. But I can't find a way how to add just UIImage itself like an NSTextAttachment.

    question 
    opened by Topwiz 2
  • What's your take on making this library platform-independent?

    What's your take on making this library platform-independent?

    Hello Twitter folks, What's your take on making this library platform-independent? Specifically, it now relies on UIKit which prevents it from being used on macOS.

    Is supporting macOS on the radar? Both UITextView and NSTextView relies on the same NSTextStorage and NSTextContainer classes so I think this should be possible without a major refactor. Would you accept a contribution that tries to make the library work on macOS?

    Cheers 👋

    question 
    opened by Moriquendi 2
Owner
Twitter
Twitter 💙 #opensource
Twitter
A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view

ZSSRichTextEditor The Editor ZSSRichTextEditor is a beautiful Rich Text WYSIWYG Editor for iOS. It includes all of the standard editor tools one would

Nic Hubbard 3.7k Dec 31, 2022
Powerful text framework for iOS to display and edit rich text.

YYText Powerful text framework for iOS to display and edit rich text. (It's a component of YYKit) Features UILabel and UITextView API compatible High

null 8.8k Jan 4, 2023
RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing.

RichEditorView RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing. Written in Swift 4 Supports iOS 8+ through Cocoapod

Caesar Wirth 1.8k Dec 24, 2022
Fully open source text editor for iOS written in Swift.

Edhita Fully open source text editor for iOS written in Swift. http://edhita.bornneet.com/ What Edhita means? Edhita (Romaji) == エディタ (Katakana) == Ed

Tatsuya Tobioka 1.2k Jan 1, 2023
A lightning fast, native SwiftUI scratchpad/text editor.

Sedit A lightning fast, native SwiftUI scratchpad/text editor. Sedit (Swift Edit, as in the language and as in fast) is a lightning fast basic text ed

null 5 Jan 28, 2022
Rich Markdown editing control for iOS

MarkdownTextView Rich Markdown Editing for iOS MarkdownTextView is an iOS framework for adding rich Markdown editing capabilities. Support for Markdow

Indragie Karunaratne 676 Dec 7, 2022
OysterKit is a framework that provides a native Swift scanning, lexical analysis, and parsing capabilities. In addition it provides a language that can be used to rapidly define the rules used by OysterKit called STLR

OysterKit A Swift Framework for Tokenizing, Parsing, and Interpreting Languages OysterKit enables native Swift scanning, lexical analysis, and parsing

Swift Studies 178 Sep 16, 2022
An iOS app to turn typed text into images of handwritten text in your own handwriting style.

Text-to-Handwritting © 2021 by Daniel Christopher Long An iOS app to turn typed text into images of handwritten text in your own handwriting style. ht

Daniel Long 11 Dec 29, 2022
Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform.

twitter-text This repository is a collection of libraries and conformance tests to standardize parsing of Tweet text. It synchronizes development, tes

Twitter 2.9k Dec 27, 2022
Notepad - A fully themeable iOS markdown editor with live syntax highlighting.

Notepad is just like any other UITextView, but you need to use the convenience initializer in order to use the themes. To create a new theme, copy one of the existing themes and edit the JSON.

Rudd Fawcett 802 Dec 31, 2022
VEditorKit - Lightweight and Powerful Editor Kit built on Texture(AsyncDisplayKit)

VEditorKit provides the most core functionality needed for the editor. Unfortunately, When combined words are entered then UITextView selectedRange will changed and typingAttribute will cleared. So, In combined words case, Users can't continue typing the style they want.

David Ha 471 Dec 27, 2022
A TextView that provides easy to use tagging feature for Mention or Hashtag

Tagging A TextView that provides easy to use tagging feature for Mention or Hashtag. Introduction Tagging is a UIView that encloses a TextView that co

DongHee Kang 110 Jan 3, 2023
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
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
Swift String Validator. Simple lib for ios to validate string and UITextFields text for some criterias

Swift String validator About Library for easy and fastest string validation based on сciterias. Instalation KKStringValidator is available through Coc

Kostya 17 Dec 21, 2019
🌍⏩📄 Convert ISO8859 1-16 Encoded Text to String in Swift. Supports iOS, tvOS, watchOS and macOS.

ISO8859 Convert ISO8859 1-16 Encoded Text to String in Swift. Usage let encoding = ISO8859.part1 let string = String([...], iso8859Encoding: encoding)

Devran Cosmo Uenal 18 Jan 2, 2023
Like a SwiftUI ViewBuilder, but for Text

TextBuilder Introduction Text composition in SwiftUI can often be cumbersome, especially when there's logic affecting its format and content. TextBuil

David Roman 180 Dec 26, 2022
Get any text on your screen into your clipboard.

macOCR macOCR is a command line app that enables you to turn any text on your screen into text on your clipboard. When you envoke the ocr command, a "

Marcus S 1.9k Dec 29, 2022
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.

Atributika is an easy and painless way to build NSAttributedString. It is able to detect HTML-like tags, links, phone numbers, hashtags, any regex or

Pavel Sharanda 1.1k Jan 8, 2023