Category Archives: iOS

Xcode UI Recordings Vs Unit Testing

Although they may seem familiar and some people tend to confuse them, Xcode UI Testing and Unit Testing differ notably.

Unit Test is the very much Unit Test we all know, since testing techniques are known. You have complete access to the Main Project and you operate its classes and frameworks like you do as a side library. You can write mocks, stubs, etc.

But UI Test is less familiar.

UI testing differs from unit testing in essential ways.

Continue reading Xcode UI Recordings Vs Unit Testing

Big iOS learning classic is back again

The very well-known Stanford University’s course CS193p (Developing Applications for iOS using SwiftUI) formerly using Swift, has been broadcasted again this year.

This is the second time the curse is entirely done in SwiftUI. The course is very similar to last years’ but has some new approaches and updates that might worth repeating.

Continue reading Big iOS learning classic is back again

Cocoapods Pod install – Pod update differences

How to get a clear succinct picture of these two popular actions.

Use pod install to install new pods in your project. Even if you already have a Podfile and ran pod install before; so even if you are just adding/removing pods to a project already using CocoaPods.

Use pod update [PODNAME] only when you want to update pods to a newer version.

Now, here’s the tricky part, if there’s an existing Podfile.lock that specifies the versions of all requested pods, there is no difference.

Continue reading Cocoapods Pod install – Pod update differences

Dependency injection

In software engineering, dependency injection is a technique in which an object receives other objects that it depends on. These other objects are called dependencies. In the typical “using” relationship the receiving object is called a client and the passed (that is, “injected“) object is called a service.

The code that passes the service to the client can be many kinds of things and is called the injector. Instead of the client specifying which service it will use, the injector tells the client what service to use. The “injection” refers to the passing of a dependency (a service) into the object (a client) that would use it.

Continue reading Dependency injection

SOLID PROGRAMMING – LISKOV SUBSTITUTION PRINCIPLE

Substitutability is a principle in object-oriented programming stating that, in a computer program, if S is a subtype of T, then objects of type T may be replaced with objects of type S (i.e. an object of type T may be substituted with any object of a subtype S) without altering any of the desirable properties of the program (correctness, task performed, etc.). More formally, the Liskov substitution principle (LSP) is a particular definition of a subtyping relation, called (strongbehavioral subtyping, that was initially introduced by Barbara Liskov in a 1987.

The Liskov Substitution Principle is the third of Robert C. Martin’s SOLID design principles. It extends the Open/Closed principle and enables you to replace objects of a parent class with objects of a subclass without breaking the application. This requires all subclasses to behave in the same way as the parent class.

Therefore:

Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it.” – Robert C. Martin

A violation of this behaviour would imply your code is not SOLID and it may be prone to malfunctioning.

An easy way to generate your color palette for Android and iOS

material.io is a free, no trick, easy grab, palette tool that will allow you compose your color harmony for Android and iOS in a very simplistic way.

This website is based on Material Design, which is a design language developed by Google. Very popular across the board.

https://material.io/resources/color here you may find a large array of colors and easily generate primaryColor, primaryLightColor, primaryDarkColor, secondaryColor, primaryTextColor, etc.

On top of that, it will allow you to download straightaway a colors.xml or colors.xml file with all the constants well defined, which is pretty convenient. Ready to drop into your Android Studio or XCode project.

Fancy trying? Take a look at it!