Fix infinite layout loops on timeline (#6942)

* Remove `forceZeroSageAreaInsets` from `VectorHostingController`

* Fix layout issues when adding hosting views into the content view

* Use the new api when adding views into the content

* Add changelog
This commit is contained in:
ismailgulek
2022-10-20 15:55:07 +03:00
committed by GitHub
parent 39444b0291
commit d62640c56d
12 changed files with 60 additions and 60 deletions
@@ -84,8 +84,7 @@ final class TimelinePollCoordinator: Coordinator, Presentable, PollAggregatorDel
func start() { }
func toPresentable() -> UIViewController {
VectorHostingController(rootView: TimelinePollView(viewModel: viewModel.context),
forceZeroSafeAreaInsets: true)
VectorHostingController(rootView: TimelinePollView(viewModel: viewModel.context))
}
func canEndPoll() -> Bool {
@@ -26,13 +26,13 @@ class TimelinePollProvider {
/// Create or retrieve the poll timeline coordinator for this event and return
/// a view to be displayed in the timeline
func buildTimelinePollViewForEvent(_ event: MXEvent) -> UIView? {
func buildTimelinePollVCForEvent(_ event: MXEvent) -> UIViewController? {
guard let session = session, let room = session.room(withRoomId: event.roomId) else {
return nil
}
if let coordinator = coordinatorsForEventIdentifiers[event.eventId] {
return coordinator.toPresentable().view
return coordinator.toPresentable()
}
let parameters = TimelinePollCoordinatorParameters(session: session, room: room, pollStartEvent: event)
@@ -42,7 +42,7 @@ class TimelinePollProvider {
coordinatorsForEventIdentifiers[event.eventId] = coordinator
return coordinator.toPresentable().view
return coordinator.toPresentable()
}
/// Retrieve the poll timeline coordinator for the given event or nil if it hasn't been created yet