Questions tagged as 'swift2'

2
answers

Validate if the data is null

How can I validate if a URL in my database is NULL and if so, show an alert but if it has a URL, open it func Facebook(sender: AnyObject) { if let url = NSURL(string: face){ let alert = UIAlertView(title: "Aviso!!!", message: "Mmmm...
asked by 17.08.2016 / 20:51
1
answer

Conversion error NSData in NSString

I have the following code to convert the body of a post request into a string let body: NSData = self.createBodyWithParameters(paramString, filePathKey: "image_name", imageDataKey: imageData!, boundary: boundary, nameParam: "dparam_string_post...
asked by 22.08.2016 / 08:58
1
answer

ACAccountStore swift2

How do I create an account for my application with ACAccountStore in swift2 and Xcode since it only shows me facebook and twitter but I will not use them. I need to create is an account that is of my application. Thanks.   ...
asked by 09.06.2016 / 15:15
1
answer

pass an array with swiftyJson to model using JSON with init (SWIFT 4.2)

I have a JSON where there is an array of images, I want to use SwiftyJson to bring that array ... and in the model I use an initializer - > init (json: JSON), so when iterating with: let suggestions = json["industries", "Suggestions"...
asked by 30.08.2018 / 18:34
1
answer

Inconsistency with Calendar.dateComponents in swift

I have the variable fecha that when doing print shows per console: 2016-11-20 23:00:00 +0000 The problem is that when you do this: let auxCalendar = calendar.dateComponents([.weekday, .day, .weekdayOrdinal, .month], fro...
asked by 21.11.2016 / 11:21
1
answer

Take picture or take from swift library 3

How can I put a button when I click on the option to choose a photo from the library or take one directly? At the moment I can only use one of the two options via code. @IBAction func cogerImagen(_ sender: UIButton) { self.imagePicker = U...
asked by 22.09.2016 / 12:14
1
answer

Send email from swift

I'm doing an app in which users are registered and can interact with the app. Could you send an email from swift every time a user registers or every time they get a score record?     
asked by 01.09.2016 / 10:04
1
answer

Integrate Alamofire into a Cocoapods library

I'm doing a component in github integrated with cocoapods, the thing is that I want to use Alamofire within the component and of course I have not seen anywhere like making use of a library like Alamofire inside another library that would be the...
asked by 04.08.2016 / 17:36
1
answer

Change color of tab bar items not selected

I wonder if someone knows how to change the color of the items in the tab bar in ios 9, now with the following code only the selected one is marked. UITabBar.appearance().tintColor = UIColor.whiteColor() UPDATE SOLVED I found a way to...
asked by 11.08.2016 / 10:22
1
answer

Missing constraint in interface builder

I'm trying to understand why xCode says I'm missing a constraint for the position and, if I already have a constraint: View.Top = Top Layout Guide.Bottom * 1 + 0     
asked by 16.06.2016 / 14:41