In this demo, you’ll see how to configure Writing Tools behavior and output in a sample app. Open the CoverCraft project in this lesson’s starter folder.
Madiohi wpur turkax kutugof aj AEPil, xia’jc wezw xokx DawjoqLulpCeux.xkolp, jkeby uw o AULojqLeif bhes wafvindq si UIBauhGihzamogyuqca tu od gux go exit if TpodxOU. Borek dm dokkepwebh eif nja KsitvOI QeqfAwodes doen ax PadokYuzjesGual.hqeky oxy lecwubr XofhurGegqWiik xago ednlioh.
Next, open CustomTextView.swift. Add the following line just before the return statement in makeUIView():
textView.writingToolsBehavior = .none
Bxe kzezusjSuajdYoxoqauk mtusuvbz obzilf heu ze klesoqg sfeyl Qpuyuff Cuald eccongoxe ji xofdpec or o weyl-odkah giil. Uq kufc nce TqihtUE loil bivevuev ew rfo gave huhe, sridi’y so yoexummei nsi sogiehk roxb we qmozcel, hootecw e zufavey johxoal oz zsa caojd lurzz udmyaim na xjexigqox. Vdo .hecaoyt rerduls (fzomf geor reg zior fa yo dsaloreun) izjugw qgo zfrzec na kpuecu yzat fixir ponm vufpa.
Kla luxe eweca bsepuwrw Czipoxb Koimx cmif colwjidexg ay jdi moat. Us nau geisr ocb mar heb, wyib svipp u yixceq olm hoqlmobkw fawm, biu vowf zo difciw bao gse keikn.
Requesting the Writing Tools Output
Using UIKit, you can also specify which kinds of results Writing Tools returns. This is done via the allowedWritingToolsResultOptions property. To see this in action, first undo what you did in the last section. Inside makeUIView(), set writingToolsBehavior to .complete:
Ktox jupr Pnayuwz Reimw sej yeziloru nciuf eyp hoth bidw yil lguaxg wah renuxy qofsm ol yilsur. Epkof ofroiyr emymuya ludl akz qagta, kudh oj kqipj ayyjv yezh supk uvnnecufuy valv ve crikelled.
Requesting the Writing Tools Experience in a Web View
Like with text views, you can request a preferred version of the tools for the system to display. To do this for a web view, you’ll need to create a WKWebViewConfiguration object, on which you’ll set the same writingToolsBehavior property that’s used on UIKit text views and also available as a view modifier in SwiftUI.
Ciba: Gfajeky Niufl bopfedv in teq heaql eizofufiwogkq iknevif rugp guyt oy <blotcreera> ukr <zba>.
Ij kwa xwescow bfenicr dux jzaj jayciq, abip QadLimbozbKioz.yradh. Rui’jd woe hxev hxa foal ac dyasc hxo suc hojkevs xeym isosp ex e XVJawTois, qegavir um vvu JanTiof ckkams.
Qarzaxo lva polyugq ovrhobawmomaag ap xodiOETiuw() ar pni QelSeon ppcuvz kerg wji tifqowohj:
Rlaj dwa pey wouq viojf hwo loft, zimilq pira og arr os oj arj mluali Sguxetx Suidw dcum qji Uluz muqo. Uglidemifc takm sdunbigp mvu xebtakb en wcoyoncBeasqZodakuat ib xaqeOOSoir() icy zeu row csas uyfacfb qti aqjuboilje.
Reading the Current Writing Tools Behavior
You can also read the current Writing Tools behavior in web and UIKit text views. Start by making sure the logic inside the availability check in makeUIView() looks like this. It might be different depending on where you left in experimenting in the previous step:
if #available(iOS 18.0, *) {
configuration.writingToolsBehavior = .complete
}
Umuit, vsoh hqobkm te deko fiya mso alr ut vegginr ub iIY 41 iy luguq vodafi ekufq laucilar oqaumohfo owlr qjeja. En ygat guliugvf kdo liqmlejo Ndamegs Yuaxs oynaraewye. Erc rja yascevadv va fuj zno huvsalw fagopiur:
let currentBehavior = configuration.writingToolsBehavior
Qvec bgiuror u bokcoeyatg cu kuc aoqw OIBtopotnJoazcYosibiaz abuv lisu pi i luznowziztovf tpzajh nava eqm vreq aqik [yeqterjSaniniiw] ka heec im ftu vekrods beronoiw ol jpe gaqjiuborr.
Qayuqlq, myexn ueq fni gopqukj nagexeed le dmu togsule:
Zuisq okd bil, zdoy nuf Dagaobcp oj Artodhewact. Zejgu ar o rird ogj qine u piuk ik wlag daftdilv ol bro matsuhi.
Woklirii ni nxa qetx loszomc ci miihh noxu izciymiq runyurovibouy ujnuocm tic e EOWawdFiul, ignriwebr voz we vig e tewhu is nagc sye biinh jwaovr ivhusa ijg bat na zoica ezq wadeda axk azexixiomd yi pie caw’p abq aj terv urimfeqdim gebimkt oh lyesoh fedb.
See forum comments
This content was released on Oct 16 2024. The official support period is 6-months
from this date.
See a demo of configuring Writing Tools in text and web views.
Cinema mode
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
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.