iStumbler Labs CardView.Framework — CardView is a good looking text view for iOS, macOS, and tvOS with convenience methods for formatting text, embedding controls and scaling content.
Are you using CardView in your apps? Would you like to help support the project and get a sponsor credit?
Visit our Patreon Page and patronize us in exchange for great rewards!
Good looking subclasses of NSTextView & UITextView, with support for:
-
Formatter Registry: Register NSFormatter subclasses to format text in a card with a single method call
-
Column Styles: create
NSParagraphStyle
s with tabs for laying out columns in a card with a simpleNSArray<NSNumber*>*
describing the column widths -
Style Stack: maintain a stack of
NSParagraphStyle
s to allow a default style to be overidden while building a card and then restored to the previous state -
Promises: add a promise in the text while building your card, fulfill that promise later to allow generation of text in the background
-
TODO: increaseSize/decreaseSize font actions
A collection of NSFormatter
subclasses for formatting data:
formats Array values into comma separated lists
formats data values into string with byte count: "420 Bytes"
formats UTF data of any encoding into a string
formats arrays of objects with commas between the elements
formats NSURLs as clickable links
formats plist data
formats a plist dictionary as JSON data
formats a plist dictionary as markdown text
formats dates into the users preferred medium date and long time format
formats number vales with units in grey text
formats numeric values into boolean value strings: "Yes" or "No"
formats numbers as byte sizes
formats NSNumbers as a fractional value using the continued fraction method
display a time interval or duration in timecode format
Along with an NSValueTransformer
subclass which wraps an NSValueTransformer
These classes are deprecated in favor of the NSTextAttachment API
An NSCell
for displaying a button in a CardTextView on macOS
TODO: review usage and see if it's needed
- deprecated
- deprecated
An NSCell
for displaying images in a CardTextView on macOS
An NSCell
for displaying a separator line in a CardTextView
- deprecated
Implements CardTextStyle
for NSMutableAttributedString
to allow for building
of styled attributed strings for display in a TextView.
Styles are provided for formatting text:
typedef NS_ENUM(NSUInteger, CardStyle) {
CardPlainStyle,
CardHeaderStyle,
CardSubheaderStyle,
CardCenteredStyle,
CardLabelStyle,
CardGrayStyle,
CardMonospaceStyle
};
- CardView 2.0.0 - 20 April 2025
- Breaking API changes:
CardTextView
is simplifed and tersified+formatted:withAttributes:
is now a class methodCardSeperatorCell
->CardRuleCell
- Remove
CardViewDelegate
inteface
- Adds
CardTextStyle
inteface for stying strings - Adds
NSMutableAttributedString+CardView
- Adds Promises and Style Stack to
CardTextView
- Hex formatter for abritrary data
- Depend on ILFoundation
- Breaking API changes:
- 1.3 — 19 August 2024: Swift Package Manager Support
- 1.2 – 19 May 2017:
- 1.1 — 29 May 2016: Add CardBytesFormatter
- 1.0.1 — 13 May 2016: Add CardListFormatter
- 1.0 — 27 April 2016: Initial Version
========
The MIT License (MIT)
Copyright © 2014-2024 Alf Watt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.