Questions tagged as 'swift'

1
answer

Add profile picture to chat with JSQMessagesViewController

I'm experimenting with JSQMessagesViewController and Firebase. I have managed to save download Firebase content and save them via chat. Until now I have had problems with the profile image. I am declaring the following two variables: var incom...
asked by 01.06.2016 / 01:10
1
answer

Help with JSON to convert it to Array

I would like to know how I could receive a Dictionary and turn it into an Arrangement of type Classes. The dictionary is received in Json and I download it with alamofire. What I would need help with is to create the function that converts me to...
asked by 03.04.2017 / 04:06
2
answers

How to Mark or Uncheck CheckBox?

I need help with a custom checkbox. To make them I put two buttons and create two classes, one for each checkbox that gives them their form which I take from this same site, I leave the class with which I give shape to the button import UIK...
asked by 01.08.2016 / 00:33
2
answers

Connect menu of 5 buttons to a view, with a single segue

How to use a single segue (1 segue for 5 buttons) instead of 5 segues (1 per button) leaving only one, which contains all the IBAaction and takes you to the other view depending on what you press, the content in the other view is presented in on...
asked by 11.08.2017 / 23:50
1
answer

UITableView separation between Swift cells

I have the following UITableView I would like to be able to add spaces between each cell My Swift code // MARK: - Table view data source func numberOfSections(in tableView: UITableView) -> Int { return 6 }...
asked by 05.04.2018 / 22:00
1
answer

Change the background color of the "header" of a UITableView

I have the following table @IBOutlet weak var menuTableView: UITableView! Which I complete with the following code override func viewWillAppear(_ animated: Bool) { menuTableView.reloadData() } // MARK: - Table view data source func n...
asked by 18.04.2018 / 15:27
1
answer

Dictionary or Tuple? How to access a key inside another key in Swift?

I have a web service in which, with the Alamo library, I collect some data. I have the result in a variable such as: response.result.value Within this variable I want to access a second level key. The result is returned as: response.result....
asked by 02.08.2017 / 17:41
2
answers

Format Date yyyy-MM-dd HH: mm: ss at 12 o'clock

I have this format and obviously when I turn on the clock at 12 o'clock, it returns a null , if I put it at 24h, I format the date well. How can I solve this? ! Update: For 12h I try this let dateFormatter1 = DateFormatter() d...
asked by 30.03.2017 / 13:02
2
answers

IOS user permissions

I'm making an app that asks for access to access the image gallery. So I have to ask the user for access. My question is: If the user the first time cancels the permissions, how can I ask them again? At the moment I have this code that...
asked by 22.11.2016 / 07:45
2
answers

Obtain n characters from a string with swift

I need to get the first 4 characters of a string in Swift. Is there a function for it?     
asked by 03.10.2016 / 09:17