Question: I have an old Sprint iPhone 4s that hasn't been under contract for around a year now and I have a friend on T-Mobile whose contract doesn't end for another year. He still has a flip phone so I want to give him the old iPhone. Is there a way to unlock the iPhone if it is no longer under contract?

Answer: 
Unlocking is trivial with carrier support.

Here is Apple's article on how to proceed technically once your carrier has unlocked the device:

* <http://support.apple.com/kb/HT5014>

We have a nice thread on this Sprint to T-Mobile shift here:

* [Getting an unlocked iPhone 4/4S to work on T-Mobile](https://apple.stackexchange.com/questions/27969/getting-an-unlocked-iphone-4-4s-to-work-on-t-mobile)
In order to unlock - you will need to jailbreak it first. If you did want to jailbreak your iphone 4s as well,then jailbreak gives you to complete control to download whatever apps you want. That information is best for you that have an to unlock their iPhone.