![]() Var fullString: String = "" // Used to store the file contentsįullString = try String(contentsOf: fileURL, encoding. Print("Failed writing to URL: \(fileURL), Error: " error.localizedDescription) Try writeString.write(to: fileURL, atomically: true, encoding: 8) Let writeString = "Write this text to the fileURL as text in iOS using Swift" Let fileURL = DocumentDirURL.appendingPathComponent(fileName).appendingPathExtension("txt") Let DocumentDirURL = try! URL(resolvingAliasFileAt: url!) ![]() let DocumentDirURL = URL(fileURLWithPath: "/Users/f/d/t/App/Assets/Apps/TestApp") In the code bellow I tried to access the shared folder of my second mac and write the Text "Write this text to the fileURL as text in iOS using Swift" into the file named "Test.txt" and after that I want to read the same file again. I already tried different things(code bellow). ![]() I also tried to access my shared folders via this App and yes it worked I can see my shared folders on my Phone.īut there needs to be a way to do it with swift. There is an App in the App Store called "FileExplorer" where you can access these shared folders, but I do not know how they programmed this and with which language. Is there any possible way to do that with swift? I am trying to build an app where I am able to access(read/write) windows/mac shared folders in my local network with swift.
0 Comments
Leave a Reply. |