Вы можете использовать didSet внутри cellIndex.
var cellIndex: Int = 0 {
didSet {
let s1 = "word \(cellIndex) to \(cellIndex+7)"
let mystring:NSString = "\(s1) recovery phrases" as NSString
var myMutableString = NSMutableAttributedString()
myMutableString = NSMutableAttributedString(string:mystring as String, attributes: [NSAttributedString.Key.font:Font.mediumRegularFont()])
myMutableString.addAttribute(NSAttributedString.Key.foregroundColor, value: Color.darkColor(), range: NSRange(location:0,length:s1.count))
stepBarView.attributedText = myMutableString
}
}
Теперь, когда значение установлено в cellIndex, оно будет обновлять метку нужной строкой.