nnhubbard / ZSSRichTextEditor

A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view
MIT License
3.78k stars 585 forks source link

Subclass ViewController with ZSSRichTextEditor, results in blank screen #180

Open shivanraptor opened 7 years ago

shivanraptor commented 7 years ago

I'm using Storyboard. I install ZSSRichTextEditor via Cocoapods, and subclass a fresh View Controller with ZSSRichTextEditor:

#import <UIKit/UIKit.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
#import <ZSSRichTextEditor/ZSSRichTextEditor.h>

@interface EditorVC : ZSSRichTextEditor

@end

But results in blank page with the suggested demo codes from the README:

- (void)viewDidLoad {
    [super viewDidLoad];

    // HTML Content to set in the editor
    NSString *html = @"<!-- This is an HTML comment -->"
    "<p>This is a test of the <strong>ZSSRichTextEditor</strong> by <a title=\"Zed Said\" href=\"http://www.zedsaid.com\">Zed Said Studio</a></p>";

    // Set the base URL if you would like to use relative links, such as to images.
    //self.baseURL = [NSURL URLWithString:@"http://www.zedsaid.com"];

    // If you want to pretty print HTML within the source view.
    self.formatHTML = YES;

    // set the initial HTML for the editor
    [self setHTML:html];
}

What did I miss?

yakovlevmaksym commented 7 years ago

I have the same issue. Included via Cocoapods and subclassed. Is there any solution to resolve this issue?

JeromeTW commented 7 years ago

configure Build Phases in following link: https://github.com/nnhubbard/ZSSRichTextEditor/issues/170#issuecomment-340633096