I am using segmentio pod for segment with image and text, I have added pod in project and added view in storyboard and assign Segmentio class name and import Segmentio.
Here how to add array of text and images in segmentio
i have tried like below:
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)
}
}
errors:
Consecutive declarations on a line must be separated by ';'
Missing argument labels 'title:image:selectedImage:' in call
Consecutive declarations on a line must be separated by ';'
This is not valid Swift. The part that says
is not valid. It looks like a combination of a function call and a function definition.
I can see that the documentation for Segmentio is not very clear and also includes this invalid code.
Correct usage could be something like this:
I do not know Segmentio so this might not be 100 % correct.