Swift: WebSocket Real-Time Data Introduction (2022, iOS, Xcode 13)

  Рет қаралды 36,060

iOS Academy

iOS Academy

2 жыл бұрын

In this video we will take a look at WebSockets in Swift & iOS. A type of url streaming session that lets us get real time data, webSockets can be used to build real time applications like Robinhood or others.
www.piesocket.com/websocket-t...
💻 Source Code: / iosacademy
🎥 Subscribe for more: kzfaq.info?su...
😎 Like my teaching style? Check out some of my most popular courses! courses.iosacademy.io
** Popular Series
Building Instagram: courses.iosacademy.io/p/build...
Building TikTok: / @iosacademy
SwiftUI for Beginners: ios-academy.teachable.com/p/s...
** Get Skillshare free for 2 Months and learn iOS
www.skillshare.com/r/user/afraz
** Manage all your investments from app earnings on Betterment!
bit.ly/3eBwlI9
** Grow your own KZfaq tech channel with TubeBuddy:
www.tubebuddy.com/iosacademy
#swift #websockets #urlSessino

Пікірлер: 82
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Enjoy my teaching style? Check out full series at courses.iosacademy.io
@shashankmishra5329
@shashankmishra5329 2 жыл бұрын
Can implement websocket on app delegate?
@folahanmikolawole8219
@folahanmikolawole8219 5 ай бұрын
omg i'm so glad i found this video, thank you. this video is so timely for me right now because at work I'm working on building a social media app with chatting capabilities using websockets. i'm the only ios developer here in the company, and i'm still a mid level ios developer that didn't even know about websockets before now; so i definitely would appreciate more websocket videos
@iOSAcademy
@iOSAcademy 5 ай бұрын
You got this!
@folahanmikolawole8219
@folahanmikolawole8219 5 ай бұрын
thank you!@@iOSAcademy
@divsyntax9720
@divsyntax9720 2 ай бұрын
Congrats! You've made it to 112k subs!!! 🥳Awesome tut btw!! Love WS, I wanna see more.
@TechRagh
@TechRagh 2 жыл бұрын
Congratulations on 42K, waiting for 50K celebrations and new videos as always :)
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Thank you!!!
@oles1837
@oles1837 2 жыл бұрын
Thank You! Yes more websockets!
@iOSAcademy
@iOSAcademy 2 жыл бұрын
You’re welcome
@Mettaworldj
@Mettaworldj 2 жыл бұрын
This is so timely thank you!!
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Youre welcome
@rev_kous9275
@rev_kous9275 2 жыл бұрын
I’m waiting for a video with Clean Architecture (VIP/MVVM, Clean Swift) for iOS.
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Coming soon
@obinnaaguwa
@obinnaaguwa 2 жыл бұрын
It would be a pleasure to a see more please!
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Coming soon!
@aafaqahmed2265
@aafaqahmed2265 Жыл бұрын
Whenever I see iOS Academy name writte below the video no google search, I leave everything and quickly tap on that. Thanks for creating the greate stuff.
@iOSAcademy
@iOSAcademy Жыл бұрын
Thanks for that!
@abhishekmahajan3432
@abhishekmahajan3432 2 жыл бұрын
Great video.
@buck-johnson
@buck-johnson 2 жыл бұрын
This was a great video thanks.
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Youre welcome!
@mokh08
@mokh08 Жыл бұрын
I really enjoyed that and thanksssss
@iOSAcademy
@iOSAcademy Жыл бұрын
Thanks!
@alwaysrookie583
@alwaysrookie583 2 жыл бұрын
You are a good man
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Haha thanks
@waheedafolabi6929
@waheedafolabi6929 Жыл бұрын
Nice walkthrough...thanks. In case the websocket server requires some parameters, how do we pass them? For example, an authorization token.
@saikumarreddygujjula3703
@saikumarreddygujjula3703 2 жыл бұрын
Yes want more websockets!
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Coming soon
@perrygupta
@perrygupta 4 ай бұрын
Perfect
@manishah92
@manishah92 2 жыл бұрын
thank you so much
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Youre welcome!
@setilanaji8442
@setilanaji8442 2 жыл бұрын
OMG OMG OMG You're the best
@terrywong8005
@terrywong8005 2 жыл бұрын
Thanks for demo on how to use websocket on iOS app. Just one question about the demo. You said calling ping function for keep alive purpose. But why you only calling it in the didOpenWithProtocol delegate once only? the ping function are needed to call more oftenly? like once per minute etc?
@mattdamon2532
@mattdamon2532 2 жыл бұрын
Thanks!
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Youre welcome!
@codechamp2599
@codechamp2599 2 жыл бұрын
Please make video on mvvm along with alamofire, swifty json with repository design pattern please
@phase5mediallc513
@phase5mediallc513 Жыл бұрын
This example was great in Storyboard format... Do you have example using SWIFTUI? I imagine it is similar - but different..
@kimsanov
@kimsanov 2 жыл бұрын
I am confused. If we have to manually recursively run receive() method - what is benefits of websocket in comparison to simple polling request? I thought that websocket allows somehow receive pushed data from server. Didn’t constant polling drain battery?
@shubhamjoshi8481
@shubhamjoshi8481 2 жыл бұрын
If you found any solution for this just ping me.
@easthastings6919
@easthastings6919 2 жыл бұрын
lol still no answer. i really hope someone answers us to debunk socket scam pyramide
@kimsanov
@kimsanov 2 жыл бұрын
@@easthastings6919 😅
@kimsanov
@kimsanov 2 жыл бұрын
@@easthastings6919 There are some other ways to use websocket. Found that under Linux You use some kind of hw interrupts. So your code only activates when data arrived. And OS manages other stuff
@renedekker9806
@renedekker9806 2 жыл бұрын
The server cannot simply send a message to the client because it would be blocked by firewalls for security reasons. The server can, however, send a response to a message sent by the client. Therefore, under water, the "receive" method sends out a message (call it a "receive request") to the server, and then the server waits with responding to that message until it has something to say. Then the server responds with the data it wants to sent. This response arrives in the completion handler of the "receive" method. The client then sends out a new "receive request", to wait for a new response. So the "receive" completion handler is only called when the server has something to say (or after a time out). But I agree that it is weird that Apple choose to expose that mechanism in the interface.
@despode
@despode Ай бұрын
Hi! Great video! I have a question though. Where does the "let message" come from, i.e. where does the "message" come from? It is not listed anywhere in the in parameters....
@dhav7634
@dhav7634 2 жыл бұрын
Great video. Can you explain how the recursive send function will ever reach the sending part since we are calling send() just before it ?
@renedekker9806
@renedekker9806 2 жыл бұрын
The only thing the recursive send does is dispatch an action to be executed after 1 second. It returns immediately, and does not wait for that action to be executed.
@gofudgeyourselves9024
@gofudgeyourselves9024 2 жыл бұрын
wow great i was never aware that we can achieve this with URLSession
@iOSAcademy
@iOSAcademy 2 жыл бұрын
yep, pretty cool stuff
@JeffreyLarsen
@JeffreyLarsen 2 жыл бұрын
This is some good stuff! Unfortunately I'm late to the IOS dev game, so I have only learned Swift with SwiftUI. I might be in a minority asking this, but it looks like you are looking to do websockets again in the future, could you tackle it from the SwiftUI side? And/Or (this might be a stretch but) using the Combine framework? Like is that even possible? Thanks all the questions you've answered and now questions you let me ask
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Absolutely
@oak_lef8408
@oak_lef8408 2 жыл бұрын
I'm an robotics engineer trying to learn some Swift to make a simple robotics control iOS app using a websocket to connect to a Raspberry Pi so this would be super helpful since I'm using SwiftUI!
@rommelreyes82
@rommelreyes82 Жыл бұрын
How can I make a program with socket and swift that allows the user to reserve seats for an airplane? It's a project from the university. I need help.
@eldarkk4566
@eldarkk4566 2 жыл бұрын
More VIPER, CLEAN ARCHITECTURE, SWINJECT, SOLID, CUSTOM ANIMATIONS, TRANSITIONS, PUSH NOTIFICATION EXTENSIONS, AR, NFC, ASSOCIATED DOMAINS, DEEP LINKING, DYNAMIC LINKING, AUTOMATIC CALL RECEIVE
@hungpham-qb6ch
@hungpham-qb6ch 2 жыл бұрын
Do you have any course use Storyboard?
@duyliem1770
@duyliem1770 2 жыл бұрын
Hi friend, is it possible to connect to websocket when app is killed?
@andrewdunbar828
@andrewdunbar828 7 ай бұрын
A macOS command line app example would be useful.
@user-ho3ml3er3b
@user-ho3ml3er3b 2 жыл бұрын
hello,could you please make a video to teach how to build an ios app with aws rather than firebase,because in China,the firebase services are all blocked. I would really appreciate that
@victorriurean
@victorriurean 2 жыл бұрын
🔥🔥🔥
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Thanks
@mohammadolwan6432
@mohammadolwan6432 Жыл бұрын
Hello, how can get "wss" protocol?
@UmairKhan-bu6gd
@UmairKhan-bu6gd Жыл бұрын
Can we send Push Notification with Socket
@vichhaikan7248
@vichhaikan7248 2 жыл бұрын
It would be a pleasure if you can make a real-life example app.Thank you.
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Coming soon
@luki8502
@luki8502 2 жыл бұрын
Kinda unrelated to this video but is there any reason you did the Instagram and Spotify apps with CGRects and not AutoLayout? Since you understand how it works I couldn’t get why you were doing all those maths calculations 🤯 Also those don’t bring landscape support
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Both autolayout & frame layout are used professionally. I just preferred frame based
@gregfrllo
@gregfrllo 2 жыл бұрын
more socket please :)
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Coming soon!
@KK-pq6lu
@KK-pq6lu 2 жыл бұрын
Would like to see how to get socket addresses and address of the device
@oak_lef8408
@oak_lef8408 2 жыл бұрын
Will this work on an M1 mac?
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Yes
@tayyabmubeen8798
@tayyabmubeen8798 2 жыл бұрын
Looking for more content on web socket Please
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Added to my list!
@andrewdunbar828
@andrewdunbar828 7 ай бұрын
parenthasea
@eldarkk4566
@eldarkk4566 2 жыл бұрын
More sockets and payments online
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Coming soon!
@mac6779
@mac6779 2 жыл бұрын
content is good. video quality needs to be improved.
@iOSAcademy
@iOSAcademy 2 жыл бұрын
thanks for the feedback
@aniketkumar3218
@aniketkumar3218 2 жыл бұрын
wss = websocket secure not websocket stream
@Tenly2009
@Tenly2009 2 жыл бұрын
“It’s really not a lot of code” Yeah 🤦🏻‍♂️ …. Because you cut so many corners and left out a ton of stuff that should be there - even in a demo. Maybe if you stopped going over how to create a new project and if you started with your UI already designed, you’d be able to devote a more appropriate amount of time and code to the actual topic of the video.
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Thanks for the feedback
Swift: Dynamic Member Lookup Intro (Xcode 13, 2022) - iOS
10:55
iOS Academy
Рет қаралды 9 М.
Don't Use Websockets (Until You Try This…)
6:46
Code With Ryan
Рет қаралды 293 М.
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 60 МЛН
Doing This Instead Of Studying.. 😳
00:12
Jojo Sim
Рет қаралды 21 МЛН
Inside Out 2: Who is the strongest? Joy vs Envy vs Anger #shorts #animation
00:22
Your Brain 🧠 on Swift Concurrency - iOS Conf SG 2023
30:38
iOS Conf SG
Рет қаралды 8 М.
Want to make a chat app? Get Real-time With WebSockets & Socket.io!
1:31:40
Good Morning Developers
Рет қаралды 8 М.
WebSockets (Вебсокеты в Swift, Socket.IO-Client-Swift, chat example)
25:20
Design Uber Eats - iOS System Design Interview
14:00
Andrey Tech
Рет қаралды 18 М.
Why Agent Frameworks Will Fail (and what to use instead)
19:21
Dave Ebbelaar
Рет қаралды 35 М.
Swift: Actors Introduction (2023, Xcode 13) - iOS
8:54
iOS Academy
Рет қаралды 39 М.
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 60 МЛН