Open gerchicov-vg opened 3 months ago
Just added this chunk of code and tried to run:
class MarkdownSubreddit: MarkdownLink { private static let regex = "(^|\\s|\\W)(/?r/(\\w+)/?)" override var regex: String { return MarkdownSubreddit.regex } override func match(match: NSTextCheckingResult, attributedString: NSMutableAttributedString) { let subredditName = attributedString.attributedSubstringFromRange(match.rangeAtIndex(3)).string let linkURLString = "http://reddit.com/r/\(subredditName)" formatText(attributedString, range: match.range, link: linkURLString) addAttributes(attributedString, range: match.range, link: linkURLString) } }
Errors:
Argument labels for method 'match(match:attributedString:)' do not match those of overridden method 'match(_:attributedString:)'
'attributedSubstringFromRange' has been renamed to 'attributedSubstring(from:)'
'rangeAtIndex' has been renamed to 'range(at:)'
Just added this chunk of code and tried to run:
Errors: