Today extension crashing with NSNotificationCenter - ios

I'm creating a today extension that grows/shrinks to save space. in the Notification Center, but I am having problems with the NSNotificationCenter. If I call the visibility() function, the view shrinks and grows normally, but if I try posting a notification, the extension fails and attempts to reload instead(at least the first time, the second time the extension just says "Unable to load". Why is this?
var NSNotificationDidChoose = "NSNotificationDidChoose"
#IBOutlet var tableView: UITableView!
#IBOutlet var activityIndicator: UIActivityIndicatorView!
#IBAction func shrink(sender: AnyObject) {
//visibility(["bool":false])works fine here
NSNotificationCenter.defaultCenter().postNotificationName(NSNotificationDidChoose, object: nil, userInfo: ["bool":false])
//Crashes and the extension reloads
}
#IBAction func unshrink(sender: AnyObject) {
//visibility(["bool":true]) works fine here
NSNotificationCenter.defaultCenter().postNotificationName(NSNotificationDidChoose, object: nil, userInfo: ["bool":true])
//Crashes and the extension reloads
}
#IBOutlet var buttonview: UIView!
func visibility(boole:[NSObject:AnyObject]) {
var bool = boole["bool"] as Bool
println(bool)
tableView.hidden = !bool
activityIndicator.hidden = !bool
if bool {
self.preferredContentSize = CGSize(width: 350, height: 420)
} else {
self.preferredContentSize = CGSize(width: 350, height: buttonview.frame.height+25)
}
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(true)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "visibility:", name: NSNotificationDidChoose, object: nil)
}

The argument of notification method is NSNotification. Try this.
func visibility(notif: NSNotification) {
let boole = notif.userInfo!
var bool = boole["bool"] as Bool
....
}

Related

Data transfer between tab view controllers - swift

There are 3 child tab view controllers. There are labels as 0 in view controllers. If the number(0) of labels increases in any view controller, I want to increase from the others. How can i do this data transfer.
class tab1Controller: UIViewController {
#IBOutlet weak var countLabel: UILabel!
var count = ""
override func viewDidLoad() {
super.viewDidLoad()
count = countLabel.text!
UserDefaults.standard.set(count, forKey: "count")
UserDefaults.standard.synchronize()
}
class tab2Controller: UIViewController {
#IBOutlet weak var countLabel2: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
countLabel2.text = UserDefaults.standard.string(forKey: "count")
}
I did something like this but it didn't work
I think the simplest way in your case is to update the label text in viewWillAppear method.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
countLabel.text = UserDefaults.standard.string(forKey: "count")
}
You also should update the value in UserDefaults every time the number changes.
Do it i viewWillAppear() instead of viewDidLoad().. Because DidLoad() of all controllers called when tabBar construct and show first tab ...
#IBOutlet weak var countLabel2: UILabel!
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
countLabel.text = UserDefaults.standard.string(forKey: "count")
}
I assume that your child controllers are created at the same when the tab controller created. In such cases that needed to notify other existing controllers, you must use NotificationCenter.
A notification dispatch mechanism that enables the broadcast of information to registered observers.
extension Notification.Name {
static let didReceiveCountData = Notification.Name("didReceiveCountData")
}
class tab1Controller: UIViewController {
#IBOutlet weak var countLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Listen notifications for name .didReceiveCountData.
// onDidReceiveCountData(_:) will be called when notification received.
NotificationCenter.default.addObserver(self, selector: #selector(onDidReceiveCountData(_:)), name: .didReceiveCountData, object: nil)
}
// This will be called when the count changes.
#objc func onDidReceiveCountData(_ notification:Notification) {
if let newCount = notification.object as? String {
countLabel.text = newCount
}
}
// Call this when you need to change count and notify other tabs.
private func changeCount(_ newCount: String) {
NotificationCenter.default.post(name: .didReceiveCountData, object: newCount)
}
}
class tab2Controller: UIViewController {
#IBOutlet weak var countLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// Listen notifications for name .didReceiveCountData.
// onDidReceiveCountData(_:) will be called when notification received.
NotificationCenter.default.addObserver(self, selector: #selector(onDidReceiveCountData(_:)), name: .didReceiveCountData, object: nil)
}
// This will be called when the count changes.
#objc func onDidReceiveCountData(_ notification:Notification) {
if let newCount = notification.object as? String {
countLabel.text = newCount
}
}
// Call this when you need to change count and notify other tabs.
private func changeCount(_ newCount: String) {
NotificationCenter.default.post(name: .didReceiveCountData, object: newCount)
}
}

How to update a progress view that is on another UIViewController - SWIFT?

I have a UITableViewController that is embedded in a UINavigationController. When I click on a row I am attempting to upload a file. To show the progress of this upload I have decided to use custom popup (another UIViewController) - if anyone has a better idea to show the progress of the upload in this context I am open to it.
The only idea I have to transfer continuous data from one UIViewController to another (if that is possible) is by using a Singleton. My code is below, my issue at the moment is I do not know how to update the progress view even though now it has access to the progress data via the singleton.
class SharedSingleton{
private init(){}
static let shared = SharedSingleton()
var prog: Float = 0
}
UITableViewController:
Using Alamofire to get the fraction of upload completed:
/**TRACK PROGRESS OF UPLOAD**/
upload.uploadProgress { progress in
//print(progress.fractionCompleted)
let mySingleton = SharedSingleton.shared
mySingleton.prog = Float(progress.fractionCompleted)
print("mySingleton.prog: \(mySingleton.prog)")
UIViewController containing popup:
#IBOutlet weak var popUpContainer: UIView!
#IBOutlet weak var uploadStatus: UILabel!
#IBOutlet weak var progressBar: UIProgressView!
override func viewDidLoad() {
super.viewDidLoad()
// Make popup have rounded corners
popUpContainer.layer.cornerRadius = 5
popUpContainer.layer.masksToBounds = true
// Call Singleton and assign progress of upload to progress view
// HOW TO UPDATE ??????
let mySingleton = SharedSingleton.shared
progressBar.progress = mySingleton.prog
}
One option would be to use NotificationCenter and in your pop-up view controller subscribe to notifications and in your API callback for the progress, publish a notification.
For example:
UploadNotifications.swift:
import Foundation
extension Notification.Name {
static let UploadProgress = Notification.Name("UploadProgress")
}
UploadProgressViewController.swift (your pop-up):
import UIKit
class UploadProgressViewController: UIViewController {
#IBOutlet weak var progressBar: UIProgressView!
private let progress: Progress = {
let progress = Progress()
progress.completedUnitCount = 0
progress.totalUnitCount = 100
return progress
}()
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
NotificationCenter.default.addObserver(self, selector: #selector(self.uploadDidProgress(_:)), name: .UploadProgress, object: nil)
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
NotificationCenter.default.removeObserver(self)
}
#objc private func uploadDidProgress(_ notification: Notification) {
if let progress = notification.object as? Int64 {
self.progress.completedUnitCount = progress
if progress == 100 {
// dismiss/exit
}
}
}
}
Then in your method with the upload progress callback:
upload.uploadProgress { progress in
NotificationCenter.default.post(name: .SyncDidProgress, object: Int64(progress))
}

This keyboard won't leave

I'm having a weird behavior from a keyboard. But only on one of the view controllers. I have another view controller with a UITextField and that one works charms (as soon as I press the return button it disappears). And the weird part is that that one isnt even setup at all. it only has becomefirstresponder on viewdidload and resignfirstresponder on viewwilldissapear.
THIS keyboard however, VIDEO OF NASTY KEYBOARD is quite the nasty booger.
NOTE: In the video I do the following:
* Tap the UITextfield
* Keyboard Appears (view shifts up)
* I type lol and then press send (nothing happens)
* I start tapping frantically all around the screen (except the UITextField)
* Keyboard dissapears
Here's the code for this View:
class ChatScreenVC: UIViewController, UITextFieldDelegate {
var gameDelegate: GameManagerDelegate?
var chatLogString: String = ""
var offsetY:CGFloat = 0
#IBOutlet weak var chatView: UIView!
#IBOutlet weak var closeBtn: UIButton!
#IBOutlet weak var titleBtn: UILabel!
#IBOutlet weak var chatLog: UITextView!
#IBOutlet weak var chatInput: UITextField!
#IBOutlet weak var sendBtn: UIButton!
#IBOutlet weak var viewCenterConstraint: NSLayoutConstraint!
#IBAction func inputTapped(_ sender: Any) {
chatInput.becomeFirstResponder()
}
#IBAction func closeTapped(_ sender: Any) {
self.dismiss(animated: true, completion: nil)
}
#IBAction func sendTapped(_ sender: Any) {
if chatInput.text != nil && chatInput.text != "" && chatInput.text != " " {
gameDelegate?.sendChat(message: chatInput.text!)
}
chatInput.text = ""
chatInput.resignFirstResponder()
self.view.endEditing(true)
}
#objc func keyboardWillShow(_ notification: Notification) {
if let keyboardFrame: NSValue = notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue {
let keyboardRectangle = keyboardFrame.cgRectValue
let keyboardHeight = keyboardRectangle.height
viewCenterConstraint.constant = -keyboardHeight
}
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
print("THIS IS HAPPENING!")
chatInput.resignFirstResponder()
self.view.endEditing(true)
return true
}
#objc func keyboardWillHide(_ notification: Notification) {
if let keyboardFrame: NSValue = notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue {
viewCenterConstraint.constant = 0
}
}
#objc func reloadData() {
chatLogString = (gameDelegate?.updateChatString())!
chatLog.text = chatLogString
}
override func viewDidLoad() {
super.viewDidLoad()
chatLog.text = chatLogString
chatLog.isEditable = false
chatInput.autocorrectionType = .no
// Do any additional setup after loading the view.
}
override func viewWillAppear(_ animated: Bool) {
setupView()
animateView()
}
override func viewWillDisappear(_ animated: Bool) {
chatInput.resignFirstResponder()
}
override func viewDidAppear(_ animated: Bool) {
NotificationCenter.default.addObserver(self, selector: #selector(self.reloadData), name: Notification.Name(rawValue: SMACK_TALK), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: NSNotification.Name.UIKeyboardWillHide, object: nil)
}
override func viewDidDisappear(_ animated: Bool) {
NotificationCenter.default.removeObserver(self, name: Notification.Name(rawValue: SMACK_TALK), object: nil)
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
}
}
Now before you go and tell me "not to use both the resignfirstresponder and the endediting(true)" I gotta clear out that I tried both individually and together and still don't get any response.
You can resign keyboard before sendChat(). I think it is sync call and it will block main thread for sometimes thats why this weird behaviour occurs.
chatInput.resignFirstResponder() before you are making API call.
#IBAction func sendTapped(_ sender: Any) {
if chatInput.text != nil && chatInput.text != "" && chatInput.text != " " {
chatInput.resignFirstResponder()
self.view.endEditing(true)
gameDelegate?.sendChat(message: chatInput.text!)
}
}

Keyboard move up and down

I have a loginView, inside that i have two textFields and a button. I have to move up the view while tapping on textField and move down the view when press the return key.
My problem is that it is working fine for all conditions but while tap on the one textField view is moving up but at same time when we go for next textField view is moving down.
import UIKit
class CheckFontIconView: UIViewController,UITextFieldDelegate {
var activeField: UITextField?
#IBOutlet weak var loginFieldsView: UIView!
#IBOutlet weak var label: UILabel!
#IBOutlet weak var mobileNo: UITextField!
#IBOutlet weak var textFieldPassword: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
mobileNo.delegate = self
textFieldPassword.delegate = self
registerForKeyboardNotifications()
}
#IBAction func btnLoginAction(_ sender: Any) {
}
deinit {
//NotificationCenter.default.removeObserver(self)
self.deregisterFromKeyboardNotifications()
}
func registerForKeyboardNotifications() {
//Adding notifies on keyboard appearing
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWasShown(notification:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillBeHidden(notification:)), name: NSNotification.Name.UIKeyboardWillHide, object: nil)
}
func deregisterFromKeyboardNotifications() {
//Removing notifies on keyboard appearing
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)
}
func keyboardWasShown(notification: NSNotification) {
//Need to calculate keyboard exact size due to Apple suggestions
var info = notification.userInfo!
let keyboardSize = (info[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue.size
if self.activeField != nil {
self.loginFieldsView.frame.origin.y -= (keyboardSize?.height)!
}
}
func keyboardWillBeHidden(notification: NSNotification) {
//Once keyboard disappears, restore original positions
var info = notification.userInfo!
let keyboardSize = (info[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue.size
self.loginFieldsView.frame.origin.y -= (keyboardSize?.height)!
self.loginFieldsView.endEditing(true)
}
func textFieldDidBeginEditing(_ textField: UITextField) {
self.activeField = textField
}
func textFieldDidEndEditing(_ textField: UITextField) {
self.activeField = nil
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
activeField?.resignFirstResponder()
return true
}
}
Once try with scrollView,I hope it will help you.
Use a scroll view to moving text field up and down.
Making Up
Make a #IBOutlet weak var scroller: UIScrollView!;
Under textFieldDidBeginEditing:textField method
Create a CGPoint with x: 0 and y texfield.frame.origin.y
And then start moving the scroller with setContentOffset:animated function.(Parameter will be your CGPoint and a boolean value true).
Making Down
Under textFieldDidEndEditing:textField set your scroller to CGPoint.zero with same setContentOffset:animated function.
*And your textFieldShouldReturn:textField should be resignFirstResponder or to next textField.
Please let me know if having any problem on this.
Thanks for ask question...
Use TPKeyboard to achieve above functionality then no manage this kind of stuff (Automatically manage by TPKeyboard)...
Update:
I think you have done some mistake in given below code...
func textFieldDidEndEditing(_ textField: UITextField) {
self.activeField = nil
}
You have to DEBUG and identify exact issue..
Happy coding...
I made the simple code for your problem. It is not good but you can refer with that idea for fix your problem.
import UIKit
class ViewController: UIViewController, UITextFieldDelegate {
var activeField: UITextField?
#IBOutlet weak var loginFieldsView: UIView!
#IBOutlet weak var label: UILabel!
#IBOutlet weak var mobileNo: UITextField!
#IBOutlet weak var textFieldPassword: UITextField!
var originalHeight:CGFloat!
override func viewDidLoad() {
super.viewDidLoad()
mobileNo.delegate = self
textFieldPassword.delegate = self
originalHeight = self.loginFieldsView.frame.origin.y
registerForKeyboardNotifications()
}
#IBAction func btnLoginAction(_ sender: Any) {
}
deinit {
//NotificationCenter.default.removeObserver(self)
self.deregisterFromKeyboardNotifications()
}
func registerForKeyboardNotifications() {
//Adding notifies on keyboard appearing
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWasShown(notification:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillBeHidden(notification:)), name: NSNotification.Name.UIKeyboardWillHide, object: nil)
}
func deregisterFromKeyboardNotifications() {
//Removing notifies on keyboard appearing
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)
}
func keyboardWasShown(notification: NSNotification) {
//Need to calculate keyboard exact size due to Apple suggestions
var info = notification.userInfo!
let keyboardSize = (info[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue.size
if self.activeField != nil {
if self.loginFieldsView.frame.origin.y == originalHeight {
self.loginFieldsView.frame.origin.y -= (keyboardSize?.height)!
}
}
}
func keyboardWillBeHidden(notification: NSNotification) {
//Once keyboard disappears, restore original positions
var info = notification.userInfo!
let keyboardSize = (info[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue.size
if originalHeight > self.loginFieldsView.frame.origin.y {
self.loginFieldsView.frame.origin.y += (keyboardSize?.height)!
}
self.loginFieldsView.endEditing(true)
}
func textFieldDidBeginEditing(_ textField: UITextField) {
self.activeField = textField
}
func textFieldDidEndEditing(_ textField: UITextField) {
self.activeField = nil
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
activeField?.resignFirstResponder()
return true
}
}
Just one change hold your view old frame in a variable and assign it again to your view when keyboard disappear.
import UIKit
class CheckFontIconView: UIViewController,UITextFieldDelegate {
var activeField: UITextField?
#IBOutlet weak var loginFieldsView: UIView!
#IBOutlet weak var label: UILabel!
#IBOutlet weak var mobileNo: UITextField!
#IBOutlet weak var textFieldPassword: UITextField!
var previousFrame : CGRect!
override func viewDidLoad() {
super.viewDidLoad()
previousFrame=self.loginFieldsView.frame
mobileNo.delegate = self
textFieldPassword.delegate = self
registerForKeyboardNotifications()
}
func keyboardWasShown(notification: NSNotification) {
//Need to calculate keyboard exact size due to Apple suggestions
var info = notification.userInfo!
let keyboardSize = (info[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue.size
if self.activeField != nil {
self.loginFieldsView.frame.origin.y = previousFrame.origin.y-(keyboardSize?.height)!
}
}
func keyboardWillBeHidden(notification: NSNotification) {
//Once keyboard disappears, restore original positions
/*var info = notification.userInfo!
let keyboardSize = (info[UIKeyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue.size*/
self.loginFieldsView.frame = previousFrame
//self.loginFieldsView.endEditing(true)
}
func textFieldDidBeginEditing(_ textField: UITextField) {
self.activeField = textField
}
func textFieldDidEndEditing(_ textField: UITextField) {
self.activeField = nil
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
activeField?.resignFirstResponder()
return true
}
}

IOS swift when keyboard apears it hiddes the top 2 TextField

This is my whole code when keyboard appears it hides the top 1 textfield and one is half visible. It works but when it hiddes the top fields it looks to wired.
I found this code on net but i can't able to fix it.
class ViewController2: UIViewController, ENSideMenuDelegate, UITextFieldDelegate {
#IBOutlet weak var text1: UITextField!
#IBOutlet weak var text2: UITextField!
#IBOutlet weak var text3: UITextField!
#IBOutlet weak var text4: UITextField!
#IBOutlet weak var scrollview: UIScrollView!
var activeTextField: UITextField!
#IBOutlet weak var container_view: UIView!
override func viewDidLoad() {
super.viewDidLoad()
//Move next line to viewWillAppear functon if you store your view controllers
self.sideMenuController()?.sideMenu?.delegate = self
// Do any additional setup after loading the view.
self.text1.delegate = self
self.text2.delegate = self
self.text3.delegate = self
self.text4.delegate = self
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - ENSideMenu Delegate
func sideMenuWillOpen() {
println("sideMenuWillOpen")
}
func sideMenuWillClose() {
println("sideMenuWillClose")
}
func sideMenuDidClose() {
println("sideMenuDidClose")
}
func sideMenuDidOpen() {
println("sideMenuDidOpen")
}
/*
func sideMenuShouldOpenSideMenu() -> Bool {
println("sideMenuShouldOpenSideMenu")
return false
}
*/
// MARK: - Keyboard
// Call this method somewhere in your view controller setup code.
func registerForKeyboardNotifications() {
let notificationCenter = NSNotificationCenter.defaultCenter()
notificationCenter.addObserver(self,
selector: "keyboardWillBeShown:",
name: UIKeyboardWillShowNotification,
object: nil)
notificationCenter.addObserver(self,
selector: "keyboardWillBeHidden:",
name: UIKeyboardWillHideNotification,
object: nil)
}
func unregisterFromKeyboardNotifications () {
let center: NSNotificationCenter = NSNotificationCenter.defaultCenter()
center.removeObserver(self, name: UIKeyboardDidShowNotification, object: nil)
center.removeObserver(self, name: UIKeyboardWillHideNotification, object: nil)
}
private func stopObservingKeyboardEvents() {
NSNotificationCenter.defaultCenter().removeObserver(self, name: UIKeyboardWillShowNotification, object: nil)
NSNotificationCenter.defaultCenter().removeObserver(self, name: UIKeyboardWillHideNotification, object: nil)
}
// Called when the UIKeyboardDidShowNotification is sent.
func keyboardWillBeShown(sender: NSNotification) {
let info: NSDictionary = sender.userInfo!
let value: NSValue = info.valueForKey(UIKeyboardFrameBeginUserInfoKey) as! NSValue
let keyboardSize: CGSize = value.CGRectValue().size
let contentInsets: UIEdgeInsets = UIEdgeInsetsMake(0.0, 0.0, keyboardSize.height, 0.0)
scrollview.contentInset = contentInsets
scrollview.scrollIndicatorInsets = contentInsets
// If active text field is hidden by keyboard, scroll it so it's visible
// Your app might not need or want this behavior.
var aRect: CGRect = self.view.frame
aRect.size.height -= keyboardSize.height + 80
let activeTextFieldRect: CGRect? = activeTextField?.frame
let activeTextFieldOrigin: CGPoint? = activeTextFieldRect?.origin
if (!CGRectContainsPoint(aRect, activeTextFieldOrigin!)) {
scrollview.scrollRectToVisible(activeTextFieldRect!, animated:true)
}
}
// Called when the UIKeyboardWillHideNotification is sent
func keyboardWillBeHidden(sender: NSNotification) {
let contentInsets: UIEdgeInsets = UIEdgeInsetsZero
scrollview.contentInset = contentInsets
scrollview.scrollIndicatorInsets = contentInsets
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
self.registerForKeyboardNotifications()
}
override func viewDidDisappear(animated: Bool) {
super.viewWillDisappear(animated)
NSNotificationCenter.defaultCenter().removeObserver(self)
}
// MARK: - Text Field
func textFieldDidBeginEditing(textField: UITextField) {
self.activeTextField = textField
}
func textFieldDidEndEditing(textField: UITextField) {
self.activeTextField = nil
}
}
Instead of doing this
var aRect: CGRect = self.view.frame
aRect.size.height -= keyboardSize.height + 80
do this
self.view.frame.y -= keyboardSize.height + 80
(not sure what the 80 is, but I'm keeping it there in case it is accounting for something on your app.)
the .height property will stretch your frame while the .y property will move it.

Resources