Right. And the 4th amendment is only tangentially relevant to that question, because Apple has no 4th amendment rights over the phone (it's not Apple's phone nor Apple's data on the phone).
In this case, it has come up that Apple owns the software on your phone, and grants you a temporary license to use it. You do not have ownership of the copy of iOS, Apple does. The government has been attempting to use that to their advantage.