Post

Replies

Boosts

Views

Activity

Is there a more simple way to create a directory in swift 5?
let applicationSupport = NSURL(fileURLWithPath: NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true)[0])     let launcherdir = applicationSupport.appendingPathComponent("MyApp") do { try FileManager.default.createDirectory(atPath: launcherdir!.path, withIntermediateDirectories: true, attributes: nil)                 } catch {                     print(error)                 }
3
0
1.4k
May ’22
JSON Array
can I create a json array without key? An example: {     [         {             "id":1,             "name":"Otto Matic",             "icon":"",             "developer":"Pangea Software"         },         {             "id":2,             "name":"Minecraft",             "icon":"",             "developer":"Mojang"         }     ] }
1
0
497
Jun ’22
What is the error?
What is the error in this code? @main struct CollectionManagerApp: App {     init() {         do {             var bo: ObjCBool = true             let library = try FileManager().url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: false).appending(path: "CollectionManager")             let database = library.appendingPathComponent("DataBase.plist")             if !FileManager().fileExists(atPath: library.absoluteString) {                 try FileManager().createDirectory(at: library, withIntermediateDirectories: false)             }             if !FileManager().fileExists(atPath: database.absoluteString) {                 FileManager().createFile(atPath: database.absoluteString, contents: nil)                 print("OK")             }         } catch {             print("Init Error:  \(error)\nEND")         }     }     var body: some Scene {         WindowGroup {             ContentView()         }     } } The error: Init Error:  Error Domain=NSCocoaErrorDomain Code=516 "The file “CollectionManager” couldn’t be saved in the folder “Application Support” because a file with the same name already exists." UserInfo={NSFilePath=/Users/gattino09/Library/Application Support/CollectionManager, NSUnderlyingError=0x600003ba0150 {Error Domain=NSPOSIXErrorDomain Code=17 "File exists"}} END
0
0
750
Jan ’23
How can I add my app to the Full Access to Disk list?
I had created an app that request the full disk access but I don’t now how can I get my app to show up in the Fuol Disk Access list. Excuse me for my bad English.
Replies
1
Boosts
0
Views
721
Activity
Mar ’22
Is there a more simple way to create a directory in swift 5?
let applicationSupport = NSURL(fileURLWithPath: NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true)[0])     let launcherdir = applicationSupport.appendingPathComponent("MyApp") do { try FileManager.default.createDirectory(atPath: launcherdir!.path, withIntermediateDirectories: true, attributes: nil)                 } catch {                     print(error)                 }
Replies
3
Boosts
0
Views
1.4k
Activity
May ’22
Mac to iDevice APIs
Is there an API that allows to my app to read the info/modify the info of an iDevice connected to the Mac?
Replies
0
Boosts
0
Views
961
Activity
May ’22
How can I check if the website is in WebClip mode?
I want that a JavaScript Check if the website was opened from safari or from a webclip. how can I?
Replies
0
Boosts
0
Views
635
Activity
May ’22
How can I get the connected iPod?
How can I get the list of the connected iPod to the Mac? I'm using Swift 5.5 and Xcode 13.4.1
Replies
1
Boosts
0
Views
703
Activity
Jun ’22
hoe can I create an init view?
i want to add to my app an init view like GarageBand. how can I?
Replies
3
Boosts
0
Views
584
Activity
Jun ’22
JSON Array
can I create a json array without key? An example: {     [         {             "id":1,             "name":"Otto Matic",             "icon":"",             "developer":"Pangea Software"         },         {             "id":2,             "name":"Minecraft",             "icon":"",             "developer":"Mojang"         }     ] }
Replies
1
Boosts
0
Views
497
Activity
Jun ’22
How can I create a new window in swiftUI?
How can I create a new window in SwiftUI? I'm using: Swift 5.6.1 Xcode 13.4.1 macOS 12.4
Replies
0
Boosts
1
Views
438
Activity
Jul ’22
Can I use apple virtualization in swiftUI?
Can I use apple virtualization in swiftUI? the tutorials use the Storyboard so I don't now if is possible.
Replies
2
Boosts
0
Views
1.3k
Activity
Jul ’22
How can I get the execution path?
how can i get the directory from which the executable is started? cd Hello mycommand i want to get the directory where the user is when the user start the command.
Replies
2
Boosts
0
Views
2.5k
Activity
Jul ’22
How can i get all caches directories?
I'm creating an app to clean all the trash on the mac, my app cleans user and system cache but how can I get the app's cache directories?
Replies
1
Boosts
0
Views
703
Activity
Oct ’22
How can i delete a file in a system dir?
i want to remove all the files in /Library/Caches, /System/Library/Caches. How can i get the right permissions to do that in my app? I'm using Swift 5
Replies
1
Boosts
0
Views
831
Activity
Oct ’22
How can I erase an usb device?
How can I erase an usb device in swift?
Replies
0
Boosts
0
Views
615
Activity
Dec ’22
What is the error?
What is the error in this code? @main struct CollectionManagerApp: App {     init() {         do {             var bo: ObjCBool = true             let library = try FileManager().url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: false).appending(path: "CollectionManager")             let database = library.appendingPathComponent("DataBase.plist")             if !FileManager().fileExists(atPath: library.absoluteString) {                 try FileManager().createDirectory(at: library, withIntermediateDirectories: false)             }             if !FileManager().fileExists(atPath: database.absoluteString) {                 FileManager().createFile(atPath: database.absoluteString, contents: nil)                 print("OK")             }         } catch {             print("Init Error:  \(error)\nEND")         }     }     var body: some Scene {         WindowGroup {             ContentView()         }     } } The error: Init Error:  Error Domain=NSCocoaErrorDomain Code=516 "The file “CollectionManager” couldn’t be saved in the folder “Application Support” because a file with the same name already exists." UserInfo={NSFilePath=/Users/gattino09/Library/Application Support/CollectionManager, NSUnderlyingError=0x600003ba0150 {Error Domain=NSPOSIXErrorDomain Code=17 "File exists"}} END
Replies
0
Boosts
0
Views
750
Activity
Jan ’23
App Store Search API
I need to search some informations about some apps on App Store but by searching online I can find any information about APIs to do that. Do they exist?
Replies
0
Boosts
0
Views
383
Activity
Jan ’24