Bridge Object

Any C++ class in cross-platform part of your project can be automatically bridged to other languages to expose it to UI code written in ObjC, Swift or Java. Just derive your class from scapix::bridge::object:

#include <scapix/bridge/object.h>

class user_info : public scapix::bridge::object<user_info>
{
public:
    //...
};

scapix::bridge::object is derived from std::enable_shared_from_this, and lifetime of bridged objects should always be managed by std::shared_ptr / std::weak_ptr:

void create()
{
    auto u1 = std::make_shared<user_info>(); // Ok
    auto u2 = std::shared_ptr(new user_info); // Ok
    user_info u3; // Wrong!!!
}