Coder Social home page Coder Social logo

akhtarraza / accessibilitykit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from keleftheriou/accessibilitykit

0.0 0.0 0.0 3.95 MB

Add-ons for more visually accessible iOS apps.

Home Page: https://www.flicktype.com

License: MIT License

Objective-C 48.41% Swift 50.40% Ruby 1.03% C 0.17%

accessibilitykit's Introduction

AccessibilityKit

Logo

Build Status Carthage License: MIT

AccessibilityKit is a collection of APIs to help you develop more visually accessible apps, for the times when iOS doesn't have you covered.

AKTextView

AKTextView is a text view that automatically and efficiently draws text using the largest possible font size, spanning multiple lines as needed to fill the view's bounds. It's great for when you need some text or label to be as visually accessible as possible, or to just generally make it more appealing. It's efficient enough that it can perform real-time resizing, if you ever need to do that.

As a bonus, you can also use all attributes of NSAttributedString, as well as a built-in vertical alignment option. And emoji, of course.

Examples

Animated example of AKTextView, portrait Animated example of AKTextView, landscape Animated example of AKTextView

Why?

  • UILabel's adjustsFontSizeToFitWidth doesn't support multiple lines.
  • UITextView and NSTextView don't have adjustsFontSizeToFitWidth.
  • Other solutions might render text incorrectly.
  • Other solutions don't support attributed strings.
  • Other solutions are slow.
  • ๐Ÿ˜ ๐Ÿ˜ค๐Ÿ˜ฉ

Usage

You can use AKTextView as a drop-in replacement for UITextView and NSTextView (iOS and macOS). There's also AKLabel (replacement for UILabel), as well as AKView, an even more performant and bare-bones subclass of UIView.

iOS:

let view = AKTextView()

// Use a simple or fancy NSAttributedString.
view.attributedText = .init(string: "Some text here", attributes: [
  .font: UIFont.systemFont(ofSize: 12), // Font size will be ignored
  .foregroundColor: UIColor.black,
])

// Add to the view hierarchy...

macOS:

let view = AKTextView()
view.string = "Some text here"

// Add to the view hierarchy...

Text-to-speech additions coming soon

AccessibilityKit is used in the award-winning, low-vision keyboard FlickType.

accessibilitykit's People

Contributors

keleftheriou avatar

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.