Stuck Creating a feature allowing people to create a post

I’m trying to develop my first app my Vision is a new creative app for sharing ideas, inventions, artwork, and more in a safe inviting app.

Im stuck trying to develop a feature to allow a user to create a post. For example allowing them to upload a file, a photo, a video, or just text.

any and all help is appreciated thx!

Answered by Claude31 in 689697022

What is it exactly you don't know how to do ?

Here is how you upload text from a website.

 let url = URL(string:"http://www.SchematicsPro.com/SomeFile.txt")!  // The document on the web site
 let task = URLSession.shared.dataTask(with:url) { (data, response, error) in
    if error != nil {
       print(error!)
  } else {
       if let textFile = String(data: data!, encoding: .utf8) {
          print(textFile)
       }
    }
  }
 task.resume()
Accepted Answer

What is it exactly you don't know how to do ?

Here is how you upload text from a website.

 let url = URL(string:"http://www.SchematicsPro.com/SomeFile.txt")!  // The document on the web site
 let task = URLSession.shared.dataTask(with:url) { (data, response, error) in
    if error != nil {
       print(error!)
  } else {
       if let textFile = String(data: data!, encoding: .utf8) {
          print(textFile)
       }
    }
  }
 task.resume()
Stuck Creating a feature allowing people to create a post
 
 
Q