小编Jur*_*hip的帖子

如何快速制作UIPickerView Multiline?

我有一个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)

uipickerview ios swift

8
推荐指数
2
解决办法
5352
查看次数

如何在swift中显示CGPDFDocument?

嗨,我有一个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)

iphone cgpdfdocument ios swift

0
推荐指数
1
解决办法
3417
查看次数

标签 统计

ios ×2

swift ×2

cgpdfdocument ×1

iphone ×1

uipickerview ×1