在问题标签和按钮标签中显示数组

时间:2020-03-19 22:42:18

标签: ios arrays swift xcode

我有一个问题数组和3个答案,我想在文本标签中显示问题,并在每个按钮标签中显示3个答案。文本标签和每个按钮都有一个插座。我是一个快速入门者,无法从数组中提取

struct Questions {

    let allQuestions = [

        "The easiest way to learn is:",
        "When buying clothes i usually make the decision on the basis of:"
]

    let answers = [

        [
            "By viewing, reading, and observing how the others carry out certain tasks",
            "By listening, discussing and doing according to verbal instructions",
            "By doing and experimenting by myself",
        ],

        [
            "By their appearance and looks",
            "Their practicality and use",
            "How comfortable they are or how they feel"
        ]
]

1 个答案:

答案 0 :(得分:1)

services.Replace<ITokenService, MyTokenService>();