-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PLAYRTS-5578 - iOS 18 Update #512
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the result in the simulator on iOS 18 and on an iOS 17 device. Two quick feedbacks without diving too much into the code yet:
- Restoring the small vertical space between the player bar and the bottom bar would be nicer IMHO.
- The TV program header seems broken, on iPad at least. Maybe a simulator thing, this needs to be tested on a device running the latest beta.
A suggestion also: You might want to assign the |
A few additional inputs:
|
// Place the button where it would appear if a navigation bar was available. | ||
if traitCollection.horizontalSizeClass == .regular { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (! _playerBottomToViewConstraint) { | ||
_playerBottomToViewConstraint = [self.miniPlayerView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular) { | ||
self.playerBottomToSafeAreaConstraint.active = YES; | ||
} else { | ||
self.playerBottomToViewConstraint.active = YES; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the two contraints compatible in the same time as they are link both to self.miniPlayerView.bottomAnchor
?
Do we expect to set active = NO
to one, and active = YES
to the other one?
…n depending on size class This also solves the crash that was occurring
a5def0f
to
4b33ceb
Compare
} else { | ||
if let presentationController { | ||
config.presentationContext = .viewController(presentationController) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combining the else
with the enclosed if
is a bit more readable:
} else { | |
if let presentationController { | |
config.presentationContext = .viewController(presentationController) | |
} | |
} | |
else if let presentationController { | |
config.presentationContext = .viewController(presentationController) |
if (self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular) { | ||
self.playerBottomToViewConstraint.active = NO; | ||
self.playerBottomToSafeAreaConstraint.active = YES; | ||
} else { | ||
self.playerBottomToViewConstraint.active = YES; | ||
self.playerBottomToSafeAreaConstraint.active = NO; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular) { | |
self.playerBottomToViewConstraint.active = NO; | |
self.playerBottomToSafeAreaConstraint.active = YES; | |
} else { | |
self.playerBottomToViewConstraint.active = YES; | |
self.playerBottomToSafeAreaConstraint.active = NO; | |
} | |
BOOL isRegular = (self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular); | |
self.playerBottomToViewConstraint.active = ! isRegular; | |
self.playerBottomToSafeAreaConstraint.active = isRegular; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few remarks:
- On iOS 17 there is a small offset between the mini player and the tab bar. This makes the layout more readable.
- Using a block to factor out part of the implementation requires awkward block signatures and dereferencing. It is better factored out as a method IMHO (which, BTW, should probably not be related to pre-iOS 18 behavior, as not all code paths are related to such behavior).
The original code is quite poor. If it can help we can try refactoring things a little bit together.
Description
This PR solves both issues.
Changes Made
Both issues were fixed by:
Checklist