Code Monkey home page Code Monkey logo

aceviewswift's Introduction

ACEViewSwift

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 !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.