Make a button display an text input - ios

So I am new on app development. I am currently using swift on Xcode 6.1 and I want to make a button to create a Table View Cell. So I need to do when the button is clicked prompt a text input with a name for you Cell, and after this name is typed create the cell.
My button and table view are:
#IBOutlet weak var charListIPhone: UITableView!
#IBOutlet weak var addCharIPhone: UIButton!

Related

Disable interaction on subview of UITableViewCell

I have a custom table cell with two subView in it. One of them should allow user interaction, and one of the views should not allow interaction.
I have already tried userInteraction enable and disable on UIView but didn't get any result.
#IBOutlet weak var headerView: UIView!
#IBOutlet weak var detailView: UIView!
The orange selected color is my detailView and i want to prevent user interaction on this view.

View over tableView

I have the following screen (image) which shows a side menu when the button is pressed the menu appears, plus I have a uitableview to show other things
my problem is that when the side menu appears the uitableview is resized.
How do I keep my uitableview intact?
I've been trying the next but I have not got anything:
#IBOutlet weak var Vmenu_usuario: UIView!
#IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
view.sendSubview(toBack:tableView)
view.bringSubview(toFront:Vmenu_usuario)
}
If you want to delete White space view over tableview
uncheck the option 'Adjust Scroll View Insets'.
more detail: Empty white space above UITableView inside a UIView
Hope this hellp.

Is it possible to set inputView/ inputAccessoryView for textfields in storyboard?

I have picker and toolbar for textfields.
#IBOutlet var picker: UIDatePicker!
#IBOutlet var toolbar: UIToolbar!
#IBOutlet weak var toTF: UITextField!
#IBOutlet weak var fromTF: UITextField!
and then in viewDidLoad
fromTF.inputView = picker
toTF.inputView = picker
fromTF.inputAccessoryView = toolbar
toTF.inputAccessoryView = toolbar
Is it possible to avoid this code and set them in storyboard? (Like you do that for delegates, etc.) I can't find any possibilities.
As far as I can tell, this isn't possible. You can set the views up in your Storyboard/Xib as yo have done, but it looks like the actual connection logic needs to take place in code.

UILabel height depending on text

I am getting data from JSON and it changes for each view so I need the labels to change their height depending on their content and also the rest of labels and buttons should move down. I am using sizeToFit but anything else moves and when I scroll it loses its height and goes to 1 line again.
My labels have 0 lines in storyboard.
#IBOutlet weak var titulares: UILabel!
#IBOutlet weak var scroller: UIScrollView!
#IBOutlet weak var imagen: UIImageView!
#IBOutlet weak var estilo: UILabel!
#IBOutlet weak var historia: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
// I get JSON Data
self.historia.sizeToFit()
self.titulares.sizeToFit()
self.estilo.sizeToFit()
Use autolayout
from the storyboard, press on a label and then in the right bottom side of the screen, you have the "Add new constrains" button.
Use it to set a spacing from a view to it's neighbors
https://developer.apple.com/library/tvos/documentation/UserExperience/Conceptual/AutolayoutPG/index.html

Splitting text in different TextViews SWIFT

I have a big paragraph i want to add to a view. But the problem i am having is the first textview is small and then under it i have a map view. After the map view i want the text to continue from where it stopped in the first textview. I put an example below to show exactly what i mean.
#IBOutlet var firstSection: UITextView!
#IBOutlet var articleMapView: MKMapView!
#IBOutlet var secondSection: UITextView!
I want have a text above to map and and below it.

Resources