Tweak that removes the iOS restriction on PictureInPicture (PiP) size. This was created so that the PiP mode on iPads was more useful for people like myself who like to scroll through reddit while watching a show casually.
It also works on iPhones that have used other tweaks to enable PiP (such as ipadify or ForceInPicture).
Note: I've ONLY tested it on my iPhone X; the plan is to test this on an iPad Pro once the uncover jailbreak is released.
Note that this example is on iPhone so its usefulness is not as pronounced.
Before the tweak is enabled, the PiP is restricted by iOS and can't get much bigger. After being enabled, the PiP can become huge (to the the point that its not really useful on iPhones)
This was only my second tweak so for any other beginners, I will outline the steps I took to reverse engineer the solution:
- I searched iOS 13 for headers relating to PiP on limenos (https://developer.limneos.net/index.php).
- I found a few headers and looked through each of them for methods that mention constraints or restrictions
- Some methods that stood out to me:
_updateContentViewLayoutConstraintsWithContentViewSize
,(CGSize)_constrainContentViewSize:(CGSize)arg1
,(CGSize)maximumContentViewSizeForAspectRatio:(CGSize)arg1
. - I hooked onto those methods and logged (NSLog) to see what the arguments were and how they changed to make a guess as to what each method was being used for
- Repeat step 4 a lot but change the return value of the methods and see what happens.
- Voila!
Copyright GNU GENERAL PUBLIC LICENSE (feel free to use the code, just keep it open source)