Skip to main content

Posts

Resetting checkboxes in an Ionic modal

I am building my first iOS app or HTML5/iOS app with the Ionic framework. Now my app has a list of items, and each item has a modal dialog attached to it that displays a bunch of properties attached to the item. These properties can be in an on/off state, so they are presented as checkboxes, so the user can modify their state. The state of the properties are independent of the similar properties on other items, so what was the problem I faced? Problem Ok so lets look at the Ionic tabs sample app, that we can get once we run the following command ionic start resetModal tabs So amongst other things, it gives us a tab for chats, that looks something like this Chats Ok so lets say there was this feature that on swiping left, it would revel a modal dialog ( IonicModal ) that contains a list of days (checkboxes) that you can select to set the availability for each chat contact. So when you swipe left on each contact, it should present the modal dialog in it's pristine state i...

How UX changed the way I look at my app

Ok, so this blog post is really more of a story as opposed to all my previous posts, that explain how to solve a particular programming problem. Ok so now let's start my story, so it starts off by me meeting this awesome researcher at a meetup and ends with my discovery of UX . Ok so let me start my story, so here goes... In the beginning So it all started in the 4th quarter of 2014 when I was looking for ways to promote my PTA (Post Traumatic Amnesia) app. So I came across this site called Meetup  where I found the  health tech meetup and I thought it would be a good way to try and promote my PTA app (which I will be releasing as an open-source project soon). At the meetup I met someone, a very interesting girl who was a researcher with her research topic being health, fitness and dieting. So we had a chat about what both of us wanted out of the meetup and how we both perceived the notion of building apps. This girl was Mandy Schippers , who is a "behavioural scientist...

Branching in Git: simplified with examples

Distributed version control systems are a lot of fun to work with, and I just happen to know  Git  more than any of the others. I do know Mercurial but while I had to learn Mercurial on my own, I had(still have when I get stuck) a great teacher for Git. He's the guy who created SuburbChooser , he could probably describe SuburbChooser's purpose better than me. All I know is that it is built to help people  and it is powered by some pretty complex algorithms under the hood.  Anyway let's not lose focus, we are here to talk about why branching in Git is awesome and how can we benefit from it in our projects. Why this post? I am building a dieting app with this researcher who does research in, well; health and exercise? or so (I do not know the exact research topic). What I know is that she is an expert in this field and besides sounding smart when talking,  she has published research in the field to back up the smart talk. Anyway, so while...

Local notifications in an Html5 powered iOS app(native)

Ok, so I have already written about why I decided to take the route of building an hybrid(Html5/Native) app, such that I get to know the native environment. So that post also mentions how I have built this Xcode starter project which can serve as a template for building html5 iOS apps using the Ionic framework.   Recently, I wrote about about how that initiative of mine helped someone . and what I have done now is created a branch, Notifications  which provides some sample code for adding local notifications to the project. In this post, I am going to talk about what is in the Notifications branch. Questions 1) Why build a Hybrid app such that I need to write some native code? Well one of the reasons outlined in my previous post , was that I wanted my app to use local notifications.   2) But scheduling local notifications is so simple, why add some sample code for it? Yes scheduling local notifications is simple and this tutorial does a good job of showing ho...

How do I get the day of the week for a date in my iOS app (using Swift)?

The title of this blog can be continued with the following line "...such that it works on both iOS7.1 and iOS8 and above". For a certain feature of my app, I needed to find out what day of the week it is for a give date and a lazy Google search lead me to the following code let today = NSDate () let calendar = NSCalendar ( calendarIdentifier : NSGregorianCalendar )! var components : Int = calendar . component (. WeekdayCalendarUnit , fromDate : today ) So I included that code in my app and first tested it on my iPhone 6 and it was working great, I was like "phew! one more thing done for my app". Unfortunately, that expression was a bit premature and I realised that when the app crashed after I deployed it to my old iPhone 5 running iOS7.1. This is the error I got, [_NSCopyOnWriteCalendarWrapper component:fromDate:]: unrecognized selector sent to instance 0x7f8452f4e490 Well as it turns out, the method that includes the fromDate parameter, ...

Struggling to fit a rejected PhoneGap project (app) into XCode

So at some point in December last year, I got a rather nice "Happy new year" message on my Google chat. The following is an extract from that message, A zillion thanks for posting the Swift with html5 frameworks. I have really been struggling to get a rejected PhoneGap project into XCode, and using your Framework made it possible.  Thanks a million and Happy New Year to you!   The framework the message was referring to was this Github project  that I created last year, I have described this project in more detail in this post . So long story short, being new to iOS development, I had/have a burning desire to build an HTML5 project for iOS devices. My goal has/was to build a hybrid project like the way I have described in my blog post and I wanted to make use of the Ionic framework . When I started developing the project, I had some issues getting the project to the point where I wanted it to be, simply because I did not know enough about iOS. Eventually I did get to ...

Passing parameters into a Swift method and modifying their values

So for people who have read my blog or who know me, they would probably know that I am a Java developer in my day job(full-time contract) and coding Swift is something that I do in my spare time. So there is one thing that I do every now and again in Java and that is something like this public void modifyCollection(List<String> collection) { collection.add("one"); collection.add("two"); collection.add("three"); } and the method is invoked as follows List<String> testCollection = new ArrayList<String>(); modifyCollection(testCollection); So after the line  modifyCollection(testCollection); the testCollection will have strings one , two and three. Now let us trying something similar in Swift func modifyCollection(collection:[String]) { collection.append("one") collection.append("two") collection.append("three") } var strArray:[String] = [String]() modifyCollection(strArray)...