Mo Code
Mo Code

Reputation: 117

How to display a couple pages of text in swift ios

I've got an information page which has about 3 pages worth of text to display.

What would be the best method to display all this text in an iOS application coded in swift?

I have been trying to do it with scroll view but I can't fit all the text into one label on one screen. And all the tutorials I'm following say to set the scroll view to the size of the label. But the thing is my text is so long that it would fill the screen several times.

How could this be accomplished so that no matter which device size screen it's being viewed on it will fit all my text and be scrollable vertically?

I can't seem to get it working with a scrollview :/

Upvotes: 0

Views: 1017

Answers (3)

Morgan
Morgan

Reputation: 1310

You can make a text view non editable. screenshot

Upvotes: 1

zapzapzap
zapzapzap

Reputation: 17

I have this problem also.. Maybe you could use table view and add contents programmatically.. hope it could add to your imagination.

Upvotes: 0

Ewan Mellor
Ewan Mellor

Reputation: 6847

Put the content in an HTML file, and render it using WKWebView: https://developer.apple.com/library/ios/documentation/WebKit/Reference/WKWebView_Ref/index.html#//apple_ref/occ/cl/WKWebView

Upvotes: 2

Related Questions