Search code examples
iosswiftuser-interfacemultipeer-connectivityjsqmessagesviewcontroller

How to implement JSQViewController UI with MultipeerConnectivity Framework?


I have a fully functional Multipeer Connectivity app that allows me to browse the connected devices via Bluetooth and wifi, I have tried to implement the JSQViewController UI by installing the pod and creating a bridging-header.h file to import and thus, I have been able to create the UI with no problem whatsoever but the Multipeer Connectivity framework seems to not be working.

In the JSQViewController UI which includes the standard "send" button, it has been nearly impossible to create the "browse" button for the Multipeer Connectivity Framework that segues into a UITableView to connect with (an)other device(s). How best should I approach this in my view controller file? How would I subclass the class that has my Multipeer Connectivity Framework and my JSQViewController import in another class + file ?

Any suggestions on what should be done? I've searched everywhere and have done quite a few tutorials in relation to this and have found myself stumped.


Solution

  • I thing you are doing to much. When adding the JSQMessagesViewController to your project you do not need a bridging bridging-header.h it should not be added in that. If you look at the getting started guide there is a Swift example in the project itself.

     `Swift Example can be found in the SwiftExample folder just open the SwiftExample.xcworkspace.
    

    Run pod install first.`

    its a good example on how to implement JSQ in a swift project.

    Once you have that set up and running looking into overwriting the toolbar to allow you to have a browse should be easier. Let me know when you have gotten to that point and ask any related toolbar button questions and I will try to answer them for you.

    Hope that helps let me know if I can do anything else. 👽