Hello,
currently I am trying to develop my first iPad app with Xcode. For handling the data on a remote server I want to use ProcessWire as middleware. For synchronizing the data I am trying the Xcode framework Alamofire, which has more convenient functions for handling such requests, especially for a beginner in Swift like me.
Now I am wondering how I should output my JSON objects in my template files the right way for Alamofire to recognize them. So far I tried the following:
<?php
$data = array(
'test' => 'Hello World!'
);
header('Content-Type: application/json');
echo json_encode($data);
But when I build my app and request the JSON after loading the first view, I don't get a response. Maybe I am missing something. The example URL from GitHub works as expected.
Do I have to be more specific with my JSON objects and do you think this is a good solution for handling data in general?
Regards, Andreas