Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory for CSV file does not get created in IOS #3

Closed
kedolg opened this issue Oct 25, 2017 · 7 comments
Closed

Directory for CSV file does not get created in IOS #3

kedolg opened this issue Oct 25, 2017 · 7 comments

Comments

@kedolg
Copy link

kedolg commented Oct 25, 2017

I am developing an iPhone app using Xcode 9 and Swift 4. I have followed your installation instructions meticulously and I have attempted to create a CSV file. When I run the app the cdv file never gets populated into the directory in the app documents folder . I reviewed the CSVExport.swift file and I see the following code 👍

///get the default CSV directory

class func defaultDirectory() -> String {
    var path = "/SampleSwift"
    let fileManager = FileManager.default
    #if os(iOS)
        let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
        path = "\(path[0])/Exports"
    #elseif os(OSX)
        let urls = fileManager.urls(for: .libraryDirectory, in: .userDomainMask)
        if let url = urls.last?.path {
            paths = "\(url)/Exports"
        }
    #endif
    if !fileManager.fileExists(atPath: path) && path != ""  {
        do {
            try fileManager.createDirectory(atPath: path, withIntermediateDirectories: false, attributes: nil)
        } catch _ {
        }
    }
    return path
}

I have an iPhone 7 plus connected as a test device. I never receive any runtime errors. The console displays the following path for the userlist1.csv file 👍

/var/mobile/Containers/Data/Application/13DB9A0A-774C-45B0-A753-62FF8C56CF11/Documents/Exports/userlist1.csv

How do I get access to that file ? It never gets populated into the apps documents folder and the Exports folder never gets created.

I would appreciate any assistance you can offer .
thanks !
Tom

@DogandElk
Copy link

It's been ten days since I submitted a question with no response. Are you no longer supporting your work ? If not, I will inform cocoa pods that you are not.

@DogandElk
Copy link

We discovered that when using a connected device, the file gets created on the device itself, however, it is not visible. To see the file, one must use an application like iMazing. They have free version as well as paid versions with more functionality.

@vigneshuvi
Copy link
Owner

Hi @kedolg @DogandElk ,

Bundle display name - "APPLICATION NAME"
Application requires iPhone environment - YES
Supports opening documents in place - YES
Application supports iTunes file sharing - YES

This is not SwiftCSVExport framework issue. Add above key's in your project. Then, you can see those files in the iOS Files app.

@kedolg
Copy link
Author

kedolg commented Nov 7, 2017 via email

@vigneshuvi
Copy link
Owner

vigneshuvi commented Nov 7, 2017

@kedolg,

You have to add those keys in app .plist file. Please find the reference or review my SampleSwift project.

Reference: https://github.com/vigneshuvi/SwiftCSVExport/blob/master/Examples/SampleSwift/SampleSwift/Info.plist

@kedolg
Copy link
Author

kedolg commented Nov 7, 2017 via email

@vigneshuvi
Copy link
Owner

Hi @kedolg & @DogandElk

🚀 SwiftCSVExport (1.0.5) successfully published
📅 November 7th, 21:07
🌎 https://cocoapods.org/pods/SwiftCSVExport

Release note

iCloud is big staff. We have to configure in developers account and so on!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants