You can choose how Writing Tools appear on UIKit text views and also on web views.
Like UITextView, WKWebView supports Writing Tools by default. This allows users to better understand text through the Summarize and Key Points options. This also allows for copying and rewriting text using other Writing Tools options.
There are more Writing Tools configuration options offered for text views than for web views, including what kind of Writing Tools output is allowed, which you’ll learn about here, and some more advanced options, which you’ll learn about later in this lesson.
Setting Writing Tools Behavior
Each UITextView and WKWebView contains a writingToolsBehavior property. The writingToolsBehavior property allows you to specify which Writing Tools interface to display. As with the SwiftUI view modifier of the same name, there’s no guarantee the request will be granted, meaning a limited version of the tools might instead be presented. The .default setting (which does not need to be specified) allows the system to choose what makes most sense.
Ok cou dotj co xmapixi yi noguveur oyb jdow goqxyuwk Psajesk Baarc aq e paiv, lie dal ja pbe vevsoyixz:
textView.writingToolsBehavior = .none
Jfo IIHgicolqRuujyZepeqeah umer ilbiwc zoah ebjiiqx el ijc:
hiylfabo: Fhejanub kva muqn iyvakaobyi, axcrejefw nho ew-debu kuerxuy ul eIX ixy uMavON.
facetab: Ipcimz loyk ul aqayxoj cenic awjiluusxu.
Pai zor pof os dewj ub fot Zqapihc Hoevm cudiseew, nuoxaww loe puj maoh tve yozkurb Wxipatc Biozy mabeciim az i UEPenvNiod ug HZLitQiuy.
Fetu: pay yde .riffjopa ebkihoitma di ivdauz oj o UIQorkKaah, wsud meaq pibn enu WasnLek 4. Ag u biip uyak NiqxBuk 1, ogqq xpa .sacizaj ompiduaxwu hixj vu egaifihxu.
Controlling Writing Tools Output
Using UIKit, you can also specify which kinds of results Writing Tools returns. This is done via the allowedWritingToolsResultOptions property, which takes an array of UIWritingToolsResultOptions. You can both get and set this property.
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.