<?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_2021W_Lecture_5</id>
	<title>Mobile App Development 2021W Lecture 5 - 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_2021W_Lecture_5"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2021W_Lecture_5&amp;action=history"/>
	<updated>2026-04-26T13:50:57Z</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_2021W_Lecture_5&amp;diff=22859&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  Video from the lecture given on January 25, 2021 [https://homeostasis.scs.carleton.ca/~soma/mad-2021w/lectures/comp1601-2021w-lec05-20210125.m4v is now available]....&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2021W_Lecture_5&amp;diff=22859&amp;oldid=prev"/>
		<updated>2021-01-25T21:33:47Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lecture given on January 25, 2021 [https://homeostasis.scs.carleton.ca/~soma/mad-2021w/lectures/comp1601-2021w-lec05-20210125.m4v is now available]....&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 25, 2021 [https://homeostasis.scs.carleton.ca/~soma/mad-2021w/lectures/comp1601-2021w-lec05-20210125.m4v is now available].&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 5&lt;br /&gt;
---------&lt;br /&gt;
Lecture topics&lt;br /&gt;
    Swift functions &amp;amp; closures&lt;br /&gt;
    Swift dictionaries &amp;amp; arrays&lt;br /&gt;
    Writing simple command line synchronous interface in Swift&lt;br /&gt;
    Declaring custom views in SwiftUI&lt;br /&gt;
    SwiftUI @State and @Binding&lt;br /&gt;
    SwiftUI ForEach&lt;br /&gt;
&lt;br /&gt;
Key ideas&lt;br /&gt;
 - functions can be passed around as data&lt;br /&gt;
 - functions without names are called closures, in other languages lambda is the term&lt;br /&gt;
   (lambda comes from lamda calculus, worth looking up)&lt;br /&gt;
   &lt;br /&gt;
Why closure?&lt;br /&gt;
 - encapsulates the lexical scope of where the function is declared&lt;br /&gt;
 - regular languages do (mostly) lexical scoping)&lt;br /&gt;
   - variables &amp;amp; other symbols are valid or not depending on where they are found&lt;br /&gt;
     in the source code&lt;br /&gt;
 - lexical scoping really only comes up when you have functions defined inside of&lt;br /&gt;
   other things (like struct, class, function)&lt;br /&gt;
    - closures &amp;quot;remember&amp;quot; where they were declared, can see those symbols&lt;br /&gt;
&lt;br /&gt;
closures are typically used for callbacks&lt;br /&gt;
 - you pass a function in as an argument, it will get called later by someone else&lt;br /&gt;
   at some time, you don&amp;#039;t know when or in what context&lt;br /&gt;
&lt;br /&gt;
Event driven programming tends to lead to closures in some form&lt;br /&gt;
 - because you have to specify what happens in response to events&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>