What's up everyone I'm Nick welcome to the SwiftUI bootcamp I am super excited to share this first video with you guys
大家好吗?我是尼克,欢迎来到SwiftUI训练营,我非常兴奋能在这个视频中与你们分享第一个视频。
in this video, We are going to look at Xcode Xcode is the software tool that we're going to do all of our coding inside
我们将看看Xcode Xcode是我们将在其中完成所有编码的软件工具
So as an iOS developer you're going to end up spending most if not all of your time in Xcode
所以作为一个iOS开发者,你最终会把大部分时间花在Xcode上
So it's really important to get a good comfortable understanding of how Xcode works
因此,充分理解Xcode的工作原理非常重要
Understand the layout and where all the tools and buttons are
了解布局以及所有工具和按钮的位置
Now of course Xcode has a ton of features most of which we're not going to use
当然,Xcode有很多特性,其中大部分我们不会使用。
But in this video we're going to cover some of the basics that we're going to use in pretty much every video in this course
但是在这个视频中,我们将涵盖一些基础知识,我们将在本课程的几乎每个视频中使用
So it's going to be a whole lot of fun
所以这将会非常有趣
I'm going to first show you guys how to download Xcode if you don't have it already and then we're going to set up our first Xcode project
我将首先向你们展示如何下载Xcode,如果你们还没有的话,然后我们将建立我们的第一个Xcode项目
So there's not going to be any coding in this video you can sit back and relax
所以这个视频中不会有任何编码,你可以坐下来放松。
But there are going to be a lot of really useful tools and tips that I think you guys will benefit from
但是会有很多非常有用的工具和技巧,我认为你们会从中受益。
So with that said welcome again to the SwiftUI bootcamp
所以说欢迎再次来到SwiftUI训练营
Thank you guys for watching hope you learned something from this video and let's get into it
谢谢你们的收看,希望你们从这个视频中学到了一些东西,让我们开始吧。
So if you don't have Xcode already on your computer
因此,如果您的计算机上还没有Xcode
It's actually super easy to download just open up the app store on your Mac and search for Xcode
它实际上非常容易下载,只需在Mac上打开应用商店并搜索Xcode
And it should come up probably the first result you can see here
你可以在这里看到第一个结果。
Xcode is developed by Apple. It's the number one tool for developing iOS applications
Xcode由苹果公司开发,是开发iOS应用程序的首选工具
It is the recommended tool and I would say almost all iOS developers use Xcode
这是推荐的工具,我想说几乎所有iOS开发人员都使用Xcode
So it's something that you're going to get very comfortable using if you're going to become an iOS developer
所以如果你想成为一名iOS开发者,你会非常习惯地使用它
It's also free to download which is awesome
它也可以免费下载,这太棒了。
So go ahead and click that install or download button if you don't have it already installed
所以如果你还没有安装,请点击安装或下载按钮。
And the download probably is going to take a couple minutes if not like an hour. It's a pretty big file
下载可能需要几分钟,如果不是一个小时的话。这是一个相当大的文件。
So you might have to pause this video and come on back
所以你可能需要暂停这个视频,然后回来。
Before we leave this page
在我们离开这一页之前
I just want to take a quick note that I'm going to be using version 12.3 for this course
我只是想采取一个快速的笔记我将使用版本12.3为本课程
And as long as you have version 12.0 or higher you should be fine
只要你有12.0或更高版本,你应该没问题。
But if you have an old version I would recommend moving that version to the trash and then installing the new version of Xcode
但如果您有旧版本,我建议将该版本移至垃圾箱,然后安装新版本的Xcode
And when we click on version history here
当我们点击历史版本
We can see that Apple's releasing a new version of Xcode about once every month and in each of these new versions
我们可以看到Apple大约每月发布一次新版本的Xcode,并且在每个新版本中
They're fixing bugs, but they're also adding a lot of really cool new features
他们在修复bug的同时也加入了很多很酷的新功能
And that that's why I'm recommending you to use at least version 12.0
这就是为什么我建议您至少使用12.0版本
Because in version 12.0 they added a lot of really cool new features for Swift UI that we're going to use in this course
因为在12.0版中,他们为我们将在本课程中使用的Swift UI添加了许多非常酷的新功能
So again, just make sure you have version 12.0 or higher
所以,请确保您拥有12.0或更高版本
Go ahead and download Xcode and
继续下载Xcode和
Once you have it downloaded, let's go ahead and open up our first project
一旦你下载了它,让我们继续打开我们的第一个项目。
Open up Xcode and we are going to create a new Xcode project
打开Xcode,我们将创建一个新的Xcode项目
So when we get to the screen it's basically asking us what kind of project do we want to make and
所以当我们看到屏幕时,它基本上是在问我们想做什么样的项目
Some of these options are really cool. We can make a regular app
其中一些选项真的很酷。我们可以制作一个常规应用程序
We can make a game we can make an augmented reality app or iMessage app and when we click one of these
我们可以制作一个游戏,我们可以制作一个增强现实应用程序或iMessage应用程序,当我们点击其中一个时
It's basically just going to give us a starter template for that type of app and you'll notice at the top here
它基本上只是给我们一个该类型应用程序的入门模板,你会注意到在顶部
We also have these tabs. So for the iOS tab
我们还有这些标签。所以对于iOS标签
This means we can make an app to be deployed on iOS
这意味着我们可以制作一个应用程序部署在iOS
iOS supports the iPhone as well as the iPad
iOS支持iPhone以及iPad
But if we wanted to click the Mac OS we can then make apps for the Mac as well as the Apple Watch and the Apple TV
但如果我们想点击Mac OS,我们可以为Mac以及Apple Watch和Apple TV制作应用程序
And the really cool feature Xcode now has is a multi-platform and here we can make a single code base
Xcode现在非常酷的功能是多平台,在这里我们可以制作一个单一的代码库
You can make a single app that can be deployed on multiple operating systems
您可以制作可以部署在多个操作系统上的单个应用程序
So we can make an app and then use the same app for iOS as well as macOS as well as watch OS and that's really powerful
所以我们可以制作一个应用程序,然后将相同的应用程序用于iOS以及macOS和watch OS,这非常强大
But in this course we are just doing the basics
但在这门课中,我们只是做基础
So let's just keep an iOS app and we're just going to create a regular app for today
所以让我们保留一个iOS的应用程序,我们将为今天创建一个常规应用程序
Go ahead and click next and
继续并单击下一步
Then it's going to ask for some extra details about this project
然后它会询问一些关于这个项目的额外细节
First it's asking for a project name. This is basically the title of our app
首先它要求一个项目名称。这基本上是我们应用程序的标题
It's also going to be the name of the folder where the app is saved
它也将是保存应用程序的文件夹的名称
So I'm going to call this Swiftful thinking bootcamp
所以我把这个叫做敏捷思维训练营。
But you can call it whatever you want to call it and then it's going to ask us for a team
但你想怎么称呼它都行然后它会要求我们组建一个团队
Now we can leave this as a none for now if this is the first time you're opening Xcode
如果这是您第一次打开Xcode,现在我们可以暂时将其保留为无
It will say none
它会说没有
But as you get more into iOS development and if you ever want to push this app to say the app store
但是随着你越来越投入iOS开发,如果你想推动这个应用程序,比如应用商店
You will need to have a development team here and that's basically just an Apple developer account
您需要在这里拥有一个开发团队,这基本上只是一个Apple开发者帐户
It is free to make a personal account and if you want a professional account
它是免费的使个人帐户和如果你想要一个专业的帐户
It is $99 per year through Apple and a professional account basically lets you actually put apps into the app store
通过Apple,每年99美元,专业账户可以让你将应用放入应用商店。
So for right now let's just leave this as none and then it's going to ask us for an organization identifier
所以现在让我们把它作为没有,然后它会要求我们提供一个组织标识符
Again because this app is not going into the app store. It's not very relevant
再次因为这个应用程序不会进入应用程序商店。这不是很相关
But the standard approach to making an organization identifier is to do calm dot and then the name of your organization
但是制作组织标识符的标准方法是做平静点,然后是你组织的名称
Or the name of your company or the name of your team or whatever you want to call it
或者你公司的名字或者你团队的名字随便你怎么称呼它
So I'm just going to leave this as my organization as a template for you guys
所以我将把这个作为我的组织作为你们的模板
and, Then it's going to create a bundle identifier and you can see here that this is basically just the organization identifier
然后它将创建一个包标识符,您可以在这里看到这基本上只是组织标识符
Dot and then the name of your app and the bundle identifier is basically a unique key for this app
点,然后你的应用程序的名称和捆绑标识符基本上是这个应用程序的唯一键
So that if we put this app into the app store we could reference this key
所以如果我们把这个应用放到应用商店我们可以引用这个密钥
But of course, we're not putting this into the app store
当然,我们不会把它放到应用商店里。
So it's kind of irrelevant for now
所以这暂时无关紧要
But one thing I want to point out here is that because the title of Prague name is included in the bundle identifier
但有一点我想在这里指出的是,因为布拉格名称的标题包含在捆绑标识符中
I would recommend not putting any special characters or spaces in your product name
我建议不要在您的产品名称中添加任何特殊字符或空格
So you can see here if I put a space
所以你可以看到如果我在这里放一个空格
in Swiffle thinking space boot camp
旋转思维太空新兵训练营
The bundle identifier will update but it will be a dash while my Prague name is a space
捆绑标识符将更新,但它将是破折号,而我的布拉格名称是空格并且
and That could get confusing down the line for some weird reason and to just avoid any issues like that
出于某种奇怪的原因,为了避免这样的问题,这可能会让人困惑
I would recommend not using any special characters or spaces in the product name. So calm. Your organization dot product name
我建议不要在产品名称中使用任何特殊字符或空格。如此冷静。您的组织点产品名称
And then lastly it's going to ask us for a couple setup options for this file
最后,它会要求我们为这个文件提供几个设置选项。
We want to make sure the interface is Swift UI the life cycle is a Swift UI app and the language of course is Swift
我们要确保界面是Swift UI,生命周期是Swift UI应用程序,语言当然是Swift
In this beginner project, we're not going to use core data and we're not going to need tests
在这个初级项目中,我们不会使用核心数据,也不需要测试
So we can leave all this unchecked and let's go ahead and click next
所以我们可以不检查所有这些,让我们继续点击下一步
It's then going to ask us where we want to save our project and you can save it wherever you want on your computer
然后它会询问我们要将我们的项目保存在哪里,您可以将其保存在计算机上任何您想要的位置
So go ahead and find that file and then click create
所以继续找到那个文件,然后点击创建
All right, so we are now inside our very first Xcode project and
好的,所以我们现在在我们的第一个Xcode项目中
Immediately it's going to say automatic preview updating paused
马上就会说自动预览更新暂停了
Let's click that resume button on the right side there so we can get the preview connected
让我们点击右边的恢复按钮,这样我们就可以连接预览。
Give it a second to load and you should see an iPod touch on the right side
给它一秒钟加载,您应该会在右侧看到一个iPod touch
I want to quickly change this preview device from an iPod touch to an iPhone
我想快速地把这个预览设备从iPod touch换成iPhone
So I can do that by at the top here we have all the device options and
所以我可以在顶部这样做,我们有所有的设备选项和
I'm going to select the iPhone 12
我要选择12iPhone
So now we can see an iPhone 12 on the right side and I'm going to zoom out using the the magnifying glass at the bottom
现在我们可以看到右边的iPhone12,我要用底部的放大镜缩小
All right now I want to take you guys through some of the basics of Xcode and first we have the project navigator
好的,现在我想带你们了解一些Xcode的基础知识,首先我们有项目导航器。
And that's this column on the left side here and if I click this button on the top left hide or show the navigator
这是左边的这一栏,如果我点击左上角的这个按钮,隐藏或显示导航器。
We can actually hide and show that whole column
我们可以隐藏并显示整列数据。
But looking at this column this is basically all of the files within our application
但是看这一列,这基本上是我们应用程序中的所有文件
So right now we're clicking on the content view and that's this file right here in the center
所以现在我们点击内容视图,就是中间的这个文件。
So this section in the middle is the current file that we're working in so right now it is the content view dot swift
所以中间的这一部分是我们正在处理的当前文件,所以现在它是内容视图点swft
Then within content view dot swift there is a preview provider and you can see that here at the bottom and because there's a preview provider
然后在内容视图点swft中有一个预览提供程序,您可以在底部看到它,因为有一个预览提供程序
It's also giving us a preview of that file on the right side
它还让我们预览了右侧的文件。
So right now this device right here is previewing the file on the left side and you can see that it says text hello world
所以现在这个设备正在这里预览左侧的文件,你可以看到它说文本hello world
That's like the template text that when you start a file and our app on the right side says hello world and
这就像模板文本,当您启动文件时,我们右侧的应用程序会显示hello world和
This right here is the one of the most powerful parts of Swift UI we can see in real time
这是我们可以实时看到的Swift UI中最强大的部分之一
What our code does to the device and this is super powerful and we'll save you as a developer so much time
我们的代码对设备所做的事情,这是超级强大的,我们将为您作为开发人员节省大量时间
Because we can just code and see in real time how it affects the screen
因为我们可以通过编码来实时观察它是如何影响屏幕的
So for example if I change hello world to hello everyone
例如,如果我将hello world更改为hello大家好
We can see that the preview updates automatically now this might not seem that special
我们可以看到预览现在自动更新,这可能看起来没那么特别。
But if you've coded before if you used other software applications
但是如果您以前使用过其他软件应用程序
Usually you have to build and run your whole project before you can see the update
通常您必须构建和运行整个项目才能看到更新
So by having this preview it just saves us so much time and helps us debug and make beautiful screens so much easier
所以通过这个预览,它为我们节省了很多时间,帮助我们调试,让漂亮的屏幕变得更加容易。
And on the right side here we have the inspector and again that button in the top right corner
在右边,我们有检查员,还有右上角的按钮。
Can show and hide the inspector and
可以显示和隐藏检查员和
Basically this gives us options on whatever we were clicked on in our file
基本上,这为我们在文件中点击的任何内容提供了选项
So right now I'm clicked on text and
所以现在我点击了短信
Here it's giving us all of the options for our text so we could change the text font to title
在这里,它为我们提供了文本的所有选项,因此我们可以将文本字体更改为标题
And you can see here in the preview that it automatically gets updated to title
你可以在预览中看到它会自动更新为标题。
Now I want you guys to notice that when we change the font on the right side
现在我想让你们注意当我们改变右边的字体时
It also added the font title into the file and the reason I'm pointing this out is because as we start actually developing
它还将字体标题添加到文件中,我指出这一点的原因是因为当我们开始实际开发时
Most of the time I'm just going to start typing here dot font dot title
大多数时候,我只是要开始在这里输入点字体点标题
I wouldn't actually use the inspector on the right side
我不会在右边使用检查员
But of course the inspector is really good when you're just getting started and you're not sure what options you might have
但是当然,检查员真的很好,当你刚开始的时候,你不确定你可能有什么选择。
So we could change the weight. This is the thickness and we're gonna get into some of these modifiers later
所以我们可以改变重量。这是厚度,我们稍后会讨论一些修饰剂。
But I just wanted to show you guys in this file here that you could type out modifiers or you can use the inspector on the right side
但我只是想在这个文件中向你们展示,你们可以键入修饰符,或者你可以使用右侧的检查器
I also want to point out that this view here the content view came pre-loaded with a text component inside
我还想指出,这个视图,这里的内容视图,预装了一个文本组件。
But we could have created this text ourselves
但我们可以自己创造这段文字
So we could have instead of having it default we could have just typed in text
所以我们可以直接输入文本,而不是默认设置。
with quotes and then put
加上引号,然后把
Hi again
嗨又来了
And we can make our own text
我们还可以写自己的文字
And that's the way I'm gonna do it most of this course
这门课的大部分时间我都会这样做
But if you're unsure of a component or you're not sure what to use
但是如果你不确定一个组件或者你不知道该用什么
Instead of typing in text with the parentheses
而不是用括号输入文本
We could have clicked the plus button in the top right corner, which is the library
我们可以点击右上角的加号按钮,也就是图书馆。
And we could click on the
我们可以点击
This button here the controls button and here are all the types of components that we could put into our view
这个按钮,这里是控制按钮,这里是我们可以放入视图中的所有组件类型。
So I have a text here. You could also search at the top for a text
所以我这里有一条短信。你也可以在顶部搜索一条短信。
And then I'll double click it and it will automatically be added to this file
然后我会双击它,它会自动添加到这个文件中。
So you can see here that we just added a text without actually typing any code and it says placeholder
所以你可以在这里看到,我们只是添加了一个文本,实际上没有输入任何代码,它说占位符
And then again on the right side we can start updating that text with some font with some weight with a color
然后在右边,我们可以用一些字体和一些颜色来更新文本
Now we're gonna get into all the different types of components and
现在我们将进入所有不同类型的组件
modifiers that we can use in later videos
我们可以在以后的视频中使用的修饰符
But for right now I just want to get you guys used to the structure and the layout of this application
但是现在我只想让你们习惯这个应用程序的结构和布局
So again, we have the main file that we're working in in the center left here
所以,我们在左中间有我们正在处理的主文件
We have a preview of that file in the center right and then way on the right side
我们在右中间有那个文件的预览,然后在右边。
We have the net the inspector where we can add basically options to specific elements in our code
我们有网络和检查员,我们可以在其中为代码中的特定元素添加基本选项
Now way on the left as I mentioned before is the project navigator
正如我之前提到的,左边是项目导航器
And this is all the files in our app and right now we're in the content view
这是我们应用程序中的所有文件,现在我们在内容视图中
But as we start developing more screens and more files in our app there's gonna be a whole bunch of
但是随着我们开始在我们的应用程序中开发更多屏幕和更多文件,将会有一大堆
Files in this in this area
这个区域的文件
So right now we just have a couple and one of the other ones that it comes preloaded with is this one or right here
所以现在我们只有几个,其中一个是预装的,是这个还是就在这里。
Which is the app dot swift file?
哪个是app dot swift文件?
So it's the name of your app app dot swift and let's click on that
所以这是你的应用程序的名称,让我们点击它。
And I quickly just want to show you that in this file it has the at main tag
我很快就想向您展示在这个文件中,它有at主标签
And what this means is basically whenever we actually build and run our app to a device
这意味着每当我们真正构建并在设备上运行我们的应用程序时
It's going to start and load at the at main entry point
它会从切入点开始装载
So right now the at main entry point is this struct right here
所以现在主要切入点是这个结构
Which is a type app
哪个是类型应用程序
And within the body
在身体内部
We can see that it's opening a window group which you can kind of just ignore for now
我们可以看到它正在打开一个窗口组,你现在可以忽略它。
And the first file that we're going to see is the content view
我们将要看到的第一个文件是内容视图
Now
现在呢
The content view is that content view that we're just working on
内容视图就是我们正在研究的内容视图
Right here. So when we run the app right now this screen is what will load as soon as the app opens
就在这里。所以当我们现在运行应用程序时,这个屏幕是应用程序一打开就会加载的。
So moving forward. I also want to just touch on this project navigator on the top left
所以向前看。我还想谈谈左上角的这个项目导航器。
If you click this blue bar on the top left we can go into the settings for our app
如果您单击左上角的蓝色条,我们可以进入我们应用程序的设置
So click on the general tab if you don't have it already
如果你还没有,请点击常规选项卡。
And there's a lot of settings that we can do and most of them are pretty advanced
我们可以做很多设置,其中大部分都很先进。
But I want to run you guys through some of the very basics really quickly
但是我想很快地给你们介绍一些基本的东西。
Firstly, we have the display name
首先,我们有显示名称
So when your app is on the home screen and it's like a little icon on someone's phone
所以当你的应用程序在主屏幕上时,它就像某人手机上的一个小图标
You can change the title that's underneath the icon
您可以更改图标下方的标题
So right now my project name is swithful thinking bootcamp
所以现在我的项目名称是swith ful思维训练营
But that's pretty long to have as the name on the icon
但是图标上的名字太长了。
So I might just want to make that name bootcamp
所以我可能只是想把这个名字训练营
And now the I underneath the icon it will just say bootcamp
现在图标下面的I只会说训练营
It's also going to have here the bundle identifier if we wanted to change it
如果我们想更改它,它还将在这里提供捆绑标识符
But let's leave it as is for now we already discussed that
但让我们暂时保持原样,我们已经讨论过了。
And then we have the option to increment the version and build numbers
然后我们可以选择增加版本和建造数量
And really simply the version numbers are every time I push my app
其实很简单,版本号是每次我推送我的应用程序时
To an audience. I want to increment the version number
给观众。我想增加版本号
So if I start my app at version 1.0
所以如果我从1.0版开始我的应用程序
And I push it to the audience push it to my users
我把它推给观众,推给我的用户。
And then I want to go and add a bunch of new features
然后我想添加一些新功能
Well the next time I push a version to my users
好吧,下次我向我的用户推送版本时
It will be version 1.1
它将是1.1版
And then I'll add more features and I'll go to version 1.2, 1.3
然后我将添加更多功能,然后进入1.2、1.3版本
And then if for example I had a really big update
然后,例如,我有一个非常大的更新
Something that maybe a major update to the UI or a really cool new feature
可能是UI的重大更新或非常酷的新功能
I would skip to version 2.0 to resemble that it was a big version update
我会跳到版本2.0,就像它是一个大版本更新一样
Then of course we would go version 2.1, 2.2, 2.3, etc
然后我们当然会使用版本2.1、2.2、2.3等
And I want to note that some people prefer to do 1.0.0
我想指出,有些人更喜欢做1.0.0
And then increment 1.0.1, 1.0.2
然后增加1.0.1,1.0.2
This is also fine. It's just a matter of preference
这也没问题。这只是偏好问题。
But for right now let's just leave it as 1.0
但是现在让我们把它作为1.0。
And then we have the option to update builds
然后我们可以选择更新构建
Now builds work the same way as versions except builds are within a version
现在构建的工作方式与版本相同,除了构建在版本中
So right now we're working in version 1.0 build 1
所以现在我们正在使用版本1.0 build 1
And for example let's pretend like I just made an app
例如,让我们假设我刚刚制作了一个应用程序
And I sent it to my teammates to review
我把它发给了我的队友进行审查
And when my teammates were reviewing they found some bugs
当我的队友回顾时,他们发现了一些错误
And they told me to fix the bugs
他们让我修复错误
And then let's pretend like I updated those bugs
然后让我们假装我更新了那些错误
And I want to send it to my teammates again
我想再寄给我的队友
Well this time when I send it to my teammates
好吧,这次当我把它寄给我的队友时
I'm not going to change the version
我不打算更改版本
Because it's still the same version of the app
因为它仍然是应用程序的相同版本
It's still the same features
还是一样的功能
The audience the users has not seen this version yet
观众用户还没有看到这个版本
But the code has actually changed because I edited some bugs
但是代码实际上已经改变了,因为我编辑了一些错误。
So I would keep the same version but I would increment the build
所以我会保持相同的版本,但我会增加构建
And then I would push version 1.0 build 2 to my teammates
然后我会将版本1.0 build 2推送给我的队友
And so on and so forth we would go build 3, build 4, build 5, build 6
以此类推,我们会建造3个,建造4个,建造5个,建造6个。
And then if we finally push this to the app store
然后如果我们最终把它推到应用商店
When we start editing our code again
当我们再次开始编辑代码时
We would go to the next version version 1.0
我们将进入下一个版本1.0
And we would reset to build 1
我们会重置为构建1
And then as we're fixing version 1.1
然后当我们修复1.1版本时
We would add all of our builds
我们将添加我们所有的构建
Like that
就像那样
But again for this course we're not doing any kind of versioning
但是在这门课中,我们没有做任何版本控制。
We're not putting this in the app store
我们不会把这个放在应用商店里
So let's just leave it version 1.0 build 1 for now
所以让我们暂时保留它的版本1.0 build 1
The next section I want to talk about briefly is the deployment info section
我想简要介绍的下一节是部署信息部分
And here we first have the option to choose the iOS
这里我们首先可以选择iOS
The operating system that we want our app to be deployable for
我们希望我们的应用程序可部署的操作系统
So when we click it
所以当我们点击它的时候
We can see all of the iOS options here
我们可以在这里看到所有iOS选项
And basically if you've ever had an iPhone
基本上如果你有过iPhone
At some point you probably had a notification saying you needed to update
在某个时候,您可能收到通知说您需要更新
You needed a software update
你需要软件更新
Well those software updates are these numbers
好吧,那些软件更新是这些数字
So if we deployed we wanted our app to be deployable on iOS 14
因此,如果我们部署,我们希望我们的应用程序可以部署在iOS14
Only people with iOS 14 or higher could actually use it
只有14iOS以上的人才能使用
And if someone had iOS 11 on their phone
如果有人手机上有11iOS
And they opened our app
他们打开了我们的应用程序
They were getting a notification from Apple saying you need to update your software
他们收到了Apple的通知,说您需要更新您的软件
To iOS 14 to use this app
iOS14使用此应用程序
So what's important to note here is that in each of these new iOS
所以这里需要注意的是,在每个新iOS
Apple is fixing bugs but also adding new features that we can use as developers
Apple正在修复错误,但也添加了我们可以作为开发人员使用的新功能
So iOS 14.0 has a lot of really cool developer features
iOS14.0有很多非常酷的开发者特性
That iOS 9.0 doesn't have
iOS9.0没有
So it is important which iOS system that you use
所以你使用哪种iOS系统是很重要的
And you can see here that iOS 14.3 is the most recent deployment
你可以看到14.3iOS是最新的部署
Now we could put iOS 14.3
现在我们可以把iOS14.3
And there probably are a couple features in 14.3 that are not available in 14.0
14.3中可能有一些14.0中不可用的功能
However, I try to avoid using the most recent whenever possible
但是,我尽量避免使用最新的
Because not everyone updates their iOS as soon as it comes out
因为不是每个人一iOS就更新
So by using 14.0 it seems like it's been out for a little bit of time
使用14.0,看起来它已经过时一段时间了。
And most people probably have updated to at least 14.0 by now
大多数人现在可能已经更新到至少14.0
So for this project let's just click 14.0
所以对于这个项目,让我们点击14.0。
I just want to introduce you guys to that
我只是想向你们介绍一下
Moving on we have the ability to change where we want our iOS app to be deployed
继续前进,我们有能力改变我们希望iOS应用程序部署的位置
Now at the beginning we chose iOS app
一开始我们选择iOS应用
And that's why we're getting these options here
这就是为什么我们在这里有这些选择
But if we chose like watch OS app
但如果我们选择像watch OS应用程序
We would have the watch option here
我们这里有手表选项。
But for right now we are fine with our app deploying to an iPhone as well as an iPad
但是现在我们可以将我们的应用程序部署到iPhone和iPad上
And we can leave the Mac blank for now
我们可以暂时让Mac保持空白
That's new I will get into that in another video
这是新的,我会在另一个视频中介绍。
But I also want to touch on the device orientation here
但我还想在这里谈谈设备方向。
And here if we wanted our app to only be used in portrait mode
如果我们想让我们的应用只能用于竖屏
We could uncheck these
我们可以取消这些
Or if we wanted our app to be only in landscape mode
或者如果我们希望我们的应用程序仅处于横向模式
We could uncheck portrait
我们可以取消肖像
And then we can only use our phone when it's turned to the side
然后我们只能在手机转向一边时使用它
We're not going to do too much with the device orientation
我们不打算做太多关于设备方向的事情。
And this beginner tutorial
这个初学者教程
So let's just leave it as it was with portrait landscape left landscape right
所以让我们把它留在肖像风景左边风景右边
And then lastly I want to show you guys here
最后,我想给你们看
We have the app icons and launch images section
我们有应用程序图标和启动图像部分
And in here we have the app icon source
这里我们有应用程序图标源
And this is basically a file where we are saving our app icon
这基本上是一个文件,我们在其中保存我们的应用程序图标
The app icon is the actual image when your app is on the home screen
应用程序图标是当您的应用程序在主屏幕上时的实际图像
And we can see that the app icon is within the assets folder
我们可以看到应用程序图标在资产文件夹中
Now you might be wondering what is the assets folder
现在您可能想知道资产文件夹是什么
And if you look on the left side
如果你看左边
There's an assets folder that was created as soon as we created our project
我们一创建项目就创建了一个资产文件夹
And if we jump into that assets.x assets folder
如果我们跳转到资产. x资产文件夹
We can see here that we have an app icon file
我们可以在这里看到我们有一个应用程序图标文件
Now within this file are a bunch of pixel sizes that we need to add for our app icon
现在在这个文件中有一堆我们需要为我们的应用程序图标添加的像素大小
We're not going to do that in this video
这个视频里我们不会这么做。
But I just wanted to show you where this was
但我只是想告诉你这是哪里
So this assets the sxc assets folder is very important
所以这个资产sxc资产文件夹非常重要
And we're going to use this a bunch in our project
我们将在我们的项目中大量使用它
As we start adding assets to our project
当我们开始向我们的项目添加资产时
And most of the assets are going to be colors or images for our app
大部分资产将是我们应用程序的颜色或图像
But right now we're just going to leave this blank
但现在我们要把这个留空
And let's just jump back into the content view
让我们回到内容视图
And let's click resume on that preview canvas
让我们点击预览画布上的简历
So we make sure we are all connected
所以我们要确保我们都联系在一起
So in the next video we're going to actually start coding in Swift UI
所以在下一个视频中,我们将真正开始在Swift UI中编码
And it's going to be a whole lot of fun
这将会非常有趣
But that's it for this video
但这就是这个视频
Hope you guys enjoyed it
希望你们喜欢
As always I'm Nick
一如既往我是尼克
This is Swiftful Thinking
这就是思维敏捷。
And I will see you guys in the next video
我们下一个视频再见