Swift closure isn't allowed to capture context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi guys,

Recently I was trying to use pjsip stack libraries in an iOS project which uses Swift language, but I have noticed
a thing which makes library hard to use. C function pointers are translated into Swift closures, a special type of closure. The problem is 
that Swift doesn’t allow to capture context (self) in this type of closure. Looking into the source code of pjsip libs convinced me that
pjsip callbacks don’t have a parameter for referencing context. I’m not a C specialist but this seems to me at least not ok.

I’m addressing the developers who used library in Swift projects, how did you handle this situation ?



Best regards,
Stefan




_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org




[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux