First of all, you use installation methods when you can just use properties. Secondly, you set up a bunch of unnecessary properties that are very close to the default settings. Here is much simpler and possibly what you intended using your code:
Objective-c
- (void)loadTextView1 { UITextView *textView1 = [[UITextView alloc] initWithFrame:CGRectMake(15, 29, 290, 288)]; textView1.text = @"Example of non-editable UITextView"; textView1.backgroundColor = [UIColor clearColor]; textView1.editable = NO; [self addSubView:textView1]; [textView1 release]; }
swift
func loadTextView1() { let textView1 = UITextView(frame: CGRect(x: 15, y: 29, width: 290, height: 288)) textView1.text = "Example of non-editable UITextView" textView1.backgroundColor = .clear textView1.isEditable = false addSubView(textView1) }
source share