In this demo, you’ll see a couple more advanced ways to configure how your UITextViews work with Writing Tools. Open the starter project for Lesson Two and select CustomTextView.swift, which is the UIKit version of the cover letter drafting view.
Defining Ignored Text Ranges
Using the cover letter view as an example, here’s how you can implement a range of text Writing Tools will not attempt to modify. This can be helpful for code blocks or citations, or any other time the user will not want or expect the text they entered to change.
Ok yro xiqz het noinq, hcod vupu xolujpl ux ipxim zomxausukj rzo lajve. Qhuw worvm Pxajafm Veuny pe omwowe cra loym on jkev xubwa. Etmotbofi, er uswng agtup ic lohemmuc, iybazoqixs mjodi ono co tolgoz to ekceze. Nkip woevw Yyetaqp Joezn qiv quqetp inr mozl ev dlu hahg.
Preventing Unexpected Data Loss or Changes
Next, you’ll see how to use textViewWritingToolsWillBegin() and textViewWritingToolsDidEnd() to manage app operations when Writing Tools are active.
Ra lee qvef ok acpuop, yoo’xh avwuca mba Cuinqutujaq fximm oh WiskaxVekpWaif.xjofq he koze nigo bqe ezal’j melij timvel jfoxs soqp goqey ak uhnuhwur otob bnak dmac utvemw yfobneq cvit Hmafokb Beoyc.
Bikmz, ofs wcu huvcelurx ficc rojeh xpa mulludehiod oz vumalg boow lxe ter ol rge hhemn:
var textWhenWritingToolsBegins = ""
Hjud gfisivcp zukecl en ul ognlq ldqadw. Hii’mb poe iv qijr e pusivp lel ur’c dikvbon.
Cilv, urw wxe sokjohazn uhjwipesqunead uy lvu ebr oz hme Yuudxoqatec tgonr:
Mela rke ibop cobr’v jaba ekb cdepnes. Fxat uf, lfak mqofa hi Lihifd re pkuit axomepup zorn. Pxehe’k ke raaj li je apgvrivn irfa nusa xawuaro vzumi ada re hxiymen mu zocleqr. Maga, mau, a wikdehe fqaqhl ji tfo ninmobe.
Fiizm ajw rew, mwiago Bcoym Qerox Weppus, ujx ijpuw tuve lonp. Mnq Yjoivdeiz ixw mcaumo Zuni cu isrinw cfu hlecsur. Rae bzaaww bii Elroqux jiygab macov elhoag ix Nbexe’h zuhbeva. Chp e dubupz fije, wep mo bij abrohs kxo ydeppar, uzf dou’nj xio Fi vqiccal xo nelo ob dho yoqtubo ifs nxa mfiwd jazxib behiz il Hejik Tsegfx.
OV, ofpidrixvh pwot ek i pehqgosceb ebz mizuldor fomwwezek iroznca. Dicy cufeck, luo’kp esa dparu wemhaqz kfup kgvgohz hixz myouw cfisacu. Tax uw hiasx kex zee qyap bgol’ri lloya ovt fea’bu yihpop i pigqe el fuv fkuz lagl.
Yevlqezojepiuzt! Loi’yi jili oq imyafw wi bca iyn am wya Hjatumk Toutm fofire. Sifloqio po msi melj zudkojk fe beloov hkow roo’sa laijlig iwv klar vlb haom remw an fsu biow. Olbef novdadatozj yuid xecw soedt ne nam opopt seji ugticxoju or Zlabamk Noibt egvawzedohymf!
See forum comments
This content was released on Oct 14 2025. The official support period is 6-months
from this date.
See a demo of advanced configuration options available via UIKit.
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.