I'm trying to find a way to remove instances of empty names in my array. I was trying to find the indices to remove them but it does not print. I could use a little help.
Code Block func filterArr() { |
for (index, player) in cPlayerArr.enumerated() { |
if (player.yahooName == "") { |
print("Found \(player) at \(index)") |
} |
} |
} |
Code Block extension CurrentPlayers { |
|
@nonobjc public class func fetchRequest() -> NSFetchRequest<CurrentPlayers> { |
return NSFetchRequest<CurrentPlayers>(entityName: "CurrentPlayers") |
} |
|
@NSManaged public var photoUrl: String? |
@NSManaged public var firstName: String? |
@NSManaged public var lastName: String? |
@NSManaged public var position: String? |
@NSManaged public var team: String? |
@NSManaged public var yahooName: String? |
@NSManaged public var status: String? |
@NSManaged public var jerseyNumber: Int64 |
|
} |
|
extension CurrentPlayers : Identifiable { |
|
} |
I will close this thread I have a better idea.