LoginSignup
0
0

More than 3 years have passed since last update.

using MMMarkdown

Last updated at Posted at 2020-11-24
    NSError *error;

    NSString *markdown = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Example" ofType:@"md"]  encoding:NSUTF8StringEncoding error:&error];

    if (error == nil) {
        NSString *html = [MMMarkdown HTMLStringWithMarkdown:markdown error:&error];

        if (error == nil) {
            html = [NSString stringWithFormat:@"<style>img {max-width: 100%%;max-height: 100%%;}</style> \n%@",html];

            [self.webView loadHTMLString:html baseURL:nil];
        }
    }
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0