Skip to main content

Posts

Showing posts with the label XCode

Xcode project template with Firebase

Analytics is one of the ways in which you can know how users use your app and I think it’s very important to know how users use your app. It’s one of the things that we (or I) use at My Day To-Do (MDT) to encourage usage of certain features. What do I mean? I have written in the past that about my Software engineering background and as such my UI/UX skills are not the best. So the first think I think about when users don’t use certain features of my app is probably because they don’t know about it. Hence to compensate for that, I monitor how the app is used, so I know if the users aren’t using the features I think they should, I will add visual cues in the app to make the feature obvious for them. In almost all of the apps that I have developed at My Day To-Do, I have used Firebase Analytics to monitor app usage. In this post, I will just be talking about how to setup an iOS app with Firebase, provide some sample analytics code of the  Github repo  that I made for this ...

UITableView.refersh: a method to refresh a tableView in iOS (Swift)

When I was working on building some native iOS UI , UITableView  was one of the things that I was working with and at some point during my work, I wanted to refresh the table and I was expecting a built-in method like UITableView.refresh. Naturally, one of the first things that I tried was to type in the variable name in Xcode , key in "." and type "r" expecting the Autocomplete to show the refresh method. However to my surprise there was no refresh method? and I thought what? A basic feature like this should surely be there. Turns out that there is a way to refresh the table, it's just not immediately obvious to someone who's new to iOS. So in this post, I will talk about my solution to refresh table. Problem Refresh UITableView: the tableView in question only has only one section and it should be refreshed with an animation by clicking a button or otherwise.  Provide a general, reusable method to refresh UITableView. Solution The solution use...

Xcode project template for native Html5 apps is now Swift2/Xcode 7 ready

This is a very short blog post to describe my latest commit to this template. The Xcode project template in question here is my open-source repo on Github, titled  Html5StarterAppWithSwift . This repo came to be while I was working on my iOS app, My Day Todos and if you need to know what that repo is, then have a look at this README file or this blog post .  The latest update to the repo: Swift 2 When Xcode 7 was released, so was Swift 2 and since this repo was built using Xcode 6 and Swift 1, I had to migrate it so people do not have any issues when working with this on Xcode 7. I think there may still be people working with Xcode 6 for at least another few months and hence, my original Xcode 6 compliant code is still there. I have added another branch to this repo called, SwiftOne which has the Xcode 6 and Swift 1 code. Upcoming features: Charting and what else? Very soon, I will be demonstrating how to use an Html5 based charting solution in a native iOS app via...

Html5StarterAppWithSwift, featured in thechangelog.com weekly newsletter

So I have written a few posts about my Html5StarterAppWithSwift  and one of my objectives with that project/Github repo is to ensure more people know about it. So if anyone is trying to build a "native" HTML5 iOS app in a way similar to what is mentioned here , they are not slowed down by having to solve the same problems that I faced. How does thechangelog.com fit into the whole picture? I listen to thechangelog.com podcast often i.e. every time they have a new podcast on something that interests me (which is 80-85% of the time). I have been listening to their podcasts for a few years now and I know they like and support open-source stuff. So I decided to let them know about Html5StarterAppWithSwift by "Ping"  ...ing them i.e. create an issue in their Github repo , to let them know about Html5StarterAppWithSwift and then it got featured in thechangelog.com weekly. So I am hoping more people know about it and can make use of it, while working on their iOS app...

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 ...