Использование необъявленного типа NSLinguisticTagScheme

У меня есть код, работающий на детской площадке, и XCode не показывает ошибок, но когда я компилирую файл в командной строке, он возвращается с ошибками

use of undeclared type NSLinguisticTagScheme
and String has no member 'tokenType'

Вот код проблемы.

let tagSchemes : [NSLinguisticTagScheme] = [ .tokenType]
let tagger : NSLinguisticTagger = NSLinguisticTagger(tagSchemes: tagSchemes, options: 0)
let options : NSLinguisticTagger.Options = [ .omitPunctuation, .omitWhitespace]

tagger.string = text
let range = NSRange(location: 0, length: text.utf16.count)

tagger.enumerateTags( in: range, unit: .sentence, scheme: .tokenType, options: options, using: 
{ tag, tokenRange, stop in
    let token = (text as NSString).substring(with: tokenRange)
    sentences.append(token)
})

Есть идеи?

1 ответ

Обновление Xcode решило проблему

Другие вопросы по тегам