We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do you have example to use in Swiftui?
The text was updated successfully, but these errors were encountered:
I have one, just as an example,
import Foundation import SwiftUI import MarkdownKit struct GPTDescView: View { @State private var text: NSAttributedString = NSAttributedString(string: "") @Binding var gptInfo: GptWordVo var body: some View { VStack(spacing: 0) { DialogTitleView(title: "AI 拓展 - 单词信息", rightImage: nil) .padding(.vertical, 8) ShadowScrollView { Text(AttributedString(text)) .font(.system(size: 15)) .foregroundColor(Color.text_color_primary) .padding(.horizontal, 15) .padding(.vertical, 15) .textSelection(.enabled) } }.onChange(of: gptInfo) { value in renderText() }.onAppear { renderText() } } private func renderText() { let markdownParser = MarkdownParser( font: UIFont.systemFont(ofSize: 16), color: .textColorPrimary ) let explanation = GPTWordsManager.fixExplanation( explanation: gptInfo.explanation ?? "") markdownParser.enabledElements = .disabledAutomaticLink markdownParser.header.font = UIFont.systemFont(ofSize: 16) markdownParser.header.fontIncrease = 1 self.text = markdownParser.parse(explanation) } }
Sorry, something went wrong.
No branches or pull requests
Do you have example to use in Swiftui?
The text was updated successfully, but these errors were encountered: