I am learning swift ui by mimicing stickies but i am facing richtexteditor problem

I am learning swift ui by mimicing stickies but i am having issue with richtextui

Error ViewBridge to RemoteViewService Terminated: Error Domain=com.apple.ViewBridge Code=18 "(null)" UserInfo={com.apple.ViewBridge.error.hint=this process disconnected remote view controller -- benign unless unexpected, com.apple.ViewBridge.error.description=NSViewBridgeErrorCanceled}

Why it is connecting to remote service when i develop it in local for mac

UI error is this. I type cursor moves and no text displayed. changed color to everything

some code

import SwiftUI import AppKit

struct RichTextEditor: NSViewRepresentable { @Binding var attributedText: NSAttributedString var isEditable: Bool = true var textColor: NSColor = .black var backgroundColor: NSColor = .white var font: NSFont = NSFont.systemFont(ofSize: 14)

I only started swift ui 2 day ago. Bought mac mini 4 3 day ago to develop ios app but learning mac app first to get experience with mac environment

Who can help

Contact me via discord alexk3434 I need mac developer friends.

Ok i resolved it. As i am new i asked chatgpt to give richtext and it giving me broken code. Fix was this

let scrollView = NSTextView.scrollableTextView() let textView = scrollView.documentView as! NSTextView

chat gpt gave this let scrollView = NSScrollView()

That was wrong

I am learning swift ui by mimicing stickies but i am facing richtexteditor problem
 
 
Q