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

Graph store url #98

Closed
JARMourato opened this issue Mar 7, 2016 · 9 comments
Closed

Graph store url #98

JARMourato opened this issue Mar 7, 2016 · 9 comments

Comments

@JARMourato
Copy link

Hi, is there any plans for providing a way to pass the graph location when creating ? Imagine that I want to share data between an iOS app and a Today Extension, I would have to use a shared container, which means Graph would have to be located there.

How could i do that using Graph ?

@daniel-jonathan
Copy link
Member

Hey, That isn't something that is available through an API at the moment, but I do like the idea of that flexibility. So let's leave this issue up and I will put it in the next release. If you wanted to do it yourself for now, until the release -- look in the Graph.swift file, and there is a computed property called persistentStoreCoordinator, you can change the location of the store there.

@JARMourato
Copy link
Author

Thanks for the answer. Will do that :)

@misuqian
Copy link

maybe
NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true).last! as String

@daniel-jonathan
Copy link
Member

@misuqian This isn't an issue of getting the location, more so, I believe @JARMourato wants to control the location. This is coming up soon as we make additions to Graph.

@JARMourato
Copy link
Author

Yes @DanielDahan, you are correct. It's is not an issue, it's an enhancement I suggested @misuqian.

Really looking forward to those additions ;)

@daniel-jonathan
Copy link
Member

I will start working on it tomorrow and give you an update or a release based on the outcome :) @JARMourato.

@daniel-jonathan
Copy link
Member

Hi @JARMourato,

I made an update to Graph, version 1.0.8, where you can now specify the storage location, name, and type. For example:

Graph.storeName = "NewStorageName.sqlite"
Graph.storeURL = File.URL(.DocumentDirectory, path: "Graph/NewStorageLocation")
// Graph.storeType = NSSQLiteStoreType

These values need to be set prior to using Graph. Once Graph is initialized, these values will have no affect.

I hope this solves your issue. If not, please reopen the issue, or create a new one :)

All the best!

@JARMourato
Copy link
Author

Many thanks @DanielDahan :D

@xemacobra
Copy link

I was just about to ask for the same thing and then thought I'd read the previous posted issues first. Thanks. This will be helpful for me as well.

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

No branches or pull requests

4 participants