VYT
VYT

Reputation: 1071

How to make textfield with scrolling functionality, Xcode, swift

I have working program with Wrapping Text Fields, and I would like to add vertical scrolling. I have found that there is Text View object in xcode library and it has NSTextView in NSScrollView. The problems came when I simply tried to substitute Text Fields with Text View. First, when I made outlet, this outlet belongs to NSScrollView (no NSTextView), and NSScrollView doesn't have String type, which I need for working code. Second, when I deleted NSScrollView (I don't know if it was right to do this) and typed instead NSTextView in outlet, I could use type string, but code didn't work. What I did wrong, what should I do ?

Upvotes: 0

Views: 4002

Answers (1)

FruitAddict
FruitAddict

Reputation: 2032

  1. Add an UITextView
  2. Drag an outlet from it to your class
  3. Make this class implement UITextViewDelegate
  4. In code, set this text views delegate to this class It is really simple, I'm confused by steps you took to try to get it working.

Upvotes: 2

Related Questions