AFTER writing the code mentioned directly below,
//
// FirstCustomSegue.swift
// Prayer
//
// Created by Jae Hyun Kim on 8/9/15.
// Copyright (c) 2015 Jae Hyun Kim. All rights reserved.
//
import UIKit
class FirstCustomSegue: UIStoryboardSegue {
override func perform() {
var firstVCView = self.sourceViewController.view as UIView!
var secondVCView = self.destinationViewController.view as UIView!
let screenWidth = UIScreen.mainScreen().bounds.size.width
let screenHeight = UIScreen.mainScreen().bounds.size.height
secondVCView.frame = CGRectMake(0.0, screenHeight, screenWidth, screenHeight)
}
}
One of the statements in a tutorial that I am reading says, "At this point, the view of the second view controller is not a subview of the app’s window yet. So, before we implement the actual animation, it’s obvious that we must add it to the window. This will be achieved using the insertSubview(view:aboveSubview:) method of the app’s window object. As you see next, at first we access the window object, and then we add the destination view:" Then he goes to add the following code:
override func perform() {
...
// Access the app's key window and insert the destination view above the current (source) one.
let window = UIApplication.sharedApplication().keyWindow
window?.insertSubview(secondVCView, aboveSubview: firstVCView)
}
However, I'm not exactly sure what he means when he states "At this point, the view of the second view controller is not a subview...and blah blah blah" What does this mean? I would be more specific about what my question is about the statement such as what does "subview" mean. But I'm confused about pretty much everything about the statement. I'm sorry :(
And what does this statement, secondVCView.frame = CGRectMake(0.0, screenHeight, screenWidth, screenHeight)
, mean?