Hi
I've been reading "Using Swift with Cocoa and Objective-C" on how to import C header files in Swift.
Now I've imported a C header file in Swift using Xcode 6.4. All structs from the C header file have been imported fine using the bridging header except one which is missing a field of type union.
The struct in the C header file looks something like this:
typedef struct Foo {
int a;
int b;
union {
Astruct aaa;
AnotherStruct bbb;
}
} Foo;
The Foo-struct in Swift contains 'a' and 'b' but I cannot see 'aaa' and 'bbb'. So my question is how to I access fields in a union from Swift? Do I need to write a wrapper in either Objective-C or in C?
Here's a link to the actual struct I'm trying to import (TTMessage): https://github.com/BearWare/TeamTalk5/blob/master/TeamTalk_DLL/TeamTalk.h#L2743
Kind regards
-- Bjoern