1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

table: TypeCategory; freetype: remove C code; [typedef] C structs;

Objective-C interfaces
This commit is contained in:
Alexander Medvednikov
2019-08-20 14:34:29 +03:00
parent c8da79d785
commit eb5fcafa77
8 changed files with 247 additions and 213 deletions

22
vlib/darwin/darwin.v Normal file
View File

@ -0,0 +1,22 @@
module darwin
#include <Cocoa/Cocoa.h>
#flag -framework Cocoa
struct C.NSString { }
// macOS and iOS helpers
fn nsstring(s string) *NSString {
// #return @"" ;
// println('ns $s len=$s.len')
# return [ [ NSString alloc ] initWithBytesNoCopy:s.str length:s.len
# encoding:NSUTF8StringEncoding freeWhenDone: false];
return 0
//ns := C.alloc_NSString()
//return ns.initWithBytesNoCopy(s.str, length: s.len,
//encoding: NSUTF8StringEncoding, freeWhenDone: false)
}