K
K
Kraynovofficial2015-08-23 10:11:46
Swift
Kraynovofficial, 2015-08-23 10:11:46

How to pass sounds from tableview to button to detailview in Swift?

Hello! I am a complete newbie to data programming. I figured out the graphic files, but I don't understand anything about the audio. I have two controllers: tableview and detailview. The detailview has a button button, and the tableview has an array cell of [sound1, sound2, sound3]. I need, for example, when clicking on the sound1 cell, the detailviewcontroller opens, and the button plays sound1.mp3 (either on the network or local), I click on the sound2 cell and the detailviewcontroller opens, and when the button is clicked, it plays sound2.mp3.
Please help me to do this. Who can help with what - source code, lesson ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2015-08-23
@onepavel

In the delegate, you catch a click on the cell and pass the array index to the controller [detailview setSoundId: id]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question