Documentation
¶
Overview ¶
Package objcbridge contains small Objective-C runtime helpers.
Index ¶
- func AddMethods(cls objc.Class, className string, methods []objc.MethodDef) error
- func ProtocolsByName(names ...string) []*objc.Protocol
- func RequiredProtocolsByName(names ...string) ([]*objc.Protocol, error)
- type BlockInvoker
- func (r *BlockInvoker) BoolError(block objc.ID, value bool, errID objc.ID) error
- func (r *BlockInvoker) Error(block objc.ID, errID objc.ID) error
- func (r *BlockInvoker) Object(block objc.ID, object objc.ID) error
- func (r *BlockInvoker) ObjectError(block objc.ID, object objc.ID, errID objc.ID) error
- func (r *BlockInvoker) ObjectObject(block objc.ID, a objc.ID, b objc.ID) error
- func (r *BlockInvoker) ObjectObjectError(block objc.ID, a objc.ID, b objc.ID, errID objc.ID) error
- func (r *BlockInvoker) Uint(block objc.ID, value uint) error
- func (r *BlockInvoker) Uint64Error(block objc.ID, value uint64, errID objc.ID) error
- func (r *BlockInvoker) UintptrError(block objc.ID, value uintptr, errID objc.ID) error
- func (r *BlockInvoker) Void(block objc.ID) error
- type BlockShims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMethods ¶
AddMethods installs methods on cls using purego callbacks.
func ProtocolsByName ¶
ProtocolsByName resolves Objective-C protocols, skipping protocols not present on the running system.
Types ¶
type BlockInvoker ¶
type BlockInvoker struct {
// contains filtered or unexported fields
}
BlockInvoker invokes Objective-C blocks with known signatures.
If a typed shim is linked into the process, BlockInvoker uses that bridge; otherwise it falls back to the block's invoke pointer. Its methods return an error when block is nil or when the fallback invoke pointer cannot be resolved.
func NewBlockInvoker ¶
func NewBlockInvoker() *BlockInvoker
NewBlockInvoker returns a block invoker with no linked shim names.
func NewBlockInvokerWithShims ¶
func NewBlockInvokerWithShims(shims BlockShims) *BlockInvoker
NewBlockInvokerWithShims returns a block invoker that prefers linked typed shims when they are present.
func (*BlockInvoker) ObjectError ¶
ObjectError invokes block(object, err).
func (*BlockInvoker) ObjectObject ¶
ObjectObject invokes block(a, b).
func (*BlockInvoker) ObjectObjectError ¶
ObjectObjectError invokes block(a, b, err).
func (*BlockInvoker) Uint ¶
func (r *BlockInvoker) Uint(block objc.ID, value uint) error
Uint invokes block(value).
func (*BlockInvoker) Uint64Error ¶
Uint64Error invokes block(value, err).
func (*BlockInvoker) UintptrError ¶
UintptrError invokes block(value, err).