Latest 2.1.0
Homepage https://github.com/ACENative/ACEViewSwift
License MIT
Platforms osx 10.10
Frameworks WebKit
Authors

Use the wonderful ACE editor in your Swift Cocoa applications.

Build Status

ACEView example

For great justice.

Documentation

ACEViewSwift’s documentation is done via Jazzy and can be found here

Installation & Usage

CocoaPods

pod "ACEViewSwift"

Manually

  1. Clone the repo
  2. Run git submodule update --init --recursive (for the dependencies)
  3. Build the framework target
  4. Add it into your Swift project

then just import ACEViewSwift into your files in order to use it

ACEView XIB

Make sure you’ve got an IBOutlet in your view controller, and bind that bad girl:

ACEView XIB Binding

Now, you could do something like this:

import Cocoa
import ACEViewSwift

class ViewController: NSViewController {

  @IBOutlet weak var aceView: ACEView!

  override func viewDidLoad() {
      super.viewDidLoad()

      // Some text content
      let html = "..."

      // onReady() is a convenience closure for configuring
      // the ACEView right after it has been finished loading

      aceView.onReady = { [unowned self] in
          self.aceView.string = html
          self.aceView.mode = .HTML
          self.aceView.theme = .Xcode
          self.aceView.keyboardHandler = .Ace
          self.aceView.showPrintMargin = true
          self.aceView.showInvisibles = false
          self.aceView.basicAutoCompletion = true
          self.aceView.liveAutocompletion = true
          self.aceView.snippets = true
          self.aceView.emmet = true
          self.aceView.focus()
      }
  }

}

Contributions

All are welcome, all are read.

Many thanks to Michael Robinson and all the people that developed the original ObjC framework !

Latest podspec

{
    "name": "ACEViewSwift",
    "version": "2.1.0",
    "summary": "Use the wonderful ACE editor in your Swift Cocoa applications",
    "description": "The ACEView framework aims to allow you to use the ACE source code editor in your Cocoa applications, as if it were a native control.",
    "homepage": "https://github.com/ACENative/ACEViewSwift",
    "screenshots": "https://raw.github.com/ACENative/ACEViewSwift/master/Screenshots/Demo%20window.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Vasilis Akoinoglou": "[email protected]"
    },
    "social_media_url": "http://twitter.com/alladinian",
    "documentation_url": "http://acenative.github.io/ACEViewSwift/",
    "platforms": {
        "osx": "10.10"
    },
    "source": {
        "git": "https://github.com/ACENative/ACEViewSwift.git",
        "tag": "v2.1.0",
        "submodules": true
    },
    "source_files": "ACEViewSwift/*.swift",
    "frameworks": "WebKit",
    "resources": [
        "ACEBuilds/src-min/*",
        "ACEViewSwift/Dependencies/emmet/*",
        "ACEViewSwift/index.html"
    ],
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This