Swiftpack.co - tid-kijyun/CatalystAdditions as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by tid-kijyun.
tid-kijyun/CatalystAdditions 0.0.1
CatalystAdditions implements missing features in Mac Catalyst.
⭐️ 8
🕓 3 years ago
macOS
.package(url: "https://github.com/tid-kijyun/CatalystAdditions.git", from: "0.0.1")

CatalystAdditions

GitHub release Swift Package Manager

CatalystAdditions implements missing features in Mac Catalyst.

:warning: Using this library may be rejected by AppStore reviews. :warning:

Requirements

  • Swift 5.1 or later
  • iOS 13.0 or later
  • macOS 10.15 or later

Installation

We can add to your project using Swift Package Manager.

Usage

All relevant code must be enclosed in a preprocessor, as shown below:

#if targetEnvironment(macCatalyst)
import CatalystAdditions
#endif

#if targetEnvironment(macCatalyst)
// use module APIs
#endif

Put NSSearchField in the NSToolbar

let item = SearchToolbarItem(itemIdentifier: .search) { text in
    // do something
}
let item = SearchToolbarItem(itemIdentifier: .search, textChanged: { (textChanged) in
    // update search results as the user is typing
}) { (textReturned) in
    // update search results only after return/enter key is pressed
}
Screenshot

Screen Shot 2019-11-11 at 10 12 44

Setting focus ring to UITextView

In the current Catalyst, UITextView cannot set the focus ring. By default, the focus ring is displayed.

let textView: UITextView // A properly initialized TextView
textView.focusRingType = .none

GitHub

link
Stars: 8
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

4 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics