Add Markdown & Code Syntax Highlighting to ChatGPT iOS SwiftUI App



Add Markdown & Code Syntax Highlighting to ChatGPT iOS SwiftUI App

Add Markdown & Code Syntax Highlighting to ChatGPT iOS SwiftUI App

In this video, we’re going to add Markdown Rendering & Code Syntaxt Highlighting to the iOS target of ChatGPT SwiftUI App. This is a continuation of the previous tutorials in “Build SwiftUI ChatGPT series”
#swiftui #chatgpt #iosdevelopment #iosdevelopment

Tutorial Links:

Starter Project – XCAChatGPT SwiftUI Git
(Select markdown-code-highlight-ios-starter Tag):
https://github.com/alfianlosari/ChatGPTSwiftUI

Completed Project commit diff changes:
https://github.com/alfianlosari/ChatGPTSwiftUI/commit/66a547f871c32fe6aadd4aece42d510cba5a7d87

Build SwiftUI ChatGPT series Playlist:
https://www.youtube.com/playlist?list=PLuecTl5TrGws7XyrBor8T0DoboJk6PBW0

Apple Swift Markdown Git:
https://github.com/apple/swift-markdown

Highlighter Swift Forked Git:
https://github.com/alfianlosari/HighlighterSwift

Christian Selig Markdownosaur Code Snippet:
https://github.com/christianselig/Markdownosaur/blob/main/Sources/Markdownosaur/Markdownosaur.swift

Highlighter Swift Original Git:
https://github.com/smittytone/HighlighterSwift

Timeline
00:00:00 Intro
00:01:20 Project Setup & SPM Dependencies
00:05:59 Markdown Attributed String Parser
00:21:07 CodeBlock Syntax Higlighting SwiftUI View
00:39:01 MessageRow SwiftUI View with Attributed String
01:00:11 ChatGPT API Response Parsing in View Model

Colorful Flowers by Tokyo Music Walker | https://soundcloud.com/user-356546060
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
https://creativecommons.org/licenses/by/3.0/

Comments are closed.