Migrate Swift struct to Swift class to allow generateMenu to be called by objc selector
This commit is contained in:
@@ -44,15 +44,15 @@ class MatchesAPI {
|
||||
let leftscore = String(split[0])
|
||||
let rightscore = String(split[1])
|
||||
|
||||
let newMatch = Match(
|
||||
ongoing: true,
|
||||
streamLink: "https://twitch.tv" + (match.getAttributes()?.get(key: "data-stream-twitch"))! ,
|
||||
league: try match.select("tr > td > div > div > a").text(),
|
||||
team1name: try match.getElementsByClass("team-left").text(),
|
||||
team1score: leftscore,
|
||||
team2name: try match.getElementsByClass("team-right").text(),
|
||||
team2score: rightscore
|
||||
)
|
||||
let newMatch = Match()
|
||||
newMatch.ongoing = true
|
||||
newMatch.streamLink = "https://twitch.tv" + (match.getAttributes()?.get(key: "data-stream-twitch"))!
|
||||
newMatch.league = try match.select("tr > td > div > div > a").text()
|
||||
newMatch.team1name = try match.getElementsByClass("team-left").text()
|
||||
newMatch.team1score = leftscore
|
||||
newMatch.team2name = try match.getElementsByClass("team-right").text()
|
||||
newMatch.team2score = rightscore
|
||||
print(newMatch)
|
||||
matches.append(newMatch)
|
||||
}
|
||||
return matches
|
||||
|
||||
Reference in New Issue
Block a user