neo4j-ios
neo4j-ios copied to clipboard
Problem Installing in iOS Swift 4.0 project
Followed these instructions carefully:
git submodule
Add it as a submodule to your existing project. git submodule add [email protected]:GraphStory/neo4j-ios.git Open the Theo folder, and drag Theo.xcodeproj into the file navigator of your Xcode project. In Xcode, navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the "Targets" heading in the sidebar. In the tab bar at the top of that window, open the "Build Phases" panel. Expand the "Link Binary with Libraries" group, and add Theo.framework. Click on the + button at the top left of the panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add Theo.framework.
But the build fails with no explanation after doing these steps. If I delete the links to the library, then the project will run normally again.
Using Xcode 9.1 on MacOS High Sierra running on iOS 6S simulator.
Any help would be appreciated.
@jewilhel I'll take a look at this today
Thank you! Looks like only a MacOS framework is available and the IOS version is missing.
@jewilhel A few things.
- Through Terminal, navigate to the submodule directory and run
swift package fetch
. Theo has other dependencies and they need to be fetched. - You have to add Theo and the dependencies to the link phase and copy phase (see attachment).
I'll update the documentation. Thank you for pointing it out.

Thanks! Got it installed now! Yeah, I think a little clarity in the docs would help others.
btw... all the dependancies were there already, just didn't know I needed to add all of them.
Ran into another issue:
After typing import Theo
I add let theo: Client = Client(baseURL: "hostname.com")
(with my server name)
but it gives me the folioing error:
Use of undeclared type Client
something still seems wrong with the installation, or the framework has been changed. I looked through the source and noticed the BoltClient, but don't know how to use it.
Hi, sorry about the doc not being updated since 3.0. In 3.1 Client was renamed RestClient while BoltClient was introduced as the new shiny. We're just about to release 4.0, and the doc has been updated there, do check it out: https://github.com/Neo4j-Swift/Neo4j-Swift/tree/4.0
(also, the repo will be moving over there)
Hi thanks, for the help earlier. I used the RestClient as you suggested. Can this work with the community version of Neo4j running on my laptop? I tried the following and got domain errors:
let theo: RestClient = RestClient(baseURL: "http://localhost:7474", user: "neo4j", pass: "myPassword")
theo.metaDescription({(meta, error) in
print("meta in success \(meta) error \(error)")
})
I followed the link you provided to branch 4.0, but didn't see any updated information there. Perhaps I'm looking in the wrong place for the docs. Sorry for all the newbie questions.
Hi, RestClient was deprecated in 3.2 and is removed in 4.0 (it is deprecated in the current Neo4j version), so I would strongly encourage you to use BoltClient, and at this point I'd encourage you to use 4.0 already. Having said that, we'll do our best to support 3.2 for a while after the 4.0 release, acknowledging that there are many projects built upon RestClient.
You can use either client to connect to the community edition of Neo4j running on your laptop. I don't know if you're targeting iOS or macOS. If you are on iOS, localhost is not the device Neo4j is running on, so you should change that for your laptops IP address (you might need to configure Neo4j to allow incoming connections from outside your laptop). If you're running your Swift code on macOS on the same laptop as the Neo4j instance, localhost is fine.
Thanks for your helpful advice... I was wondering if your instructions above also apply to running an iOS app running in the simulator on the laptop that's serving the Neo4j database, or does the app need to be running on an external iPhone?