This highly improves interop with Swift. It would map all pointers as implicitly unwrapped optionals, which skip all null safety checks. Adding `_Nullable` to pointer types makes swift map them as optionals. Also constructors are now nullable since it's valid to return nil from Go code. Change-Id: If0506bb80f31bf36f11522c16a1e66d77be935f8 GitHub-Last-Rev: bd6c30f7f50ef5ea5797b07073f0a4a70d545025 GitHub-Pull-Request: golang/mobile#26 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/159477 Run-TryBot: Elias Naur <mail@eliasnaur.com> Reviewed-by: Elias Naur <mail@eliasnaur.com>
78 lines
1.3 KiB
Plaintext
78 lines
1.3 KiB
Plaintext
// Objective-C API for talking to vars Go package.
|
|
// gobind -lang=objc vars
|
|
//
|
|
// File is generated by gobind. Do not edit.
|
|
|
|
#ifndef __Vars_H__
|
|
#define __Vars_H__
|
|
|
|
@import Foundation;
|
|
#include "ref.h"
|
|
#include "Universe.objc.h"
|
|
|
|
|
|
@class VarsS;
|
|
@protocol VarsI;
|
|
@class VarsI;
|
|
|
|
@protocol VarsI <NSObject>
|
|
@end
|
|
|
|
@interface VarsS : NSObject <goSeqRefInterface, VarsI> {
|
|
}
|
|
@property(strong, readonly) id _ref;
|
|
|
|
- (nonnull instancetype)initWithRef:(id)ref;
|
|
- (nonnull instancetype)init;
|
|
@end
|
|
|
|
@interface Vars : NSObject
|
|
+ (BOOL) aBool;
|
|
+ (void) setABool:(BOOL)v;
|
|
|
|
+ (double) aFloat;
|
|
+ (void) setAFloat:(double)v;
|
|
|
|
+ (float) aFloat32;
|
|
+ (void) setAFloat32:(float)v;
|
|
|
|
+ (double) aFloat64;
|
|
+ (void) setAFloat64:(double)v;
|
|
|
|
+ (NSString* _Nonnull) aString;
|
|
+ (void) setAString:(NSString* _Nonnull)v;
|
|
|
|
+ (VarsS* _Nullable) aStructPtr;
|
|
+ (void) setAStructPtr:(VarsS* _Nullable)v;
|
|
|
|
+ (long) anInt;
|
|
+ (void) setAnInt:(long)v;
|
|
|
|
+ (int16_t) anInt16;
|
|
+ (void) setAnInt16:(int16_t)v;
|
|
|
|
+ (int32_t) anInt32;
|
|
+ (void) setAnInt32:(int32_t)v;
|
|
|
|
+ (int64_t) anInt64;
|
|
+ (void) setAnInt64:(int64_t)v;
|
|
|
|
+ (int8_t) anInt8;
|
|
+ (void) setAnInt8:(int8_t)v;
|
|
|
|
+ (id<VarsI> _Nullable) anInterface;
|
|
+ (void) setAnInterface:(id<VarsI> _Nullable)v;
|
|
|
|
@end
|
|
|
|
@class VarsI;
|
|
|
|
@interface VarsI : NSObject <goSeqRefInterface, VarsI> {
|
|
}
|
|
@property(strong, readonly) id _ref;
|
|
|
|
- (instancetype)initWithRef:(id)ref;
|
|
@end
|
|
|
|
#endif
|