如何使用xcode构建xcframework

People build frameworks to help the community by building useful blocks of code and distribute it to others so they can use it directly without having to rewrite all that logic again.

人们通过构建有用的代码块来构建框架来帮助社区,并将其分发给其他人,这样他们就可以直接使用它,而无需再次重写所有逻辑。

It is very useful in the software industry, you can always rely on others and open source libraries/frameworks that other have invested a great time perfecting & testing for other to use, and we as software engineers we should leverage that when it is convenient for us.

它在软件行业中非常有用,您可以始终依靠他人以及他人投入大量时间进行完善和测试以供他人使用的开源库/框架,并且作为软件工程师,我们应该在方便的时候利用它我们。

In large teams, people build frameworks to modularize the work which helps large teams to split up the work and smaller teams can work in isolation. Also to be able to reuse the same component/framework in different apps within the company without having to rewrite or copy/paste that code from a place to place.

在大型团队中,人们建立框架以使工作模块化,这有助于大型团队拆分工作,而较小的团队可以孤立地工作。 同样,能够在公司内的不同应用程序中重用相同的组件/框架,而不必从一个地方重写或复制/粘贴该代码。

In this article I’ll cover how you can build your framework and test it using xcode.

在本文中,我将介绍如何构建框架并使用xcode测试框架。

创建框架源代码 (Create the Framework source code)

This article is written and tested by xcode Version 11.4.1 (11E503a).

本文是由xcode版本11.4.1(11E503a)编写和测试的。

Open xcode and start with a framework project.

打开xcode并从框架项目开始。

Image for post

I’ll name mine FruitBasket, you can choose whatever you want, and I’ll save it to my desktop so I can easily access it later when I’m building the xcframework.

我将其命名为FruitBasket ,您可以选择任何内容,并将其保存到桌面上,以便以后在构建xcframework时可以轻松访问。

Image for post

What is FruitBasket? It is a silly example I made for this article it is basically a basket of fruits and we should be able to add fruits to it and the basket should tell us how many fruits are in there and what are they. Quite fun, isn’t it?

什么是FruitBasket ? 这是我为本文编写的一个愚蠢的示例,它基本上是一篮水果,我们应该能够向其中添加水果,并且该篮应该告诉我们其中有多少种水果,它们是什么。 很好玩,不是吗?

I’ll start by adding a swift file to contain simple enum for a number of fruits to use, I’ll name that file fruit.

我将从添加一个快速文件开始,以包含要使用的多种水果的简单枚举,然后将其命名为水果。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值