         baseView.addSubview(infoView)
         miniView = createView(UIColor.yellowColor())
         baseView.addSubview(miniView)
+
+        setupPortraitLayout()
     }
 
-    override func traitCollectionDidChange(previousTraitCollection: UITraitCollection?) {
-        if traitCollection.verticalSizeClass == .Regular {
-            setupPhonePortraitLayout()
-        }
-        else if traitCollection.verticalSizeClass == .Compact {
-            setupPhoneLandscapeLayout()
+    override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
+        if size.height > size.width {
+            setupPortraitLayout()
         }
         else {
-            println("verticalSizeClass(\(traitCollection.verticalSizeClass.rawValue)) is not support.")
+            setupLandscapeLayout()
         }
     }
 

            miniView[.Bottom] == baseView[.Bottom] - 8,
            ])
    }
}

        view.layer.borderColor = UIColor.redColor().CGColor
        view.layer.borderWidth = 1
        return view
    }

    private func setupPortraitLayout() {
        switch traitCollection.userInterfaceIdiom {
        case .Phone:
            setupPhonePortraitLayout()
        case .Pad:
            setupPadPortraitLayout()
        default:
            println("unknown device:\(traitCollection.userInterfaceIdiom.rawValue)")
        }
    }

    private func setupLandscapeLayout() {
        switch traitCollection.userInterfaceIdiom {
        case .Phone:
            setupPhoneLandscapeLayout()
        case .Pad:
            setupPadLandscapeLayout()
        default:
            println("unknown device:\(traitCollection.userInterfaceIdiom.rawValue)")
        }
    }

    private func setupPhonePortraitLayout() {
