client name and listening to events

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

intomo
Posts: 51
Joined: 22 Nov 2010, 21:21
Location: Los Angeles

client name and listening to events

Postby intomo » 01 Dec 2021, 22:54

Is there any problem with giving clients integer custom names? I seem to remember all names had to begin with a letter, or am I mistaken?
Also, in Swift is there a way to selectively listen to events? I remember in Obj-C we used to have to import specific events in order to receive them. Is there a way to prohibit listening to specific events on specific clients?
Thanks in advance.
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: client name and listening to events

Postby Lapo » 02 Dec 2021, 10:23

Hi,
user names can use any character, there are no limitations, besides being unique.

Also, in Swift is there a way to selectively listen to events? I remember in Obj-C we used to have to import specific events in order to receive them. Is there a way to prohibit listening to specific events on specific clients?


Clients are compiled binaries so, as the developer, you get to decide which events you want to listen to and which you don't want.
It's not entirely clear what do you mean by "prohibit listening"... Maybe you can give us an example to clarify?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
intomo
Posts: 51
Joined: 22 Nov 2010, 21:21
Location: Los Angeles

Re: client name and listening to events

Postby intomo » 14 Dec 2021, 18:06

In AS or JS I would addEventListener for specific events on a case by case basis. Is there no way to do this in Swift/Objective-C? Thanks.
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: client name and listening to events

Postby Lapo » 15 Dec 2021, 19:33

Hi,
no the Objective-C API work in a more Apple-like fashion where you have a Protocol with a number of methods that can be implemented to handle specific events.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 26 guests