Skip to main content

Posts

SOLID Design Principles in Swift

What are solid principles in programming world? 5 SOLID design principles in swift SOLID is acronym used in software programming for making software design more understandable, flexible, scalable and maintainable.  Every Software Developer must be aware of 5 SOLID principles in order to deliver good quality code SOLID stands for what? S -  Single Responsibility principle O - Open Closed Principle L - Liskov substitution Principle I - Interface segregation Principle D - Dependency Inversion Principle If we apply 5 SOLID principles while creating iOS/Mac Apps then the benefits which we will get are as follow: ·       We will have flexible code which can be changed easily. ·       Software code becomes more reusable. ·       Software developed will be robust, scalable and stable. ·       Code is loosely couple which means dependency between the elements is low. Now let’s discuss each principle one by one. 1.)  Single Responsibility Principl
Recent posts

Lifecycle of React Native Component [2020 Edition]

What are the life cycle methods of React Native Component? A component's life cycle in React Native can be divided into 4 phases: React Native Component life cycle phases Mounting:  In this phase,  component instance is created and inserted into the DOM. Updating: In updating phase, a react component is said to be born and it start growing by receiving new updates. Unmounting: In this phase, a react component gets removed from actual DOM. Error Handling: It is called when any error occurs while rendering the component. Now let's discuss about different methods that gets called during these phases. Mounting phase Below are the methods which gets called when instance of component is created and inserted into the DOM. Constructor() static getDerivedStateFromProps() render() ComponentDidMount() Constructor() constructor ( props ) { super ( props ) ; this . state = { employeeId : 0 } ; } It is first method which gets called in the l

Apple to launch iPhone 9 Plus along with iPhone 9 with A13 bionic chipset

Apple expected to launch two budget iPhones soon iPhone 9 expected design As we all know that Cupertino based company Apple is working on budget iPhone 9 (successor of iPhone SE) for 2020. Now it has emerged that there wouldn't be single budget iPhone to be released in 2020. According to 9to5Mac website, Apple is also working on iPhone 9 Plus too. Although corona virus outbreak delayed the iPhone 9 release but this doesn't stopped the company to work on new hardware. Both iPhone 9 and iPhone 9 Plus seems to come with A13 bionic chipset which is present in iPhone 11 series  and may have physical home button supporting old Touch Id feature.  As we know that Apple discontinued home button after iPhone 8 and iPhone 8 Plus but now again company is in mood to replace much more expensive Face Id feature with Touch Id in order to decrease its cost. It is not incorrect to believe that both these iPhones will be the replacement of iPhone 8 and iPhone 8 plus which was l

What is Redux in React Native and why we need it ?

Redux is state management library in react native application which is used to manage the entire application state. It helps us to create applications that behave consistently, can run in different environments and are easy to test. Why we need it In react native, we have components where we can manage states internally. It does well when the application have fewer components but when the size of application grows the task of sharing the states between the components become quite difficult. But this management of different states in our application becomes easy in redux because in redux we have a single centralised global store which contain all the states of the application which is accessible to any component which subscribe to the store. So the task of passing states via props between the components gets eliminated. Redux is made up of store, actions, reducer and dispatcher. Let’s discuss about them. Store Store is basically a place where we manage all the states of

How to communicate between React Native and Swift using Bridging

In this article we will learn how can we achieve communication between React Native and Swift code. As we know React Native (RN) is great for building cross platform apps, but during development of react native app we might come across a situation where we need to call native code written in swift. This is where bridge module comes in, which allows us to communicate with the native layer of the application. If we are developing app in React Native for iOS and Android platform then we need to create a bridge for each platform. In this article we will discuss creation of React Native Bridge for iOS only. So Let’s start To better understand the concept we will create sample DemoApp in react native using react native CLI. Below are the commands to setup new project in react native. ·       react-native init DemoApp ·       cd DemoApp ·       react-native run-ios On running the app on iOS simulator, you will be presented with following screen. React Native wel