<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Mobile_App_Development_2022W_Lecture_2</id>
	<title>Mobile App Development 2022W Lecture 2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Mobile_App_Development_2022W_Lecture_2"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2022W_Lecture_2&amp;action=history"/>
	<updated>2026-04-06T01:53:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2022W_Lecture_2&amp;diff=23671&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  Video from the lecture given on January 14, 2022 is now available: * [https://homeostasis.scs.carleton.ca/~soma/mad-2022w/lectures/comp1601-2022w-lec02-20220114.m4v...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2022W_Lecture_2&amp;diff=23671&amp;oldid=prev"/>
		<updated>2022-01-15T02:50:06Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lecture given on January 14, 2022 is now available: * [https://homeostasis.scs.carleton.ca/~soma/mad-2022w/lectures/comp1601-2022w-lec02-20220114.m4v...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Video==&lt;br /&gt;
&lt;br /&gt;
Video from the lecture given on January 14, 2022 is now available:&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/mad-2022w/lectures/comp1601-2022w-lec02-20220114.m4v video]&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/mad-2022w/lectures/comp1601-2022w-lec02-20220114.cc.vtt auto-generated captions]&lt;br /&gt;
Video is also available through Brightspace (Resources-&amp;gt;Zoom Meetings (Recordings, etc.)-&amp;gt;Cloud Recordings tab).  Note that here you&amp;#039;ll also see chat messages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 2&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
Topics&lt;br /&gt;
 - participation &amp;amp; tutorial grading&lt;br /&gt;
 - structure of classes each week&lt;br /&gt;
&lt;br /&gt;
var vs let&lt;br /&gt;
 - var is for declaring variables (i.e., symbols whose value can change)&lt;br /&gt;
 - let is for associating values with a name (the associated value never changes)&lt;br /&gt;
&lt;br /&gt;
Notice that names assigned with let are immutable (unlike variables)&lt;br /&gt;
&lt;br /&gt;
In math, x = x + 1 makes no sense&lt;br /&gt;
But in programming we often do things like this&lt;br /&gt;
 - with var, you can do x=x+1&lt;br /&gt;
 - with let, you can&amp;#039;t&lt;br /&gt;
&lt;br /&gt;
One oddity in swift&lt;br /&gt;
 - you can have var&amp;#039;s that are actually immutable (because&lt;br /&gt;
   they are part of a larger thing that is immutable)&lt;br /&gt;
&lt;br /&gt;
Note that readLine() returns something of type &amp;quot;String?&amp;quot;&lt;br /&gt;
 - so it could be a String, or it could be nil&lt;br /&gt;
&lt;br /&gt;
In C, if you return a string, it is normally a pointer so could be NULL&lt;br /&gt;
Java, same thing basically (even though it will be a reference not a pointer)&lt;br /&gt;
&lt;br /&gt;
When you add a ? at the end of a type in Swift, it means it is either that value or nil&lt;br /&gt;
 - thus, if you don&amp;#039;t have the ?, you are *guaranteed* to have something&lt;br /&gt;
   of that type, it will never be nil&lt;br /&gt;
&lt;br /&gt;
Basically, the compiler makes sure that you never treat nil as real data by accident (you have to do it on purpose, and it doesn&amp;#039;t make it easy)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Unwrapping&amp;quot; is the process of taking a value that could be nil and deciding whether or not it is and acting accordingly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Type inference&lt;br /&gt;
 - you often don&amp;#039;t specify types, but they are always there in Swift&lt;br /&gt;
 - moreover, the type of a symbol doesn&amp;#039;t change&lt;br /&gt;
   - if you try to change it, you&amp;#039;ll get an error&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Lexical scoping&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To learn all about Swift, see https://docs.swift.org/swift-book/&lt;br /&gt;
 - helpful, but I&amp;#039;ll try to cover the key concepts in class&lt;br /&gt;
&lt;br /&gt;
You can use the ?? operator to unwrap a value instead of &amp;quot;if let&amp;quot;&lt;br /&gt;
 - you specify a default value after ?? which is used if the value is nil&lt;br /&gt;
&lt;br /&gt;
In SwiftUI, you don&amp;#039;t control when the screen is updated&lt;br /&gt;
 - instead, your Views specify what the screen should look like at any time&lt;br /&gt;
 - SwiftUI will automatically call your code to update the screen&lt;br /&gt;
   when relevant data changes (e.g., when @State variables change)&lt;br /&gt;
&lt;br /&gt;
Standard GUI interface&lt;br /&gt;
 1. user event happens&lt;br /&gt;
 2. program code processes event, updates program state&lt;br /&gt;
 3. program updates interface&lt;br /&gt;
&lt;br /&gt;
In SwiftUI, #3 happens automatically&lt;br /&gt;
In older GUI frameworks, you have to do this manually&lt;br /&gt;
  (we&amp;#039;ll be doing it manually for Android)&lt;br /&gt;
  (it is also manual for iOS Storyboard/UIKit)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>