Question: I'm new to JSON and have below file. I have to save the array "steps" in java and need to loop the objects "duration" , "status" and "Keyword".

```
"steps": [
      {
        "result": {
          "duration": 7128811788,
          "status": "passed"
        },
        "line": 5,
        "name": "The Browser is Launched and Smart Business URL is loaded",
        "match": {
          "location": "Common_Login.the_Browser_is_Launched_and_Smart_Business_URL_is_loaded()"
        },
        "keyword": "Given "
      },]

```

I tried below but didn't worked.

```
JSONParser parser = new JSONParser();
Object obj = parser.parse(new FileReader("./target/JSON/Output.json"));
JSONArray jsonArray = (JSONArray) obj;
System.out.println(jsonArray);

for (int i = 0; i < jsonArray.size(); i++) {
    JSONObject jsonObjectRow = (JSONObject) jsonArray.get(i);
    name = (String) jsonObjectRow.get("duration");
    id = (String) jsonObjectRow.get("status");
    uri = (String) jsonObjectRow.get("name");
    status = (String) jsonObjectRow.get("location");
}

```

Answer: 
I would present a modal view at startup, which you can then configure with login fields. This allows you to keep split view as the root view. In AppDelegate's `didFinishLaunchingWithOptions`, you can add something like:

```
    let storyboard = UIStoryboard(name: "Main", bundle: nil)
    let modalView = storyboard.instantiateViewController(withIdentifier: "startupView")
    modalView.modalPresentationStyle = .formSheet
    splitViewController.present(modalView, animated: true, completion: nil)

```

after you have configured your split view. This would present a View Controller with identifier "startupView" which you can then configure in Storyboard. 

EDIT - you may also wish to set modal view as page sheet or blur the background if you do not wish the user to see any of the master/detail content before login.
After login succeed, you set the root of window to SplitViewController like that:

```
let splitVC = UISplitViewController()
let window = UIApplication.shared.windows.first
window?.rootViewController = splitVC

```