Sugar for Swift


Build Status Carthage compatible

Sugar for Swift -- Ruby Core sweetness and more for Swift.

If you're looking for a complete Ruby Core implementation, see this: RubyNative/SwiftRuby


You can use this project with Carthage and Swift Package Manager.


Sugar supports iOS, OS X, tvOS and watchOS 2(?) by using Carthage. Add following line to your Cartfile:

github "venj/Sugar" ~> 0.1.0

Add both Sugar.framework and CommonCrypto.framework to your project.

Swift Package Manager

Swift Package Manager only supports OS X target and Linux target for now. Add dependency code in your Package.swift:

dependencies: [
    .Package(url: "", versions: Version(0,1,0) ..< Version(1,0,0)),

If you are on Linux, you may also need to install OpenSSL library headers.

sudo apt-get install libssl-dev

Now, in your code:

import Sugar

Note: There are many extension methods missing on Linux platform as they require methods that only available on OS X. As Apple's cross-platform Foundation library expanding, these extension methods would be finally available on Linux.


  1. Install the tool

    gem install jazzy
  2. Generate documentation

  3. Read documentation in docs directory.

See main.swift for an example.

Known Issues

Currently, playgrounds in the sample project is not working.


  • Swift Tools 4.2.0
View More Packages from this Author


  • None
Last updated: Fri Mar 17 2023 21:48:24 GMT-0500 (GMT-05:00)