Post

Replies

Boosts

Views

Activity

Why isn’t markdwon implemented when text is passed as a variable?
import SwiftUI struct ContentView: View { @State private var username: String = "" var pass: String = "hello" var body: some View { VStack { TextField("Hi", text: $username) Image(systemName: "globe") .imageScale(.large) .foregroundColor(.accentColor) Text(pass) } } }why isn’t markdwon automatically implemented here? It’s just a simple query to help me understand how it works :) help is greatly appreciated. PS: when i pass a string directly like Text(hello) then markdown is implemented and the text is made bold. …
1
0
316
May ’23
I am a new developer. How can i make my output text editable?
I have made a Scan to Text app with the help of sources from the internet, but I can’t figure out a way to get my output text to be editable. Here’s my code private func makeScannerView()-> ScannerView {         ScannerView(completion: {             textPerPage in             if let outputText = textPerPage?.joined(separator: "\n").trimmingCharacters(in: .whitespacesAndNewlines){                 let newScanData = ScanData(content: outputText)                 self.texts.append(newScanData)             }             self.showScannerSheet = false                      })     }
0
0
656
Jan ’22
Type of expression is ambiguous without context error fix needed
Im getting the errror on the line where it says @Environment. The error is highliting the exportFiles part on that line. Any ideas anyone? A fix will be highly appreciated Thanks in advance import PlaygroundSupport struct ContentView: View {     @Environment(\.exportFiles) var exportAction          var body: some View {         Button("Export Your file") {             let url = Bundle.main.url(forResource: "symbols",                                       withExtension: "json")!             exportAction(moving: url)  {result in                 switch result {                     case .success(let url):                     print("Success! Moved to: /url")                 }             }         }     }      } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } } PlaygroundPage.current.setLiveView(ContentView())
3
0
3.5k
Jul ’20