1 00:00:00,540 --> 00:00:05,990 We learned about Visual Studio for Mac earlier, so your Mac should be all setup. 2 00:00:05,990 --> 00:00:11,659 We also should have our Mac Agent setup for when we worked on the IOS storyboard. 3 00:00:11,659 --> 00:00:13,743 With the Mac Agent connected, 4 00:00:13,743 --> 00:00:18,641 we can test it out by showing the simulator from the Tools menu under iOS. 5 00:00:18,641 --> 00:00:22,280 You'll see the default simulator pop up on your Mac. 6 00:00:22,280 --> 00:00:25,440 While we're here, we'll look at some of the other tools for iOS. 7 00:00:26,530 --> 00:00:30,870 The other tools for iOS are the Device Log, can display 8 00:00:30,870 --> 00:00:36,100 all activity on a physical device, even if you're not debugging the app. 9 00:00:36,100 --> 00:00:41,810 The Mac Agent Console allows for more complex interactions with the Mac Agent. 10 00:00:44,540 --> 00:00:46,249 We won't be using it in this course. 11 00:00:47,560 --> 00:00:51,120 Now, we can launch our app in iOS using the simulator. 12 00:00:52,350 --> 00:00:57,570 The first step is to set the startup project to the iOS PizzaCalculator. 13 00:00:58,920 --> 00:01:03,040 You can do it by right-clicking and setting as StartUp Project. 14 00:01:05,220 --> 00:01:09,880 Or you can choose the startup project from the toolbar. 15 00:01:09,880 --> 00:01:13,714 Just like with Android, the Debug Run button has a drop down to 16 00:01:13,714 --> 00:01:16,539 select the device you want to run your app on. 17 00:01:16,539 --> 00:01:18,528 Doesn't matter which on you choose, 18 00:01:18,528 --> 00:01:22,070 although I use a phone to save screen real estate. 19 00:01:22,070 --> 00:01:25,095 Click the Debug button and our app should launch. 20 00:01:35,207 --> 00:01:36,553 So our app launched, but 21 00:01:36,553 --> 00:01:41,740 we get a error message saying that the PizzaCalculator.iOS needs to be updated. 22 00:01:41,740 --> 00:01:44,320 Let's go take a look at how to fix it. 23 00:01:44,320 --> 00:01:46,262 We'll stop our debug session. 24 00:01:49,068 --> 00:01:54,700 In the properties for the IOS project, the current template uses i386, 25 00:01:54,700 --> 00:02:01,100 but Apple has changed the requirements to only allow 64-bit instructions. 26 00:02:01,100 --> 00:02:05,122 Select the supported architecture, 27 00:02:05,122 --> 00:02:09,526 x86_64, and rebuild the project. 28 00:02:09,526 --> 00:02:14,176 If you are using a device and selected the iPhone platform, 29 00:02:14,176 --> 00:02:18,268 the supported architecture is ARM 7 plus ARM 64, 30 00:02:18,268 --> 00:02:23,050 which is correct so you don't need to change it. 31 00:02:23,050 --> 00:02:27,410 Now click the Debug button and switch to the emulator and watch our app. 32 00:02:29,080 --> 00:02:35,960 Let's enter a value, calculate, and we get 11. 33 00:02:35,960 --> 00:02:39,100 You may have discovered another thing that can be troublesome. 34 00:02:39,100 --> 00:02:42,643 Once you enter the people count and tap the calculate button, 35 00:02:42,643 --> 00:02:44,429 the keyboard does not go away. 36 00:02:44,429 --> 00:02:48,317 The reason is that the text entry still has the focus, or 37 00:02:48,317 --> 00:02:51,550 in Apple terms, first responder. 38 00:02:51,550 --> 00:02:57,940 So, once you tap the button, we need the PeopleEntry to not be the first responder. 39 00:02:57,940 --> 00:03:02,280 If we go back to the view controller we can add a line to the delegate, so 40 00:03:02,280 --> 00:03:05,235 the PeopleEntry will resign first responder. 41 00:03:07,458 --> 00:03:11,487 We'll stop our app, go to the view controller, 42 00:03:15,530 --> 00:03:22,452 When we calculate, we want to resign first responder from the PeopleEntry. 43 00:03:28,390 --> 00:03:34,960 Now when we run our app, The keyboard goes away. 44 00:03:34,960 --> 00:03:43,613 Now let's stop debugging, And take a quick look at the configuration options. 45 00:03:47,607 --> 00:03:51,319 Since we opened the preferences to set the supported architecture, 46 00:03:51,319 --> 00:03:55,240 you can see that it's much more complicated than Android preferences. 47 00:03:55,240 --> 00:03:58,300 I'll do a brief overview of the important preferences. 48 00:03:58,300 --> 00:04:03,270 The iOS Build section, the SDK Version should be set to default, but 49 00:04:03,270 --> 00:04:07,320 if you have an older or beta version selected here, 50 00:04:07,320 --> 00:04:10,660 Linker Behavior is slightly different than Android. 51 00:04:10,660 --> 00:04:16,440 Set Linker Behavior to Don't Link, will not link any libraries. 52 00:04:16,440 --> 00:04:22,070 And Link Framework SDKs Only will link basic class libraries, 53 00:04:22,070 --> 00:04:23,550 but no user assemblies. 54 00:04:25,060 --> 00:04:29,430 Supported Architecture must be set to 64-bit for all new apps. 55 00:04:30,960 --> 00:04:37,160 The iOS Debug and iOS On-Demand Resource sections are not important at this point. 56 00:04:37,160 --> 00:04:41,530 The iOS Bundle section is important for publishing to stores, but 57 00:04:41,530 --> 00:04:46,130 the automatic settings usually work for development. 58 00:04:46,130 --> 00:04:48,510 None of the other sections are important at this time. 59 00:04:50,460 --> 00:04:53,660 The Build, Build Events, and References Paths, and 60 00:04:53,660 --> 00:04:58,370 Security are just like any other MS Build project and don't need to be changed.