-
-
Notifications
You must be signed in to change notification settings - Fork 10
Question #73
Comments
Hey @h36ahmed, Questions are awesome, you can't learn new things without asking a few questions :)
Hope that answers your questions, curious to know how it goes, best of luck! Cheers! |
Thank you for replying. All are great answers! for 2nd question, is it possible for you guys to implement a similar function as below if you create view controller in storyboard:
What essentially I am doing is having a view in storyboard and then adding view of my child controller inside the view that i constrained in storyboard. This way the autolayout takes care of different screen sizes. If I were to use your library, I have to supply static height which would not be ideal for different screen sizes, right? |
So having an extra parameter, |
Hey @h36ahmed, you should already have these kinds of methods on As for The algorithm works in different ways for different types of views. If you have a class that inherits from scroll view, then the content size of the scroll view will determine the height of the view and render it correctly in linear-order. If the content size is larger than the viewport, the size of the view will never exceed it but rather scroll the scroll view by proxy to retain proper dequeuing for table and collection views. Views that don't have a content size will use the view's frame as the source of truth to know what height to use. So the container view controller does not have to know how large the view should be and will respond to updates to those frames using observers. Using different sizes on different phone sizes (at least for widths and so on) will be handled by the parent giving the children their sizes, and the parent uses auto layout constraints. Would you mind making an example project and point me in the right direction so that I can grasp the current situation more clearly, then I might be able to come up with a feasible solution to the issue. Also, pull requests for adding new functionality is always welcome, as long as the changes are inline with the direction of the project. Cheers! |
@h36ahmed ping pong 🏓 |
@h36ahmed any updates here? |
Closing this due to lack of activity. Feel free to re-open the issue if it is still relevant later. |
Hey man, sorry for the late reply, been busy but I have used a custom solution for now that works but I am sure if I were to use your library, it would be far more simple. But thanks for replying! |
Hi, this is not an issue but more of a question of how to use your library.
I have a view controller built in storyboard and it has multiple views that require their own controller. However, because I don't know how to set child view controller properly, I have one massive view controller managing three different views.
I find this library very useful in terms of separating three views into separate view controllers and having a parent controller.
FamilyViewController
as subclass of my parent controller that is built in storyboard?view1 = viewController1.view
when I do addaddChild(viewController1)
?The text was updated successfully, but these errors were encountered: