如何在Segmentio中快速添加文本和图像数组

问题描述 投票:0回答:2

我正在使用segmentio Pod来分割带有图像和文本的片段,我在项目中添加了pod,并在情节提要中添加了视图,并指定了Segmentio类名称并导入了Segmentio。

这里如何在segmentio中添加文本和图像数组

我尝试过如下操作:

 import UIKit
 import Segmentio
 class EventsDashboardViewController: UIViewController {

@IBOutlet weak var segmentioView: Segmentio!

//var swipeMenuArray: NSMutableArray = []
var content = [SegmentioItem]()

override func viewDidLoad() {
        super.viewDidLoad()

 segmentioView.setup(
    content: [SegmentioItem],
    style: SegmentioStyle,
    options: SegmentioOptions?
)


    let tornadoItem = SegmentioItem(
        (title: "Alert",
        image: UIImage(named: "img1")),
        (title: "Message",
        image: UIImage(named: "img2")),
        (title: "Stared",
        image: UIImage(named: "img3"))
    )
    content.append(tornadoItem)

 }

 }

错误

一行上的连续声明必须以';'分隔

在调用中缺少参数标签'title:image:selectedImage:'>>

一行上的连续声明必须以';'分隔

我正在使用segmentio pod来分割带有图像和文本的段,我在项目中添加了pod,并在情节提要中添加了视图,并指定Segmentio类名称并导入Segmentio。这里如何添加文本数组...

ios swift segment segment-io
2个回答
0
投票

这是无效的Swift。表示


0
投票

我还没有使用过这个Pod,但是我认为SegmentioItem不是数组类型,它看起来像数组项,请尝试其中一项:

© www.soinside.com 2019 - 2024. All rights reserved.