Swiftpack.co -  keitaoouchi/MarkdownView as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Markdown View for iOS.
.package(url: "https://github.com/keitaoouchi/MarkdownView.git", from: "1.8.3")


CI Status Swift 5.2 Carthage compatible Version License Swift Package Manager compatible

MarkdownView is a WKWebView based UI element, and internally use bootstrap, highlight.js, markdown-it.


How to use

import MarkdownView

let md = MarkdownView()
md.load(markdown: "# Hello World!")


md.isScrollEnabled = false

// called when rendering finished
md.onRendered = { [weak self] height in
  self?.mdViewHeight.constant = height

// called when user touch link
md.onTouchLink = { [weak self] request in
  guard let url = request.url else { return false }

  if url.scheme == "file" {
    return false
  } else if url.scheme == "https" {
    let safari = SFSafariViewController(url: url)
    self?.navigationController?.pushViewController(safari, animated: true)
    return false
  } else {
    return false

Experimental Features

This is not stable :bow:

Custom CSS Styling

Please check Example/ViewController/CustomCss.swift.


Please check Example/ViewController/Plugins.swift. Each plugin should be self-contained, with no external dependent plugins.

Here is a sample project that builds markdown-it-new-katex as a compatible library.


Target Version
iOS => 13.0
Swift => 5.2


MarkdownView is available through Swift Package Manager or CocoaPods or Carthage.

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/keitaoouchi/MarkdownView.git", from: "1.7.1")

Alternatively, you can add the package directly via Xcode.


pod "MarkdownView"


github "keitaoouchi/MarkdownView"

for detail, please follow the Carthage Instruction


keita.oouchi, keita.oouchi@gmail.com


bootstrap is licensed under MIT license.
highlight.js is licensed under BSD-3-Clause license.
markdown-it is licensed under MIT license.

MarkdownView is available under the MIT license. See the LICENSE file for more info.


Stars: 1681
Last commit: 18 hours ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

6 days ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics