Skip to content

Use the wonderful ACE editor in your Cocoa applications

License

Notifications You must be signed in to change notification settings

mdabbagh88/ACEView

 
 

Repository files navigation

ACEView

Use the wonderful ACE editor in your Cocoa applications.

ACEView example

For great justice.

Documentation

Full API documentation.

Usage

Using ACEView is about as easy as it gets. First add the ACEView framework to your project (see linking library or framework for information on how to do this), then add a view to your XIB, and tell it to be an ACEView:

*note that ACEView has some dependencies - either use CocoaPods or run: git submodule update --init --recursive inside the folder you cloned ACEView into.

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/Cocoa.h"
#import "ACEView/ACEView.h"

@interface AppDelegate : NSObject <NSApplicationDelegate, ACEViewDelegate> {
    IBOutlet ACEView *aceView;
}

@property (assign) IBOutlet NSWindow *window;

@end

#import "AppDelegate.h"
#import "ACEView/ACEView.h"
#import "ACEView/ACEModeNames.h"
#import "ACEView/ACEThemeNames.h"

@implementation AppDelegate

- (void) applicationDidFinishLaunching:(NSNotification *)aNotification {

    // Note that you'll likely be using local text
    [aceView setString:[NSString stringWithContentsOfURL:[NSURL URLWithString:@"https://github.com/faceleg/ACEView"] encoding:NSUTF8StringEncoding
                                                   error:nil]];
    [aceView setDelegate:self];
    [aceView setMode:ACEModeHTML];
    [aceView setTheme:ACEThemeXcode];
    [aceView setShowInvisibles:YES];
}

- (void) textDidChange:(NSNotification *)notification {
    NSLog(@"%s", __PRETTY_FUNCTION__);
}

@end

githalytics.com alpha

Bitdeli Badge

About

Use the wonderful ACE editor in your Cocoa applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 97.0%
  • Ruby 1.6%
  • Shell 1.4%