I'm making an application on xcode 8.3.3 and am using swift to make the app. We have a hosted postgres database which is up and running but I don't know how to connect to it through swift and xcode. I have a host, port number, username and password but I don't know how to connect to the database so I can get the data. I'm a newbie to xcode, swift and basically programming in general please help.
1 Answer
A simple google search would yield tremondous results.
http://druware.tumblr.com/post/112163075395/getting-started-with-pgsqlkit-and-swift
I believe the above link should get you sorted.
Basically you have to use the C API libpq library.
3 Comments
vsarunhah
Hey, thanks but how do import the code from [link] (druware.com/pgsqltouch) as a .framework file?
David
@vsarunhah see: help.apple.com/xcode/mac/8.0/#//apple_ref/doc/uid/… and also: stackoverflow.com/questions/3352664/…
vsarunhah
Sorry but there's another problem. The apple link isn't opening and the stackoverflow link helps but the problem is that the code isn't downloadable as a framework nor is it possible to copy it into a cocoa touch framework because it requires you to import "GenDBConnection" which currently doesn't exist. Can you help me with that? @David Farrugia