What is Auto Layout?

Auto Layout is a constraint-based layout system. It was introduced with Xcode 6 Beta. It allows developer to create an adaptive UI for the apps that responds appropriately to changes in screen size and device orientation.

Auto Layout dynamically calculates the size and position of all the views in your view hierarchy, based on constraints placed on those views.

Why Auto Layout?

Today we have lots of variants available of iPhone and iPad in size in market. So, the user...

Read complete blog post

Ecto’s query syntax does not cater to all types of database queries. fragment is useful to inject custom SQL for composing queries.

Lets take a very simple example to lowercase a target column while comparing a string in where clause in our SQL query. We can usefragmentto inject custom SQL into our query.

email = "test@hello.com"

query = from u in User, 
 where: fragment("lower(?)", u.email) == ^email, 
 select: u.email

Repo.all query

In the...

Read complete blog post

There are many ways you can style react component you can use are Inline CSS and there are many React Libraries like typestyle which is good but there have some other flaws in it like it forces you to write CSS in javascript object means if you want to write CSS as background-color:red you would have to write as backgroundColor:'red' like this which seems very weird but if you use styled component is very simple and also it allows use style react in plain CSS

First, we gonna create new...

Read complete blog post

Apple released most interesting feature Facial recognition with iPhone X. Face ID is a new revolution in recognition. It is a powerful and secure authentication system that’s more convenient, faster and easy than Touch ID.

Face ID is biometric authentication. Biometrics technology is mainly used for identification and access control. Touch ID recognition is also biometric authentication.

Face ID uses LocalAuthentication Framework for authentication and Touch ID uses the same framework for...

Read complete blog post

I have been using Ubuntu for most of my development works for a long time. But recently I also started working on a Mac on one of my projects. This was the first time I was using it. Most of the things felt homely but the first thing that caught my attention was, there no auto-complete feature available on the terminal for Git commands.

Git is the first step to start working on any project, so this small thing was what I wanted to fix on Mac. I asked few of my fellow Mac using friends but...

Read complete blog post

Naturally, Indicator of ScrollView is visible when the content view of ScrollView is longer than ScrollView height and user drag on Screen. As we all know It is a default functionality, we can't make it always visible directly.

Using flashScrollIndicators() method we can make it visible.

Example

override func viewDidAppear(_ animated: Bool) {
 super.viewDidAppear(true)
 scrollView.flashScrollIndicators()
 }

But indicator only appears for some time after...

Read complete blog post

Ember uses the Handlebars templating library to power your app's user interface. Handlebars templates contain static HTML and dynamic content. It uses data-bindings for dynamic contents.

For more details you can check ember documentation: Handlebar Documentation

Helpers: Helpers are functions that are designed to help you control the way your data is rendered by the template in the browser for the client to view. Helpers allow you to add additional functionality to your templates beyond what...

Read complete blog post

Rollbar does real-time error monitoring for developers, It catches all types of errors and also show the root cause for error. In this article I am going to explain implementing Rollbar in ember application with ember-rollbar-client and configuration. Before using ember-rollbar-client we used 'ember-rollbar-cli` but It was not catching errors for Android and IOS builds.

To use ember-rollbar-client add it in package.json

After installing this package you need to add rollbar configuration in ...

Read complete blog post

As we all know the apple is bringing all the new changes in iOS every year, they are improving the the UIKit for the better User Interface for iOS.

Today we will see 2 new changes of UIKit in iOS 11.

Navigation Bar Controller

A navigation bar appears at the top of an app screen, below the status bar, and enables navigation through a series of hierarchical screens. When a new screen is displayed the back button appear with the label of previous screen title on the left side of the screen. We...

Read complete blog post

When we write code in Imperative programming languages, we make this mistake of considering a procedure as a function many times without realizing it. We keep using word function commonly. Whether the written method is a function or not.

If you do not believe me then keep reading this article and you will see that.

To start with let's see what is actually a Pure Function and Impure Function

Pure Function

The pure function always has following:

  • Accepts one or more parameters
  • Each parameter...

Read complete blog post

We had requirement of building realtime notification system. So whenever a user mentions n number of users we have to broadcast a message to all the users in real time and thereby update the count of each notification and push the message on their respective client. To implement this we need to understand Channels in phoenix.

Channels:

Phoenix framework has a built-in facility to manage two way communication between web clients and the server. Sender broadcast a message about topics and...

Read complete blog post

Reading Time: 4 mins

While writing a custom Mix task in Elixir, I ran into minor challenges for running / executing an Ecto query to update a database table column from within my mix task. It was not straightforward initially thus I thought to share here. In this short article, we will also see how to pass arguments to our mix task to run dynamic query.

First, what is Mix? Elixir documentation says:

Mix is a build tool that ships with Elixir that provides tasks for creating, compiling,...

Read complete blog post

Use spring to run RSpec -

with spring -

bundle exec spring rspec spec/controllers/api/v1/
Finished in 47.14 seconds (files took 1.58 seconds to load)
72 examples, 0 failures

without spring -

bundle exec rspec spec/controllers/api/v1/
Finished in 48.84 seconds (files took 29.23 seconds to load)
72 examples, 0 failures

One of the reasons for RSpec tests being slow is the initial application boot time. This happens every time you make changes in your...

Read complete blog post

Visual Studio database project is one of the awesome tool provided by visual studio for managing database changes across all environments and developers machine. We can manage database changes same way as we manage the code changes using version control. VS database project helps to keep everyone in sync with the changes in database.

For effective use of database project and make development easier, we should follow some things like, Developers should use local SQL Server, names of databases...

Read complete blog post

ActiveAdmin is great framework for managing website administration interfaces. It allows us to list records of a table, filter them, sort them and also support exporting them in CSV, XML or JSON. By default, records that are being displayed are exported. For example, say we have a products table where each product is distinguished by their type. We can apply a filter to list all electronics products. Clicking on CSV link below the list will export all electronics products only.

But sometimes...

Read complete blog post

The .closest() and .find() are very handy methods in JQuery. These 2 selectors are useful when you want to find corresponding elements where the event has triggered.

  1. .closest(): This selector traverses up the DOM till it finds the matching element for the supplied selector.

  2. .find(): This element traverses down the DOM along descendants of supplied DOM element.

Let's take a look at one example of how to use these 2 selectors together.

<form action="/posts/456/attachments">...

Read complete blog post

In iPhone, A user can now press Home screen icon to immediately access 3D touch Quick Actions functionality provided by your app. By Pressing hard on the home screen icon can now launch a quick action menu to take the user directly to parts of the app.

Users with devices that support 3D Touch will use this feature. You can add this feature quickly.

Home Screen Quick Actions

Quick actions can be static or dynamic. You can define static actions at build time and dynamic actions at runtime....

Read complete blog post

As software developer most important thing for us is to understand debugging. When things go wrong with code, we need to be able to find the bug quickly and solve it. Today we are going to have look at some important thing regarding ember app debugging. These are small things but can help you if you are new with ember and trying to debug some error in your ember application.

Ember Inspector:

Ember Inspector is a browser extension available for Chrome and Firefox. This is helpful tool for...

Read complete blog post

Nowadays, Asynchronous programming is very popular with the help of the async and await keywords in C#.

Recently we were using Async Await keyword while writing unit test cases in our project and found various issues in using them correclty.

As users, we prefer applications which respond quickly and do not freeze when loading or processing data. While we are less patient with applications that keep us waiting. Even operating systems are becoming more responsive, and give you the option to...

Read complete blog post

What is search console?

Google Search Console is a free service offered by Google that helps you monitor and maintain your site's presence in Google Search result. You don't have to sign up for Search Console for your site to be included in Google's search results, but doing so can help you understand how Google views your site and optimize its performance in search results. The tool gives webmasters the ability to find out if there are any specific problems that could be detrimental to being...

Read complete blog post