Swift in 100 Seconds
Вставка
- Опубліковано 28 вер 2024
- Swift is a modern programming language developed by Apple. It is commonly used to code apps for iOS and MacOS, but is open-source and can be used outside of Apple’s walled garden.
#apple #programming #100SecondsOfCode
🔗 Resources
Swift Docs www.swift.org/
Swift Announcement • Video
Kotlin in 100 Seconds • Kotlin in 100 Seconds
C in 100 Seconds • C in 100 Seconds
🔥 Get More Content - Upgrade to PRO
Upgrade to Fireship PRO at fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
🔖 Topics Covered
- What is Swift?
- Swift vs Objective C
- Apple Swift Basics
- Swift Syntax and Memory Safety
- When was Swift Announced?
Subscribe to my walled garden of content 🍎
I love the kids that say "First reply"
EDIT: They can't do that now :)
Do C# pleaseeee
Swift is love ❤️
Can you make a video on "How to research like a pro"
I appreciate this joke
Anyone else wanting to see LLVM in 100 seconds?
Was just going to write this!
Oh yes plz!
absolutely
yes
Comm of support.
Awesome timing, was recently giving Swift some thought, as my next unnecessary play thing 🤓
I would definitely recommend it!
Report
Me too, “What should I invest my time in learning while leaving tons of unfinished side projects?”. Swift was one of the options, so I guess Swift it is.
Same here...
@@WillAmaral29 😂 😂 I thought it was just me that does that- glad I’m not alone ☺️
"It uses automatic reference counting to manage memory automatically"
_proceeds to show memory that will never be released_
the best part is you can't tell if he's joking or not
@@lanye2708 I can. He isn't.
@@lanye2708 He likes to throw in these little easter eggs.
Swift is amazing! Some more terms to research would be: Protocol Oriented Programming (Protocols), Structs in Swift, If Let syntax. There’s more but those are the first ones I thought of. Also, through the Swift Evolution process, more development is always being done to make the language more powerful and easy to use.
I played around with Swift back when I used to use Mac and I have to say… Swift is the most sensible, sane and pleasant language I’ve ever used. Simple for easy beginner things yet gives all the features & efficiency you could want for serious applications.
Shame it doesn’t really exist outside of Apple’s ecosystem.
It’s getting there slowly, async/await and other new async features other languages don’t have were just added, as well as better Windows support, so I can see web servers becoming more popular in the next year or two once things catch up
@@randomizednamme even without async await, it's a great language. but the adoption rate tho, low
@@randomizednamme better memory management and generics improvements are on the way now too!
@@adlsfreund waiting for Rust-like ownership, higher kind types and opaque return types with specifiable associated types. And it would be good to get better specialization guarantees for generic types. Oh, and Vapor could really use a complete overhaul inspired by composability patterns seen e.g. in SwiftUI, but swift on the server isn’t really a big thing yet
Caveats: XCode sucks and the compiler sometimes takes minutes to spit out a mysterious segfault without indication what the actual problem was. But it’s not much worse than with other languages. And in return, you get a package manager for which you don’t need to learn another language - it’s swift!
PLEASE make more videos on Swift! Maybe on the SwiftUI and UIKit frameworks? I love your channel and this has been my favourite video so far!
The syntax is insanely similar to Typescript.
The swift “let” === js “const” definitely trips me up a lot
It's even more similar to kotlin
I was gonna say.
Also like Nim
@@thespacejedi it's rather the other way around, Kotlin is similar to swift
"Congratulations! Your app is now ready to seek approval on the apple appstore."
The main lesson 😂
Now i a fully fledged IOS swift developer after this tutorial thanks man.
This was pretty swift, good job man!
A more fitting ending might have been "..your code is now ready to seek rejection from the App Store" - since we know how particular and arbitrary they can be. Maybe not with code in general, but with app functionality.
One of the best languages out there. I wish it were more popular outside of the Apple eco
Ok time to update git and resume ..
-knowledgeable and skilled in swift programming
Furthermore, Swift is much more Protocol Oriented., It uses protocols (interfaces) to extends the types of a struct/class.
It forces the usage of Structs rather than Classes. Mainly because classes are passed by reference. Hello again mutability.
You can also easily extends a built-in protocol by using extensions.
And if you want to make a backend application, KItura from IBM and Vapor are great tools to get started!
protocols = typeclasses
generics = polymorphic types
structs = product type
enums = sum type
I'd absolutely love a full tutorial i've wanted to use it for a long time
These short videos about languages and other things are golden.
Keep them coming 🤩🤩
Swift really is a great language. My favorite to code in.
Swift is one of my favorite languages to write in, although I've only built like two projects with it and usually am using C++ or Java.
Hey, could we get a 100sec video of an esoteric programming language? I think it would be quite fun...
speaking of which, youtube just recommend me watching chicken and brainf*ck esoteric languages
Fireship literally explaining the full basics of any technologies within 100 seconds.💥
As a mobile developer, I like it when big companies accept that their current language is not up to the mark and create something new from scratch instead of just patching the old and creating more drawbacks than benefits. Google did exactly this with Java and Kotlin for Android!
no, they didn't do "exactly" this. Kotlin was created by JetBrajns, not by Google. Google adopted it as an official language for Android, and contributed to its development, but they didn't create it, much less "from scratch".
never used swift but I get the impression that its not really fast
My man makes every language the best
I've been considering playing with swift for a while now. This video made it soo incredibly easy to get some grip. You made it seem incredibly similar to JavaScript which greatly helps take off some edge. I love how you explain things. Looking forward to a 'Beyond 100 seconds' with swift :)
cheers!
damn good timing i was just thinking about learning swift but now i really want to
So that's what REPL means...
Also, I love those picture-in-picture code snippets 🤗
May we have an Objective - C in 100 seconds video?
No mention of protocols?! I know there is a lot to cover in 100 seconds, but POP is at the core of Swift.
I was waiting for this video!! 🔥
yo that's finna woke 🔥🔥🔥
I would like to see Haxe in 100 seconds, It allows you to compile your Haxe code to java,cpp,lua,php and is very usefull to make a full-stack application
If I recall correctly you can call C or objective C with swift
Yes for example you can put an “@objc” above a function to make it an objective c one
one of these codes can easily be passed as typescript… i’m actually baffled by how syntactically similar they are!
Swift is like if Typescript and Golang had a baby
Thanks, Awesome content. The full swift tutorial would be amazing.
*Spring in 100 seconds*
man , google assistant actions in 100 seconds
"let" in JS should have signified a constant like in Swift. Scope or block keyword should be used instead of the let JS.
Just use const
LLVM in 100 seconds. i hear it so much but have no clue what it is
employers: at least 10 years swift expirience
swift: _created at 2014_
When you mix Typescript and Ruby = Swift
what a fantastic series. cheers
If Python and JavaScript had a love child, it would probably turn out to look something like Swift.
do c# next
What about delphi, pascal?
one year with swift , it is the best language BUT still related to apple products ONLY
even backend need time to framework like vapor to mature .
Next : Fortran in 100 second 😅
please make a video on swift vs rust
As usual, hundreds of web developers for whom every syntactically modern language looks like JavaScript/TypeScript :)
C# in 100 seconds, pleaseee 😍
Jeff finally started using his mac for recording
Left at 0:22 isn’t obj-c.
Found a mistake at fireship vid. Feel so proud of myself.
A very nice overview!
1:13 Correction: Colon
I really hope the language gains sole track outside of the apple ecosystem. I love it so much.
by adding a colon after the variable name, not semicolon
I can't believe apple turned a more complicated c++ to an easier to type peice of code...
Use this for my Spheros I have 3 2.0 spheros 1 spark plus a bb-8 a r2-d2 an Ollie a sphero Specdrum
Ruby/Rails please!
Next on the agenda is Objective-C.
if youre learning to program i think swift is a really good option
No because you need a MacOS to build things with it
awesome quality content!!!
Haskell in 100 seconds. ❤️
CSharp in 100 seconds 💢😠
Where can i find the background music? I love it
I thought I was watching a Kotlin video for a second there
That with let is kinda confusing where's my const?
me, who has been programming python for years, and thought let me learn swift... I think python has already taught me swift 😁
I wish the iPad had Xcode 😔
What a swift video
Next, Ruby in 100 second
The let/var in swift is gonna get so confusing if you're used to let/const from js
Hi, do you think iOS development is good career path if I want to be full time freelancer? Most of ppl saying the web dev is better for freelancing but im enjoying swift more than other languages. What do you think?
Feels like Apple swiftly reinvented the Javascript.
Can you please create a Neo.mjs video in 100s?
Ocaml next ?
Which software do you use to make your videos?
Is there any practical applications for Swift outside of Apple-made environment (i.e iOS, macOS etc) other than educational purpose??
I mean, is there any Windows/Linux application that uses Swift? An embedded system or server application maybe??
Rust users: So its rust with classes
Beau Manors
I am waiting for 100s of XAMARIN
Great video 👍
A small detail is that at 1:25, it should be “colon” instead of “semicolon”
thanks, watched that part five times thinking I was missing it
yeah i too noticed that
Why doe this look like JS and Python combined?
Hmm i wonder why it looks like the two most popular languages on earth…HMMM HOW DID THIS HAPPEN HMMMMMM
Never insult Swift like that again
Swift is really underappreciated as just being a good and modern programmming language
The issue is that one needs a mac inorder to build native iOS apps
@@tanaykamath1415 yeah thats stupid. I use linux on my main pc arch btw but use an iPhone as my main mobile device so I cant really develop apps for iOS. Also its really expensive. I guess its just the apple way of doing things
@@tanaykamath1415 I installed macOS on roblox
@@aayushtheapple arch users are the vegans of Linux
@@select_from_users5842 damn true
Thank you for covering Swift!
If I may add something here, in Swift structs are commonly used in place of classes. They are similar in terms of functionality, but each one has its own strengths and weaknesses. And also, inheritance is not really a common occurrence in Swift, instead people tend to write protocols - Of course, you can still make a class that inherits another, but writing with protocols makes your code more modular and composable! There are a lot of interesting and useful language features that cannot possibly go into a 100 second video, so I hope people will take more interest in Swift 🥳
Are protocols like interfaces in Java and C#? How do they work?
@@HDSQ i don't know java or c# but protocols allow you to add custom functionality to structs ,classes and other types that conform(implement) to certain specs that you can define in the protocol. If a struct conforms to a protocol it will gain the functionality implemented in the protocol. It is a very powerful tool which lets you extend and "inherit" functionality by simply conforming to a protocol. you can even create protocols for built in types like arrays etc. eg you could add a protocol to arrays to return all indices of a value in the array. and any array will have access to the protocol.... so long as the array conforms to the protocol ( eg. the elements would probably need to be identifiable; which is also a protocol)
@@HDSQ Yep, similar to Java interfaces. In Swift you can declare properties and methods that a conforming class/struct/enum etc must conform to. You can also create default implementations for these properties and methods like in Java.
@@UltravioletMind looks like Kotlin extension functions
You have successfully sold me to pick up swift, thank you good person on the internet.
Great language in overall, thanks for the explanation. It feels like i got more in this 100 seconds than me procrastinating the whole day
@Rafly Tzy report
@@abh1yan roger
That's why I'm here. Now I can complete the day thinking that I've done at least something productive!
Now, back to procrastinating.
@@ssholum bravo
@@ssholum bravo
There is one jeff who makes awesome content for developers in 100 secs , and then theres the evil jeff who went to space for 100 secs
Underrated comment
Please do Lua in 100 seconds!
And also Luau! (it was recently open sourced, (its a variant of lua but with types and many other useful functions including much more speed!))
@@artoshia roblox lua
Jeff: "Swift is open source so you can create something outside apple platform".
Me: That's great Jeff!
few seconds later
"Congrats for watching till the end, you can now publish your work on apple and hopefully they approve your work."
Me: Wait...what?!
Thing you can do != most common use case
C# please!
Thank you very much, Jeff!
I appreciate your content 🙂
Waiting for:
- WebWorkers in 100 seconds
- WebStorage (including indexedDB, WebSQL) in 100 seconds
- Repaint/Reflow in 100 seconds
- Critical Rendering Path in 100 seconds
If your critical rendering path takes 100 seconds, you might have a performance problem!
The day Jeff makes repaint/reflow in 100 seconds is the day newbies will be able to steal my job, so no thanks XD
🤔
Exquisite choice of topics.
Learning to code swift, from a nodejs, react background, and have to say, it truly feels like a language that Apple developed. It just makes sense.
XCode was also developed by Apple. And calling it shit would be a praise.
Obj-C is a bloody mess, and it was also made by Apple.
I guess you can see my point. Made by Apple doesn't mean good and sane.
@@mad_t lol, have you used android studio?
@@mad_t Obj-C wasn’t made by Apple, but by Tom Love and Brad Cox. NeXT (founded by Steve Jobs) used it for its operating system NeXTSTEP, and later Apple bought NeXT, this is how it became the main language on their platforms. The syntax looks strange indeed, but if you consider it was released before C++ (in 1984), and inspired by Smalltalk, it's a different story.
that's just javascript isn't it?
no??
i know its a series, but this was the perfect opportunity to name the video "Swift, swiftly"
a constant declare with "let", as a js dev, i don't like this.
If it weren't for Swift, I would not have even touched iOS development. Objective C is downright unenjoyable to look at
Indeed, Swift is a very good language, on power with rust and go. Had it been for the language to be loosely coupled with apple, it would have seen better adoption on multiple platforms and environments.
> on power with rust and go
Largely depends on the context. Rust and Go are in different leagues of there own, e.g. Go would not be the language to implement a kernel.
> loosely coupled with apple,it would have seen better adoption on multiple platforms
Not sure I agree. If we look at Kotlin, which is not loosely but **largely** coupled with Android development, Stack Overflow Developer Survey shows Kotlin as more loved than Swift. In the same vein as Swift, Kotlin supports multiple platforms via its Kotlin Native via LLVM, the same compiler toolchain as Swift.
I think Swift is a very fine language, but I'm not sure if it innovates more than other languages, hence why it's stagnated in adoption outside of iOS.
@@hi_arav The Swift developers do not prioritise multi-platform support, which is a design goal for Kotlin. That alone explains the difference.
@@hi_arav Why do you think Kotlin is largely coupled with Android development? Kotlin is pretty popular for backends too.
Imagine switching to Swift after Javascript, and using `let`.
I went to JavaScript after Swift and it wasn’t a problem. Swift is “use let 90% of the time” and JS is “use const 90% of the time”.
let => constant ... I can hear JS developers dying inside.