Disabling Scrolling then Setting ContentOffset in UITextView only makes the text in the top content of TextView visible, how do we make the text in that range visible?

I made a full view DrawBoard class which is inherited from a UITextView class.When the switch on the view controller is on the user can type and scroll, when it is off the user can draw on the Drawboard.


@IBAction func changeSwitch(sender: UISwitch) {
            if sender.on{
                drawBoard.setNeedsDisplay()
                drawBoard.scrollEnabled = true
                drawBoard.editable = true
                drawBoard.selectable = true
                drawBoard.switchBool = false
           
            }else if !sender.on {
                drawBoard.switchBool=true
                let a:CGPoint = drawBoard.contentOffset
                drawBoard.scrollEnabled = false
                drawBoard.setContentOffset(a, animated: false)
                drawBoard.editable = false
                drawBoard.selectable=false
            }

        }


It updates the scrolling but

scrollEnabled= false
just saves the text that is in the first page range of the textview so that it scrolls to the top automatically and disable the scrolling there.Then when I do the setContentOffset the drawable view of the background is visible and it draws on the right place of the textview. However the text that should be on top of it is not visible. This only happens when the switch button is set to off while I am out of the first page's range. In other words what I'm having issues with is the scrollEnabled=false because it automatically bounces the scroller of the UITextView to top. ScrollEnabled hinders setContentOffSet (that ı used in the above code) and the text below the CGPoint a is not shown in the textView although the content is in the right place.How do I also make the text at that range visible?
Disabling Scrolling then Setting ContentOffset in UITextView only makes the text in the top content of TextView visible, how do we make the text in that range visible?
 
 
Q