Search code examples
swiftios8jsqmessagesviewcontroller

JSQMessagesViewController in half screen ios swift


I am going to create chat app using ios native sdk (Swift) and i found JSQMessagesViewController for chatting.

Can I use it in my app and apple will allow this? Also I have inherited JSQMessagesViewController in my viewController.

I have used NavigationController also in the viewController.

When I open the viewController it open in full screen but i need it half screen. Can anyone help me ?

Thanks


Solution

  • Yes you can. Set up a container view that takes up half the screen and create a custom subclass that uses JSQMessagesViewController for the container view.

    Make sure that you have appropriate constraints set up such that the container view only takes up half the screen and the other half contains whatever view elements you want.