Swift 4, который работает для меня:
// Convert from JSON to nsdata
func jsonToNSData(json: AnyObject) -> NSData?{
do {
return try JSONSerialization.data(withJSONObject: json, options: JSONSerialization.WritingOptions.prettyPrinted) as NSData
} catch let myJSONError {
print(myJSONError)
}
return nil;
}
у меня была подобная проблема с помощью проект easyappointments, решение состояло в том, чтобы звонить fullCalendar ('рендеринг') в функции обратного вызова после того, как следующее отделение мастера, показал:
Код JQuery :
// Display the next step tab (uses jquery animation effect).
var nextTabIndex = parseInt($(this).attr('data-step_index')) + 1;
$('#button-next-1').click(function () {
$(this).parents().eq(1).hide('fade', function () {
/* some code */
$('#wizard-frame-' + nextTabIndex).show('fade');
$('#calendar').fullCalendar('render');
});
});
HTML-код :
<div id="wizard-frame-1" class="wizard-frame">
<div class="frame-container" style="margin-top: 20px!important">/*some code*/</div>
<div class="modal-footer fixedFooter p-l-10 p-r-10">
<button type="button" id="button-next-1" class="btn button-next btn-primary"
data-step_index="1">
<?= lang('next') ?>
<span class="glyphicon glyphicon-forward"></span>
</button>
</div>
</div>