The Frequent Locations feature was quietly introduced to iPhones a year ago

It is tracking your every move – recording the exact time you left for work, where you bought your coffee and where you like to shop.

But this isn’t a futuristic spy drone or some sinister Big Brother state – it’s the iPhone sitting in your pocket.

Hidden in Apple phones is a function which logs every journey. The iPhones are then able to analyse the data to figure out where you live and work, basing decisions on the frequency and timing of trips.

The function – called the Frequent Locations feature – was quietly introduced to iPhones a year ago. But since access to the programme is buried beneath five layers of settings menus, few people know it exists.

Apple claims the data never leaves your phone without your permission, and that it was only designed to improve mapping services.

But Professor Noel Sharkey, one of Britain’s leading computing experts, described Apple’s ability to track people as ‘terrifying’. ‘This is shocking,’ he said. ‘Every place you go, where you shop, where you have a drink – it is all recorded. This is a divorce lawyer’s dream. But what horrifies me is that it is so secret. Why did we not know about this?’

Smartphones have had the ability to track their owners’ movements since they were first installed with GPS chips and mapping functions.

But this feature, which is automatically installed on any iPhone with the iOS 7 or an iOS 8 operating system, is the first to display the movements clearly on a map. The phone records the date of every one of your journeys, your time of arrival and departure and how many times you have been to each address.

Apple insists the data only leaves the phone if users gives their consent by selecting the Improve Maps option in the phone’s privacy menu.

But campaigners say the data could be seen by a snooping boss, a jealous wife, or even seized by police or an authoritarian government.

The revelation comes at the end of a week in which Apple saw £12billion wiped off its value after a glitch left iPhone 6 owners unable to get a signal – and some owners of the new slimline iPhone 6 Plus bent their frames. In an open letter this month, Apple chief executive Tim Cook said: ‘Our business model is very straightforward. We don’t “monetize” the information on your iPhone or in iCloud.’

But Professor Sharkey said: ‘Apple might promise not to use our location information for advertising. And many of our authorities might be quite benevolent at the moment. But if you put that information in someone else’s hands, then it becomes powerful, and in some cases, dangerous.’