This is my Global file:
import Foundation
import UIKit
var tableViewData = [cellData]()
var myRoster: [String]? = []
var draftOrder: [String]? = []
func strikeThroughText (_ text:String) -> NSAttributedString {
let attributeString: NSMutableAttributedString = NSMutableAttributedString(string: text)
attributeString.addAttribute(NSAttributedString.Key.strikethroughStyle, value: 1, range: NSMakeRange(0, attributeString.length))
return attributeString
}
func noStrikeThroughText (_ text: String) -> NSAttributedString {
let attributeString: NSMutableAttributedString = NSMutableAttributedString(string: text)
attributeString.addAttribute(NSAttributedString.Key.strikethroughStyle, value: 0, range: NSMakeRange(0, attributeString.length))
return attributeString
}
var strikeThroughTextBool: Bool = false
This is my TopPlayersData file that contains the Data Struct and the data:
import Foundation
import UIKit
struct Data {
var num: Int = 0
var name: String = ""
var team: String = ""
var position: String = ""
var strikeThrough: Bool = false
var color: Bool = false
var accessory: Bool = false
}
var objectsArray = [Data]()
func quarterBacks() {
objectsArray = [
Data(num: 1, name: "Patrick Mahomes", team: "KC", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 2, name: "Deshaun Watson", team: "HOU", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 3, name: "Aaron Rodgers", team: "GB", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 4, name: "Matt Ryan", team: "ATL", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 5, name: "Baker Mayfield", team: "CLE", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 6, name: "Carson Wentz", team: "PHI", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 7, name: "Jared Goff", team: "LAR", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 8, name: "Cam Newton", team: "CAR", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 9, name: "Andrew Luck", team: "IND", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 10, name: "Drew Brees", team: "NO", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 11, name: "Ben Roethlisberger", team: "PIT", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 12, name: "Dak Prescott", team: "DAL", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 13, name: "Russell Wilson", team: "SEA", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 14, name: "Kyler Murray", team: "ARI", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 15, name: "Tom Brady", team: "NE", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 16, name: "Lamar Jackson", team: "BAL", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 17, name: "Mitchell Trubisky", team: "CHI", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 18, name: "Jameis Winston", team: "TB", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 19, name: "Philip Rivers", team: "LAC", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 20, name: "Kirk Cousins", team: "MIN", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 21, name: "Derek Carr", team: "OAK", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 22, name: "Sam Darnold", team: "NYJ", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 23, name: "Josh Allen", team: "BUF", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 24, name: "Matthew Stafford", team: "DET", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 25, name: "Marcus Mariota", team: "TEN", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 26, name: "Jimmy Garoppolo", team: "SF", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 27, name: "Andy Dalton", team: "CIN", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 28, name: "Eli Manning", team: "NYG", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 29, name: "Nick Foles", team: "JAC", position: "QB", strikeThrough: false, color: false, accessory: false),
Data(num: 30, name: "Joe Flacco", team: "DEN", position: "QB", strikeThrough: false, color: false, accessory: false)
]
}
func runningBacks() {
objectsArray = [
Data(num: 1, name: "Saquon Barkley", team: "NYG", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 2, name: "Christian McCaffrey", team: "CAR", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 3, name: "Alvin Kamara", team: "NO", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 4, name: "Ezekiel Elliott", team: "DAL", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 5, name: "David Johnson", team: "ARI", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 6, name: "Le'Veon Bell", team: "NYJ", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 7, name: "Todd Gurley II", team: "LAR", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 8, name: "Kerryon Johnson", team: "DET", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 9, name: "Joe Mixon", team: "CIN", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 10, name: "James Conner", team: "PIT", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 11, name: "Dalvin Cook", team: "MIN", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 12, name: "Nick Chubb", team: "CLE", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 13, name: "Leonard Fournette", team: "JAC", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 14, name: "Josh Jacobs", team: "OAK", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 15, name: "Devonta Freeman", team: "ATL", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 16, name: "Melvin Gordon", team: "LAC", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 17, name: "Derrick Henry", team: "TEN", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 18, name: "Chris Carson", team: "SEA", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 19, name: "Marlon Mack", team: "IND", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 20, name: "Aaron Jones", team: "GB", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 21, name: "Damien Williams", team: "KC", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 22, name: "Mark Ingram II", team: "BAL", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 23, name: "James White", team: "NE", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 24, name: "Sony Michel", team: "NE", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 25, name: "Kenyan Drake", team: "MIA", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 26, name: "David Montgomery", team: "CHI", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 27, name: "Tarik Cohen", team: "CHI", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 28, name: "Phillip Lindsay", team: "DEN", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 29, name: "Derrius Guice", team: "WAS", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 30, name: "Lamar Miller", team: "HOU", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 31, name: "Tevin Coleman", team: "SF", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 32, name: "Miles Sanders", team: "PHI", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 33, name: "Austin Ekeler", team: "LAC", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 34, name: "Duke Johnson Jr.", team: "HOU", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 35, name: "Royce Freeman", team: "DEN", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 36, name: "Rashaad Penny", team: "SEA", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 37, name: "Nyheim Hines", team: "IND", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 38, name: "Peyton Barber", team: "TB", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 39, name: "Latavius Murray", team: "NO", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 40, name: "Jordan Howard", team: "PHI", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 41, name: "Matt Breida", team: "SF", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 42, name: "LeSean McCoy", team: "BUF", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 43, name: "Darrell Henderson", team: "LAR", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 44, name: "Darwin Thompson", team: "KC", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 45, name: "Ronald Jones", team: "TB", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 46, name: "Devin Singletary", team: "BUF", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 47, name: "Jalen Richard", team: "OAK", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 48, name: "Dion Lewis", team: "TEN", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 49, name: "Giovani Bernard", team: "CIN", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 50, name: "Kalen Ballage", team: "MIA", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 51, name: "Jaylen Samuels", team: "PIT", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 52, name: "Justice Hill", team: "BAL", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 53, name: "Tony Pollard", team: "DAL", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 54, name: "Chris Thompson", team: "WAS", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 55, name: "Justin Jackson", team: "LAC", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 56, name: "Carlos Hyde", team: "KC", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 57, name: "Jerick McKinnon", team: "SF", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 58, name: "Kareem Hunt", team: "CLE", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 59, name: "Malcolm Brown", team: "LAR", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 60, name: "Damien Harris", team: "NE", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 61, name: "Mike Davis", team: "CHI", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 62, name: "Mark Walton", team: "MIA", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 63, name: "C.J. Anderson", team: "DET", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 64, name: "Dexter Williams", team: "GB", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 65, name: "Adrian Peterson", team: "WAS", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 66, name: "Jamaal Williams", team: "GB", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 67, name: "Ito Smith", team: "ATL", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 68, name: "Alexander Mattison", team: "MIN", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 69, name: "Gus Edwards", team: "BAL", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 70, name: "Chase Edmonds", team: "ARI", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 71, name: "Frank Gore", team: "BUF", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 72, name: "Theo Riddick", team: "DEN", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 73, name: "Dontrell Hilliard", team: "CLE", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 74, name: "Darren Sproles", team: "PHI", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 75, name: "Benny Snell Jr.", team: "PIT", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 76, name: "Doug Martin", team: "OAK", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 77, name: "Rex Burkhead", team: "NE", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 78, name: "Ryquell Armstead", team: "JAC", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 79, name: "Ty Montgomery", team: "NYJ", position: "RB", strikeThrough: false, color: false, accessory: false),
Data(num: 80, name: "Andre Ellington", team: "TB", position: "RB", strikeThrough: false, color: false, accessory: false)
]
}