All Projects → KyoheiG3 → Attributedlabel

KyoheiG3 / Attributedlabel

Licence: mit
Easy to use, fast, and higher performance than UILabel.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Attributedlabel

Impact
Crash capturing library for Apple platforms
Stars: ✭ 395 (-23.15%)
Mutual labels:  tvos
Stringz
A lightweight and powerful editor for localizing iOS, macOS, tvOS, and watchOS applications.
Stars: ✭ 440 (-14.4%)
Mutual labels:  tvos
Corexlsx
Excel spreadsheet (XLSX) format parser written in pure Swift
Stars: ✭ 481 (-6.42%)
Mutual labels:  tvos
Efqrcode
A better way to operate QR Code in Swift, support iOS, macOS, watchOS and tvOS.
Stars: ✭ 4,121 (+701.75%)
Mutual labels:  tvos
Mtlpp
C++ Metal wrapper
Stars: ✭ 425 (-17.32%)
Mutual labels:  tvos
Ppcounter
iOS与macOS中一款优雅的数字/金额增减动效组件
Stars: ✭ 451 (-12.26%)
Mutual labels:  uilabel
Activelabel.swift
UILabel drop-in replacement supporting Hashtags (#), Mentions (@) and URLs (http://) written in Swift
Stars: ✭ 3,942 (+666.93%)
Mutual labels:  uilabel
Formvalidator Swift
A framework to validate inputs of text fields and text views in a convenient way.
Stars: ✭ 495 (-3.7%)
Mutual labels:  tvos
Swiftuipager
Native Pager in SwiftUI
Stars: ✭ 430 (-16.34%)
Mutual labels:  tvos
Googlereporter
Easily integrate with Google Analytics in your iOS app
Stars: ✭ 479 (-6.81%)
Mutual labels:  tvos
Fiber2d
Cross-platform 2D Game Engine in pure Swift
Stars: ✭ 415 (-19.26%)
Mutual labels:  tvos
Userdefaultsstore
Why not use UserDefaults to store Codable objects 😉
Stars: ✭ 416 (-19.07%)
Mutual labels:  tvos
Telegraph
Secure Web Server for iOS, tvOS and macOS
Stars: ✭ 474 (-7.78%)
Mutual labels:  tvos
Json
Micro framework for easily parsing JSON in Swift with rich error messages in less than 100 lines of code
Stars: ✭ 395 (-23.15%)
Mutual labels:  tvos
Provenance
iOS & tvOS multi-emulator frontend, supporting various Atari, Bandai, NEC, Nintendo, Sega, SNK and Sony console systems… Get Started: https://wiki.provenance-emu.com |
Stars: ✭ 4,732 (+820.62%)
Mutual labels:  tvos
Acknowlist
Acknowledgements screen displaying a list of licenses, for example from CocoaPods dependencies.
Stars: ✭ 392 (-23.74%)
Mutual labels:  tvos
Nudein
An easy-to-use attributed text view for iOS Apps,use like masonry
Stars: ✭ 450 (-12.45%)
Mutual labels:  uilabel
Autoscrolllabel
Provides marquee like UILabel scrolling, think Music.app track title scrolling. For Obj-C & Swift.
Stars: ✭ 499 (-2.92%)
Mutual labels:  uilabel
Swiftyutils
All the reusable code that we need in each project
Stars: ✭ 490 (-4.67%)
Mutual labels:  tvos
Gridstack
A flexible grid layout view for SwiftUI
Stars: ✭ 474 (-7.78%)
Mutual labels:  tvos

AttributedLabel

Build Status Carthage compatible Version License Platform

Graph

Higher performance than UILabel.

Appetize's Demo

Label

Overview

This is a better performance than UILabel and can be used like a standard UI component. Also, Easier to use than UILabel.

Since UIView is inherited instead of UILabel, there is little wasteful processing. It uses the function of TextKit to draw characters.

However, please note that content layout is not done automatically. If want to automatically fix the height of the content, set usesIntrinsicContentSize to true.

Customization is easy.

Customize

Left tab is customizable label. The center tab AttributedLabel So fast. Right tab is UILabel So slow. Fast more than 10 times from 5 times.

  • use the UIlabel

UILabel

  • use the AttributedLabel

AttributedLabel !

Requirements

  • Swift 5.0
  • iOS 7.0 or later
  • tvOS 9.0 or later

How to Install AttributedLabel

iOS 8+, tvOS

CocoaPods

Add the following to your Podfile:

pod "AttributedLabel"

Carthage

Add the following to your Cartfile:

github "KyoheiG3/AttributedLabel"

iOS 7

Just add everything in the AttributedLabel.swift file to your project.

Usage

Variable

var numberOfLines: Int
  • Same as numberOfLines of UILabel.
  • Default is 0.
var contentAlignment: AttributedLabel.ContentAlignment
  • Alignment of content.
  • Default is left.
@IBInspectable var padding: CGFloat
  • lineFragmentPadding of NSTextContainer.
  • default is 0.
var font: UIFont
  • Text font.
  • Default is system font 17 plain.
var lineBreakMode: NSLineBreakMode
  • Same as lineBreakMode of UILabel.
  • Default is ByTruncatingTail.
@IBInspectable var textColor: UIColor?
  • Default is nil (text draws black).
var paragraphStyle: NSParagraphStyle?
  • Default is nil.
var shadow: NSShadow?
  • Default is nil.
var attributedText: NSAttributedString?
  • Default is nil.
@IBInspectable var text: String?
  • Default is nil.
var usesIntrinsicContentSize: Bool
  • If need to use intrinsicContentSize set true.
  • Should call invalidateIntrinsicContentSize when intrinsicContentSize is cached. When text was changed for example.
  • Default is false.
var preferredMaxLayoutWidth: CGFloat
  • Support for constraint-based layout (auto layout)
  • If nonzero, this is used when determining intrinsicContentSize for multiline labels

Function

override func sizeThatFits(size: CGSize) -> CGSize
  • Same as sizeThatFits of UILabel.
override func sizeToFit()
  • Fit like UILabel.

Author

Kyohei Ito

Follow me 🎉

LICENSE

Under the MIT license. See LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].