objc2swift icon indicating copy to clipboard operation
objc2swift copied to clipboard

Modern C struct support is missing

Open CodingMarkus opened this issue 9 months ago • 0 comments

E.g. this is valid Obj-C code

typedef struct {
    time_t time;
    size_t bytes;
} SessionLimits;

// ....

return (SessionLimits){
    .time = someValue
    .bytes = someOtherVAlue
};

This would translate to

import Darwin

struct SessionLimits {
     var time: time_t
     var bytes: size_t
}

// ...

return SessionLimits(time: someValue, bytes: someOtherValue)

in Swift.

CodingMarkus avatar Mar 23 '25 01:03 CodingMarkus