title
Swift Tutorial

description
Get the Cheat Sheet Here : http://goo.gl/3qACJw Run Swift on Windows : http://goo.gl/HwQkrY Best Swift Book : http://amzn.to/1LmumTq Support me on Patreon : https://www.patreon.com/derekbanas Data Types 1:57 Casting 7:26 Math 8:54 If 11:29 Ternary Operator 13:19 Switch 14:12 Range 16:29 Arrays 17:23 Dictionaries 23:13 Tuples 24:34 For 25:26 For In 27:25 While 30:05 Do While 30:33 Functions 31:10 Variadic Parameters 32:53 Pointers / InOut 33:46 Return Multiple Variables 35:00 Returning Functions 36:05 Inner Functions 39:00 Closures 40:26 Structs 44:10 Computed Properties 46:48 Static 47:32 Classes / Objects 48:06 Init 48:47 Overloaded Methods 50:47 Inheritance 51:54 Override Methods 52:19 Final 52:30 Super 53:00 Dynamic Typing 54:06 Protocol / Interfaces 55:54 Extensions 59:16 Generics 1:01:52 Enums 1:06:12 Today I'll help you learn Swift in one video! All of the code follows the video below. We'll cover Data Types, Casting, If, Ternary Operator, Switch, Range, Arrays, Tuples, Dictionaries, For, While, Functions, Variadic Parameters, Pointers, Inner Functions, Closures, Structs, Computed Properties, Static, Classes, Objects, Overloading, Inheritance, Dynamic Typing, Protocols, Extensions, Generics, Enums and more.

detail
{'title': 'Swift Tutorial', 'heatmap': [{'end': 543.283, 'start': 495.91, 'weight': 0.795}, {'end': 1339.058, 'start': 1247.676, 'weight': 0.875}, {'end': 1419.335, 'start': 1371.576, 'weight': 0.714}, {'end': 1544.615, 'start': 1458.655, 'weight': 0.825}, {'end': 2136.07, 'start': 1918.646, 'weight': 0.857}, {'end': 2509.084, 'start': 2421.189, 'weight': 0.952}, {'end': 2588.427, 'start': 2542.356, 'weight': 0.748}, {'end': 2671.484, 'start': 2628.805, 'weight': 0.742}, {'end': 2880.662, 'start': 2793.243, 'weight': 0.76}, {'end': 3384.368, 'start': 3336.58, 'weight': 0.761}, {'end': 3589.76, 'start': 3544.846, 'weight': 0.877}], 'summary': 'This tutorial covers comprehensive aspects of swift programming language, including ios development basics, swift fundamentals, loops, functions, data structures, oop concepts, and extensions, with detailed explanations and examples for each topic.', 'chapters': [{'end': 33.649, 'segs': [{'end': 33.649, 'src': 'embed', 'start': 0.129, 'weight': 0, 'content': [{'end': 2.87, 'text': 'Well hello Internet and welcome to my Swift video tutorial.', 'start': 0.129, 'duration': 2.741}, {'end': 4.89, 'text': 'You guys requested it and here it is.', 'start': 2.91, 'duration': 1.98}, {'end': 9.192, 'text': "In this one video I'm going to pretty much teach everything you want to know about the Swift programming language.", 'start': 4.971, 'duration': 4.221}, {'end': 16.634, 'text': "We're going to be covering data types, math, conditionals, arrays, dictionaries, tuples, looping functions, closures, structs, classes, protocols,", 'start': 9.232, 'duration': 7.402}, {'end': 19.595, 'text': 'extensions, generics, enums and a whole bunch more.', 'start': 16.634, 'duration': 2.961}, {'end': 23.999, 'text': 'And to help you get to exactly whatever you want to learn, rather than watch the entire video.', 'start': 19.855, 'duration': 4.144}, {'end': 29.906, 'text': "in the description underneath the video, you're going to find lists of every single topic that I cover in this whole tutorial.", 'start': 23.999, 'duration': 5.907}, {'end': 33.649, 'text': "And you can click on those and jump directly there to learn whatever you'd like to learn.", 'start': 29.946, 'duration': 3.703}], 'summary': 'Swift video tutorial covering data types, math, conditionals, arrays, dictionaries, tuples, looping functions, closures, structs, classes, protocols, extensions, generics, enums, and more.', 'duration': 33.52, 'max_score': 0.129, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY129.jpg'}], 'start': 0.129, 'title': 'Swift programming language tutorial', 'summary': 'Provides a comprehensive tutorial on the swift programming language, covering data types, math, conditionals, arrays, dictionaries, tuples, looping functions, closures, structs, classes, protocols, extensions, generics, and enums, with navigation to specific topics in the video description.', 'chapters': [{'end': 33.649, 'start': 0.129, 'title': 'Swift programming language tutorial', 'summary': 'Covers a comprehensive tutorial on the swift programming language, including data types, math, conditionals, arrays, dictionaries, tuples, looping functions, closures, structs, classes, protocols, extensions, generics, and enums, with the option to navigate to specific topics provided in the video description.', 'duration': 33.52, 'highlights': ['The tutorial covers data types, math, conditionals, arrays, dictionaries, tuples, looping functions, closures, structs, classes, protocols, extensions, generics, and enums.', 'The video description provides lists of every single topic covered in the tutorial, enabling viewers to navigate directly to specific topics.']}], 'duration': 33.52, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY129.jpg', 'highlights': ['The tutorial covers data types, math, conditionals, arrays, dictionaries, tuples, looping functions, closures, structs, classes, protocols, extensions, generics, and enums.', 'The video description provides lists of every single topic covered in the tutorial, enabling viewers to navigate directly to specific topics.']}, {'end': 638.744, 'segs': [{'end': 62.743, 'src': 'embed', 'start': 33.81, 'weight': 1, 'content': [{'end': 35.812, 'text': "And I have a whole lot to do, so let's get into it.", 'start': 33.81, 'duration': 2.002}, {'end': 45.552, 'text': "Okay, so I'm going to be using Xcode in this tutorial and I'm just going to skip this part here and I'm going to come over here to open our file and go File New and go File.", 'start': 36.766, 'duration': 8.786}, {'end': 51.756, 'text': "This is going to open up, and I'm going to click on iOS, and Source, and Playground, and click on Next.", 'start': 45.732, 'duration': 6.024}, {'end': 54.018, 'text': "Now it's going to ask me to create something.", 'start': 52.056, 'duration': 1.962}, {'end': 56.519, 'text': "We can just call this My Playground, doesn't really matter.", 'start': 54.138, 'duration': 2.381}, {'end': 60.522, 'text': "Click on Create, and if it says, do you want to replace this? Yeah, I'll say Replace.", 'start': 56.639, 'duration': 3.883}, {'end': 62.743, 'text': 'And this is basically what you should see on your screen.', 'start': 60.802, 'duration': 1.941}], 'summary': 'Using xcode for ios development, creating my playground.', 'duration': 28.933, 'max_score': 33.81, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY33810.jpg'}, {'end': 101.451, 'src': 'embed', 'start': 71.448, 'weight': 2, 'content': [{'end': 74.73, 'text': "I'm going to instead use what they call the assistant editor.", 'start': 71.448, 'duration': 3.282}, {'end': 78.233, 'text': 'And you just go view assistant editor and show assistant editor.', 'start': 74.951, 'duration': 3.282}, {'end': 81.174, 'text': 'You can see here you can put it on the right bottom horizontal or vertical.', 'start': 78.293, 'duration': 2.881}, {'end': 82.635, 'text': "I'm going to say I want it on the right.", 'start': 81.334, 'duration': 1.301}, {'end': 88.959, 'text': 'And over here is where all of the output for our program is going to show over here on the right side of the screen.', 'start': 82.835, 'duration': 6.124}, {'end': 93.803, 'text': "You can see right here, this is a basic one-line comment, and I'm going to go through everything.", 'start': 89.139, 'duration': 4.664}, {'end': 97.707, 'text': 'And here is a multi-line comment.', 'start': 94.284, 'duration': 3.423}, {'end': 101.451, 'text': 'Pretty simple, pretty much like every other programming language you may have seen.', 'start': 97.947, 'duration': 3.504}], 'summary': 'Using assistant editor to display program output on the right side of the screen.', 'duration': 30.003, 'max_score': 71.448, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY71448.jpg'}, {'end': 159.116, 'src': 'embed', 'start': 129.332, 'weight': 4, 'content': [{'end': 132.354, 'text': "A little bit strange, but that's the rule and that's the way it goes.", 'start': 129.332, 'duration': 3.022}, {'end': 134.996, 'text': 'Now your variable names must start with a letter.', 'start': 132.774, 'duration': 2.222}, {'end': 141.261, 'text': 'however, they can contain most any Unicode character except for white space, mathematical symbols or arrows.', 'start': 134.996, 'duration': 6.265}, {'end': 147.906, 'text': 'Now, if you do not provide information in regards to what exactly this is in this situation, it would be a string,', 'start': 141.601, 'duration': 6.305}, {'end': 154.251, 'text': "and that's how we would define a string by putting a colon and the data type right there, and I'll go through all the other different data types.", 'start': 147.906, 'duration': 6.345}, {'end': 159.116, 'text': "But if you didn't put that there, Swift is going to use type inference to guess the data type,", 'start': 154.491, 'duration': 4.625}], 'summary': 'Variable names must start with a letter and swift uses type inference.', 'duration': 29.784, 'max_score': 129.332, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY129332.jpg'}, {'end': 195.002, 'src': 'embed', 'start': 164.502, 'weight': 5, 'content': [{'end': 167.325, 'text': 'But I personally like to define the data types for everything.', 'start': 164.502, 'duration': 2.823}, {'end': 173.992, 'text': "Another thing that's important to know is even though, remember we changed this to var instead of let, so that means we can change the value here.", 'start': 167.345, 'duration': 6.647}, {'end': 179.875, 'text': "That doesn't, however, mean we can go in here and jump in and say str is equal to 1.", 'start': 174.252, 'duration': 5.623}, {'end': 180.915, 'text': 'That would be an integer.', 'start': 179.875, 'duration': 1.04}, {'end': 186.818, 'text': "And you'll see over here it gives errors and it says cannot assign a value of type int to a value of type string.", 'start': 181.095, 'duration': 5.723}, {'end': 188.039, 'text': 'See, it knew it was a string.', 'start': 186.938, 'duration': 1.101}, {'end': 195.002, 'text': "So it does use data types and will keep you from entering certain data in there, but that's just the way it is.", 'start': 188.239, 'duration': 6.763}], 'summary': 'Defining data types is important for type safety, preventing errors, and ensuring correct data input.', 'duration': 30.5, 'max_score': 164.502, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY164502.jpg'}, {'end': 262.002, 'src': 'embed', 'start': 237.781, 'weight': 0, 'content': [{'end': 247.348, 'text': 'and the different data types that are going to be available for us are going to be ints, which of course are going to be integers, doubles or floats,', 'start': 237.781, 'duration': 9.567}, {'end': 252.552, 'text': 'which of course are going to be floating, point numbers or numbers with decimal places, Strings of course,', 'start': 247.348, 'duration': 5.204}, {'end': 255.375, 'text': 'which is just a whole bunch of characters between quotes.', 'start': 252.552, 'duration': 2.823}, {'end': 257.757, 'text': 'Bool, which are going to be booleans.', 'start': 255.836, 'duration': 1.921}, {'end': 262.002, 'text': "And then there's characters and a whole bunch of other different types that we'll also get into here in a second.", 'start': 258.118, 'duration': 3.884}], 'summary': 'The data types available are ints, doubles, floats, strings, bools, and characters.', 'duration': 24.221, 'max_score': 237.781, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY237781.jpg'}, {'end': 413.72, 'src': 'embed', 'start': 378.86, 'weight': 7, 'content': [{'end': 380.401, 'text': 'you can see it also went up to two.', 'start': 378.86, 'duration': 1.541}, {'end': 385.105, 'text': "however, if we take out one of these numbers, you're going to see that we have accuracy.", 'start': 380.401, 'duration': 4.704}, {'end': 391.469, 'text': "so for floats, you're going to have accuracy to six digits and doubles, you're going to have precision up to 15 digits.", 'start': 385.105, 'duration': 6.364}, {'end': 394.611, 'text': 'in regards to your floating point numbers or your decimals.', 'start': 391.469, 'duration': 3.142}, {'end': 400.695, 'text': 'booleans, which are created with bool, are going to store either true or false, so we could create.', 'start': 394.611, 'duration': 6.084}, {'end': 405.614, 'text': "one is over 18 and we're going to assign a value of true.", 'start': 400.695, 'duration': 4.919}, {'end': 406.555, 'text': "there's your boolean.", 'start': 405.614, 'duration': 0.941}, {'end': 413.72, 'text': 'your strings, like I saw before, are going to store a whole bunch of different types of characters between quotes.', 'start': 406.555, 'duration': 7.165}], 'summary': 'Floats have accuracy to 6 digits, doubles have precision up to 15 digits, booleans store true or false, and strings store various characters between quotes.', 'duration': 34.86, 'max_score': 378.86, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY378860.jpg'}, {'end': 543.283, 'src': 'heatmap', 'start': 495.91, 'weight': 0.795, 'content': [{'end': 502.792, 'text': "for true, in regards to booleans, if you'd like to turn a string into an integer and go, let my age now,", 'start': 495.91, 'duration': 6.882}, {'end': 509.934, 'text': "of course it's going to have to already be a number, but we're defining this right now as a string and if we would want to convert it into an integer,", 'start': 502.792, 'duration': 7.142}, {'end': 515.869, 'text': 'go my age, int my age and then to int right like that.', 'start': 510.407, 'duration': 5.462}, {'end': 525.852, 'text': "and now, if you'd like to convert a string into a float, we could just go my age float and then you go my age as ns string.", 'start': 515.869, 'duration': 9.983}, {'end': 529.633, 'text': 'this is something you kind of like have to remember and then follow that with float value,', 'start': 525.852, 'duration': 3.781}, {'end': 533.856, 'text': "And that's pretty much all you need to know about casting and converting into different data types.", 'start': 529.793, 'duration': 4.063}, {'end': 537.258, 'text': "Now let's take a look at the different math functions that are available to us.", 'start': 534.076, 'duration': 3.182}, {'end': 539.52, 'text': 'I just went ahead and did these all ahead of time.', 'start': 537.659, 'duration': 1.861}, {'end': 543.283, 'text': 'And you can see here exactly we can, of course, add, subtract, multiply, divide.', 'start': 539.66, 'duration': 3.623}], 'summary': 'Converting string to integer and float, using math functions.', 'duration': 47.373, 'max_score': 495.91, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY495910.jpg'}], 'start': 33.81, 'title': 'Ios development and swift basics', 'summary': 'Covers using xcode in ios development, creating new files, and navigating the assistant editor. it also includes essential swift programming concepts such as variable declaration, data types, type inference, constants, precision issues, casting, math functions, shorthand notations, and compound assignments.', 'chapters': [{'end': 88.959, 'start': 33.81, 'title': 'Using xcode for ios development', 'summary': 'Covers using xcode in ios development, including creating a new file in xcode and navigating the assistant editor for program output.', 'duration': 55.149, 'highlights': ['The tutorial demonstrates using Xcode to create a new file for iOS development, with specific steps such as selecting iOS, Source, and Playground.', 'The chapter emphasizes the use of the assistant editor in Xcode for displaying program output, offering instructions for accessing and positioning the editor.', 'It covers the initial setup and navigation in Xcode for iOS development, providing guidance on creating a new file, opening the assistant editor, and understanding the workspace layout.']}, {'end': 638.744, 'start': 89.139, 'title': 'Swift programming basics', 'summary': 'Covers essential swift programming concepts including variable declaration, data types (int, double, string, bool), type inference, constants, precision issues with floats and doubles, casting between data types, math functions, shorthand notations, and compound assignments.', 'duration': 549.605, 'highlights': ['The chapter covers essential Swift programming concepts including variable declaration, data types (int, double, string, bool), type inference, constants, precision issues with floats and doubles, casting between data types, math functions, shorthand notations, and compound assignments. Variable declaration, data types, type inference, constants, precision issues with floats and doubles, casting between data types, math functions, shorthand notations, compound assignments.', 'The chapter discusses that variable names must start with a letter, and they can contain most any Unicode character except for white space, mathematical symbols, or arrows. Variable naming conventions and restrictions.', "It explains the differences between using 'var' and 'let' keywords for variable declaration, where 'var' allows the value to be changed, and 'let' declares a constant. Differences between 'var' and 'let' in variable declaration.", 'The chapter emphasizes the usage of type inference to guess the data type based on the stored data, as well as the importance of defining data types for variables. Usage of type inference, importance of defining data types for variables.', 'It highlights the precision issues with floats and doubles, indicating that floats have an accuracy limit to six digits, while doubles have precision up to 15 digits. Precision issues with floats and doubles.']}], 'duration': 604.934, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY33810.jpg', 'highlights': ['The chapter covers essential Swift programming concepts including variable declaration, data types, type inference, constants, precision issues with floats and doubles, casting between data types, math functions, shorthand notations, and compound assignments.', 'The tutorial demonstrates using Xcode to create a new file for iOS development, with specific steps such as selecting iOS, Source, and Playground.', 'The chapter emphasizes the use of the assistant editor in Xcode for displaying program output, offering instructions for accessing and positioning the editor.', 'It covers the initial setup and navigation in Xcode for iOS development, providing guidance on creating a new file, opening the assistant editor, and understanding the workspace layout.', 'The chapter discusses that variable names must start with a letter, and they can contain most any Unicode character except for white space, mathematical symbols, or arrows. Variable naming conventions and restrictions.', "It explains the differences between using 'var' and 'let' keywords for variable declaration, where 'var' allows the value to be changed, and 'let' declares a constant. Differences between 'var' and 'let' in variable declaration.", 'The chapter emphasizes the usage of type inference to guess the data type based on the stored data, as well as the importance of defining data types for variables. Usage of type inference, importance of defining data types for variables.', 'It highlights the precision issues with floats and doubles, indicating that floats have an accuracy limit to six digits, while doubles have precision up to 15 digits. Precision issues with floats and doubles.']}, {'end': 1517.061, 'segs': [{'end': 679.868, 'src': 'embed', 'start': 655.657, 'weight': 0, 'content': [{'end': 663.104, 'text': "If you'd like to generate a random number you're just going to come in here and you're going to type in arc for random, right like this.", 'start': 655.657, 'duration': 7.447}, {'end': 670.426, 'text': 'And then the maximum number you want to generate between 0 and, but not including this.', 'start': 663.484, 'duration': 6.942}, {'end': 675.527, 'text': 'This basically just means I want to generate a random number between 0 and 10.', 'start': 670.706, 'duration': 4.821}, {'end': 677.348, 'text': 'See, one less than whatever you put inside of there.', 'start': 675.527, 'duration': 1.821}, {'end': 679.868, 'text': 'And here you can see the random number generated is 0.', 'start': 677.588, 'duration': 2.28}], 'summary': 'Generate a random number between 0 and 10 using arc for random.', 'duration': 24.211, 'max_score': 655.657, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY655657.jpg'}, {'end': 713.335, 'src': 'embed', 'start': 689.656, 'weight': 1, 'content': [{'end': 696.858, 'text': 'Now, the conditional operators that we have available to us are going to be greater than less than, greater than or equal to, less than or equal to,', 'start': 689.656, 'duration': 7.202}, {'end': 698.558, 'text': 'equal to and not equal to.', 'start': 696.858, 'duration': 1.7}, {'end': 703.299, 'text': "And the logical operators we're going to have available are and, or, and, not.", 'start': 698.758, 'duration': 4.541}, {'end': 709.801, 'text': "Now I'm going to go in here and show you exactly how they work, and also take a look at ifs, elses, and else ifs, and all that stuff.", 'start': 703.559, 'duration': 6.242}, {'end': 713.335, 'text': "So let's come in here and let's create a constant for age.", 'start': 710.111, 'duration': 3.224}], 'summary': 'Introduction to conditional and logical operators with examples.', 'duration': 23.679, 'max_score': 689.656, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY689656.jpg'}, {'end': 877.653, 'src': 'embed', 'start': 852.773, 'weight': 2, 'content': [{'end': 858.218, 'text': 'And that brings us to another way of testing conditionals, and that is going to be the switch statement.', 'start': 852.773, 'duration': 5.445}, {'end': 864.644, 'text': 'Now the switch statement in Swift, unlike many other languages, is going to work with ints, doubles, floats, booleans,', 'start': 858.478, 'duration': 6.166}, {'end': 866.746, 'text': 'strings and a whole bunch of other different things.', 'start': 864.644, 'duration': 2.102}, {'end': 874.69, 'text': "So let's just say we have a program here that is going to make suggestions based off of ingredients that you have available.", 'start': 867.166, 'duration': 7.524}, {'end': 877.653, 'text': "so let's just say we have pinto beans as our ingredient.", 'start': 874.69, 'duration': 2.963}], 'summary': 'Testing conditionals with switch statement in swift, works with ints, doubles, floats, booleans, and strings.', 'duration': 24.88, 'max_score': 852.773, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY852773.jpg'}, {'end': 1012.217, 'src': 'embed', 'start': 983.974, 'weight': 8, 'content': [{'end': 987.016, 'text': "and in this situation we're going to say something like i don't know.", 'start': 983.974, 'duration': 3.042}, {'end': 988.697, 'text': "So that's how switch statements work.", 'start': 987.256, 'duration': 1.441}, {'end': 992.521, 'text': 'And I might as well go in here and show you another situation in which we can use switch statements.', 'start': 988.938, 'duration': 3.583}, {'end': 995.804, 'text': 'Switch statements are pretty powerful inside of Swift.', 'start': 992.541, 'duration': 3.263}, {'end': 998.206, 'text': 'We could use something else called a range.', 'start': 996.024, 'duration': 2.182}, {'end': 1002.77, 'text': "What I'm going to do here is just come in and go let, meaning this is going to be a constant.", 'start': 998.506, 'duration': 4.264}, {'end': 1004.892, 'text': "And we'll use a test score here.", 'start': 1003.071, 'duration': 1.821}, {'end': 1008.716, 'text': "And we'll give it a value of 89 just to put something in there.", 'start': 1005.313, 'duration': 3.403}, {'end': 1012.217, 'text': 'Now what we can do is come in and go test score.', 'start': 1008.996, 'duration': 3.221}], 'summary': 'Swift switch statements are powerful, can use ranges, demonstrated with a test score of 89.', 'duration': 28.243, 'max_score': 983.974, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY983974.jpg'}, {'end': 1083.877, 'src': 'embed', 'start': 1056.95, 'weight': 4, 'content': [{'end': 1060.912, 'text': "as well as just pretty much any type of object which we'll get into here in a second.", 'start': 1056.95, 'duration': 3.962}, {'end': 1063.993, 'text': 'We can create an array in a couple different ways.', 'start': 1061.252, 'duration': 2.741}, {'end': 1067.394, 'text': 'We could go in here and say we want to have an array of friends.', 'start': 1064.273, 'duration': 3.121}, {'end': 1070.354, 'text': 'An array is just a bunch of boxes that contain data.', 'start': 1067.494, 'duration': 2.86}, {'end': 1076.056, 'text': 'And each one of those boxes is going to have a label or what is more commonly known as an index.', 'start': 1070.554, 'duration': 5.502}, {'end': 1081.537, 'text': 'The first index or the first value inside of an array is going to have the index 0.', 'start': 1076.396, 'duration': 5.141}, {'end': 1083.877, 'text': "And it's just going to continue going 1, 2, 3, 4, 5.", 'start': 1081.537, 'duration': 2.34}], 'summary': 'Arrays hold labeled data boxes, starting at index 0 and continuing sequentially.', 'duration': 26.927, 'max_score': 1056.95, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY1056950.jpg'}, {'end': 1339.058, 'src': 'heatmap', 'start': 1247.676, 'weight': 0.875, 'content': [{'end': 1255.539, 'text': "maybe we decided that we no longer want to have tomatoes and you can see that that's been moved and all the other different parts have all been moved over to the left.", 'start': 1247.676, 'duration': 7.863}, {'end': 1258.76, 'text': 'we could also come in and remove an item by its value.', 'start': 1255.539, 'duration': 3.221}, {'end': 1268.641, 'text': "so let's say we go if let match is equal to, and we could say that we want to find inside of the groceries array the value of beans and then,", 'start': 1258.76, 'duration': 9.881}, {'end': 1276.986, 'text': "whenever we find it, we're going to go groceries remove at index and then get our match, and that is going to cut beans out of our array.", 'start': 1268.641, 'duration': 8.345}, {'end': 1281.249, 'text': "you're going to be able to sort the array pretty easily in neat ways sort of.", 'start': 1276.986, 'duration': 4.263}, {'end': 1289.073, 'text': "so we'll go, groceries is equal to sorted and then you're going to type in groceries like this and if you want to go from lowest to highest,", 'start': 1281.249, 'duration': 7.824}, {'end': 1290.634, 'text': 'you go less than otherwise.', 'start': 1289.073, 'duration': 1.561}, {'end': 1294.416, 'text': 'you would do greater than and you can see sorted it potato, whole wheat flour.', 'start': 1290.634, 'duration': 3.782}, {'end': 1301.219, 'text': "you could also, in a very similar way, go groceries reverse to reverse every single thing that's inside of the array.", 'start': 1294.416, 'duration': 6.803}, {'end': 1306.021, 'text': 'And yes, we can also create arrays inside of arrays or multi-dimensional arrays.', 'start': 1301.419, 'duration': 4.602}, {'end': 1307.561, 'text': 'So we can go array.', 'start': 1306.101, 'duration': 1.46}, {'end': 1309.942, 'text': "Let's say we want to put an array inside of an array.", 'start': 1307.801, 'duration': 2.141}, {'end': 1311.122, 'text': "Well, we'll just go like this.", 'start': 1310.062, 'duration': 1.06}, {'end': 1313.483, 'text': "Instead of one brackets, we're going to put two inside of there.", 'start': 1311.202, 'duration': 2.281}, {'end': 1316.204, 'text': 'And then we could go in and assign the different values.', 'start': 1313.703, 'duration': 2.501}, {'end': 1319.765, 'text': "So we're going to have our one big array and then our array inside of arrays.", 'start': 1316.424, 'duration': 3.341}, {'end': 1320.685, 'text': "And let's put it 0, 0.", 'start': 1320.065, 'duration': 0.62}, {'end': 1325.147, 'text': "So we'll be able to maybe a little bit easier be able to see exactly what's inside of here.", 'start': 1320.685, 'duration': 4.462}, {'end': 1327.329, 'text': 'And I just went through those into strings.', 'start': 1325.447, 'duration': 1.882}, {'end': 1334.834, 'text': 'See, I changed this from int to string to make a string array just so that we keep this being 0, 0 instead of just switching into regular 0.', 'start': 1327.369, 'duration': 7.465}, {'end': 1339.058, 'text': "And I'm setting this up so that we basically see that the first integer array,", 'start': 1334.834, 'duration': 4.224}], 'summary': 'Demonstrating array manipulation and creating multi-dimensional arrays in code.', 'duration': 91.382, 'max_score': 1247.676, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY1247676.jpg'}, {'end': 1319.765, 'src': 'embed', 'start': 1294.416, 'weight': 3, 'content': [{'end': 1301.219, 'text': "you could also, in a very similar way, go groceries reverse to reverse every single thing that's inside of the array.", 'start': 1294.416, 'duration': 6.803}, {'end': 1306.021, 'text': 'And yes, we can also create arrays inside of arrays or multi-dimensional arrays.', 'start': 1301.419, 'duration': 4.602}, {'end': 1307.561, 'text': 'So we can go array.', 'start': 1306.101, 'duration': 1.46}, {'end': 1309.942, 'text': "Let's say we want to put an array inside of an array.", 'start': 1307.801, 'duration': 2.141}, {'end': 1311.122, 'text': "Well, we'll just go like this.", 'start': 1310.062, 'duration': 1.06}, {'end': 1313.483, 'text': "Instead of one brackets, we're going to put two inside of there.", 'start': 1311.202, 'duration': 2.281}, {'end': 1316.204, 'text': 'And then we could go in and assign the different values.', 'start': 1313.703, 'duration': 2.501}, {'end': 1319.765, 'text': "So we're going to have our one big array and then our array inside of arrays.", 'start': 1316.424, 'duration': 3.341}], 'summary': 'Explains how to create multi-dimensional arrays in a programming language.', 'duration': 25.349, 'max_score': 1294.416, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY1294416.jpg'}, {'end': 1419.335, 'src': 'heatmap', 'start': 1371.576, 'weight': 0.714, 'content': [{'end': 1380.079, 'text': "Then we'll be able to go print line and then of course output whatever the value is for our row as well as the value for our column.", 'start': 1371.576, 'duration': 8.503}, {'end': 1385.26, 'text': "If we close that off you're going to see that it went out and printed all of that information out on our screen.", 'start': 1380.339, 'duration': 4.921}, {'end': 1388.361, 'text': "So that's a brief explanation of exactly how arrays work.", 'start': 1385.38, 'duration': 2.981}, {'end': 1391.082, 'text': "As we go on we're going to be looking at them a little bit more.", 'start': 1388.521, 'duration': 2.561}, {'end': 1394.383, 'text': "Now let's look at something very similar which is called a dictionary.", 'start': 1391.222, 'duration': 3.161}, {'end': 1399.385, 'text': "Now a dictionary is very similar to an array except it's going to hold key valued pairs.", 'start': 1394.523, 'duration': 4.862}, {'end': 1404.467, 'text': 'and the key is basically going to be the same thing as the index with arrays.', 'start': 1399.765, 'duration': 4.702}, {'end': 1413.172, 'text': "However, instead of just using 0 through 1, 2, 3, 4, 5, and so forth and so on, we're going to be able to use integers, double strings or even enums,", 'start': 1404.748, 'duration': 8.424}, {'end': 1414.432, 'text': "which we're going to look at here in a moment.", 'start': 1413.172, 'duration': 1.26}, {'end': 1419.335, 'text': "Now let's create a dictionary and we'll just go for superheroes,", 'start': 1414.592, 'duration': 4.743}], 'summary': 'An explanation of arrays and introduction to dictionaries in programming.', 'duration': 47.759, 'max_score': 1371.576, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY1371576.jpg'}, {'end': 1413.172, 'src': 'embed', 'start': 1385.38, 'weight': 7, 'content': [{'end': 1388.361, 'text': "So that's a brief explanation of exactly how arrays work.", 'start': 1385.38, 'duration': 2.981}, {'end': 1391.082, 'text': "As we go on we're going to be looking at them a little bit more.", 'start': 1388.521, 'duration': 2.561}, {'end': 1394.383, 'text': "Now let's look at something very similar which is called a dictionary.", 'start': 1391.222, 'duration': 3.161}, {'end': 1399.385, 'text': "Now a dictionary is very similar to an array except it's going to hold key valued pairs.", 'start': 1394.523, 'duration': 4.862}, {'end': 1404.467, 'text': 'and the key is basically going to be the same thing as the index with arrays.', 'start': 1399.765, 'duration': 4.702}, {'end': 1413.172, 'text': "However, instead of just using 0 through 1, 2, 3, 4, 5, and so forth and so on, we're going to be able to use integers, double strings or even enums,", 'start': 1404.748, 'duration': 8.424}], 'summary': 'Explanation of arrays and dictionaries, using key-value pairs instead of just indices.', 'duration': 27.792, 'max_score': 1385.38, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY1385380.jpg'}], 'start': 638.744, 'title': 'Swift programming fundamentals and data structures', 'summary': 'Covers swift programming basics including random number generation, conditional operators, if-else statements, ternary operator, switch statements, and range testing. it also introduces arrays, discussing the rules for storing data, creating and initializing arrays, adding, removing, and sorting elements, creating multi-dimensional arrays, and using for loops, while briefly covering dictionaries and tuples.', 'chapters': [{'end': 1040.792, 'start': 638.744, 'title': 'Swift programming basics', 'summary': 'Covers random number generation, conditional operators, if-else statements, ternary operator, switch statements, and range testing in swift programming, including examples and explanations.', 'duration': 402.048, 'highlights': ['The random number generator in Swift can be used to generate a random number between 0 and a specified maximum number, exclusive, such as between 0 and 10, providing control over the range of generated numbers.', 'The chapter explains the usage of conditional operators (greater than, less than, equal to, etc.) and logical operators (and, or, not) for creating if-else statements and handling different conditions based on the value of variables.', "It demonstrates the implementation of if-else statements with examples, such as checking age conditions and performing specific actions based on the evaluated conditions, including the usage of logical operators like 'or' and 'not'.", 'The concept of the ternary operator is introduced, which allows assigning a value based on a condition, providing a concise way of handling if-else scenarios in Swift programming.', 'The chapter delves into the usage of switch statements in Swift, covering its functionality with different data types (ints, doubles, floats, booleans, strings) and the default option triggered if no other case matches, including examples and explanations.', 'It also demonstrates the utilization of range testing in switch statements to handle a range of potential values, providing a comprehensive understanding of switch statement functionality in Swift.']}, {'end': 1517.061, 'start': 1040.792, 'title': 'Swift: arrays, dictionaries, and tuples', 'summary': 'Introduces the concept of arrays, discussing the rules for storing data, creating and initializing arrays, adding, removing, and sorting elements, creating multi-dimensional arrays, and using for loops. it also briefly covers dictionaries and tuples.', 'duration': 476.269, 'highlights': ['Arrays: Rules for Storing Data The only rule for storing data inside arrays is that the elements must be of the same type.', "Arrays: Initializing and Adding Values Arrays can be initialized with values like 'Bob' and can also have Swift automatically infer the data type, as demonstrated by initializing with values such as '3, 6, 9'.", "Arrays: Adding and Removing Elements The 'append' method is used to add values to an array, and the 'insert' and 'remove' methods allow for inserting and removing items at specific indexes or by value.", "Arrays: Sorting and Reversing Arrays can be sorted using the 'sorted' method and reversed using the 'reverse' method, providing flexibility in organizing array elements.", 'Arrays: Multi-Dimensional Arrays and For Loops The concept of multi-dimensional arrays is introduced, and the usage of for loops to cycle through the elements of arrays is demonstrated.', 'Dictionaries: Creating and Managing Dictionaries, similar to arrays, store key-value pairs, and values can be added, counted, and removed by referencing the dictionary by name.', "Tuples: Creating and Accessing Values Tuples are used to store multiple values and can be accessed by referencing the tuple's name and the specific data type."]}], 'duration': 878.317, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY638744.jpg', 'highlights': ['The random number generator in Swift can be used to generate a random number between 0 and a specified maximum number, exclusive, such as between 0 and 10, providing control over the range of generated numbers.', 'The chapter explains the usage of conditional operators (greater than, less than, equal to, etc.) and logical operators (and, or, not) for creating if-else statements and handling different conditions based on the value of variables.', 'The concept of the ternary operator is introduced, which allows assigning a value based on a condition, providing a concise way of handling if-else scenarios in Swift programming.', "Arrays: Sorting and Reversing Arrays can be sorted using the 'sorted' method and reversed using the 'reverse' method, providing flexibility in organizing array elements.", "Arrays: Adding and Removing Elements The 'append' method is used to add values to an array, and the 'insert' and 'remove' methods allow for inserting and removing items at specific indexes or by value.", 'The chapter delves into the usage of switch statements in Swift, covering its functionality with different data types (ints, doubles, floats, booleans, strings) and the default option triggered if no other case matches, including examples and explanations.', 'Arrays: Multi-Dimensional Arrays and For Loops The concept of multi-dimensional arrays is introduced, and the usage of for loops to cycle through the elements of arrays is demonstrated.', 'Dictionaries: Creating and Managing Dictionaries, similar to arrays, store key-value pairs, and values can be added, counted, and removed by referencing the dictionary by name.', 'The chapter demonstrates the utilization of range testing in switch statements to handle a range of potential values, providing a comprehensive understanding of switch statement functionality in Swift.']}, {'end': 1851.858, 'segs': [{'end': 1656.188, 'src': 'embed', 'start': 1615.642, 'weight': 0, 'content': [{'end': 1620.225, 'text': "How we'd do that is we'd say if i is equal to 10, we'll then break.", 'start': 1615.642, 'duration': 4.583}, {'end': 1622.443, 'text': "And that's going to jump us out of the for loop.", 'start': 1620.663, 'duration': 1.78}, {'end': 1626.524, 'text': 'So continue is going to jump us back up to the beginning of the for loop and continue execution.', 'start': 1622.623, 'duration': 3.901}, {'end': 1629.105, 'text': 'Break is going to jump us after this curly bracket.', 'start': 1626.744, 'duration': 2.361}, {'end': 1631.105, 'text': 'And that is the only way that they really differ.', 'start': 1629.465, 'duration': 1.64}, {'end': 1634.106, 'text': "And otherwise, it's going to print out the data on our screen.", 'start': 1631.425, 'duration': 2.681}, {'end': 1637.026, 'text': 'And you can see that it printed out 2, 4, 6, and 8.', 'start': 1634.386, 'duration': 2.64}, {'end': 1639.807, 'text': "And it didn't print out 10 because of this guy right here.", 'start': 1637.026, 'duration': 2.781}, {'end': 1643.288, 'text': 'Now there is a whole bunch of different types of for loops inside of Swift.', 'start': 1640.027, 'duration': 3.261}, {'end': 1646.128, 'text': "Also use what's called the for in loop.", 'start': 1643.588, 'duration': 2.54}, {'end': 1648.529, 'text': 'So we could say for j in.', 'start': 1646.328, 'duration': 2.201}, {'end': 1650.529, 'text': 'And then we could use a range.', 'start': 1648.889, 'duration': 1.64}, {'end': 1656.188, 'text': 'So we could say the range of values that j is going to have are negative 5 the whole way through 5.', 'start': 1651.004, 'duration': 5.184}], 'summary': 'Explains the difference between continue and break in a for loop, and demonstrates output with a range of values.', 'duration': 40.546, 'max_score': 1615.642, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY1615642.jpg'}, {'end': 1860.023, 'src': 'embed', 'start': 1826.172, 'weight': 3, 'content': [{'end': 1829.335, 'text': 'And then you just need to increment inside of your while loop.', 'start': 1826.172, 'duration': 3.163}, {'end': 1832.839, 'text': "And that's going to cycle through and print 1 through 10 or 0 through 10.", 'start': 1829.496, 'duration': 3.343}, {'end': 1834.921, 'text': 'And then we also have the do while loop.', 'start': 1832.839, 'duration': 2.082}, {'end': 1838.105, 'text': "Again, the value you're going to be incrementing, you want to put outside of it.", 'start': 1835.262, 'duration': 2.843}, {'end': 1846.774, 'text': 'And the only difference between the do while loop and the while loop is the do while loop is going to do everything that is inside of here at least one time,', 'start': 1838.245, 'duration': 8.529}, {'end': 1848.276, 'text': 'whether the condition is true or not.', 'start': 1846.774, 'duration': 1.502}, {'end': 1848.956, 'text': 'There we go.', 'start': 1848.496, 'duration': 0.46}, {'end': 1851.858, 'text': 'We can increment the value of L in that situation.', 'start': 1849.136, 'duration': 2.722}, {'end': 1860.023, 'text': 'And the reason why is it goes through that whole entire list of code, and then it checks if L is less than or equal to 10 at the very end of it.', 'start': 1852.078, 'duration': 7.945}], 'summary': 'Explanation of while and do while loops with incrementing and conditions.', 'duration': 33.851, 'max_score': 1826.172, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY1826172.jpg'}], 'start': 1517.081, 'title': 'Loops in swift and javascript', 'summary': "Covers the basics of tuples and for loops in swift, iterating through a range and executing code based on conditions to output even numbers. it also demonstrates the use of for, while, and do while loops in javascript, with examples such as counting lowercase 'a's in a quote and cycling through a dictionary of heroes and their secret identities.", 'chapters': [{'end': 1656.188, 'start': 1517.081, 'title': 'Tuples and for loops in swift', 'summary': 'Covers the basics of tuples and for loops in swift, with an emphasis on using for loops to iterate through a range and execute code based on specific conditions, resulting in the output of even numbers within a certain range.', 'duration': 139.107, 'highlights': ['The for loop is used to iterate through a range and execute code based on specific conditions. The chapter explains the use of for loops to iterate through a range of values and execute code based on conditions, such as printing only even numbers within a certain range.', 'The use of continue and break statements to control the flow of the for loop. The chapter describes the use of continue to skip certain code and increment the loop, and break to exit the loop, with a practical example resulting in the output of 2, 4, 6, and 8, excluding 10.', 'Explanation of different types of for loops in Swift, including the for-in loop and using a range of values. The chapter introduces the for-in loop and demonstrates using a range of values for iteration, exemplifying the range of values from negative 5 to 5.']}, {'end': 1851.858, 'start': 1656.188, 'title': 'Using loops in javascript', 'summary': "Demonstrates the use of for loops, while loops, and do while loops to cycle through arrays, dictionaries, and ranges, with specific examples and results, including printing out the total number of lowercase 'a's in a quote and cycling through a dictionary of heroes and their secret identities.", 'duration': 195.67, 'highlights': ["The chapter demonstrates the use of for loops to cycle through arrays, dictionaries, and ranges, with specific examples and results, including printing out the total number of lowercase 'a's in a quote and cycling through a dictionary of heroes and their secret identities.", "The for loop is used to cycle through an array, printing out each individual person in the array, resulting in 'Bob Fred and Paul' being printed out on the screen.", "The for loop is utilized to cycle through a dictionary of heroes and their secret identities, resulting in 'Batman is Bruce Wayne, Flash is Barry Allen, and Superman is Clark Kent' being printed out on the screen.", 'The chapter introduces while loops and do while loops, illustrating their usage to cycle through values and print the results, such as printing the values from 0 through 10 in a while loop and cycling through the do while loop to increment the value and print the results.']}], 'duration': 334.777, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY1517081.jpg', 'highlights': ['The for loop is used to iterate through a range and execute code based on specific conditions.', 'The chapter demonstrates the use of for loops to cycle through arrays, dictionaries, and ranges.', 'The use of continue and break statements to control the flow of the for loop.', 'The chapter introduces while loops and do while loops, illustrating their usage to cycle through values and print the results.', 'Explanation of different types of for loops in Swift, including the for-in loop and using a range of values.']}, {'end': 2093.415, 'segs': [{'end': 1897.981, 'src': 'embed', 'start': 1872.315, 'weight': 0, 'content': [{'end': 1877.497, 'text': 'Now functions are going to allow us to reuse code as well as better organize our code.', 'start': 1872.315, 'duration': 5.182}, {'end': 1879.817, 'text': "So let's create a couple simple functions.", 'start': 1877.717, 'duration': 2.1}, {'end': 1882.658, 'text': "Let's create one that just says say hello.", 'start': 1880.077, 'duration': 2.581}, {'end': 1890.72, 'text': "And what we can do is say that we're going to be receiving a string in this situation, which we're going to give the value of name.", 'start': 1882.678, 'duration': 8.042}, {'end': 1893.879, 'text': "And that's the only attribute it's going to be receiving.", 'start': 1891.718, 'duration': 2.161}, {'end': 1897.981, 'text': "And whenever it gets that name sent over to it, it's just going to print out hello name.", 'start': 1894.159, 'duration': 3.822}], 'summary': 'Creating functions to reuse code and organize it. implementing a simple function to say hello.', 'duration': 25.666, 'max_score': 1872.315, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY1872315.jpg'}, {'end': 1984.331, 'src': 'embed', 'start': 1947.159, 'weight': 1, 'content': [{'end': 1950.903, 'text': "And then we're going to type in the data type that we're going to be returning from our function.", 'start': 1947.159, 'duration': 3.744}, {'end': 1951.784, 'text': "So that's a little bit odd.", 'start': 1950.923, 'duration': 0.861}, {'end': 1955.928, 'text': 'And then to return a value, we just go num1 plus num2.', 'start': 1952.124, 'duration': 3.804}, {'end': 1959.912, 'text': 'And then we could pass in two values inside of here as the attributes.', 'start': 1956.148, 'duration': 3.764}, {'end': 1965.417, 'text': "But if you do that without saying what variables they should be assigned to, you're going to get in a little bit of an error here.", 'start': 1959.932, 'duration': 5.485}, {'end': 1969.081, 'text': 'And in that situation, to correct that, you would say num1 colon num2.', 'start': 1965.718, 'duration': 3.363}, {'end': 1971.058, 'text': 'and num2, colon.', 'start': 1969.597, 'duration': 1.461}, {'end': 1972.88, 'text': "And if you do that, it's going to add those up.", 'start': 1971.239, 'duration': 1.641}, {'end': 1976.123, 'text': "We're also going to be able to use something called variadic parameters,", 'start': 1973.1, 'duration': 3.023}, {'end': 1980.828, 'text': "which is what we're going to use whenever you don't know how many attributes could possibly be sent into a function.", 'start': 1976.123, 'duration': 4.705}, {'end': 1983.11, 'text': "So we'll say function getSum2.", 'start': 1981.168, 'duration': 1.942}, {'end': 1984.331, 'text': "Let's create a new one.", 'start': 1983.25, 'duration': 1.081}], 'summary': 'The transcript discusses returning values from a function and handling variadic parameters in swift programming.', 'duration': 37.172, 'max_score': 1947.159, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY1947159.jpg'}], 'start': 1852.078, 'title': 'Functions and code reuse', 'summary': 'Discusses the use of functions to reuse code with examples of creating simple and complex functions, handling arguments, default values, return types, and variadic parameters.', 'chapters': [{'end': 2093.415, 'start': 1852.078, 'title': 'Functions and code reuse', 'summary': 'Discusses the use of functions to reuse code and better organize it, with examples of creating simple and complex functions, including handling arguments, default values, return types, and variadic parameters.', 'duration': 241.337, 'highlights': ['Examples of creating simple and complex functions The chapter provides examples of creating simple and complex functions to reuse code and better organize it.', 'Handling arguments, default values, and return types It covers the handling of arguments, default values, and return types in functions.', 'Explanation of variadic parameters The chapter explains variadic parameters and their use when the number of attributes sent into a function is unknown.']}], 'duration': 241.337, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY1852078.jpg', 'highlights': ['Examples of creating simple and complex functions to reuse code and better organize it.', 'Handling arguments, default values, and return types in functions.', 'Explanation of variadic parameters and their use when the number of attributes sent into a function is unknown.']}, {'end': 2669.183, 'segs': [{'end': 2186.057, 'src': 'embed', 'start': 2156.98, 'weight': 0, 'content': [{'end': 2165.598, 'text': "what's actually being passed back here is a tuple and they're being stored in these two variable types of the tuple and you can see 100 and 150 comes back.", 'start': 2156.98, 'duration': 8.618}, {'end': 2169.301, 'text': 'another thing we can do inside of swift, which is a little bit weird.', 'start': 2165.598, 'duration': 3.703}, {'end': 2171.583, 'text': "if you don't quite get this, just don't worry about it.", 'start': 2169.301, 'duration': 2.282}, {'end': 2173.205, 'text': 'continue and then come back to it.', 'start': 2171.583, 'duration': 1.622}, {'end': 2175.947, 'text': 'you can actually return a function.', 'start': 2173.205, 'duration': 2.742}, {'end': 2186.057, 'text': "so what we're going to do is we're going to create two functions and this is going to get numbers and it's going to be just a series of integers being passed inside of here.", 'start': 2175.947, 'duration': 10.11}], 'summary': 'Functions can be returned in swift, with a tuple returning 100 and 150.', 'duration': 29.077, 'max_score': 2156.98, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2156980.jpg'}, {'end': 2246.13, 'src': 'embed', 'start': 2218.164, 'weight': 1, 'content': [{'end': 2223.268, 'text': "So what we're going to do here is we're going to be able to call either average or sum based off of a condition.", 'start': 2218.164, 'duration': 5.104}, {'end': 2225.089, 'text': "So let's create a sum function here.", 'start': 2223.508, 'duration': 1.581}, {'end': 2227.25, 'text': "Again, it's going to receive a series of integers.", 'start': 2225.109, 'duration': 2.141}, {'end': 2227.971, 'text': "Don't know how many.", 'start': 2227.29, 'duration': 0.681}, {'end': 2228.992, 'text': "It's going to return a double.", 'start': 2228.051, 'duration': 0.941}, {'end': 2231.273, 'text': 'Actually, the average in this situation.', 'start': 2229.352, 'duration': 1.921}, {'end': 2232.554, 'text': "We're also going to come up here.", 'start': 2231.493, 'duration': 1.061}, {'end': 2234.563, 'text': 'Go double, nums count.', 'start': 2232.938, 'duration': 1.625}, {'end': 2236.91, 'text': "That's how we get the total number of that.", 'start': 2234.784, 'duration': 2.126}, {'end': 2238.515, 'text': "And that's going to return an average.", 'start': 2237.071, 'duration': 1.444}, {'end': 2241.707, 'text': 'And this is just going to return a simple sum.', 'start': 2238.965, 'duration': 2.742}, {'end': 2246.13, 'text': "Now the weird part where we're actually returning a function is going to happen right here.", 'start': 2241.887, 'duration': 4.243}], 'summary': 'Creating a function to calculate average or sum based on a condition for a series of integers.', 'duration': 27.966, 'max_score': 2218.164, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2218164.jpg'}, {'end': 2353.993, 'src': 'embed', 'start': 2328.479, 'weight': 5, 'content': [{'end': 2334.126, 'text': 'and then pass values into them and have them automatically jump to the right function and perform the right calculation.', 'start': 2328.479, 'duration': 5.647}, {'end': 2339.082, 'text': "So like I said, that's a little bit weird, but like I said, I also wanted to be able to cover mostly everything here.", 'start': 2334.298, 'duration': 4.784}, {'end': 2341.083, 'text': 'And that brings us to inner functions.', 'start': 2339.102, 'duration': 1.981}, {'end': 2346.567, 'text': "What we're going to do here is return an inner function that's going to receive two integers and return a string.", 'start': 2341.103, 'duration': 5.464}, {'end': 2347.768, 'text': "So we'll go function.", 'start': 2346.847, 'duration': 0.921}, {'end': 2352.331, 'text': "And like I said, if you don't quite get these, these are a little bit more advanced, but I just wanted to cover them.", 'start': 2348.068, 'duration': 4.263}, {'end': 2353.993, 'text': "So I'm going to call this multiply it.", 'start': 2352.351, 'duration': 1.642}], 'summary': 'Covering inner functions and passing values for automatic calculations.', 'duration': 25.514, 'max_score': 2328.479, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2328479.jpg'}, {'end': 2509.084, 'src': 'heatmap', 'start': 2421.189, 'weight': 0.952, 'content': [{'end': 2421.909, 'text': 'There you go.', 'start': 2421.189, 'duration': 0.72}, {'end': 2422.929, 'text': '5 plus 3 is equal to 8.', 'start': 2421.929, 'duration': 1}, {'end': 2426.63, 'text': 'So those are all the different weird ways we can work with functions.', 'start': 2422.929, 'duration': 3.701}, {'end': 2428.491, 'text': "Now let's take a look at closures.", 'start': 2426.85, 'duration': 1.641}, {'end': 2431.092, 'text': "Okay, so now let's talk about closures.", 'start': 2428.911, 'duration': 2.181}, {'end': 2436.853, 'text': "Now closures confuse people a lot, but they're just basically self-contained code, just like a function.", 'start': 2431.552, 'duration': 5.301}, {'end': 2443.995, 'text': 'And the only thing that is a little bit odd about them is that they can be anonymous and have no name, where a function has to have a name.', 'start': 2437.053, 'duration': 6.942}, {'end': 2448.018, 'text': 'And the basic layout of a closure is basically what you see right here.', 'start': 2444.255, 'duration': 3.763}, {'end': 2451.78, 'text': "You're going to have your parameter types, like this, and your return types.", 'start': 2448.038, 'duration': 3.742}, {'end': 2453.862, 'text': "And then you're going to have the keyword in.", 'start': 2451.98, 'duration': 1.882}, {'end': 2456.924, 'text': "You're going to have whatever your code is, the statements there.", 'start': 2454.142, 'duration': 2.782}, {'end': 2459.045, 'text': "And you're going to have a return value.", 'start': 2457.064, 'duration': 1.981}, {'end': 2460.926, 'text': "Now let's create some closures.", 'start': 2459.065, 'duration': 1.861}, {'end': 2465.57, 'text': "Let's create a really simple one that's just going to accept and then return an integer.", 'start': 2461.367, 'duration': 4.203}, {'end': 2468.512, 'text': "I'm going to call this var square this.", 'start': 2465.59, 'duration': 2.922}, {'end': 2470.613, 'text': 'Going to receive an integer.', 'start': 2469.032, 'duration': 1.581}, {'end': 2473.555, 'text': 'And then it is going to return an integer.', 'start': 2471.053, 'duration': 2.502}, {'end': 2478.982, 'text': "have this equal to, and then we're going to say num in, make sure you have the in there.", 'start': 2473.979, 'duration': 5.003}, {'end': 2483.125, 'text': "and then on the next line we're going to say return num times, num.", 'start': 2478.982, 'duration': 4.143}, {'end': 2490.729, 'text': "so pretty simplistic and you can see it's going to be very easy for us to pass in 15 to that function and then over here you can see the final result.", 'start': 2483.125, 'duration': 7.604}, {'end': 2492.691, 'text': 'so that is a very simple closure.', 'start': 2490.729, 'duration': 1.962}, {'end': 2496.533, 'text': "now we're just going to ramp it up and get more and more complex as we go on here.", 'start': 2492.691, 'duration': 3.842}, {'end': 2498.955, 'text': 'But before we do, I just want to point out something.', 'start': 2496.713, 'duration': 2.242}, {'end': 2503.179, 'text': 'Remember previously we were able to assign a function to a variable.', 'start': 2499.115, 'duration': 4.064}, {'end': 2509.084, 'text': "We're also going to be able to come in here and assign a closure to a variable in exactly the same way.", 'start': 2503.319, 'duration': 5.765}], 'summary': 'The transcript discusses closures and creating simple closures to return integer values.', 'duration': 87.895, 'max_score': 2421.189, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2421189.jpg'}, {'end': 2451.78, 'src': 'embed', 'start': 2422.929, 'weight': 6, 'content': [{'end': 2426.63, 'text': 'So those are all the different weird ways we can work with functions.', 'start': 2422.929, 'duration': 3.701}, {'end': 2428.491, 'text': "Now let's take a look at closures.", 'start': 2426.85, 'duration': 1.641}, {'end': 2431.092, 'text': "Okay, so now let's talk about closures.", 'start': 2428.911, 'duration': 2.181}, {'end': 2436.853, 'text': "Now closures confuse people a lot, but they're just basically self-contained code, just like a function.", 'start': 2431.552, 'duration': 5.301}, {'end': 2443.995, 'text': 'And the only thing that is a little bit odd about them is that they can be anonymous and have no name, where a function has to have a name.', 'start': 2437.053, 'duration': 6.942}, {'end': 2448.018, 'text': 'And the basic layout of a closure is basically what you see right here.', 'start': 2444.255, 'duration': 3.763}, {'end': 2451.78, 'text': "You're going to have your parameter types, like this, and your return types.", 'start': 2448.038, 'duration': 3.742}], 'summary': 'Closure is self-contained code, can be anonymous, with parameters and return types.', 'duration': 28.851, 'max_score': 2422.929, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2422929.jpg'}, {'end': 2588.427, 'src': 'heatmap', 'start': 2542.356, 'weight': 0.748, 'content': [{'end': 2547.206, 'text': 'we could also have a closure that has no attributes but does return something.', 'start': 2542.356, 'duration': 4.85}, {'end': 2551.067, 'text': "so we'll say say happy again, receives nothing,", 'start': 2547.206, 'duration': 3.861}, {'end': 2559.993, 'text': 'and it returns a string equal to say something like happy birthday and then call it from inside of print line and you can see it says happy birthday over here.', 'start': 2551.067, 'duration': 8.926}, {'end': 2566.156, 'text': "another thing we can do that is kind of neat with a closure is we're going to be able to reference variables that are outside of it.", 'start': 2559.993, 'duration': 6.163}, {'end': 2567.117, 'text': "so let's create one.", 'start': 2566.156, 'duration': 0.961}, {'end': 2569.859, 'text': "let's call this number three and give it a value of three.", 'start': 2567.117, 'duration': 2.742}, {'end': 2572.822, 'text': 'give our increment num is equal to.', 'start': 2569.859, 'duration': 2.963}, {'end': 2576.943, 'text': "You're not going to be able to do this with a function, but you can do it with a closure.", 'start': 2572.842, 'duration': 4.101}, {'end': 2584.186, 'text': "And then, just to prove that it can be done, we'll just go print line number three and it will increment it on top of that and then have that execute.", 'start': 2577.184, 'duration': 7.002}, {'end': 2588.427, 'text': 'And you can see that it incremented it, and it also went and printed it out there on the screen.', 'start': 2584.326, 'duration': 4.101}], 'summary': 'Closures can return and reference external variables, as seen in incrementing and printing a value.', 'duration': 46.071, 'max_score': 2542.356, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2542356.jpg'}, {'end': 2584.186, 'src': 'embed', 'start': 2559.993, 'weight': 2, 'content': [{'end': 2566.156, 'text': "another thing we can do that is kind of neat with a closure is we're going to be able to reference variables that are outside of it.", 'start': 2559.993, 'duration': 6.163}, {'end': 2567.117, 'text': "so let's create one.", 'start': 2566.156, 'duration': 0.961}, {'end': 2569.859, 'text': "let's call this number three and give it a value of three.", 'start': 2567.117, 'duration': 2.742}, {'end': 2572.822, 'text': 'give our increment num is equal to.', 'start': 2569.859, 'duration': 2.963}, {'end': 2576.943, 'text': "You're not going to be able to do this with a function, but you can do it with a closure.", 'start': 2572.842, 'duration': 4.101}, {'end': 2584.186, 'text': "And then, just to prove that it can be done, we'll just go print line number three and it will increment it on top of that and then have that execute.", 'start': 2577.184, 'duration': 7.002}], 'summary': "Using closures, we can reference external variables and increment them, as demonstrated by incrementing and printing the value of 'number three'.", 'duration': 24.193, 'max_score': 2559.993, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2559993.jpg'}, {'end': 2675.027, 'src': 'embed', 'start': 2647.323, 'weight': 7, 'content': [{'end': 2650.347, 'text': "So there's a whole bunch of different ways we can use closures.", 'start': 2647.323, 'duration': 3.024}, {'end': 2654.291, 'text': "Now let's take a look at structs, which are very similar to classes.", 'start': 2650.507, 'duration': 3.784}, {'end': 2658.175, 'text': 'Now basically a struct is just a custom data type.', 'start': 2655.233, 'duration': 2.942}, {'end': 2662.978, 'text': "And they're mainly used when you don't have the need to inherit like you would with a class.", 'start': 2658.395, 'duration': 4.583}, {'end': 2667.482, 'text': "And they're also used whenever you are wanting to model simple data structures.", 'start': 2663.299, 'duration': 4.183}, {'end': 2669.183, 'text': "So let's say we create one.", 'start': 2667.822, 'duration': 1.361}, {'end': 2671.484, 'text': "This isn't going to be that simple of a struct.", 'start': 2669.203, 'duration': 2.281}, {'end': 2673.286, 'text': "I'm going to do something a little bit interesting here.", 'start': 2671.504, 'duration': 1.782}, {'end': 2675.027, 'text': "I'm going to create a struct called runner.", 'start': 2673.306, 'duration': 1.721}], 'summary': 'Different ways to use closures and creation of a struct called runner.', 'duration': 27.704, 'max_score': 2647.323, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2647323.jpg'}], 'start': 2093.415, 'title': 'Swift programming and functions', 'summary': 'Covers returning multiple values using tuples in swift, creating functions for sum and average calculations, inner functions, and closures with arrays and map method. it also introduces custom data types using structs.', 'chapters': [{'end': 2175.947, 'start': 2093.415, 'title': 'Swift programming: returning multiple values', 'summary': 'Explains how to return multiple values using tuples in swift, demonstrating the syntax and usage with an example. it also showcases the capability to return a function within swift.', 'duration': 82.532, 'highlights': ['The chapter demonstrates returning multiple values using tuples in Swift, enabling the function to return x2 and x3 as integers, proving the usefulness of returning multiple values.', 'It showcases the syntax and usage of tuples in Swift, exemplifying how to store and access multiple values returned from a function, demonstrating the return of 100 and 150 as a tuple.', 'The chapter introduces the capability to return a function within Swift, advising to revisit the concept if it seems challenging initially.']}, {'end': 2422.929, 'start': 2175.947, 'title': 'Creating functions and inner functions', 'summary': 'Covers creating functions to calculate sum and average based on a condition, as well as the concept of inner functions, allowing for the execution of calculations based on different functions and values.', 'duration': 246.982, 'highlights': ['Creating functions to calculate sum and average based on a condition The chapter explains the creation of functions to calculate the sum and average based on a condition, allowing the user to call either average or sum based on a condition, and then pass values into them for automatic calculation.', 'Concept of inner functions for executing calculations based on different functions and values The concept of inner functions is covered, demonstrating the creation of an inner function that receives two integers and returns a string, providing a reference to a function that can be used to execute the inner calculation.']}, {'end': 2669.183, 'start': 2422.929, 'title': 'Closures and structs', 'summary': 'Discusses closures, showcasing their basic layout, creation, usage, and referencing of external variables, along with using arrays and map method with closures. it also briefly introduces structs as custom data types for modeling simple data structures.', 'duration': 246.254, 'highlights': ['Closures can be anonymous and have no name, unlike functions, but are self-contained code just like a function, and can be assigned to a variable, showcasing different ways to create and use closures.', 'Closures can reference variables outside of them, allowing for actions like incrementing a variable and using arrays with map method to perform actions on every item inside the array using a closure.', 'Structs are custom data types mainly used when there is no need for inheritance and for modeling simple data structures, providing an overview of structs as an alternative to classes.']}], 'duration': 575.768, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2093415.jpg', 'highlights': ['The chapter demonstrates returning multiple values using tuples in Swift, enabling the function to return x2 and x3 as integers, proving the usefulness of returning multiple values.', 'Creating functions to calculate sum and average based on a condition, allowing the user to call either average or sum based on a condition, and then pass values into them for automatic calculation.', 'Closures can reference variables outside of them, allowing for actions like incrementing a variable and using arrays with map method to perform actions on every item inside the array using a closure.', 'It showcases the syntax and usage of tuples in Swift, exemplifying how to store and access multiple values returned from a function, demonstrating the return of 100 and 150 as a tuple.', 'The chapter introduces the capability to return a function within Swift, advising to revisit the concept if it seems challenging initially.', 'The concept of inner functions is covered, demonstrating the creation of an inner function that receives two integers and returns a string, providing a reference to a function that can be used to execute the inner calculation.', 'Closures can be anonymous and have no name, unlike functions, but are self-contained code just like a function, and can be assigned to a variable, showcasing different ways to create and use closures.', 'Structs are custom data types mainly used when there is no need for inheritance and for modeling simple data structures, providing an overview of structs as an alternative to classes.']}, {'end': 3285.998, 'segs': [{'end': 2698.559, 'src': 'embed', 'start': 2669.203, 'weight': 0, 'content': [{'end': 2671.484, 'text': "This isn't going to be that simple of a struct.", 'start': 2669.203, 'duration': 2.281}, {'end': 2673.286, 'text': "I'm going to do something a little bit interesting here.", 'start': 2671.504, 'duration': 1.782}, {'end': 2675.027, 'text': "I'm going to create a struct called runner.", 'start': 2673.306, 'duration': 1.721}, {'end': 2680.69, 'text': "And I'm going to create a variable inside of it called name, which is going to hold a string.", 'start': 2675.667, 'duration': 5.023}, {'end': 2683.892, 'text': "And then I'm going to create another one called mile pace.", 'start': 2680.89, 'duration': 3.002}, {'end': 2685.012, 'text': "And that's a double.", 'start': 2684.372, 'duration': 0.64}, {'end': 2690.675, 'text': "Now something that's neat we can do with structs is we can actually put methods inside of them.", 'start': 2685.312, 'duration': 5.363}, {'end': 2692.816, 'text': 'So we have the mile pace for this runner.', 'start': 2690.795, 'duration': 2.021}, {'end': 2698.559, 'text': "Let's say that I wanted to be able to generate the marathon pace for the runner and return a string from that.", 'start': 2692.856, 'duration': 5.703}], 'summary': "Creating a struct 'runner' with name and mile pace variables, and adding methods for generating marathon pace.", 'duration': 29.356, 'max_score': 2669.203, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2669203.jpg'}, {'end': 2880.662, 'src': 'heatmap', 'start': 2793.243, 'weight': 0.76, 'content': [{'end': 2798.884, 'text': 'or however you pronounce that can run a marathon in 4 minutes and 40.8 seconds.', 'start': 2793.243, 'duration': 5.641}, {'end': 2806.027, 'text': 'so that is the basic way you can interact with the value stored inside of a struct and also call functions inside of the struct.', 'start': 2798.884, 'duration': 7.143}, {'end': 2811.771, 'text': "So now let's take a look at something that's a little bit particular to Swift, which is what we call computed properties.", 'start': 2806.047, 'duration': 5.724}, {'end': 2816.274, 'text': 'Now a computed property is going to return versus store a value.', 'start': 2812.151, 'duration': 4.123}, {'end': 2821.638, 'text': "So let's say we wanted to go in here and get the marathon time, which is going to be a double.", 'start': 2816.414, 'duration': 5.224}, {'end': 2827.302, 'text': "What we could do is then say get and then put inside of here whatever calculation we'd like to make.", 'start': 2821.878, 'duration': 5.424}, {'end': 2830.544, 'text': 'So we could say, whatever the mile pace is for this runner,', 'start': 2827.382, 'duration': 3.162}, {'end': 2836.668, 'text': "we're going to multiply that times 26.2 and then divide that by 60 to get our final marathon time.", 'start': 2830.544, 'duration': 6.124}, {'end': 2847.26, 'text': 'We could then come down here after we went and called these other functions and easily see that the marathon finish for this specific runner would be 2.0436 hours.', 'start': 2836.808, 'duration': 10.452}, {'end': 2851.064, 'text': 'So that is what a computed property looks like inside of a struct.', 'start': 2847.6, 'duration': 3.464}, {'end': 2856.251, 'text': 'And pretty much the only other thing we could do here inside of a struct is create a static constant.', 'start': 2851.605, 'duration': 4.646}, {'end': 2861.997, 'text': "Let's say that we also wanted to store marathon distance inside of here just for the heck of it because we thought it made sense.", 'start': 2856.616, 'duration': 5.381}, {'end': 2864.378, 'text': 'We could go in there and type that in,', 'start': 2862.277, 'duration': 2.101}, {'end': 2874.16, 'text': "and then that is going to allow us to anytime call the struct specifically and get marathon distance and print that out if we'd like to do that or just work with the marathon distance.", 'start': 2864.378, 'duration': 9.782}, {'end': 2880.662, 'text': "So we can just go print line and then in this situation we'd use the struct's name followed by marathon distance,", 'start': 2874.58, 'duration': 6.082}], 'summary': 'In swift, computed properties can perform calculations and return values, like calculating marathon time in 2.0436 hours.', 'duration': 87.419, 'max_score': 2793.243, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2793243.jpg'}, {'end': 2856.251, 'src': 'embed', 'start': 2827.382, 'weight': 3, 'content': [{'end': 2830.544, 'text': 'So we could say, whatever the mile pace is for this runner,', 'start': 2827.382, 'duration': 3.162}, {'end': 2836.668, 'text': "we're going to multiply that times 26.2 and then divide that by 60 to get our final marathon time.", 'start': 2830.544, 'duration': 6.124}, {'end': 2847.26, 'text': 'We could then come down here after we went and called these other functions and easily see that the marathon finish for this specific runner would be 2.0436 hours.', 'start': 2836.808, 'duration': 10.452}, {'end': 2851.064, 'text': 'So that is what a computed property looks like inside of a struct.', 'start': 2847.6, 'duration': 3.464}, {'end': 2856.251, 'text': 'And pretty much the only other thing we could do here inside of a struct is create a static constant.', 'start': 2851.605, 'duration': 4.646}], 'summary': "Runner's marathon time calculated as 2.0436 hours using mile pace and distance.", 'duration': 28.869, 'max_score': 2827.382, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2827382.jpg'}, {'end': 2910.645, 'src': 'embed', 'start': 2882.742, 'weight': 4, 'content': [{'end': 2885.845, 'text': "So that's pretty much everything you'd need to know about structs.", 'start': 2882.742, 'duration': 3.103}, {'end': 2888.267, 'text': "So now let's go and take a look at classes.", 'start': 2886.205, 'duration': 2.062}, {'end': 2890.689, 'text': "I'm going to use a pretty simple class here.", 'start': 2888.647, 'duration': 2.042}, {'end': 2893.791, 'text': "I'm going to call it animal because I use this all the time.", 'start': 2890.709, 'duration': 3.082}, {'end': 2900.316, 'text': "And basically what we're doing with classes is we are trying to model real world things in computer programming language.", 'start': 2894.031, 'duration': 6.285}, {'end': 2903.979, 'text': 'So a real world animal very well should have a name.', 'start': 2900.657, 'duration': 3.322}, {'end': 2908.683, 'text': "And what you're going to want to do here is give everything a default value whenever you're defining it.", 'start': 2904.38, 'duration': 4.303}, {'end': 2910.645, 'text': 'And you can store anything inside of here.', 'start': 2908.863, 'duration': 1.782}], 'summary': 'Introducing classes to model real world things in programming with default values.', 'duration': 27.903, 'max_score': 2882.742, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2882742.jpg'}, {'end': 3075.992, 'src': 'embed', 'start': 3054.206, 'weight': 1, 'content': [{'end': 3062.548, 'text': 'Well, overloading a function is going to allow us to receive different types of numbers, even though the function name is exactly the same.', 'start': 3054.206, 'duration': 8.342}, {'end': 3066.289, 'text': "And it's going to just easily go and use the correct function.", 'start': 3062.768, 'duration': 3.521}, {'end': 3070.45, 'text': "So this one's going to receive two ints and return an int, just like that.", 'start': 3066.429, 'duration': 4.021}, {'end': 3072.051, 'text': 'Number one plus number two.', 'start': 3070.691, 'duration': 1.36}, {'end': 3075.992, 'text': "While this one is going to have exactly the same name, so I'm just going to copy it.", 'start': 3072.311, 'duration': 3.681}], 'summary': 'Overloading a function allows receiving different types of numbers with the same function name.', 'duration': 21.786, 'max_score': 3054.206, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3054206.jpg'}, {'end': 3145.466, 'src': 'embed', 'start': 3113.799, 'weight': 2, 'content': [{'end': 3116.061, 'text': "so now let's take a look at inheritance.", 'start': 3113.799, 'duration': 2.262}, {'end': 3119.423, 'text': 'so we went and we created our animal object.', 'start': 3116.061, 'duration': 3.362}, {'end': 3122.745, 'text': 'now, all these attributes in here and all these functions inside here.', 'start': 3119.423, 'duration': 3.322}, {'end': 3129.47, 'text': "let's say we wanted to create another type or class, such as dog, that's going to inherit from animal.", 'start': 3122.745, 'duration': 6.725}, {'end': 3132.273, 'text': 'all we do is put a colon in animal and just like that.', 'start': 3129.47, 'duration': 2.803}, {'end': 3138.839, 'text': 'now the dog has all the attributes and all of the methods that we defined inside of animal by default,', 'start': 3132.273, 'duration': 6.566}, {'end': 3145.466, 'text': 'and dog is going to be able to come in and either override methods inside of animal or create brand new methods.', 'start': 3138.839, 'duration': 6.627}], 'summary': 'Inheritance allows dog class to inherit attributes and methods from animal class, enabling method overriding and new method creation.', 'duration': 31.667, 'max_score': 3113.799, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3113799.jpg'}], 'start': 2669.203, 'title': 'Swift programming concepts', 'summary': 'Covers creating structs, methods for calculating marathon pace using math functions, swift structs, classes, computed properties, static constants, oop method overloading, inheritance, and automatic execution of correct functions.', 'chapters': [{'end': 2788.722, 'start': 2669.203, 'title': 'Creating structs and methods', 'summary': "Discusses creating a struct 'runner' with name and mile pace variables, implementing a method to calculate marathon pace, and utilizing math functions to derive the result, showcasing an example with specific mile paces.", 'duration': 119.519, 'highlights': ["The chapter explains creating a struct 'runner' with variables for name and mile pace, showcasing the use of methods within structs to calculate marathon pace.", 'It demonstrates the utilization of math functions to obtain the marathon pace for a specific runner, involving the absolute value of the pace and conversion to minutes and seconds.', 'The transcript delves into the implementation of specific mile paces for different runners and the calculation of their respective marathon paces based on the mile pace.']}, {'end': 3039.827, 'start': 2788.722, 'title': 'Swift structs and classes', 'summary': 'Explains how to interact with values stored inside a struct, use computed properties, create static constants, and model real-world things in computer programming language using classes in swift.', 'duration': 251.105, 'highlights': ['Explaining how to interact with values stored inside a struct The chapter explains how to interact with values stored inside a struct.', 'Demonstrating the use of computed properties The chapter demonstrates the use of computed properties for calculating marathon time and mile pace.', 'Creating static constants inside a struct The chapter discusses creating static constants inside a struct.', "Modeling real-world things using classes in Swift The chapter explains modeling real-world things using classes in Swift, with the example of creating an 'animal' class.", "Defining functions and initializing objects in a class The chapter explains defining functions, initializing objects, and performing actions in a class, using the example of an 'animal' class."]}, {'end': 3285.998, 'start': 3039.927, 'title': 'Overloading methods and inheritance in oop', 'summary': 'Explains method overloading to handle different types of data and inheritance in oop, showcasing the ability to override and create new methods within subclasses, and demonstrating the automatic execution of correct functions based on the object type.', 'duration': 246.071, 'highlights': ['Method overloading allows the same function name to handle different types of data, such as receiving two ints or two doubles, simplifying the usage of correct functions. The concept of method overloading is illustrated with examples of functions receiving different data types, such as ints and doubles, to demonstrate the ability to handle different types of data within the same function name.', "Inheritance enables subclasses to inherit attributes and methods from the superclass, with the flexibility to override or create new methods within the subclass. The explanation of inheritance showcases how a subclass, such as 'dog,' inherits attributes and methods from the superclass 'animal,' providing the ability to override or create new methods while maintaining inherited functionalities.", "The 'final' keyword restricts the overriding of a function, while the 'override' keyword allows the subclass to override a function from the superclass. The usage of 'final' keyword to restrict function overriding and the 'override' keyword to explicitly override a function from the superclass are explained, providing control over the inheritance and overriding behaviors in OOP."]}], 'duration': 616.795, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY2669203.jpg', 'highlights': ["The chapter explains creating a struct 'runner' with variables for name and mile pace, showcasing the use of methods within structs to calculate marathon pace.", 'Method overloading allows the same function name to handle different types of data, simplifying the usage of correct functions.', 'Inheritance enables subclasses to inherit attributes and methods from the superclass, with the flexibility to override or create new methods within the subclass.', 'Demonstrating the use of computed properties for calculating marathon time and mile pace.', "Modeling real-world things using classes in Swift, with the example of creating an 'animal' class."]}, {'end': 3567.986, 'segs': [{'end': 3311.779, 'src': 'embed', 'start': 3285.998, 'weight': 2, 'content': [{'end': 3290.943, 'text': "so let's go, spot name is equal to, let's say, spot's name got changed to doug.", 'start': 3285.998, 'duration': 4.945}, {'end': 3292.864, 'text': "That's how easy it is to change that.", 'start': 3291.263, 'duration': 1.601}, {'end': 3298.289, 'text': 'And if I wanted to go in here and check the overridden methods that we have right here, might as well just do that.', 'start': 3293.125, 'duration': 5.164}, {'end': 3298.969, 'text': 'There we go.', 'start': 3298.509, 'duration': 0.46}, {'end': 3301.411, 'text': "And you can see I'm passing all that information in there.", 'start': 3299.229, 'duration': 2.182}, {'end': 3306.015, 'text': "All I'm doing is adding on the num2 so it knows exactly where this value is sent.", 'start': 3301.431, 'duration': 4.584}, {'end': 3311.779, 'text': 'And you can see there that it performed those different calculations based off of different numbers going in there automatically.', 'start': 3306.315, 'duration': 5.464}], 'summary': "Changing spot's name to doug. overriding methods and performing calculations based on different numbers.", 'duration': 25.781, 'max_score': 3285.998, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3285998.jpg'}, {'end': 3384.368, 'src': 'heatmap', 'start': 3336.58, 'weight': 0.761, 'content': [{'end': 3339.202, 'text': 'And you could also come in and check is spot a dog.', 'start': 3336.58, 'duration': 2.622}, {'end': 3340.844, 'text': 'And that also comes back as true.', 'start': 3339.443, 'duration': 1.401}, {'end': 3343.767, 'text': 'So spot is both an animal as well as a dog.', 'start': 3341.084, 'duration': 2.683}, {'end': 3349.712, 'text': "If, however, you would go in and type in rover, you're going to get an answer of false because it doesn't work the other way.", 'start': 3344.027, 'duration': 5.685}, {'end': 3353.776, 'text': 'The dog is the animal, but the animal is not necessarily a dog.', 'start': 3349.872, 'duration': 3.904}, {'end': 3356.086, 'text': 'And that brings us to protocols.', 'start': 3354.565, 'duration': 1.521}, {'end': 3359.809, 'text': 'Now protocols are basically like interfaces in other languages.', 'start': 3356.146, 'duration': 3.663}, {'end': 3367.796, 'text': "And basically whenever you are saying you want to adopt a protocol, what you're saying is you agree to define the behavior that is described therein.", 'start': 3360.25, 'duration': 7.546}, {'end': 3369.117, 'text': "So let's create a protocol.", 'start': 3367.976, 'duration': 1.141}, {'end': 3370.158, 'text': "Here's a protocol.", 'start': 3369.357, 'duration': 0.801}, {'end': 3372.98, 'text': "And we're going to call this protocol flyable.", 'start': 3370.538, 'duration': 2.442}, {'end': 3374.882, 'text': "Say we're going to create a class.", 'start': 3373.32, 'duration': 1.562}, {'end': 3376.103, 'text': "It's going to be a vehicle.", 'start': 3375.162, 'duration': 0.941}, {'end': 3378.945, 'text': "And we're going to define if it can fly or not, basically.", 'start': 3376.183, 'duration': 2.762}, {'end': 3384.368, 'text': 'Now, you saw previously, whenever we were creating attributes inside of our class,', 'start': 3379.045, 'duration': 5.323}], 'summary': 'Example of defining protocols and behavior in object-oriented programming', 'duration': 47.788, 'max_score': 3336.58, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3336580.jpg'}, {'end': 3384.368, 'src': 'embed', 'start': 3360.25, 'weight': 1, 'content': [{'end': 3367.796, 'text': "And basically whenever you are saying you want to adopt a protocol, what you're saying is you agree to define the behavior that is described therein.", 'start': 3360.25, 'duration': 7.546}, {'end': 3369.117, 'text': "So let's create a protocol.", 'start': 3367.976, 'duration': 1.141}, {'end': 3370.158, 'text': "Here's a protocol.", 'start': 3369.357, 'duration': 0.801}, {'end': 3372.98, 'text': "And we're going to call this protocol flyable.", 'start': 3370.538, 'duration': 2.442}, {'end': 3374.882, 'text': "Say we're going to create a class.", 'start': 3373.32, 'duration': 1.562}, {'end': 3376.103, 'text': "It's going to be a vehicle.", 'start': 3375.162, 'duration': 0.941}, {'end': 3378.945, 'text': "And we're going to define if it can fly or not, basically.", 'start': 3376.183, 'duration': 2.762}, {'end': 3384.368, 'text': 'Now, you saw previously, whenever we were creating attributes inside of our class,', 'start': 3379.045, 'duration': 5.323}], 'summary': "Creating a 'flyable' protocol to define the behavior of a vehicle class.", 'duration': 24.118, 'max_score': 3360.25, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3360250.jpg'}, {'end': 3422.734, 'src': 'embed', 'start': 3395.315, 'weight': 4, 'content': [{'end': 3401.459, 'text': "If you want the getters and setters, by default they're created, but If you wanted the getters and setters to be generated,", 'start': 3395.315, 'duration': 6.144}, {'end': 3404.301, 'text': 'you could just go get and set inside of curly brackets.', 'start': 3401.459, 'duration': 2.842}, {'end': 3410.525, 'text': "If you didn't want the get to be available, you just put set, and otherwise you could type in get and get rid of the set.", 'start': 3404.521, 'duration': 6.004}, {'end': 3417.25, 'text': "And that's just a way of encapsulating or blocking different values from being settable for your variable types to protect them.", 'start': 3410.665, 'duration': 6.585}, {'end': 3422.734, 'text': "And with the protocol you're basically going to define the variables that you want set inside of here,", 'start': 3417.51, 'duration': 5.224}], 'summary': 'Getters and setters can be created using getter and setter methods inside curly brackets, allowing for encapsulation and defining settable variables in protocols.', 'duration': 27.419, 'max_score': 3395.315, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3395315.jpg'}, {'end': 3454.215, 'src': 'embed', 'start': 3430.358, 'weight': 0, 'content': [{'end': 3437.123, 'text': "You're going to define exactly what is going to be passed inside, as well as what is going to be returned,", 'start': 3430.358, 'duration': 6.765}, {'end': 3439.825, 'text': "but you're not going to define anything that it does.", 'start': 3437.123, 'duration': 2.702}, {'end': 3448.431, 'text': 'Those initializations of this variable right here and this method or function right here are going to be set in the class that you create.', 'start': 3440.185, 'duration': 8.246}, {'end': 3452.194, 'text': "So now let's create a class that's going to inherit from this protocol.", 'start': 3448.611, 'duration': 3.583}, {'end': 3454.215, 'text': "Let's just call it class Vehicle.", 'start': 3452.374, 'duration': 1.841}], 'summary': 'Defining input and output for a class inheriting from a protocol.', 'duration': 23.857, 'max_score': 3430.358, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3430358.jpg'}, {'end': 3577.632, 'src': 'embed', 'start': 3548.488, 'weight': 5, 'content': [{'end': 3549.689, 'text': 'Tell me what you think about that.', 'start': 3548.488, 'duration': 1.201}, {'end': 3550.83, 'text': "And it's going to spit back.", 'start': 3549.929, 'duration': 0.901}, {'end': 3552.027, 'text': "that it can't fly.", 'start': 3551.226, 'duration': 0.801}, {'end': 3556.092, 'text': "So there's an example of how we can use protocols inside of Swift.", 'start': 3552.247, 'duration': 3.845}, {'end': 3558.715, 'text': "Now let's go and take a look at extensions.", 'start': 3556.392, 'duration': 2.323}, {'end': 3561.238, 'text': "Okay, so now let's talk about extensions.", 'start': 3559.175, 'duration': 2.063}, {'end': 3567.986, 'text': 'Now extensions are really cool because they provide a way for us to add functionality without overriding existing functionality.', 'start': 3561.318, 'duration': 6.668}, {'end': 3573.75, 'text': 'And this can be applied to our own objects as well as even int double strings, arrays, anything.', 'start': 3568.246, 'duration': 5.504}, {'end': 3574.69, 'text': 'So this is really neat.', 'start': 3573.81, 'duration': 0.88}, {'end': 3577.632, 'text': "So why don't we come in here and create an extension.", 'start': 3574.851, 'duration': 2.781}], 'summary': 'The transcript discusses using protocols and extensions in swift for adding functionality to different types of objects.', 'duration': 29.144, 'max_score': 3548.488, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3548488.jpg'}], 'start': 3285.998, 'title': 'Using classes, protocols, and extensions in swift', 'summary': "Covers working with classes and protocols, such as changing spot's name to 'doug', performing overridden methods, and creating a protocol called 'flyable'. it also explains defining and using protocols in swift, inheriting from a protocol, and creating vehicles with specific functionalities like flying and setting names.", 'chapters': [{'end': 3410.525, 'start': 3285.998, 'title': 'Working with classes and protocols', 'summary': "Demonstrates working with classes, including changing spot's name to 'doug', performing overridden methods and checking class types. it also covers protocols, defining behavior and creating a protocol called 'flyable'.", 'duration': 124.527, 'highlights': ["Classes and methods Demonstrates changing spot's name to 'doug', performing overridden methods, and checking class types, showcasing the functionality of classes and their methods.", "Protocols and behavior definition Covers protocols, defining behavior, and creating a protocol called 'flyable', highlighting the concept of adopting protocols to define specific behavior.", 'Getters and setters in classes Explains the concept of getters and setters in classes, showcasing the automatic generation of getters and setters and customizing their availability.']}, {'end': 3567.986, 'start': 3410.665, 'title': 'Swift protocols and extensions', 'summary': 'Explains how to define and use protocols in swift, including creating a class that inherits from a protocol, defining variables and functions inside the protocol, and using protocols to create and test vehicles with specific functionalities like flying and setting names.', 'duration': 157.321, 'highlights': ['Creating a class that inherits from a protocol and defining variables and functions inside the protocol, including setting default values, is explained in detail.', 'The process of using protocols to create vehicles with specific functionalities like flying and setting names is demonstrated, with examples such as creating a Ford F-150 and testing its ability to fly 10 miles.', 'The concept of extensions in Swift, providing a way to add functionality without overriding existing functionality, is briefly mentioned.']}], 'duration': 281.988, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3285998.jpg', 'highlights': ['Creating a class that inherits from a protocol and defining variables and functions inside the protocol, including setting default values, is explained in detail.', 'The process of using protocols to create vehicles with specific functionalities like flying and setting names is demonstrated, with examples such as creating a Ford F-150 and testing its ability to fly 10 miles.', "Classes and methods Demonstrates changing spot's name to 'doug', performing overridden methods, and checking class types, showcasing the functionality of classes and their methods.", "Protocols and behavior definition Covers protocols, defining behavior, and creating a protocol called 'flyable', highlighting the concept of adopting protocols to define specific behavior.", 'Getters and setters in classes Explains the concept of getters and setters in classes, showcasing the automatic generation of getters and setters and customizing their availability.', 'The concept of extensions in Swift, providing a way to add functionality without overriding existing functionality, is briefly mentioned.']}, {'end': 4173.367, 'segs': [{'end': 3592.823, 'src': 'embed', 'start': 3568.246, 'weight': 0, 'content': [{'end': 3573.75, 'text': 'And this can be applied to our own objects as well as even int double strings, arrays, anything.', 'start': 3568.246, 'duration': 5.504}, {'end': 3574.69, 'text': 'So this is really neat.', 'start': 3573.81, 'duration': 0.88}, {'end': 3577.632, 'text': "So why don't we come in here and create an extension.", 'start': 3574.851, 'duration': 2.781}, {'end': 3578.173, 'text': 'There you go.', 'start': 3577.672, 'duration': 0.501}, {'end': 3578.933, 'text': 'Just created one.', 'start': 3578.213, 'duration': 0.72}, {'end': 3582.716, 'text': "And then you're going to type in exactly what you want to override.", 'start': 3579.153, 'duration': 3.563}, {'end': 3586.278, 'text': "And let's say that I want to output a string as an array.", 'start': 3583.036, 'duration': 3.242}, {'end': 3588.94, 'text': "So I'm going to create as array.", 'start': 3586.438, 'duration': 2.502}, {'end': 3589.76, 'text': 'Do it like this.', 'start': 3589.1, 'duration': 0.66}, {'end': 3592.823, 'text': "And it's going to pop out a bunch of characters.", 'start': 3590.201, 'duration': 2.622}], 'summary': 'Creating an extension to output a string as an array, applicable to various objects.', 'duration': 24.577, 'max_score': 3568.246, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3568246.jpg'}, {'end': 3777.086, 'src': 'embed', 'start': 3751.128, 'weight': 1, 'content': [{'end': 3759.515, 'text': "so let's go in here and make a couple changes, using generics, to show how we can use generics to avoid this type sort of issue that we have here.", 'start': 3751.128, 'duration': 8.387}, {'end': 3760.255, 'text': "so let's start off.", 'start': 3759.515, 'duration': 0.74}, {'end': 3760.916, 'text': 'first off,', 'start': 3760.255, 'duration': 0.661}, {'end': 3772.704, 'text': "and i'm going to say print any array and now I'm going to put a T inside of here and the T is going to indicate that this is a generic function that's going to accept an array of pretty much anything now,", 'start': 3760.916, 'duration': 11.788}, {'end': 3777.086, 'text': "so we're no longer going to be tied to our strings, so we could just put anything in here.", 'start': 3772.704, 'duration': 4.382}], 'summary': 'Using generics to create a function that accepts an array of any type.', 'duration': 25.958, 'max_score': 3751.128, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3751128.jpg'}, {'end': 3947.886, 'src': 'embed', 'start': 3921.035, 'weight': 2, 'content': [{'end': 3926.684, 'text': "And you can see that comes back as false, but then we could also come in here and throw in numbers, and that's automatically gonna work.", 'start': 3921.035, 'duration': 5.649}, {'end': 3931.212, 'text': "So we're basically gonna be able to test equality for any data type.", 'start': 3926.905, 'duration': 4.307}, {'end': 3932.755, 'text': 'as long as they are the same data type.', 'start': 3931.212, 'duration': 1.543}, {'end': 3934.618, 'text': "it's gonna work, which is really cool.", 'start': 3933.177, 'duration': 1.441}, {'end': 3940.502, 'text': 'another thing we could do is do comparables, which are very similar to equitables.', 'start': 3934.618, 'duration': 5.884}, {'end': 3947.886, 'text': "so we'll say compare them T and we'll say comparable here instead, and it's gonna receive two values.", 'start': 3940.502, 'duration': 7.384}], 'summary': 'Testing equality for any data type and using comparables for two values', 'duration': 26.851, 'max_score': 3921.035, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3921035.jpg'}, {'end': 4009.563, 'src': 'embed', 'start': 3983.282, 'weight': 3, 'content': [{'end': 3988.145, 'text': "and they're going to be very useful whenever you're going to be working with a limited number of options, basically.", 'start': 3983.282, 'duration': 4.863}, {'end': 3995.231, 'text': 'The one thing that is done differently with Swift is that Swift enums are not integer-based like other languages,', 'start': 3988.426, 'duration': 6.805}, {'end': 3998.374, 'text': 'and they can actually store multiple different data types.', 'start': 3995.231, 'duration': 3.143}, {'end': 4005.299, 'text': "To use those different data types, you're just basically going to need to map an enum to whatever value you want it to be associated with.", 'start': 3998.414, 'duration': 6.885}, {'end': 4006.555, 'text': "So let's create an enum.", 'start': 4005.592, 'duration': 0.963}, {'end': 4009.563, 'text': 'So enum, say we create a color enum.', 'start': 4006.655, 'duration': 2.908}], 'summary': 'Swift enums can store multiple data types, useful for limited options.', 'duration': 26.281, 'max_score': 3983.282, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3983282.jpg'}, {'end': 4172.064, 'src': 'embed', 'start': 4148.453, 'weight': 5, 'content': [{'end': 4159.448, 'text': "we could go print line and get favorite color and also go get data like that and it's going to be able to call that custom function inside of the enumerated type and print out purple.", 'start': 4148.453, 'duration': 10.995}, {'end': 4160.688, 'text': 'So there you go guys.', 'start': 4159.707, 'duration': 0.981}, {'end': 4169.421, 'text': 'That is a ton about Swift with a special emphasis on a lot of the more complicated things that seem to confuse people about Swift.', 'start': 4160.908, 'duration': 8.513}, {'end': 4172.064, 'text': 'Please leave your questions and comments below.', 'start': 4169.621, 'duration': 2.443}], 'summary': 'Discussion on swift, emphasizing complex topics and demonstrating custom function within enumerated type.', 'duration': 23.611, 'max_score': 4148.453, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY4148453.jpg'}], 'start': 3568.246, 'title': 'Swift extensions, enums, and generics', 'summary': 'Explains swift extensions for overriding functionality, such as converting a string to an array, and demonstrates the use of generics to handle different data types. it also covers the usage of generics in swift enums, including initializing, assigning values, creating functions, and accessing enum values.', 'chapters': [{'end': 3961.333, 'start': 3568.246, 'title': 'Swift extensions and generics', 'summary': 'Explains how to create swift extensions to override functionality for various data types, such as converting a string to an array, and demonstrates the use of generics to avoid repetitive code and handle different data types as well as the functionality of equitables and comparables.', 'duration': 393.087, 'highlights': ['Demonstrates creating Swift extensions to override functionality for various data types, such as converting a string to an array. The tutorial explains the process of creating an extension in Swift to convert a string to an array, showcasing the practical implementation of Swift extensions for customized functionality.', 'Explains the use of generics to avoid repetitive code and handle different data types. The tutorial provides a comprehensive explanation of using generics in Swift to handle different data types, showcasing the flexibility and efficiency achieved by avoiding repetitive code.', 'Describes the functionality of equitables and comparables for testing equality and comparison of data types. The tutorial illustrates the functionality of equitables and comparables in Swift for testing equality and comparison of data types, demonstrating their versatility and practical applications.']}, {'end': 4173.367, 'start': 3961.773, 'title': 'Swift enums and generics', 'summary': 'Covers the usage of generics in swift, demonstrating how to define and work with enums, including initializing, assigning values, creating functions, and accessing enum values, with an emphasis on the capability to store multiple data types and reference enum values in different ways.', 'duration': 211.594, 'highlights': ['The chapter demonstrates the usage of generics in Swift, showcasing the ability to work with different data types and perform various operations, providing a comprehensive understanding of the concept (e.g., using generics to handle strings, characters, and boolean operations).', 'The explanation of Swift enums includes a detailed walkthrough of defining enum types, assigning associated values, initializing with default values, creating functions within enums, and accessing enum values in various ways, offering a complete understanding of enum functionality and flexibility (e.g., defining a color enum with associated integer values, initializing with default value, creating a function to return values, and accessing enum values for comparison and function calls).', 'The chapter concludes with a wrap-up of the covered Swift concepts, encouraging audience engagement and feedback, emphasizing the complexity of Swift and the need for clarifying confusing aspects, fostering a supportive learning environment for Swift developers. The chapter effectively emphasizes the complexity of Swift and encourages audience engagement to address confusion and improve understanding.']}], 'duration': 605.121, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/6Zf79Ns8_oY/pics/6Zf79Ns8_oY3568246.jpg', 'highlights': ['Demonstrates creating Swift extensions to override functionality for various data types, such as converting a string to an array.', 'Explains the use of generics to avoid repetitive code and handle different data types.', 'Describes the functionality of equitables and comparables for testing equality and comparison of data types.', 'The chapter demonstrates the usage of generics in Swift, showcasing the ability to work with different data types and perform various operations.', 'The explanation of Swift enums includes a detailed walkthrough of defining enum types, assigning associated values, initializing with default values, creating functions within enums, and accessing enum values in various ways.', 'The chapter concludes with a wrap-up of the covered Swift concepts, encouraging audience engagement and feedback, emphasizing the complexity of Swift and the need for clarifying confusing aspects.']}], 'highlights': ['The tutorial covers data types, math, conditionals, arrays, dictionaries, tuples, looping functions, closures, structs, classes, protocols, extensions, generics, and enums.', 'The chapter covers essential Swift programming concepts including variable declaration, data types, type inference, constants, precision issues with floats and doubles, casting between data types, math functions, shorthand notations, and compound assignments.', 'The random number generator in Swift can be used to generate a random number between 0 and a specified maximum number, exclusive, such as between 0 and 10, providing control over the range of generated numbers.', 'Examples of creating simple and complex functions to reuse code and better organize it.', 'The chapter demonstrates returning multiple values using tuples in Swift, enabling the function to return x2 and x3 as integers, proving the usefulness of returning multiple values.', "The chapter explains creating a struct 'runner' with variables for name and mile pace, showcasing the use of methods within structs to calculate marathon pace.", 'Creating a class that inherits from a protocol and defining variables and functions inside the protocol, including setting default values, is explained in detail.', 'Demonstrates creating Swift extensions to override functionality for various data types, such as converting a string to an array.', 'Explains the use of generics to avoid repetitive code and handle different data types.', 'The explanation of Swift enums includes a detailed walkthrough of defining enum types, assigning associated values, initializing with default values, creating functions within enums, and accessing enum values in various ways.']}