我有一个UIPickerView如何让它成为多线?我有一些长篇文章.
这是我的代码.
func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
var returnResult: String = ""
if pickerView.tag == 1 {
//This picker has long text
let position: UInt = UInt(row)
returnResult = list.objectAtIndex(position).Description.Value;
} else if pickerView.tag == 2 {
returnResult = questionTwoOptions[row]
} else if pickerView.tag == 3 {
returnResult = questionThreeOptions[row]
} else {
returnResult = ""
}
print(returnResult)
return returnResult
}
Run Code Online (Sandbox Code Playgroud)
这是我的viewForRow方法
func pickerView(pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusingView view: …Run Code Online (Sandbox Code Playgroud) 嗨,我有一个CGPDFDocument对象.我想通过在我的应用程序中显示它或使用外部应用程序来打开此文档.这是我到目前为止的代码.在SWIFT
let cfData = CFDataCreate(kCFAllocatorDefault, UnsafePointer<UInt8>(data.File.bytes), data.File.length)
let cgDataProvider = CGDataProviderCreateWithCFData(cfData)
let cgPDFDocument = CGPDFDocumentCreateWithProvider(cgDataProvider)
Run Code Online (Sandbox Code Playgroud)