How to show tutorial or login screen upon app launch (without flashing)

So, you want to show a tutorial or login screen as soon as your app launches without flashing your main view controller first?

Go no further!

This might seem hard at first but let me assure you, it is not. So, let’s see how it’s done:

Go to your storyboard and set your login screen or tutorial screen as the Initial View Controller.

Now go to your AppDelegate.m and add this code in your didFinishLaunchingWithOptions:

You want to show your login screen or tutorial screen based on some criteria, which for the sake of this tutorial is whether the app is launched for the first time or no. For this we are checking a key in the user defaults, which we set once the app is launched. If the key exists, the app is not launched for the first time, thus we should not show the tutorial screen. (I am using an integer here but any type will be fine because we are checking for it’s existence not it’s value).

Tip: If you use a BOOL instead of an integer, checking for it’s existence might not work this way. If (BOOL) will return NO if the BOOL is set to NO and will return NO even if the BOOL is non existent.

Now, to actually present our main view controller instead of the tutorial or login screen, all we have to do is set it as the root view controller for the AppDelegate.

Thanks for reading and feel free to comment guys!

How to sort EKReminders by due date

When I was developing the Forgot app, I stumbled upon a problem which I could not easily solve: I wanted to sort the reminders I fetched using EventKit, based on their due date. Obviously, I headed to the Apple docs for answers but had very little luck there. What next? Stackoverflow! – could not find anything nor did I get any helpful answers. So I came up with my own solution. Here is the code I used, it’s fairly straight forward:

 

 

Basically I am using the sortUsingComparator method of NSArray to sort my reminders. This method takes a block with two objects and expects an NSComparisonResult in return. Our job is to compare the passed in objects (can be any type thus the id) and return an NSComparisonResult based on our comparisons.

What is an NSComparisonResult?

Well, it’s an enum and has three values:

NSOrderedAscending

NSOrderedSame

NSOrderedDescending

All I had to do now is call the compare method of NSDate which returns an NSComparisonResult.

Tip: Don’t forget to call sortReminders(or whatever you call your method) every time the reminders array changed.  The best way to do this is to register an observer for an EKEventStoreChangedNotification. This way your app will even know about updates made to the Event Store from outside of your app. Here is a code snippet to make your life easier:

 

 

Stay tuned for more tips!

How should mobile phones be designed?

My most important item on my bucket list  is creating a phone which runs a custom OS and sell it to the public. Of course this a life goal and I would not want to rival the iPhone or Android, it would be something totally different. Something like MVMT watches. They do not rival Rolex or Patek Philippe, they are doing their own thing. And they are doing it right because I just ordered one!

I definitely know that my OS would only have a few functions but it would be good at everything else. Great camera, great screen and great battery life. The OS would be fast and snappy like Windows Phone and be totally different from the whole idea of having icons for the apps. I am not even sure it would have an App Store, probably not.

But the phones would be manufactured and designed by us, like the Google Nexus is designed by Google. I think one of the most important aspects of user experience on a mobile device is the feel of the actual device in your hand.

So.. I would definitely start the design process by 3d printing dummy phones. I would hand them to people around the whole globe and ask their opinion about the feel of the device in their hand, after concluding the results the perfect phone shape could be designed. For example I strongly believe that phones should not have any bevels around the screen, but only a thin one which is a little higher than the whole screen. Why? Because if you drop your phone face-down , it won’t brake. Also, I think after a given size, making the phone thinner is actually worse than leaving it as is because users will have a hard time holding it in their hand.

Thoughts?

My launch strategy for the site

A little intro:

My site is basically an e-commerce site for buying and selling phones and tablets. Like eBay but only for phones and tablets.

To make the site work I need visitors. But who would want to buy phones from a site which has no sellers (so nothing to buy)?

So here we are with the two edged sword. This is a very common problem for business like this. Businesses which rely on sellers to attract buyers. Uber and Airbnb all faced this problem before they got big. This only makes me feel better 😀

What is my strategy for attracting visitors?

  1. I launched Facebook Ad campaigns for a prize game where you could win any phone or tablet from the site. To enter you had to like the post, the page and share the post with your friends. This got the site quite bit of traction from a small amount of money.
  2. Next, I am going to blog on the Facebook page of the site everyday. Share interesting tech articles and videos to keep the name of my site popping up on people’s feed.
  3. Every cent I make from the Google Ads on my site, I will spend it on Google Adwords until I make a sufficient amount per month.
  4. Once I make enough money, I am going to put up billboards around Hungary with my website’s name. Fortunately my friend’s father has a company which sells billboard places.

Okay fair enough… But how do you attract sellers in the beginning?

The ads are great to attract visitors, but a very small amount of those people will list their phone or tablet for sale on the site. To get around this, I made a mailing list with more than 150 e-mail addresses of shops around Hungary who sell used phones and tablets. I sent an e-mail to all of them to let them know my site is launching and they should upload their products if they want more buyers rolling in. I also went around personally and handed name cards around shops I found nearby and told them about the site. They all welcomed the idea, but I think only a fraction of them will upload anything. Of course, only until the site is unknown. Often they don’t have time to do this and their business is profitable enough already, so I offered them that I am going to the work for them. Of course they do not know that I am the owner of the site…

What to look out for with this?

The guys at these shops were all employes. They get paid no matter how many phones they sell, so uploading their inventory online is not a plus for them but only a pain in the a**. To get around this, I am going to have to contact the owner of the shops, because he will see the potential of taking his business online and will make the employees upload the phones. Probably, I am just going to cold call them like Uber CEO Travis Kalanick did when Uber was starting out and needed to attract drivers.

What if this does not work?

If I still can’t attract sellers to the site (which I hope does not happen), I am going to start paying them for uploading their ads, only until I have enough of them. This is my last choice though, but not something to abandon.

 

Have you got any suggestions for me?

Feel free to share your ideas! 🙂

Launching my website finally… Or not?

So, a week ago I launched my e-commerce site for buying and selling used or new mobile phones and tablets. I had this idea for a while, but recently I managed to get around 1600$ from my father for the project. Of course he expects me to pay him back which I will do as soon as I can.

I am sure I could have learned HTML and CSS, but I felt like it was better to find a web developer company for the job, so I hired one. After 2 months of work and a lot of e-mails, they finally sent me the site. It had a ton of bugs and it took around another week or so to fix them all.

Okay, so finally all set up…

Well, at least I thought so. My father is a lawyer so he told me that I should not be forgetting the Terms of Use and Privacy Policy from the site. Of course I did, so I kindly asked him to write those for me. This took another 2-3 days, but it was all done and I was super-excited to launch the site.

The development of the whole site cost around  1300$ and I had 300$ left for marketing. I was thinking about going with Facebook Ads only, especially because people are looking for Christmas presents at this time of the year and a smartphone is a great choice for lot of them.

I started the Facebook Ads and applied to Google Adsense because thats how I am planning to make revenue from the site. Unfortunately, Google rejected my application…

I strongly believe that for good things to come you have to deal with a lot of sh*t first. So right now I am trying to get my site approved by Google because I do not want to find an AdSense alternative, just yet.

So…Here we are with a finished site and a lot of traffic coming in from the Facebook campaigns, with no possible way to make revenue. I am pretty sad to say the least, but still very motivated. I have to mention that my senses are very good and I can often feel if something is going to work or not. I have a very good feeling about this site, so I am still hoping for the best. Google will approve eventually, I am sure.

At the time of writing this post, I have re-applied to AdSense and stopped all Facebook campaigns not to waste money on visitors.

In my next post I am going to explain my launch strategy in a few points. Stay tuned! 🙂

How did I start?

Well, when I was little I was always amazed by engineering. My grandfather taught at one of Hungary’s best technical university and his office was always full of interesting machines and computers (seeing a computer was not very common at that time). He was also a great handyman, he could fix everything and anything. This is what inspired me most I think, even if I did not know that yet.

Okay you were inspired, but what did you do?

I started learning how to create things digitally. By this I mean, I learned everything from video editing to 3D graphics. At times I wanted to be a director and a DJ, but I also wanted to be a car mechanic. So…

I was around 12 when I decided that programing and design was best for me so I started playing around with Game Maker (version 7 at the time) to create games. Where did this take me? No where, but I learned the basics of programming and how a graphics are handled by a computer, etc..

Fast forward a few years…

I developed by first app using Unity 3D. It was a small space invaders clone and it was (still is) available for both iOS  and Android. Simultaneously I was learning XCode and Objective-C (wish I started with Swift now, so you should!) and developed a few apps. As I learnt programming my apps became more and more complex but until recently I was too scared to deal with servers and stuff, so my apps were all strictly offline (except for iCloud integration). You should definitely learn PHP and MySQL right in the beginning, and don’t be sacred to make complex apps. You can only learn!

Tips?

My biggest and only tip is this: Learn programming by having ideas which you want to turn into reality. By working on your own ideas, you won’t give up. Even when some bugs seem too tough to squash.

Plus, what you learn from tutorials will be easy to put into context because you will use them in your own apps.

iOS development course in Zambia

14444694_1277459902273571_1782214210668676085_o

I have always felt an eager to help other people, but I guess I am not alone with this. However, I want to teach something to the people and share them my knowledge. Rather than helping them physically or financially. This is what sparked the whole idea of makeithAPPen. The reason why I chose Zambia is simple: I was 100% sure they were in need of learning something useful. A skill they can generate income with, and get a decent job anywhere in the world.

I had an enormous amount of fun and became richer with an experience I will never forget. We developed two apps together, a very basic calculator and a photo viewer which showed pictures of cars. Following these, they later made an app alone, which randomly printed a name from the class on the screen, every time the user pushed a button. I taught them Objective-C because I am more fluent in that however, Swift might have been a little more modern. It won’t be hard for them to switch later, though.

The school I taught at, was called Nana Rose Memorial School. In Africa this is common, but I was shocked at how often they have electricity cuts which could last for days. This made using the projector a little bit harder.🙂

And now, some pictures!

Fixing the overview polyline in Google Maps SDK for iOS:

BVAccurateRoutePlot – GitHub

My app NYC Taxi was using the autocomplete feature of Google Places for finding destinations easily. However, Google requires that if you are using a map anywhere in your app, it must be a Google map.

That’s when issues started to rase. I had to show a route as well on the map, and Google’s direction service only supplies us with an “overview polyline”. This is just a rough estimate of where the polyline of the route should be on the map, and often (especially for longer distances) it does not follow the road.

So, I came up with the following solution:

I wrote a class for fixing the overview polyline so it follows the road perfectly. The way I achieved this is by using Google’s Snap-To-road API. The idea is, that after receiving the overview polyline, I send all the points from it to the Snap-To-road API, which then sends back a polyline snapped to the road perfectly. The only issue was, that the API could only process 100 points per request, which is most of the time, just not enough. So my class takes care of that as well. It slices up the points into blocks of 100, and sends multiple requests. Once all the requests come back, it puts the points into the right order, and shows the snapped polyline on the map.

Please feel free to use it in your projects, and hope that it helps someone! 🙂

Grab it from GitHub!