When creating a room I can't set the roomOptions.

edited March 2017 in Native
I have a IOS Swift client with photon cloud.

When I do this in connectionReturn:

let roomOptions = EGMutableRoomOptions()
roomOptions.isVisible = false

NetworkLogic?.client.opJoinOrCreateRoom("roomID", roomOptions)

The room gets created with the property .isVisible = true. Am i creating and using the EGMutableRoomOptions object correctly?

Note: After the room gets created I can change the property .isVisible to false.


Best Answer


  • Hi @GreenRollingHills.

    I can not reproduce your issue. I have run 2 instances of demo_loadBalancing_swift from our latest Client SDK, without any modifications except for setting a valid app ID and the room created by one instance was visible by the other instance. Afterwards I have added your code from this post to func createRoom() and one client was no longer able to see room created by the other instance, so this works as expected.
    Note that it is
    roomOptions.IsVisible = false
    starting with an upper case I and not
    roomOptions.isVisible = false
    like in your post.
  • HI @Kaiserludi

    Thanks for your response. In my app when I try

    roomOptions.IsVisible = false

    with a capital I vs. lower case i my compiler gives me an error. It states "IsVisible has been renamed to isVisible". I am using Xcode 8.2.1 with Swift 3.0.2.

    Note: after I create the room I do:

    networkLogic?.client.currentlyJoinedRoom.isVisible = false

    and this works. Note the lower case i vs. uppercase I.

    So, I think my error is elsewhere. I'll keep looking and I'll try the demo again.
  • Update:
    OK - it seems like Swift 3 really treats all properties as if their names would start with a lower case character, even if those properties belong to an objC API which defines them as upper case. The same for member functions and basically everything else.
    I wonder what Swift does, when that objC API contains two identifiers of the same name that just differ in case...
Sign In or Register to comment.