Questions tagged as 'swift'

1
answer

Play .opus files in Swift 3-4

Good, my question is how I could play an .opus file from my application in swift, the file is remote on a server and I would have to take that file and play it in the application, how could I do it? since I've tried it in every way and there's n...
asked by 24.10.2017 / 13:22
1
answer

How can I get the data type of a "null" nil attribute in swift 3?

func Deserialize(_ json:Dictionary<String, Any>) { for (keyName, value) in json { if let type = self.value(forKey: keyName) as? String{ print("El valor con la etiqueta es de tipo estring") }...
asked by 06.10.2017 / 17:16
1
answer

Customize cell "TableViewCell" .xib with a collectionViewCell inside

I have a class TableViewCell with your file .xib . In the cell that appears in .xib I add a collectionView inside. How can I reference or use the collectionView of this TableView cell to make use of the cells...
asked by 26.09.2017 / 11:48
1
answer

Difference between using addChildViewController or just addSubview?

I created a viewController in the storyboard. This viewController puts it inside another main one with self.view.addSubview and I show it in an x, y coordinate. All perfect but I have seen other cases where addChildViewController is also used...
asked by 29.08.2017 / 10:34
1
answer

Implement a class with a swift protocol

I am trying to implement a class that should give me the weather, I am asked for a string as a parameter and also a completion and that is exactly where I get lost on how to implement it. Try to call it using weatherDataWith to display...
asked by 25.08.2017 / 17:31
1
answer

Problems With Xcode ... storyboard & ViewController

It is often happening to me that the storyBoard does not connect with the ViewController class when starting the project, this is happening more and more often, I have already deleted the file and created a new one with the class as it should be...
asked by 26.06.2017 / 20:35
2
answers

Value in null label or 0

How to do so if (for example in two boxes to perform an operation) in one of the text boxes you have not entered any value, do not close the application. and for label boxes? @IBOutlet weak var N1: UITextField! @IBOutlet weak var N2: UIText...
asked by 26.03.2017 / 22:46
1
answer

UserDefaults.standard does not work correctly with String variables

How I'm having problems with a small code .. I am trying to save a String with UserDefaults.standard private static let KEY : String = "KEY" private static let NOMBRE : String = "Usuario" let prefs = UserDefaults.standard prefs....
asked by 07.02.2017 / 18:14
1
answer

Return of an object in Realm

I am having problems with an object that returns to me in Realm, the strange thing is that if I printo by console the object if it gives me a good impression but nevertheless if I try to access its value it tells me that it is empty. The structu...
asked by 25.01.2017 / 16:11
1
answer

Sublayer not shown

Having this code: private let topView: UIView = { let view = UIView() view.translatesAutoresizingMaskIntoConstraints = false view.backgroundColor = UIColor(red: 216, green: 216, blue: 216) return view }() private lazy var type...
asked by 25.01.2017 / 19:24