Как преобразовать строку JSON в словарь?

Используйте элемент управления ProgressBar и привяжите его свойство Value к свойству ViewModel:

View

<ProgressBar Minimum="0" Maximum="0" Value="{Binding CurrentProgress}" />

ViewModel

private double _currentProgress;
public double CurrentProgress
{
    get { return _currentProgress; }
    private set
    {
        _currentProgress = value;
        OnPropertyChanged("CurrentProgress");
    }
}
144
задан Thom 22 March 2017 в 15:03
поделиться

1 ответ

let JSONData = jsonString.data(using: .utf8)!

let jsonResult = try JSONSerialization.jsonObject(with: data, options: .mutableLeaves)

guard let userDictionary = jsonResult as? Dictionary<String, AnyObject> else {
            throw NSError()}
-1
ответ дан 23 November 2019 в 21:52
поделиться
Другие вопросы по тегам:

Похожие вопросы: