How to get ActiveElement in Appium?

Hello guys.
I am using appium java client 3.2.0 to develop my tests on IOS.I want to get current active element object in my test,I tried using Driver.switchto().activeelement();,but it returned me following error in appium log:
“VerboseError: An element could not be located on the page using the given search parameters.”

Can anybody help me in achieving this?

Thanks and Regards,