Questions tagged as 'swift'

3
answers

Ternary operators in swift

Is it possible to do operadores ternarios in swift ? I have this type of code that I repeat many times, and I wanted to know if I can simplify it using operadores ternarios . condicion ? resultadoTrue : resultadoFalse...
asked by 17.11.2016 / 14:18
1
answer

Linking xib with .swift

I have already asked a similar question, but I am going to focus more on what I do not understand. The doubt comes from the storyboard and / or the .xib files linked to their respective classes. When you create a controller in the storyboard,...
asked by 12.04.2016 / 19:01
1
answer

TableView and its dataSource

Just trying to make a simple app, I could not do something which I do not understand because I could not ... Having the following user interface: and the following files: Well, what I try to do is that each tableView in my...
asked by 25.03.2016 / 00:43
1
answer

Load CPU IOS Swift

I need to know the CPU% load of the iPhone but I can not find anything in Swift or Objective-C. I have found something that uses% of the total CPU application. Someone could help me with information or something. Thanks     
asked by 19.01.2016 / 08:25
1
answer

UIButton custom class

I have the following custom class of a UIButton , but when I add it to a button in Xcode I can not make the changes be reflected. Does anyone know what the problem is? import UIKit class BotonBordesRedondeados: UIButton { // Only...
asked by 27.12.2018 / 04:47
1
answer

Display an alert in a TableViewCell

I want to show an alert when I press a button that is in a tableviewcell and it gives me the following error:    'NSInvalidArgumentException', reason: 'Application tried to present modal view controller on itself. Presenting controller is....
asked by 14.12.2018 / 18:27
1
answer

View properties do not appear in Storyboard support

Hi, I've been struggling since I started programming on iOS with the use of Pods in projects, an example is when I install Floaty Pod without problems and when I use it I do not see the properties of the view and so on I can design my button....
asked by 04.11.2018 / 22:44
2
answers

I can not make devicetoken post

I have configured the notifications using GCM and to send them later, I need to register the tokens in my database. First of all in my AppDelegate, I store the token in the following way: let deviceTokenString = NSString(format: "%@", deviceTo...
asked by 02.03.2016 / 15:53
1
answer

How to parse a JSON with array of dictionaries within another array with Swift and alamofire

I am trying to walk an object with alamofire, and everything is fine until I have to deal with the array of dictionaries that I have within that same object. I think I have a problem with the model, but I'm not sure and since I did not find any...
asked by 25.10.2018 / 21:29
3
answers

Stay with 2 decimals Swift Xcode

I consume a service "x" which gives me the balance of the accounts for example em will return 98675.38282761 What I need is to stay alone with 2 decimals, I currently get the balance and I show it in a label as follows: let balanceNumber...
asked by 11.08.2018 / 19:01