How do I add border to an #IBAction Button that is linked from storyboard in Swift 2.1? - uibutton

How to set button border if the button is linked to storyboard and is of type #IBAction?

The button's type is not IBAction, the IBAction is the connection between the storyboard and the function
if you want to change the button in the code, connect it from the storyboard as an outlet
(hold ctrl and drag the button from storyboard to your viewController)
(and u can also change it from the storyboard)

Related

the method that handles the button action never inserted when the button is dragged

I am trying to drag a button in the .m file as shown in the image below, but after releasing the mouse button the method that handles the button when clicked was never implemented.
please let me why that method gets never inserted in the .m file??
image:
Choose your ViewController in IB by clicking on the yellow circle with a square inside. Select the third tab on Xcode's right pane. Choose ViewController as your class for this IB item from the combobox. After that, the binding should work.
The storyboard viewcontroller must be a subclassed from the class you are trying to drag into (by default its UIviewController) If it's not then it won't work...
From your storyboard click on viewController and then in the inspector panel on your right change it to the right class and you should be all good.

Can't pass UIPickerView selection to UITextView in another UIViewController

I have a UIViewController with a UITextView and UIButton in it. When the user clicks this button it will present a PopUp created with a UIViewController. When the Popup view loads, it displays a UIPickerView.
The problem I am having is passing the selection from the picker to the textView in the first view. I know it has to do with creating global variables, but I just can't figure out how to do it.
Anyone could help?

UITabbar disappears when clicked on a button

I use UITabBar in my application. In one of my tabbars, i have a UITableView in a UIViewController whose root view controller is a Navigation Controller. When i click on a cell, i go to my custom edit mode which is a UIViewController.
In my edit mode I have a backButton that shows me UIViewController with the TableView.
My problem is when i click backButton, my TabBar disappears.
Do you have any ideas why my TabBar disappears?
Thanks.
In back button click, add the following code.
[self.navigationController popViewControllerAnimated:YES];

storyboard segue modal can't have back button?

So we built a bar button inside a popover and used a modal segue linked to a UIViewController in storyboard. However, there is not back button. How can we build a back button?

from xib to storyboard UIButton or no?

I created an xib file(which is a gridView) outside of storyboard. If you create a button on the xib file and wanted to move from that button back to the storyboard and passing GridViewItems. How do you do that? Thanks in advance.
I figured it out. First, you set a push segue on the storyboard from the view you called the grid view to the view you want to go. Of course, you have to connect your button in the grid view xib file to IBOutlet property.
Then add this to the tableView
[cellview.button addTarget:self action:#selector(toNextView:) forControlEvents:UIControlEventTouchUpInside];
and create a function toNextView and perform the segue in the function:
[self.own performSegueWithIdentifier:#"OwnViewToNewView" sender:item];