Transcript for:
Overview of Swift Programming Language

Swift, a multi-paradigm compiled language created by Apple, famous for building apps that grow inside of Apple's walled garden. It was first introduced in 2014 at the Worldwide Developers Conference, and was designed as a modern successor to Objective-C, the original Apple platform language that had been in use since the 1980s. Swift interops with Objective-C, but provides a shorter, more readable syntax, and features like memory safety and type inference to improve developer productivity. Today, it's used to build mobile apps on iOS, desktop apps on macOS, wearable apps for watchOS, but is also open source, which means it can be used to build software outside of Apple platforms. It compiles to native machine code, and is built on top of the LLVM toolchain, like many other modern languages. However, it also supports a read-aval print loop, allowing you to experiment with code in a playground without needing to recompile, making it a great language for beginners. In addition, it provides memory safety by preventing you from writing unsafe code by default. and uses automatic reference counting to manage memory automatically. To get started, install it, then create a file ending in.swift. Your code will start executing in the global scope. There's no need for a main function. Create a variable with the var keyword, followed by its name and value. var creates a mutable variable, which means its value can change in the future. let, on the other hand, creates an immutable variable or constant. It uses type inference to strongly type the value as a string, but we can explicitly type it by adding a semicolon after the variable name. Every variable must be initialized with a value, unless the type has a question mark, which makes it an optional type, allowing it to also contain a nil value. It also supports optional chaining, making it really easy to work with nil values. Functions are declared with the func keyword, and will use named parameters by default. Place an underscore before the name to use positional arguments instead. Now use a backslash with parentheses to interpolate these values into a string. Functions in Swift are first-class objects. They can be passed as arguments, used as return values, and nested to create closures. It also supports object-oriented patterns like classes and inheritance, to encapsulate the var and func keywords that you just learned. Now pull up the terminal and run the Swift compiler to convert your code into a high-performance executable. Congratulations, your code is now ready to seek approval on the Apple App Store. This has been the Swift programming language in 100 seconds. If you want to see more short videos like this, make sure to hit the like button and subscribe. Thanks for watching, and I will see you in the next one.