Questions tagged as 'swift-3'

2
answers

Use or not MainStoryBoard Swift

I started my studies in Swift , I am currently studying Swift 4 , but I came across a doubt, which I believe many people who are starting also have (or not). In the course I'm seeing, the teacher teaches us how to develop apps...
asked by 02.10.2017 / 14:57
2
answers

Load items from a plist

I'm having trouble loading the items on a property list. Note my plist: Here'smyfirstViewController:importUIKitclassPage1:UITableViewController{varfilePath:String?varemployees:[[String:Any]]=[]overridefuncviewDidLoad(){super.viewDidLoad()self.t...
asked by 26.03.2017 / 04:12
3
answers

Different Layout for Landscape

Good afternoon. I do not know how to do a different layout, specific to landscape ... but I wanted to do that in storyboard not in code, does anyone know? Thanks.     
asked by 12.05.2017 / 20:06
2
answers

Is it possible for a Closure (Swift) to capture reference of the instance of the object that executes it?

I'm passing a closure to an object's property, and within the closure I'd need to reference the instance of the object that will execute the closure. Example: typealias validator : ()->Bool class Field : NSObject { var name...
asked by 21.11.2016 / 14:23
3
answers

How to handle a reponse.result.value that returns as optional log ([])?

I am in the following situation I have a request in Alamofire that returns me a json that may have data or not (usually has but might not). I want to handle when the response.result.value returns optional ([]). I tried this but it did not wor...
asked by 05.04.2018 / 14:56
1
answer

How to get the iphone model

I'm starting with swift and I need to get the exact IPHONE template from the client, I already tried UIDevice returns Iphone or Ipad and I need to know if the device is an SE, 7, 8+, X, etc. Does anyone know how to do it?     
asked by 02.01.2018 / 18:43
1
answer

AutoLogin without firebase SWIFT3 IOS

I would like to know how I can save the user information and do not need to log in whenever I minimize or close the app without the use of firebase.     
asked by 14.11.2017 / 15:27
1
answer

remove parts of a string and return parts removed - Swift

How do I remove parts of a string and return those removed parts to another string in Swift? Example: var myString = "10setembro2017" let newString = myString.removeAndReturn(index:1..2) print(myString) //setembro2017 print(newString) //10...
asked by 18.10.2017 / 23:12
1
answer

How to sum variable value with the value of a variable saved in userdefaults

I try to be objective, I need to save a variable that the value that is stored inside will be the text of a label and this value is changed when an input of another variable is performed. For example: Variable balance has the value of 50.0, t...
asked by 11.09.2017 / 22:38
1
answer

How to populate a tableView using for loop and dictionary

I'm making an app that requires multiple tableviews. Some of them have more than 20 cells and some only 4, 5. Then I realized that doing 20 and so many lines of if else is a terrible practice. But since I'm very new to swift, I'd like to know...
asked by 20.06.2017 / 19:49