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

filePath issue of CreamAsset #217

Open
owenzhao opened this issue Sep 24, 2020 · 0 comments
Open

filePath issue of CreamAsset #217

owenzhao opened this issue Sep 24, 2020 · 0 comments

Comments

@owenzhao
Copy link

owenzhao commented Sep 24, 2020

In CreamAsset's create methods, it allows to save file to places other than the default place. with public static func create(objectID: String, propName: String, url: URL, shouldOverwrite: Bool = true) -> CreamAsset?.

However, the filePath: URL property is incorrect.

/// Where the asset locates in the file system
public var filePath: URL {
    return CreamAsset.creamAssetDefaultURL().appendingPathComponent(uniqueFileName)
}

It always indicates that assets are saved in the default place. However, this may not be true. For example, if someone uses shared group container, which is common when developing Extensions like Share Extension and Today Extension, the saving place will not be the default place.

I have just made a small patch for this. Just changing the computed filePath to lazy property and assign the value when a url is given explicitly.

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

1 participant