TDM
TDM

Reputation: 814

Is there a way to change the string value of an NSTextView container in Swift?

I can't seem to figure out a way to change the text/string value of an NSTextView with Swift. Does anyone know how to do that? If there is no way to do that, an alternative would simply be to figure out a way to make a text area that someone could scroll through and read. How would I do that? I'm using Xcode 7.1.1, and I'm using Swift 2.1. Thanks!

Upvotes: 1

Views: 394

Answers (2)

TDM
TDM

Reputation: 814

Turns out I just used a Label instead - that works better!

Upvotes: 0

Mark Bessey
Mark Bessey

Reputation: 19782

What have you tried? This works, in a quick test in a Playground:

//: Playground - noun: a place where people can play
import Cocoa;

var t = NSTextView(frame: NSRect(x: 0, y: 0, width: 100, height: 100));
t.string = "Hello";

Upvotes: 1

Related Questions