How to detect when two objects touch each other

What is the code to detect when two objects (new rect) touch each other?

I am new to lua so the full code will be appreciated

Here is code

rect20 = display.newRect( 100, 100, 1298.5, 50 )

There are two main options: Use Physics and collision detection. Or used a non-physics method. See this tutorial:

https://coronalabs.com/blog/2013/07/23/tutorial-non-physics-collision-detection/

Rob

There are two main options: Use Physics and collision detection. Or used a non-physics method. See this tutorial:

https://coronalabs.com/blog/2013/07/23/tutorial-non-physics-collision-detection/

Rob