Skip to content

Repository used to keep a compatible Objective-C bindings generation with D.

Notifications You must be signed in to change notification settings

MrcSnm/D-objective-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

D-objective-c

Repository used to keep a compatible Objective-C bindings generation with D.

Objective-C strings

NSLog("abcd".ns);

Objective-C Number

5.ns

Objective-C Blocks

Thanks to @jacob-carlborg, we now have support to passing D delegates to Objective-C code. For further information, this was supposed to be located in the D runtime, but it didn't made unfortunately. Nevertheless, it was a great project and further makes this binding possible!

extern(C) void foo(Block!()* block);
void main()
{
    // The `block` function is used to initialize an instance of `Block`.
    // A delegate will be passed to the `block` function which will be the
    // body of the block.
    auto b = block({ writeln("foo"); });
    foo(&b);
}

Creating Objective-C dictionaries in D

NSMutableDictionaryD a = ["hello": 5].ns;

About

Repository used to keep a compatible Objective-C bindings generation with D.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages