Custom uitextview swift 

Custom uitextview swift. borderWidth = 1. storyboard, then delete its UIImageView and navigation bar. Key functions. Instead, you should query superview for UITextView. Apr 20, 2017 · Here it's an example. view. replacingCharacters(in: range, with: text) let numberOfChars = newText. This closure should return a value of the desired type. Jan 11, 2015 · In order to do that I tried to create a new type which will only handles the action not to done. font(. Next, you need to create an instance of the UIView class and specify its size and position. @Binding var showActionSheet: Bool. Jan 3, 2022 · You can remove all the actions available via UIResponder, or create your own menu with a custom button and connect it to your own translate API – Tad Jan 4, 2022 at 0:36 Nov 25, 2014 · In example snippet below, function copyView returns an AnyObject so you could copy any subclass of an UIView, ie UIImageView. In order to set it, you need to override intrinsicContentSize. Let's say there is only a UITextView in your UITableViewCell. You can check if the font style button was selected and add a custom button to that submenu. size. In below demo TextField color's modified, Password's one is default. textViewName. The UI is simply an ordinary editable UITextView with allowsEditingTextAttributes set to true. This method is called again when the user selects a button within the menu. awakeFromNib() // Jan 23, 2017 · 1. Increase the Head indentation value. answered Sep 12, 2012 at 11:18. – I have a UITextView with some text that came from a . 6) bind an action to the button te clear the UITextView. 1- Create an instance of toolbar with with it’s frame. A text view draws a string in your app’s user interface using a body font that’s appropriate for the current platform. _Label>) -> some View {. Setting the intrinsic content size of a custom view lets auto layout know how big that view would like to be. Jan 15, 2020 · 11. Nov 23, 2022 · NSAttributedString(string: "") It is called from the SwiftUI code like this: . . Modified 6 years, 5 months ago. I declared my UITextView at the class level of the view controller it’s used in, and the one-line looks like Aug 10, 2021 · You can add a custom other delegate property and forward calls to it with the internal delegate. title) Mar 29, 2016 · 102. Alternatively, you can also use the overlay modifier. self. text = "", nothing happens. Viewed 6k times Custom UITextView with bottom border. As there was no swift answer already here, i simply provided it. This is how i create my textView and label. width, height: 44)) Feb 6, 2020 · You can create a custom Binding to pass in to the TextField. Instead of the above, which only deals with 'clearing' the field, the following will work with the field's undo/redo stack. Here is my View. And I found that (NSTextView). textView. You can detect keyboard appear/disappear using below method. frame)] // works but it also removes the text. Attaching menus to a UILabel seems very difficult. Mar 19, 2021 · How can I add hyperlinked text in a UITextView so that when it is clicked, a custom function in my app is called. You can set the return key type of the text field: textField. height is not changing after two lines. May 10, 2020 · The next step is to override textRect(forBounds:) -> CGRect and editingRect(forBounds:) -> CGRect. Aug 25, 2009 · 4. When typing in the 'block' it shows a TableView? underneath with the Mar 4, 2015 · Swift 4. Coordinator(self) func makeUIView(context: Context) -> UITextView {. , to be indented from its edges – by setting its textContainerInset property to a value of your choosing. Disconnected the UIGestureRecognizer from the UITableView. Support for multi-level rich text cascading and provide other style priority strategies. Feb 26, 2015 · Additionally you can increase the font like this: textview. Support for all NSAttributedString. isEmpty {. font(Font(uiFont as CTFont)) I think this is a valid solution, though, if we go this route, all SwiftUI EnvironmentValues that related to Font should be manually overridden. Nov 2, 2015 · 4. I originally asked this question. Oct 15, 2020 · 25. set default Font for NSTextView with swift. TL;DR: I just want something like this. Provide more details about your textView. black. Jun 17, 2016 · This is an example of text selection menu item that changes the text in a UITextView to red. edited Dec 22, 2015 at 22:04. Jan 1, 2024 · Unfortunately, there is no equivalent method that we can use when replacing attributed text. Disable scrolling for the textView. I’m building this app programmatically, so the first step is to instantiate the UITextView object. Coordinator(self) } func makeUIView(context: Context) -> UITextView {. However, UITextView doesn't provide a callback when user hits the return key. Sample Code: Text("FRANCE") Dec 10, 2015 · 27. I am trying to figure out how to make UITextView size dependent on it's contents in SwiftUI. yourTextView. delegate = self //Assign your textView delegate here. If I set the "text" property to "attributed"=. func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { let newText = (textView. let words = searchText. Jun 16, 2020 · Sorry if this is a stupid question and thanks in advance. func _body(configuration: TextField<Self. hasPrefix("@") {. viewDidLoad() self. super. class TextFieldWithPadding: UITextField May 29, 2015 · You are doing it wrong. iOS 16 you can use the underline modifier, If you want anything more advanced like control its position and size, then you can use the background modifier, and in the bg you can set the height, offset, and color of the underline. var textView2 = self. append(customMenuItem) Thanks for any help you folks can give me. To create a UIView, you need to import the UIKit framework, which provides the UIView class and other UI components. Custom UITextView swift for adjust height with the text content size. cell. This is particularly useful when working with user-generated content or displaying long texts such as articles, notes, or messages. 2 The following steps allows me to escape a full-screen UITextView with a tap, whilst allowing to scroll the contents of the UITextView:. lightGray. text = placeholder or textView. I Googled a bit and the below code works for Swift 4. override func draw(_ rect: CGRect) {. viewDidLoad() // Do any additional setup after loading the view. Mar 8, 2018 · As the description states, initializing UITextView will “Create a new text view with the specified text container”. exclusionPaths = [UIBezierPath(rect: view. Feb 10, 2016 · For those who came here because they enabled Allows Editing Attributes in IB but don't see the BIU UIMenu in the app: apparently that checkbox only activates attribute editing for the pre-defined string displayed in IB, but not in the actual UITextView presented to the user. class CustomView: UIView {. How to Create a Range in Swift (opens new window) (Deals indirectly with the issue of why we have to use selectedTextRange here rather than just selectedRange) # Remove extra paddings to fit to a precisely measured text. The textView's editable and selectable properties are both set to false. rx_text, map it to the current note's text. let textView = UITextView() return textView. Update the tableView on textViewDidChange. 3. And use this delegate method as it is: func textViewDidBeginEditing(_ textView: UITextView) {. Jun 29, 2011 · textView. With the above solutions my textview was not positioned correctly. return NSKeyedUnarchiver. I have textView where user can write something and Label to display number of characters in textView. Sometimes it's annoying especially if you want to measure some text without view Sep 15, 2014 · I was guessing it might be something like this, but it's not quite right. func textViewDidChange(UITextView) Tells the delegate when the user changes the text or attributes in the specified text view. Why not save the attributed string as RTF data (Using the May 15, 2020 · Create the UITextView. appearance(). Nov 25, 2015 · I know I can do the following to map changes to a custom object's Notes' text field to a UITextView. sizeToFit(width: 200) The idea is that the HTMLTextView would stick to the width (here 200, but in practice - the screen width) and grow vertically when the text is multiline. let textView = UITextView() textView. The only problem is that I can not reset the chat text after sending the message. archivedData(withRootObject: self)) as! Change default font to custom fonts in whole app. So I used a custom text field from here and modified a bit. func makeCoordinator() -> Coordinator {. text } . This solution works in Xcode 7 beta 6. struct BottomLineTextFieldStyle: TextFieldStyle {. text = message. components(separatedBy: . Don't forget to update your undo/redo buttons state initially and after each change to the text. text = "". That's all! Dec 14, 2020 · I am trying to add a placeholder to my textViews made with SwiftUI, but when doing textView. It takes a UITextView as a parameter, and does not return a result. For scrolling the tableview while keyboard appear/disappear is achieved by the NotificationCenter add the observer for keyboard appear/disappear on viewDidLoad as below. Outlet. Custom attribute Feb 7, 2014 · It's trivial to make hyperlinks clickable in a UITextView. ViewController. func copyView<T: UIView>() -> T {. You could use that and put calculateAndUpdateTextFields as your selector. textColor = UIColor. Aug 10, 2011 · In Swift: textField. func textView(UITextView, shouldChangeTextIn: NSRange, replacementText: String) -> Bool. fontName, size: 18) The above statement will simply set the existing font size to 18, change it to whatever you want. inputAccessoryView . Make sure Editable is unchecked. More control extension support. I guess this would be the starting point: @Binding var text: String. If you’re using a storyboard, you’ll want to create an IBOutlet and then follow the other steps the same. I suppose I could make a custom textfield with embedded view but there seems like there should be a way to handle other return button presses. Support text and attachment click or Oct 7, 2010 · 4) simply add a UIButton to your controller and place it in the top-right corner of the underlying UIView. Also, if you frequently need to set borders to your views, you can make an extension like this: Here I’m going to tell you how you can add a toolbar as custom accessory view for UITextField or UITextView in swift. However it is possible to modify it somehow, so, I assume worth posting. Like: email. It loads from URLs or local assets. I belive more people will come here looking for the swift answer than the obj-c answer as this tops google search if you search for UITextView rounded corner swift – Responding to text changes. if word. delegate = self. The text message is getting reset. Use textRect(bounds:) -> CGRect to return the drawable area for the text in a UITextField. 0f); May 6, 2018 · In this step we set frames manually just for the demonstration purpose. Apr 15, 2010 · I believe the above answers are for the previous versions of Swift. Sometimes for beginners it is a little hard to know how to do get things set up (it was for me anyway), so this example is a little fuller. 0: The Swift language is very strict about calling the super classes' designated initializer, but there should be a way to override initWithCoder: for all custom UIView subclasses, so I consider this a Swift bug. currentNote() . I am trying to create a custom autocomplete field (like in a search bar) for a science app that allows for a definition to be added to the UITextView. Add a UITextView to your project. let lm = NSLayoutManager() let ts = NSTextStorage() ts. 1. deleteBackward() for every letter in placeholder maybe) Nov 9, 2017 · Swift 4: Align TextView with UILabel. - MoZhouqi/KMPlaceholderTextView Nov 14, 2013 · The UILabel I have displays the text better, the text in the rectangular UITextView has a gap at the top so the text is not centred,offsetting the UITextview parameters means the text is anchored at the top, not centrally. RTF files and HTML both allow you to set up a user-readable string with a link "behind" it. replacingCharacters(in: range, with: text) // If Oct 15, 2017 · UITextView border in swift 3. textContainer. Even if UITextView’s frame is set, it does not mean UIScrollView’s frame . Lets make it easy. rx_text) How can I do the reverse using the same kind of pattern? The pattern is notesTextView. Jul 15, 2018 · UITextView(frame: CGRect(x:0, y:0, width:view. editingChanged) Then in the textFieldDidChange method you can examine the contents of the textField, and reload your table view as needed. var menuController = UIMenuController. Jan 29, 2024 · Step 1: Creating UIView. 0: UITextField. How can I achieve this with SwiftUI? I implemented it as the following, but it does not look how I want it to. How can I clear UITextView's text when the send button action is executed? MessageField. rtf (pasted directly onto Xcode) The context contain only one custom font (Futura Book BT 11. How you save is up to you, but the most universal solution is probably to pull out the UITextView's attributedText, archive it into an NSData (now known as Data in Swift), and save it off. For example, to give a text view insets of 50 points from each edge, you would use this code: textView. Assigning a view to this property causes that view to be displayed above the standard system keyboard (or above the custom input view if one is provided) when the text view becomes the first responder. unarchiveObject(with: NSKeyedArchiver. You can choose a different standard font, like title or caption, using the font(_:) view modifier. let previousText = attributedText. - inw2008/TextViewAutoHeight-Swift Jun 28, 2019 · 1. You can do this by adding the following line at the top of your Swift file: import UIKit. 2. This is how I got it to work: // The \n is required so that the alertcontroller keeps space for the message. class ViewController: UIViewController {. addObserver(self, forKeyPath: "contentSize", options: NSKeyValueObservingOptions. I had assumed that the reason for the slow load time of my custom view was because of layering multiple views on top of each other or perhaps because of some recursion problem. The problem is from other part of your code. var messageTextView: UITextView = {. Feb 19, 2015 · 7. inputView 3) The gif you posted is based on navigationBar buttons. Rashwan L. Inside your viewDidLoad add this: yourTextView. Support iOS & macOS & watchOS & tvOS. Result: Jun 1, 2019 · You can make interactive hyperlinks in any attributed string, which in turn means you can add interactive hyperlinks to any UIKit control. // your textView is Empty, set your Placeholder. Using textView. I was able to slightly modify this answer but unfortunatly the text color of each matching phrase is only changed once. So I just added a cocoa touch class in the project and set the target. codeText. Apr 9, 2015 · 8. Dec 29, 2023 · Using a custom UIViewRepresentable UITextView in SwiftUI allows developers to handle large amounts of text without worrying about frame height issues. addLayoutManager(lm) let tc = NSTextContainer(size: someSize) lm. 38. @IBOutlet weak var textView: UITextView! @IBOutlet weak var undoButton: UIButton! Sep 9, 2016 · This is a Swift solution and is different now since content insets and offsets have changed slightly. Duck says you just need to add below code and you are done. 0f, 75 - 1, 300, 1. text. It supports GIF, images (png, jpg, etc), and unicode. However, that still means that what the user sees is the "raw" link. // create the updated text string. count return numberOfChars < 10 // 10 Limit Value } Try this out: Feb 4, 2019 · 0. swift Overview. As a workaround, you can do the custom initialisation in. view addSubview:textView]; [textView release]; Your code is correct. override func awakeFromNib() { super. Apr 21, 2020 · Unfortunately it is not possible to change standard TextField placeholder's color so far. Oct 31, 2023 · Sponsor Hacking with Swift and reach the world's largest Swift community! Similar solutions… Polishing designs with fonts and colors; SwiftUI tips and tricks; All SwiftUI property wrappers explained and compared; How to add spacing between letters in text; How to control spacing around individual views using padding Solution #1 - If you want the placeholder to disappear as soon as the user selects the text view: First set the UITextView to contain the placeholder text and set it to a light gray color to mimic the look of a UITextField 's placeholder text. //we use lazy properties for each view. This project also includes few helper methods that will allow you to detect and handle touches in arbitrary text ranges. 0) If I set the "text(attributed)" property to "plain"= The custom font appear properly from the storyboard and from the app . var chordsArray = ["Cmaj", "Bbmaj7"] func getColoredText(textView: UITextView) -> NSMutableAttributedString {. UITextView has extra paddings by default. Nov 18, 2017 · Create a custom UITexField and add this method to it then override Oct 30, 2015 · The method is called scrollTextViewToBottom. addSubview(textView) Dec 19, 2020 · Following the code. systemFont(ofSize: 15)) . Either do so in the viewDidLoad or upon the text view's creation. text as NSString). Just sharing it for whoever it may benefit. 30. X. When I run the app I only see the label and not the textview. text. visibleRect. height)) 2) The reason why you make this mistake is because you are confusing . addTextContainer(tc) Mar 24, 2016 · I have a UITextView which displays an NSAttributedString. Update You can definitely use the same approach to set the return key to "Done", as mentioned above. . import UIKit import SwiftUI class ViewController: UIViewController { @IBOutlet weak var htmlTextView: UITextView! override func viewDidLoad() { super. In this case we need to manually handle the registration of undo handlers. @IBOutlet weak var text: UITextView! Jul 22, 2021 · func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {. Swift Increase font size of the UITextview,how? 7. Oct 12, 2013 · Detecting taps on attributed text with Swift. var textView = UITextView() I tested your code with Default UITextview and as @Quack E. However if you want some method like you've posted, you can introduce your own category like this: extension UITextView {. How would you write that method definition in Swift? A UITextView subclass that adds support for multiline placeholder written in Swift. Jun 20, 2017 · My custom tableview cell has a label and textview. 4. The number of words in this string are probably higher than the last one. ReadMoreTextView uses these methods itself to detect touches in "read more"/"read less" action areas. To do that we assign the picker as the inputView for the text field. tintColor = . 3) Hope this helps! If you have any questions feel free to ask! :D Dec 22, 2021 · Simply change the tintColor of the field with a cursor using the appearance proxy and it will apply throughout the app: Swift 3. private var borders = [UITextView: Bool]() extension UITextView {. changeToRedFunc can perform any action you want. answered Dec 22, 2015 at 21:59. Aug 29, 2010 · IMO Its the modern answer to an old problem. let label = UILabel() return label. Simply call ' [self changeTextValue: @"new value May 15, 2019 · 1. if textView. Just select the UITextView in your storyboard and go to "Show Attributes inspector" and select selectable and links. I want to change the text color of a specific text within a UITextView which matches an index of an array. override func viewWillAppear(animated: Bool) { super. Use editingRect(forBounds:) -> CGRect to return the area in the UITextField where editable text can be displayed. font. typealias UIViewType = UITextView. I also tried below in the UIViewController of where the UITextView is located with no luck: @IBOutlet weak var codeText: UITextView! override func viewDidLoad() {. Jun 6, 2019 · iOS 13+. 5) change the buttons properties: set its type to 'custom' and set its image to the image of a grey cross. All other uitextview related codes in the default ViewController. frame. coordinator. attributedSubstring(from: range) let previousSelectedRange = selectedRange. New, context: nil) } override func viewWillDisappear(animated: Bool) { super Dec 17, 2018 · Since all you're doing is adding a bottom border, you could add it straight to the UITextView if you wanted. return CGSize(width: x, height: y) Then call. text = "Placeholder" // Use your desired String here. if let searchText = postTextField. lazy var addButton: UIButton = {. delegate = context. This is what I tried: // does nothing. viewWithTag(2) as UITextView; textView2. " Use Alt + 8 to type in a bullet. Editing multiline text with UITextView. You just set the "detect links" checkbox on the view in IB, and it detects HTTP links and turns them into hyperlinks. Nov 15, 2017 · So basically as in Instagram or Facebook when the user types "@" a tableview appears and show the user suggestions. textContainerInset = UIEdgeInsets(top: 50, left: 50, bottom: 50, right let thePicker = UIPickerView() With everything in place, we now need to tell the text field that the picker view will be used as the input method when a user touches on it. Create one UILabel and place it on your text view (Give the text as Placeholder-set color gray-you can do all this in your xib) Now in you header file declare the UILabel and also the the textviewDelegate Now you can simply hide the label when you click on the textview. let toolBar = UIToolbar(frame: CGRect(x: 0, y: 0, width: self. I have function to setup my label and uitextview. 0 self. Caching is taken care of and performance is lightning fast! In this initial version, you can configure a UITextView to render the emojis. User taps button in Keyboard Accessory and button adds a 'block' in the UITextView. copy text. Sep 1, 2019 · In Swift, as shown here, you can use NSMutableAttributedString to embed links in text. returnKeyType = UIReturnKeyType. The attributedString contains a URL and I'd like to allow tapping Sep 12, 2020 · I'm trying to make a Discord-like text field. addSubview(view) This is my class. It should be: func updateView(message: String) {. class ViewController: BannerController {. @Ashish Kakkad has posted the right code but the reason it might not be working for @user1406716 is because when there is no text in the textfield, the height and width of the frame are 0 so maybe you can try the following : Obj-C : CALayer *bottomLine = [CALayer layer]; bottomLine. bindTo(self. You may only need the text container, but the text container still needs a layout manager and a text storage. } else {. (Changed not to draw background) But it doesn't expend as I expected. Fit the textView to the contentView with constraints. addTarget(self, action: #selector(textFieldDidChange), for: . class CustomTextView: UITextView { weak var other:UITextViewDelegate? 63. view. It's because your text container lacks the rest of the text kit stack. text = @"test my font size"; [self. Basically, my intention is to show a little popup window that gives more information on the clicked-upon word(s), similar to how Wikipedia works – Aug 13, 2016 · I looked here and could not find a setTextColor. Declaration of textview i did as. Jan 9, 2018 · When the editing menu is about to become visible, you get a canPerformAction(_:withSender:) call in your UITextView. The process would go like this. text = "Placeholder". notesViewModel. done. cgColor self. complete code below. font = UIFont(name: textview. This is how I do it for Lines. Make your UITextView's text type as attributed. If you need share same font, then use UIFont as model property and convert in SwiftUI where needed as, for example. – philipkd. you can use the native UITextView right in the SwiftUI code with this struct: struct TextView: UIViewRepresentable {. Open MainInterface. cornerRadius = 8 Happy Coding! Oct 30, 2013 · So if they're typing away, then tap "clear" and want to undo twice, it'll only just get them back to what their text content was before. Aug 23, 2016 · I was going to but I need to handle multiple lines of input. Text("Hamlet") . alertController = [UIAlertController alertControllerWithTitle:@"Some title". Construct your string in the following format: "• This is a string\n\n• This is another string, but longer and better. As the image below shows. Once that's done, embed the view controller in a navigation controller. You would do this as an InspectableVar so you can set it per textview in the storyboard's attribute tab. Note: This is in Swift 3 (ask if you want it in Swift 2. frame = CGRectMake(0. I wrapped the UITextView in UIViewRepresentable as following: struct TextView: UIViewRepresentable {. Jun 8, 2015 · 11. But it is not reflecting inside Custom UITextView called MessageField. Oct 4, 2015 · Update Swift 4. This way you can for exapmle implement custom links handling in your UITextView subclass. text {. However, after cutting out more and more code to see what would make a difference, it came down to whether I had a UITextView May 28, 2019 · You can force the text of any UITextView to have padding – i. When retrieving the font with custom(_:size:), match the name of the font with the font’s PostScript name. whiteColor() } I then went into the Inspector and Jun 29, 2022 · Please provide all information regarding your code as you are using custom class of UITextview. This is a very short example of how to align the contents of both views as UITextView comes with a natural “padding” that will offset the contents off its frame: Create a new custom TextView class and override draw. menuItems?. var configuration = { (view: UIViewType) in } func makeUIView(context: UIViewRepresentableContext<Self>) -> UIViewType {. Set custom font and size in Swift: textView. Objective-C: [[UITextField appearance] setTintColor:[UIColor blackColor]]; Same answer applies for an individual UITextField: Swift 3. width, height:view. Our extension is going to let users type in JavaScript, so before we get onto more coding we're going to add a basic user interface. sharedMenuController() var customMenuItem = UIMenuItem(title: "Lookup", action: "lookupWord") menuController. textColor(descriptionTextColor) . Jul 28, 2017 · snippet with swift 3 is here. I am using Xcode 12. Sep 7, 2011 at 1:47. If you want to copy only UIView you can change the return type to UIView. May 25, 2018 · Here's some sample code to handle undo/redo for a UITextView. Whenever your custom view's intrinsic content size changes and the frame should be updated. Asks the delegate whether to replace the specified text in the text view. } answered May 29, 2015 at 13:09. Here is my custom UITextView's code as looks: import UIKit You need to set the borderWidth from the UITextField's layer property. You can control the display quality as well as the scale 142. codeText. bounds. This is very straightforward, in the viewDidLoad () we just need to add one more line. If you're working with UITextView (which is likely, let's face it), you get basic hyperlinks just by enabling the "Links" data detector in Interface Builder, but that doesn't work for arbitrary strings – for example, maybe you want the words “tap here Features. Constructing rich text using interpolation, Smooth coding, Elegant and natural style. You can find the postscript name of a font by opening it with the Font Book app and selecting the Font Info tab. Connect the UITextView to the ViewController with an outlet named textView. // Combine the textView text and the replacement text to. swift. insertText(placeholder) works, but then I am unsure on how to remove the placeholder upon typing into the textView (textView. Here's my function: func suggestUser() {. Ask Question Asked 6 years, 5 months ago. e. For example, you could use this property to attach a custom toolbar to the keyboard. whitespacesAndNewlines) for var word in words {. font = UIFont(name: "ArialMT", size: 20) edited Jul 20, 2021 at 6:22. Use the custom(_:size:) method to retrieve an instance of your font and apply it to a text view with the font(_:) modifier. 6k 7 105 109. Aug 2, 2016 · Swift 4+ This is extremely easy with autolayout! I'll explain the most simple use case. You are trying to get textview's subview, which is not correct. viewWillAppear(animated) textView. map { $0. Why would they include the ability to use different return button types if you couldn't set actions for them. layer. let currentText:String = textView. borderColor = UIColor. notesTextView. Add as many \n as you like your textview height to be. let addButton The default value of this property is nil. Jul 21, 2020 · Streamoji is a custom emoji rendering library for iOS. Brabbeldas. This is how to construct a Binding<String> (what the TextField needs): var string = "" let myBinding = Binding(get: { string }) { string = $0 } The first argument of the Binding constructor is the getter. Here is my ViewController: class PostTableViewCell: UITableViewCell { @IBOutlet weak var authorAndTimeLabel: UILabel! Feb 3, 2021 · Visually speaking it would be some text, banner, more text. let updatedText = (currentText as NSString). av sc ky an qk af zl en pj wf