Post

Replies

Boosts

Views

Activity

Reply to URLSessionWebSocketTask SIP Register
I connect like this: var request: URLRequest = URLRequest(url: url) request.addValue("websocket", forHTTPHeaderField: "Upgrade") request.addValue("sip", forHTTPHeaderField: "Sec-WebSocket-Protocol") request.addValue("permessage-deflate; client_max_window_bits", forHTTPHeaderField: "Sec-WebSocket-Extensions") request.addValue("13", forHTTPHeaderField: "Sec-WebSocket-Version") request.addValue(key, forHTTPHeaderField: "Sec-WebSocket-Key") request.httpMethod = "GET" socketTask = session?.webSocketTask(with: request) socketTask?.resume() And I send the REGISTER message after connection established and this delegate method fires: func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) {}
Sep ’21
Reply to SwiftUI: which Markdown specification is supported?
I can get to the code blocks if I do this: var aString: AttributedString = try? AttributedString(markdown: m) for r in aString.runs { if let pi = r.presentationIntent { for i in pi.components { } } } But - then I lose all the new line characters in my initial string. So I can preserve the new line characters like this: var aString: AttributedString = try? AttributedString(markdown: m, options: AttributedString.MarkdownParsingOptions(interpretedSyntax: .inlineOnlyPreservingWhitespace)) But - now there are no code block annotations. Is there a way that I can preserve new lines AND get code block annotations? I need the code block annotations so I can set my own formatting. (At least until Apple renders code blocks properly).
Nov ’21