mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			17 lines
		
	
	
		
			568 B
		
	
	
	
		
			Swift
		
	
		
		
			
		
	
	
			17 lines
		
	
	
		
			568 B
		
	
	
	
		
			Swift
		
	
| 
								 
											7 years ago
										 
									 | 
							
								//
							 | 
						||
| 
								 | 
							
								//  Copyright (c) 2019 Open Whisper Systems. All rights reserved.
							 | 
						||
| 
								 | 
							
								//
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import Foundation
							 | 
						||
| 
								 | 
							
								import UIKit
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class AttachmentTextView: UITextView {
							 | 
						||
| 
								 | 
							
								    // When creating new lines, contentOffset is animated, but because
							 | 
						||
| 
								 | 
							
								    // we are simultaneously resizing the text view, this can cause the
							 | 
						||
| 
								 | 
							
								    // text in the textview to be "too high" in the text view.
							 | 
						||
| 
								 | 
							
								    // Solution is to disable animation for setting content offset.
							 | 
						||
| 
								 | 
							
								    override func setContentOffset(_ contentOffset: CGPoint, animated: Bool) {
							 | 
						||
| 
								 | 
							
								        super.setContentOffset(contentOffset, animated: false)
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |