UIAlertController 用于具有滚动功能的大量文本?

iba*_*man 1 iphone ios swift ios8

UIAlertController 显示小字符串。当字符串的大小变大时。那么此警报中的一些文本丢失了。是否有任何滚动功能可以滚动到剩余的文本?

var alert = UIAlertController(title: "title here", message: "about 30 line text here", preferredStyle: UIAlertControllerStyle.Alert)
    alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
    self.presentViewController(alert, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)

如何制作一个警报,显示大于 30 行的文本。我用的是迅捷。

Cœu*_*œur 5

它在 Playgrounds 中毫不费力地工作:

import UIKit
import PlaygroundSupport

PlaygroundPage.current.needsIndefiniteExecution = true
let window = UIWindow()
let viewController = UIViewController()
window.rootViewController = viewController
window.makeKeyAndVisible()

let message = (1...1000).reduce("") { $0 + "\($1)\n" }

let alert = UIAlertController(title: "title here", message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "action here", style: .default, handler: nil))
viewController.present(alert, animated: true, completion: nil)
PlaygroundPage.current.liveView = window
Run Code Online (Sandbox Code Playgroud)

我有 1000 行可滚动行:

1000 行可滚动