PandaText / Docs / iOS and macOS

PandaText for iOS and macOS

A UIKit and AppKit view: UIScrollView on iOS, NSView on macOS.

Get started

Install the package, then load your fonts, create a view and set the text. Package sources come with early access.

iOS and macOS

Requires: iOS 18, macOS 15, Xcode with Swift 6.3.

1 Install

In Xcode: File › Add Package Dependencies, paste the package URL, and add the PandaTextView product to your app target. Or in Package.swift:

dependencies: [
    .package(url: "<package URL from your early-access email>", from: "0.1.0"),
],
targets: [
    .target(name: "App", dependencies: [
        .product(name: "PandaTextView", package: "PandaTextView"),
    ]),
]

Add your font files (.ttf or .otf) to the app target. bundledTTF names them without the extension.

2 Create the view

The view for UIKit and AppKit, as a Swift package.

import PandaTextView

let fonts = try PandaTextFontCollection(fontFamilies: [
    [.bundledTTF("NotoSans-Regular"), .bundledTTF("NotoSans-Bold")],
])
let textView = PandaTextView(frame: .zero, fontCollection: fonts, pixelSize: 17)
textView.string = "Hello PandaText"

API

After setup, every call does the same job on every platform. Open the Editor API for iOS and macOS.