<?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_8</id>
	<title>Mobile App Development 2021W Lecture 8 - 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_8"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2021W_Lecture_8&amp;action=history"/>
	<updated>2026-04-06T02:52:15Z</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_8&amp;diff=22905&amp;oldid=prev</id>
		<title>Soma: /* Video */</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2021W_Lecture_8&amp;diff=22905&amp;oldid=prev"/>
		<updated>2021-02-03T20:18:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Video&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:18, 3 February 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Video==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Video==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Video from the lecture given on February 3, 2021 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;will be &lt;/del&gt;available &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;later today&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Video from the lecture given on February 3, 2021 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[https://homeostasis.scs.carleton.ca/~soma/mad-2021w/lectures/comp1601-2021w-lec08-20210203.m4v is now &lt;/ins&gt;available&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Code==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Code==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2021W_Lecture_8&amp;diff=22904&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  Video from the lecture given on February 3, 2021 will be available later today.  ==Code==  Below is the modified version of drag-demo that was created in class.  &lt;s...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_App_Development_2021W_Lecture_8&amp;diff=22904&amp;oldid=prev"/>
		<updated>2021-02-03T18:16:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lecture given on February 3, 2021 will be available later today.  ==Code==  Below is the modified version of drag-demo that was created in class.  &amp;lt;s...&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 February 3, 2021 will be available later today.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&lt;br /&gt;
Below is the modified version of drag-demo that was created in class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot; line&amp;gt;&lt;br /&gt;
//&lt;br /&gt;
//  ContentView.swift&lt;br /&gt;
//  drag_demo&lt;br /&gt;
&lt;br /&gt;
import SwiftUI&lt;br /&gt;
&lt;br /&gt;
let boxLocation = CGPoint(x: 200, y: 400)&lt;br /&gt;
&lt;br /&gt;
struct ContentView: View {&lt;br /&gt;
    @State var location = CGPoint(x: 185, y: 100)&lt;br /&gt;
    var body: some View {&lt;br /&gt;
        VStack{&lt;br /&gt;
            SuccessMsg(location: $location)&lt;br /&gt;
            ZStack{&lt;br /&gt;
                Rectangle()&lt;br /&gt;
                    .stroke(Color.green, lineWidth: 10)&lt;br /&gt;
                    .frame(width: 200, height: 200)&lt;br /&gt;
                    .position(boxLocation)&lt;br /&gt;
                MovableCircle(location: $location)&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
struct MovableCircle: View {&lt;br /&gt;
    @Binding var location: CGPoint&lt;br /&gt;
    @State private var isDragging = false&lt;br /&gt;
    @State var myColor = Color.blue&lt;br /&gt;
    &lt;br /&gt;
    var body: some View {&lt;br /&gt;
 &lt;br /&gt;
        return Circle()&lt;br /&gt;
            .fill(myColor)&lt;br /&gt;
            .frame(width: isDragging ? 64 : 128, height: isDragging ? 64 : 128)&lt;br /&gt;
            .position(location)&lt;br /&gt;
            .gesture(DragGesture()&lt;br /&gt;
                        .onChanged { value in&lt;br /&gt;
                            isDragging = true&lt;br /&gt;
                            self.location = value.location&lt;br /&gt;
                            }&lt;br /&gt;
                        .onEnded { value in&lt;br /&gt;
                            isDragging = false&lt;br /&gt;
                            self.location = value.location&lt;br /&gt;
                            self.location.x += 50&lt;br /&gt;
                        }&lt;br /&gt;
            )&lt;br /&gt;
            .onTapGesture(count: 2, perform: {&lt;br /&gt;
                print(&amp;quot;Circle clicked!&amp;quot;)&lt;br /&gt;
                self.myColor = Color.blue&lt;br /&gt;
            })&lt;br /&gt;
            .onTapGesture(count: 1, perform: {&lt;br /&gt;
                print(&amp;quot;Circle clicked!&amp;quot;)&lt;br /&gt;
                self.myColor = Color.red&lt;br /&gt;
            })&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
struct SuccessMsg: View {&lt;br /&gt;
    @Binding var location: CGPoint&lt;br /&gt;
    &lt;br /&gt;
    var body: some View {&lt;br /&gt;
        if (abs(location.x - boxLocation.x) &amp;lt; 20) &amp;amp;&amp;amp;&lt;br /&gt;
            (abs(location.y - boxLocation.y) &amp;lt; 20) {&lt;br /&gt;
            Text(&amp;quot;Success!&amp;quot;).bold()&lt;br /&gt;
        } else {&lt;br /&gt;
            Text(&amp;quot;Drag the circle into the box&amp;quot;).bold()&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
struct ContentView_Previews: PreviewProvider {&lt;br /&gt;
    static var previews: some View {&lt;br /&gt;
        ContentView()&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>