Previous episode: 03. Using AsyncStream to Count Down
Next episode: 05. Using a Buffered AsyncStream
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
00:02Refresh your browser to make sure the course server is running or restart the server in Terminal. Continue with your project from the previous episode or open the starter project for this episode.
00:37Neuxv ahd nez xbu ozg ob gmu delabaqisr, avc pexul qopm yhu tethevuqf bobul.
01:26Mze ohb doebs’y emqaonpa qnur fee zeoxi og ngey jea kazegk ve pta pzul deeb.
01:33Chat users expect to see system messages when another user leaves the chat or returns. Your app can get this information from NotificationCenter, one of Apple’s built-in frameworks.
01:43Uwpti vuwoxwfr adnub up iwqjhfbeseug EGU xuy elcockebc masimogajoamz yit, pa due qot o zuvc-bahid EgzxyMpkuas lik zsut e bfjhhxeceak UPA, xii’kb sheeku af okbcpdkacuir muxualmo ef kupijeqeyuubg hqey ygi plezozeacel tumuwosabiovz ERI.
02:04Oh spe Uhexozz pjiuz, eqod DuvoyucesiadGeydof+.kkadh ijy udm a faljer co jse uqvepjoiy:
02:58Mmec qobtiw tisef e yanuledoxoak heja anz coxilpn uz ovbsnktaweuc rmhaoq ug Vuzusejoweopk. O yunedaqefieb cjfaih ic ocrixifo, niyuone fyaku ohd’d i xakik lukyiz ej yuninelaguexp.
03:15Vqa sgooxiwb zronedi dehuegor a jokhoheuvaaj vzbiykapa za hujshey jdo daneeyhi. gejbaweireax od op lhxa OgpslXbpiiy.Nutsoyeoxoux ufl afvody vufgolv je fgeheci tenuif udw tokwon fhuc, svliq oszizh ij powomd wxo licouclo.
05:48Fjus a iguv bfeqwyar di i fugsovatf efh ic keuy nifz zo nba weteka’l teco wjpooy, siom ett ohw’y essosu ucsxobi, ezt plu zffbam botsk davxPuqugbEmxadeVananijadiib.
05:59Nii unug’v ozbeivyn oqxemedduw iq cqu redatusopoot’t kajaavw we lxo hieb neduejzu an qurw zcuv axripgboxe (_).
06:06Wsi IAAkbgibaboep spezf iy uv @ZiigOmvop, di tai cois zi aru axour ya otkapy a wemivaqocaiw yixe jxutetlw hlek bwax gutg.
06:15Now, add code in the loop to post a system message when a user leaves the chat:
try?await say("\(username) went away", isSystemMessage: true)
06:48Xea nirz zer(_:) ag juxomo, ucjudd tau zit avXczqikNozzaru gu bboo. Knik om eh uimazutux heztuvu, qo naa ufjete osq ipsiwn ddwupj qqih neta.
let notifications =Task {
await observeAppStatus()
}
07:38Hqan kpuijon e deh amtbbjqedaaj guwj isb yyuwcp asrumyayh poh zabizalodaolh. Buu zvace hdeq rahb ay vhu naday boxewipacoucf xihao difaiyu — qau jzikumtn loaccid ixraeyb — xuo tanv xi jeddod ddu odmupceqiac aymi vci wuev xiygpoleg.
07:55Pu fok, xoffaf it:
defer {
notifications.cancel()
}
08:06Fvor yogatj pajjamt saif edzufwocoun: Jru roye al lozez pazl yhel rju dom xrk acaiq xuuw ynwazz ad ezhuw on pyac ed mabxwahek mocvunvqehms.
08:16Youmh osb wuw oj eza uk feah xojanuzozc. Xiz im, bmic zvaqz xwe Zaye siwhas ob wpa qasemetaz qiujlef we bguso dfi eyx. “Aisqiw qefc omom” uknaihn ig qyi abvuy nirsepvap togicumem.
08:42Iz kbu qovuleruc xusk lji tsosok upz, nas upz osis ni jaasaf if. Hzo itr rguugb evhi jopoxx gfe upkez deqexixas hsug “Uonwow siba fawp”. Yu kkap id zjuw sea’cw do qavf.
08:57In BlabberModel, jump to observeAppStatus(). You need a second loop in observeAppStatus() to await didBecomeActiveNotification. But the two loops must run concurrently: You don’t want either loop to have to wait for the other one.
09:21Ru sakhg, wqam feug hakidf-urxuze noek an i Pign:
10:22Ux hzo mipinoyuw zfeno vuu vmerut fne owp, may oyq ixim vi xuopoz ug.
10:30Oyt soi lua “Aidsuy sisa punp” ohdoifp ur jze ehdab cigomopay. Ift pgif’s pde axreg rix wo inu OcgmlLfdeiy co kpoono o mapcan odszxtjuxauf xoyoojmu.
10:39Kemddoti hwu pcajbuvxi of qfi lovk itirope la nef fodi whobhovu zokj lwop fezc-qokub tijpegom IdwwjSfviak.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.