Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Anyone here tried using Swift for developing iOS apps?

Options
  • 17-03-2017 4:36pm
    #1
    Closed Accounts Posts: 1,137 ✭✭✭


    I have just started learning Swift to try and develop iOS apps and I am finding it very frustrating and difficult to understand.  I have worked with C# and Java and have found them much easier to pick up and get started with.  With Swift it seems to require an awful lot of code and concepts just to do something basic.  Quite often code samples I take from the web don't work and throw all sorts of compile errors too.

    Has anyone else had a similar experience?


Comments

  • Registered Users Posts: 2,031 ✭✭✭colm_c


    Are you familiar with Xcode and iOS development?

    Swift is just a slightly nicer way to write code compared to objective C, you still have to grabble with the tools and concepts.

    iOS development is a fickle beast, but once you get the hang of it, it's fairly straightforward.


  • Closed Accounts Posts: 1,137 ✭✭✭veganrun


    This is my first time using xcode and trying to develop with iOS. It's definitely tricky. Just spent the whole day trying to get my app to use an SQLite database and just went in circles between FMDB, SQLite.swift, core-data and never got further than compile or run-time errors.


  • Registered Users Posts: 1,148 ✭✭✭punk_one82


    Yeah, I've been developing with swift the past 6 months or so. I like it a lot.


  • Closed Accounts Posts: 1,137 ✭✭✭veganrun


    What is the best option for me to store data?  Basically I am trying to create an app that will ship with some data that I can query in the app.  I have created some of this data already in an SQLite DB as I want to be able to use the same data with an Android app.

    In theory I guess I could ship it as an XML file instead but I don't know if that is the best option.  I am getting confused between using FMDB, SQLite.swift wrappers, Core-Data or something else to access the DB and none of the examples I have been looking at are very straight-forward.  The Core-data examples all seem to be based around the user adding data in the app and saving it.  That's fine but I already have the data prepared and I just want to be able to load it and view it.


  • Registered Users Posts: 1,148 ✭✭✭punk_one82


    veganrun wrote: »
    What is the best option for me to store data?  Basically I am trying to create an app that will ship with some data that I can query in the app.  I have created some of this data already in an SQLite DB as I want to be able to use the same data with an Android app.

    In theory I guess I could ship it as an XML file instead but I don't know if that is the best option.  I am getting confused between using FMDB, SQLite.swift wrappers, Core-Data or something else to access the DB and none of the examples I have been looking at are very straight-forward.  The Core-data examples all seem to be based around the user adding data in the app and saving it.  That's fine but I already have the data prepared and I just want to be able to load it and view it.

    It sort of depends what the data is, how complex it is and how large the data set is. If you really want the data to be the same between an Android and iOS app why don't you take the data out of the apps themselves and use a common database? Something like Firebase or any other hosted db. That way you can separate the concern for datastructure/loading it into the app and just query it using a rest API or the firebase SDK etc. If you're set on pre-populating a native DB you can load the contents of a file into Core Data the first time the app is launched and then have the app query Core Data from then on. There's an example here. If the data set is quite small and simple you can even look at using a plist in your app, which is pretty much just an XML file.


  • Advertisement
Advertisement