Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.
/ Velvet Public archive

Mac framework to bridge AppKit and Core Animation-based UI frameworks

License

Notifications You must be signed in to change notification settings

bitswift/Velvet

Repository files navigation

Velvet is a UI bridging framework for Mac OS X, built to allow AppKit to interoperate with layer-based UIs. In particular, Velvet allows the use of normal Cocoa views and functionality in conjunction with frameworks like TwUI and Chameleon.

Features

  • Defines a modern API for layer-backed views (VELView), and provides some basic view classes, including:
    • VELControl, a control class supporting block-based actions
    • VELImageView, a simple image view with an easy-to-use API for stretchable images
    • VELLabel, a text label supporting formatting and sub-pixel antialiasing
  • Support for creating an AppKit view hierarchy within any Velvet hierarchy, using VELNSView
  • Automatic alignment of Velvet views to integral pixels (with an option to disable it), avoiding blurriness from landing on half-pixels
  • Slo-mo animation mode for debugging (similar to the iOS Simulator)
  • Automatic HiDPI support
  • A view controller class usable with any VELView instance, including VELNSView
  • Event recognizers (similar to UIGestureRecognizer) that work with any bridged view class
  • Improvements to some AppKit view and control classes to make bindings more useful
  • Miscellaneous conveniences for bridging Core Animation and Core Graphics functionality with that of AppKit

Additionally, most of the above features are unit tested, to validate the typical use cases and detect any future breakage.

See also our fork of TwUI, which integrates Velvet and adds view classes to bridge into and out of TwUI.

Dependencies

All dependencies can be retrieved by running git submodule update --init --recursive from the top level of the repository.

  • Xcode projects in the repository are configured using prebuilt xcconfigs
  • The unit tests for Velvet are written using Specta and Expecta
  • Parts of libextobjc are used in Velvet (but are already present in the repository)

License

Velvet is released under a modified version of the 3-clause BSD license. See the LICENSE file for more information.

About

Mac framework to bridge AppKit and Core Animation-based UI frameworks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •