Factory pattern can come in handy when you want to reduce the dependency of a class on other classes. On the other hand, it encapsulates the object creation process and users can simply pass in parameters to a generic factory class without knowing how the objects are actually being created. Also, it gives you a clean code. Let’s begin by ...
If you are a beginner Optionals can be a bit tricky to understand even though you may have found your way around it. In this article, we gonna look at the underlying principles behind SwiftOptionals. Before beginning, I assume that you know the basics of Swift. If not please follow my YouTube Videos and come back here. One of the ...
In order to understand this article, you should have a clear idea of Optionals. If you don’t know what is Optionals in Swift then please read my article on the same topic and come back here. Simple Unwrapping let name : String? = "Jay" if let myName = name {<br /> print(myName) } As we can see above we can ...
Before start reading this article, I’d highly recommend that you please go ahead and read my following articles. Understand Protocols — iOS Passing data between ViewControllers via Delegate & Protocols As usual lets setup our base protocols and classes as below. I hope the code below is self explanatory if you have read my previous article on Protocol. Let’s create some objects ...
So you’ve been trying to set custom layouts on run time on a UICollectionView or you were trying to change the UICollectionView’s cell count per row. But you’ve realised that it eventually crashes instead of getting what you want done. It’s mainly because you need to invalidate your UICollectionView’s layout. It can be simply done by calling the line below ...
This is a simple walkthrough on how to do the loader animation or Sprite animation in WatchOS using Swift. If you are using this animation as a loader animation, then probably you need to put them inside a group and hide them when the pending data becomes available. E.g. once the CoreData retrieval is successful or once the data received form the web service.
Last couple of days, the buzzword of Sri Lankan IT industry is “CEPA”. So what’s the deal with it? Why Sri Lankan government is hell bent on bringing this agreement with India? Is it really going to help Sri Lanka? There is so much of unexplored territory in this agreement. Let’s try to understand this CEPA or whatever the name ...
It’s been a week now since the Netflix launched to 130 countries around the globe including Sri Lanka. Right after the launch of Netflix in Sri Lanka, I started using their service. Let me share my experience with you in Sri Lankan context. I hope if you are going to buy a new Netflix account, this article will help you ...
YouTube is the de facto video streaming site online. It’s huge compared to competitors such as Vimeo. YouTube has been offering the streaming service on top of Adobe Flash all these days though HTML5 player was offered as an alternative option, which users have to enable. Flash has proven to be buggy and it failed to cope up with the ...
Back in 2013 due to the policy changes at the place I used to work, we all shifted our PCs from Windows to Ubuntu. Initially it was a nightmare. I couldn’t do anything at all. I had to keep searching for tips and tricks for the problem that I encounter while Using ubuntu. Here I’m going to share some of ...
Udemy is undoubtedly is the largest video based e-learning provider right now. I have been teaching at Udemy for last three months and the amount of passive income it could generate is really awesome. One of the problems I used have had over Udemy was that they don’t offer comprehensive categories. Sometimes you will see both software design courses and ...
Google I/O 2014 was once again kicked started with introduction of some awesome line of products. Interestingly one of the products which got highlighted was the new mobile phone named “Android One”. Google’s Sundar Pichai has unveiled the product during the Google I/O 2014 keynote. As usual year after year, Google is pushing their products forward. But lately you may ...
Google Search Engine is a massive tool. You must know how to tame and make use of a beast. Let me layout some of the awesome Google Search Tips that you will help you to filter and get exactly what you want from Google Search Engine. OR If you are a developer then you know about the OR. The condition OR ...
YouTube is the first option that comes to our mind when we want to search for a video or a clip. YouTube has been dominating the online video industry many years and non of the competitors were able to come any closer. No wonder Google bought it in the end. Let see some of the cool YouTube hacks and tricks ...
As a human being we all tend to resist changes. But in the world we live in, the changes are inevitable. fiverr has introduced a new advance (??) rating system recently which caused a bit of turmoil among fiverr community, especially the sellers. Do you really think that the new fiverr rating system is fair for sellers? Let’s have a quick ...
I know it’s tempting and you would think making money online is a piece of cake. You may also think that you can do it real quick. With more than 5 years of experience in internet marketing and blogging, I can say that it’s not going to happen over the night. If you want to be successful in the online money making ...
Type casting in Swift can be little confusing at times. Especially with those syntaxes such as as as? as!. Let’s learn how to type caste between different type of objects in this video lesson. If you like this video lesson please make sure to subscribe to my channel as I’m planning more video tutorials in the future.
I’m not sure why many developers (even some senior developers) confuse Protocols with Object and Struct. You can think of Protocols as a superclass with some rules. When you conform to that class you’ll have to simply obey those rules. In this case these rules can be methods and properties. Let’s look at an example so you’ll get a clear ...
Before start reading this article, I’d highly recommend that you please go ahead and read my following articles. Understand Protocols — iOS Passing data between ViewControllers via Delegate & Protocols As usual lets setup our base protocols and classes as below. I hope the code below is self explanatory if you have read my previous article on Protocol. Let’s create some objects ...
I’m not sure why many developers (even some senior developers) confuse Protocols with Object and Struct. You can think of Protocols as a superclass with some rules. When you conform to that class you’ll have to simply obey those rules. In this case these rules can be methods and properties. Let’s look at an example so you’ll get a clear ...