Tagging in ios development - ios

I'm an absolute newbie on iOS Development at the minute so please pardon me if this seems like such a simple question to ask.
I want to build a project - almost like a note taking application - in which the user will be able to associate tags to their inputs. I'm sure many have seen them before - it's used in things like hashtags, or to give an example of an iOS app - Journalling apps like DayOne have it. It's basically used to generate tags for easy retrieval of a particular article.
My question is - how do you go about creating these kinds of tags? Particularly - how do you implement the tagging system that can generate custom tags for articles in the app?
Is it something that is built into Cocoa/SDK or do i have to look at something more complex like Core Data (NSPredicates) to learn how to create something like that?
OR is it something that has to be done programatically rather than a built in system in SDK?
Thanks.

In a super simple form (i.e. there are many ways you can build on this to make it scalable):
If each note is text, create an object with properties for the text and the tags
Make the tags property an array of strings
Store the notes in an array initially (archive to save to disk, or just practice with a non-saved version)
Make the user enter the tags (auto-tagging is an interesting topic...)
Consider using a token field (google for 3rd party implementations) for tag entry
Now, when a user starts a search for tagged content, iterate through each of the notes you have and run a predicate on the tag array. This could be done using NSPredicate, or you could ensure that all tags are saved in lower case and, to start with, require exact matching - so you could use '[tagArray containsObject:userEnteredTag];`
Then:
Look at real predicates
Look at Core Data (or SQLite if you love it)

You will need to use Core Data or SQLite3. Personally I would use SQLite but it is down to preference. I have used both but if you have any SQL knowledge then I wouldn't use Core Data. Having created an app with CoreData and using a lot of NSPredicates I found that the app had a lot of bug that appeared over time.
I changed it to use SQLite and now it runs perfectly.
As you are new to iOS I would recommend you take a look at Ray Wenderlich's tutorials. I learnt a lot from there.
http://www.raywenderlich.com/913/sqlite-tutorial-for-ios-making-our-app

Related

how to create a flutter app like wikipedia

I'm trying to create a Flutter app like wikipedia where a user can search and display the information but I'm don't have a lot of backend knowledge so it'll be appreciated if someone can guide me what I should do or learn in order to start this project.
The reason I'm trying to build this app is for my ethnic group. I want to have an app where we can read articles/information in our own language.
My goals is basically get all the article or documents about our cultures from other people and store in one database and display it in my app.
I'm not really sure where will be the best place to store all the article and retrieve that in Flutter. I've been looking Firebase but I'm not really sure if I can store the whole articles and display it.
Just to give you an idea, this is minipedia app and I'm thinking about creating an app just like this.
Any suggestion will be really helpful. thanks
You can use Firebase Firestore for this project. I've used FB before and to the best of my knowledge, there shouldn't be any problem with doing what you mentioned above.
I've been looking Firebase but I'm not really sure if I can store the whole articles and display it.
Yes, you can store whole articles on Firestore and retrieve them whenever you need them. Each document has a maximum limit of 1MB, which is approximately 1 million characters but should you need more space(which I highly doubt), you can always separate your articles into chunks.

Making UI elements programmatically in iOS using Xcode in Objective-C

I am trying to parse json data and convert it to form in iOS. I am successfully able to parse data and display it, however, i want to fix the UI and make it look more like an iOS form, perhaps using tableviews, etc.
How do I approach this? should I just use a tableviewController or use a tableview? (the fields are dynamically added, so I have no idea what type and how many fields I will have, until I make a call to the API and fetch the data from the json that I get)
Are there any easy to use libraries in iOS that I can use?
That's not how UI design works on iOS. For the specific example that you mentioned of a tableViewController getting fed from an API... You'll create a tableViewController and you will design a demo cell.
Then you will fetch the results from your API, parse it. And you will iterate over the results returned by the API, inside that iteration you will programatically create the table cells (thus ensuring that you are creating as many tables as you need).
Nevertheless this is a extremely vague question, and besides briefly explaining how this whole thing works on general terms, there is not much more I can do without you posting the code you have so far.
Allow me to refer you to this tutorial by NSCookBook that although old is gold when it comes to these things.
Regards,

Firebase chat backup/export like whatsapp in SWIFT

i implemented a chat app in swift using firebase real time db, there user can send images, emojis and Text.Now i have a requirement of export chat or get the conversation's backup with media and text as per whatsApp.help me to solving it out.
While Firebase offers a backup for the Realtime Database, this doesn't fit your needs here, since you'll want a per-user export of the data.
Since this is specific to your application, you will have to code it yourself, just like the good folks at WhatsApp have probably done. It should be a matter of iterating over all data sources for the user, getting the data through the relevant API (that you're already using to display that data), and then writing to a local file). You can do this either client-side in your Swift code, or server-side on a server you already may have, or using Cloud Functions.
If you're looking for some inspiration for the latter, there is a sample repository that shows how to clean up a user's data, based on a set of wipe-out rules. You'll need to significantly modify this example though, so I'm not convinced this will be less work than rolling your own from scratch.

How iOS Google Now can show different card template

I wanted to know the technology decision behind the iOS Google app.
As we can see, in the app's Google Now feature it renders many different card templates for different scenarios, and those templates seems to be very flexible based on server inputs.
I was wondering if this is implemented all based on HTML5? or they just have many templates built in and render them locally? I'd vote for the HTML5 route but not sure if this still involved some native code to make it more responsive?
Thanks!
As we (well, most of the community) are not Google employees we can't tell you what they really did, but I'd say that it is possible to do this dynamically in the app.
We did develop something similar that responds to definitions sent by the server and transforms them to custom designed forms following basic rules.
Google reuses the design of those cards for different plattforms, the easiest solution should be showing some WebView and using HTML5.
I agree with Kevin, as this answer is entirely based on personal opinion, too.
The way I would go is to create a card class which will load some JSON data and format it with HTML and CSS. Looking at each card it would be hell to format things that way natively. I mean, attributed strings is not the way to go. Too much logic for deciding which card get a bigger text or a picture.
Additionally, the top header is most likely "localized" as well, so you get the location and load a localized image. But that is Google by nature.

IOS | Storing blog posts for reading later

I'm rather new to IOS but i managed to get my app to display a list of blog posts from RSS feeds. I would like to give my users the ability to save the blog posts for reading later when they might not have an internet connection.
I will do this through a setting in the settings bundle. I do not however know what the best way is to store blog posts within my app. I am already using core data, would this be a good option for it?
If you are already using a persistence option then use it for everything, don't mix and match.
If you are already using Core Data then yes it makes sense to keep using it throughout the application for consistency and maintainability.

Resources