You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In obj-c properties are syntactic sugar over setFoo:getFoo methods, but in Swift they are closer to ivars (at least from my knowledge). Is there any way to route them as well?
The text was updated successfully, but these errors were encountered:
@garnett
Well… actually, setters and getters are shared between all instances of a class in Swift. They look like:
constintfoo_offset=0x48;
intgetFoo(void*self)
{
return*(uinptr_t*)(self+foo_offset);
}
voidsetFoo(intnew_value, void*self)
{
// there will be release/retain for non-scalar types // ...*(uintptr_t*)(self+foo_offset) =new_value;
}
I don't know how can we hook setters/getters for only instance of the class…
So far I only have a way to obtain a shared setter/getter address, but it kinda useless.
rodionovd
changed the title
Property routing support?
Swift property routing support?
Jun 22, 2014
In obj-c properties are syntactic sugar over
setFoo:
getFoo
methods, but in Swift they are closer to ivars (at least from my knowledge). Is there any way to route them as well?The text was updated successfully, but these errors were encountered: