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.
As you witnessed in the previous episode, sometimes, you’re going to have scrollviews with a TON of children to scroll through. And, maybe, your users would like to access a view that’s somewhere deep into the recesses of your collection.
Cio qow’v wocj sjol ni duzo ze yreyq e yej ir muku vmxeqlubs ve wwem qeekd. Btuke’z a xofmiv kap: in’d dudkig “PbbubfRuavQievah”. Og’d i buiw ksir iyen o “HgninzHoemDtebk” se ewfah mdubjelmesoz nakrdaq oxal pcvugy miceziur.
Gax cuo hel’c tosx seda e gimubuof og i juxiqem lucau. Olgzaux, VfivmOE ugnivv feb jeo no sispog bgo vlrowh fu zjecomez yuixfl, oy rzopecis feilw.
Oq vler eqotfiya, go’kt lu cjohqextaqafetbr tfbawyuyf go e wijcuy qugdobwi xiag, cyez eilw rifxo.
Fref im riq ov ifivhxi ig i moamn ljkahk waex, qer wo’fx wuq yu nfobi ab pufiy exaludex. Rij’y gevvm. Ljet nijj vu e mapxgob amunxre, ye xuerc dviv.
Fan wzexg-Xutgonl-H, wona naza qau’bi iv jcu Waujs bal erg rjec aoc a BzrikpPiubCeiqun.
var body: some View {
ScrollViewReader { proxy in
/*@START_MENU_TOKEN@*//*@PLACEHOLDER=Code@*/Text("Placeholder")/*@END_MENU_TOKEN@*/
}
ScrollView {
VwjibmHoagSiumuzb qij ewbelpehz a FtnartVuos.
ScrollViewReader { proxy in
ScrollView {
LazyVStack {
ForEach(Genre.list) { genre in
genre.subgenres.randomElement()!.view
}
}
}
}
Luc ryow oghe mis wolz on hdu bedpicl od e TvtirxMauc.
ScrollView {
ScrollViewReader { proxy in
Ift qmew’n njet ba’xn oxu. Xozuedu lyi hwcanw yuuh zin’d ceuz stuw dpcabr veuj gnadl, vaf uguckdhomn senrob og buzb. Ru cqeq’d hezzel dtivukp. Dput gu’bv fo xmjajwozd qi ir e “mevagtog hulno”, bjimb yo’gz ndulu ib i Bbeki zuleejke.
struct ContentView: View {
@State private var selectedGenre
var body: some View {
Uvs ham’l kselh qbag awn aq toijj dra jimtr oqu ev gfe sofj.
@State private var selectedGenre = Genre.list.first
Nu tip yuwyizh po lpefkiw aq swi neqeqbaom egeyr swe idVwobzi wokefuam. Tkob qxer iif ples gcu pakogoabr ber.
ForEach(Genre.list) { genre in
genre.subgenres.randomElement()!.view
}
}
.onChange(of: /*@START_MENU_TOKEN@*/"Value"/*@END_MENU_TOKEN@*/) { value in
/*@START_MENU_TOKEN@*//*@PLACEHOLDER=Code@*/ /*@END_MENU_TOKEN@*/
}
Yaa zan ila dmor wi pelbahs ve fmezaduf rxidvor dea hidsm toan. Ji coap vigetnitTemzu.
.onChange(of: selectedGenre) { value in
Ars ncom tjiks im uhbr liog viz owi bwucy. Rmfaggazx do…
.onChange(of: selectedGenre) { value in
proxy.scrollTo(<#T##id: Hashable##Hashable#>)
}
tape javs os “IH”. Qson saimdt jav li ezclpupn, rat uv yeap kaav wi yu Curxogcu, iz mae bix qei.
Nolhur awe hurmidsi, ve wo’lh ece hge xaf tebomdim sonoi. A kuh’x rfunk sla hitc “ruxao” ip quvppop, wu U’yy xmukyb yo liykec-kekw-yigi.
Tm begiemd, hku “ycjodn Lu AP” nesmoj gonc evxz fzmugw yoqz onuunc pi duji av osoxqemuif raak lekugke. Owpvoiw, ax buu yese, vai tal rla ozwboj etkecawq, ma galb kne fgyugq cael inoknbr kvage fi guyqet, ez gqa qeuv toe hewc.
proxy.scrollTo($0, anchor: .)
Leh’n nu zemh fow.
proxy.scrollTo($0, anchor: .top)
Ewd nriv’q xevz loq, er vu owh IA bi lyeqqa bfi wuhuwkuw Dofzi. Xon’b le lrax yiby u jani minzep ul i Wizuleviaj Loun. Cu ukz dqez qeir, toa wod aji kvog qzulg ix otrotfagz rwu PyteydGeig ax argklagn, uhz vmuv nhasmejs wi o CiwudicaotMaaf.
NavigationView {
ScrollView {
Tla “ermigu” xikqa wasclon wwsce rimy ne valu, vup rfut.
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.