React Native 中的“自动售货"是什么? [英] What is 'vending' in React Native?

查看:45
本文介绍了React Native 中的“自动售货"是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在阅读了一些 React Native 文档后,我想知道术语vend"从何而来.任何人都可以阐明vend"的词源,或者该词是否可以从比文档中给出的程序定义更广泛的定义中受益(这个来自 React Native iOS 文档):

After reading through some of the React Native docs I was left wondering where the term 'vend' comes from. Can anyone elucidate the etymology of 'vend' or whether the word could benefit from a more expansive definition than the procedural one given in the docs (this one is from the React Native iOS docs):

出售视图很简单:

  • 创建基本子类.
  • 添加 RCT_EXPORT_MODULE() 标记宏.
  • 实现 -(UIView *)view 方法

推荐答案

在这种情况下,vend 是 'serve' 的同义词.尝试用 'serve' 替换每个 'vend' 实例,它应该对您有意义.

In this case, vend is synonymous with 'serve'. Try replacing each instance of 'vend' with 'serve' and it should make sense to you.

关键是让 RCTMapManager 成为它提供的所有视图的委托,并且...

The key is to make the RCTMapManager a delegate for all the views it vends, and...

.

您可以看到我们将管理器设置为它提供的每个视图的代理,然后...

You can see we're setting the manager as the delegate for every view that it vends, then...

.

这些子类在功能上与视图控制器相似,但本质上是单例的——桥接器只创建了每个子类的一个实例.他们将本机视图提供给 RCTUIManager,后者...

These subclasses are similar in function to view controllers, but are essentially singletons - only one instance of each is created by the bridge. They vend native views to the RCTUIManager, which...

这篇关于React Native 中的“自动售货"是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆