Questions tagged as 'swift'

1
answer

Replace string

How can I replace this string with another regardless of whether the value is 2 or 4 or 5 <font size=\"2\" Now I have it like this: replacingOccurrences(of: "font size=\"2\"", with: "font size=\"4\"") But a 2 will not always come by...
asked by 18.04.2017 / 10:44
1
answer

How does frame, position and bounds work in the layer of a view?

The question would be, how do they work, what relationship do they have with each other and what is the use of each one. I know there is a Core Animation documentation but the truth is that I am pretty lost with these 3 properties.     
asked by 14.01.2017 / 02:47
1
answer

Sort an array of dates in swift

I have this array: let arrayFechas = [2016-11-21 23:00:00 +0000, 2016-11-28 23:00:00 +0000, 2016-11-22 23:00:00 +0000, 2016-11-23 23:00:00 +0000, 2016-11-18 23:00:00 +0000, 2016-11-25 23:00:00 +0000, 2016-11-19 23:00:00 +0000, 2016-11-26 2...
asked by 21.11.2016 / 09:11
1
answer

Define different Initial View Controller Swift

I'm doing an app in IOS , in which I check if a user is already registered or not. If you are registered, I show you a screen, but if it is not registered I show you another one. How can I do to show one screen or another if I have a...
asked by 30.06.2016 / 09:56
1
answer

Image load mismatched swift

Hello in my project of xcode with swift add a gallery of images carousel style what happens in this case is that whenever you loaded the image the first time it runs down and with a white space above only happens in the first image and when the...
asked by 01.06.2016 / 22:00
1
answer

UIAlertController with activity indicator when loading JSON

I am loading JSON in my UIViewController in the following way and I need to see a UIAlertController with a Activity Indicator that is automatically hidden when the JSON is fully loaded. override func viewDidLoad() { A...
asked by 22.02.2016 / 13:43
1
answer

Parse an NSData to [String: AnyObject]

I'm trying to convert this NSData var elementos = [AnyObject]() let jsonData = try? NSJSONSerialization.dataWithJSONObject(elementos, options: NSJSONWritingOptions.PrettyPrinted) the jsonData constant carries this value: [ { "id" :...
asked by 09.06.2016 / 00:51
2
answers

Pass data from one view to another with protocol's

Having the following code: ViewController2: import UIKit protocol TransferirTexto { func transferir(texto : String) } class SecondViewController: UIViewController { @IBOutlet weak var textField: UITextField! var delegate :...
asked by 11.04.2016 / 18:37
1
answer

Core Data RelationShip Swift

I have the following example to understand the relationships between entities in Core Data , (brand model), I have car brands respectively and now I want to add models to these car brands for this I have registered in vieDidLoad som...
asked by 30.04.2016 / 22:14
1
answer

CGGetcurrentContext in UIview

I do not understand where the method mentioned in the title comes from, nor the other classes with the prefix 'CG', of core graphics. I searched for the framework 'Core Graphics' but it does not appear in UIKIT or in Cocoa touch. One more thi...
asked by 26.03.2016 / 19:48