Most voted "swift-3" questions
Use this tag only for issues directly related to changes in Apple’s Swift programming language version 3. Use the Swift tag for more general questions about the language, or your own tags, for more specific questions, about Apple platform development.
Learn more…42 questions
Sort by count of
-
3
votes1
answer370
viewsVariable declaration with ! at end Swift 3
Why in some variable statements in Swift3 an exclamation mark is added (!)? For example: var _nome: String! var _idade: Double! What does this entail of differences? When to use?…
-
2
votes5
answers241
viewsUitextfielddelegate does not hide the keyboard
Good night, fellas I’m having a little trouble with Uitextfielddelegate. I intend that when the user clicks the return key (Back) the keyboard disappears for a few moments and goes back to textField…
-
2
votes1
answer89
viewsProblems updating Uicollectionview
I’m having trouble giving reloadData() in Uicollectionview when using the UISearchBar. Debugging to see if the object coming from REALM was nil I realized that the function to filter is coming with…
-
1
votes1
answer272
viewsButton to quit app
I’m developing an example app for Iphone using Xcode with Swift 3.0. I need to put a button that when clicked closes the entire application. I couldn’t identify any event or function that does this.…
-
1
votes1
answer116
viewsHow to adjust the height of a Uiview on Swift 3 according to subviews?
I have a Uiview with subviews, and I need Uiview to increase or decrease according to the size of the subviews, the same idea of a layout with wrap_content height. Does anyone know how to do this on…
-
1
votes2
answers80
views -
1
votes1
answer200
viewsViewpager on iOS with Swift 3
Hello, I’m developing an iPhone app using Swift 3, and I’m having some doubts regarding browsing between pages within a ViewController. My application to android I have a Activity using a ViewPager…
-
1
votes3
answers138
viewsHow to treat a reponse.result.value that returns as log optional([])?
I am in the following situation I have a request in the Alamofire that returns me a json that may or may not have data (usually has but may not). I want to treat when Response.result.value returns…
-
1
votes0
answers46
viewsBest place to place Dispatch in Collectionview with Firebase
I’m racking my brain with an app based on a few examples of Brian Lets Build That App , adapting your videos to my needs. I’m downloading some images from Firebase and updating a collectionview.…
-
1
votes0
answers54
viewsSwift 3 - How to close an open webview page?
in a, index.html viewcontroller am using this code to open a local html file self.webView = WKWebView(frame: webFrame, configuration: config) self.webView?.uiDelegate = self as? WKUIDelegate…
-
1
votes4
answers364
viewsSwift 3 - How to persist objects
I’m an Android developer and I’m trying to learn some things for iOS as well. I have hit myself a little on simple things, like saving persist an object of mine to catch it again another time. On…
-
1
votes1
answer216
viewsDoubt Encoding Utf8 Swift 3
I’m having a lot of problems with encoding my app. I have an online radio in the United States and I’m trying an app for it. I get the music from Lastfm. let queryURL: String if useLastFM { queryURL…
-
1
votes1
answer48
viewsHow to pass data from one screen to another after function executed
After running the function of saving data in the database, how can I send the idcep to another screen/Viewcontroller? I have the following code: @IBAction func salvarEndereco(_ sender: Any) { let…
swift-3asked 7 years, 1 month ago GustavoSevero 2,567 -
1
votes0
answers97
viewsModal navigation
In my IOS application I have an option that opens a modal, in this modal I have a list of items, when clicking one of these items I show the details of the selected item. The solution adopted today…
-
0
votes2
answers150
viewsIs it possible for a Closure (Swift) to capture reference of the instance of the object that executes it?
I am passing a closure for the property of an object, and within the closure would need to make a reference to the instance of the object that will run the closure. Example: typealias validator :…
-
0
votes1
answer48
viewsJSON Object with Array. Migration from Swift 2 to Swift 3
Previously in my app when I made a call to the server and if there was an error I would do the following: Alamofire.request(mutableURLRequest).responseJSON{ response in if let JSON =…
-
0
votes0
answers477
viewsExample Login with basic auth authentication using Alamofire?
I’m trying to make a login screen where I use Alamofire to make the request, but with the examples of the site Alamofire is not working. If anyone can help with an example code, I would really…
-
0
votes1
answer136
viewsDoubt with creation of For on Swift 3
I’m following an iOS course and in the course shows the for in this way: for var i = 1; i <= 10; i++ { } But I have an error message, has it changed? How could this be done in the new way? error:…
-
0
votes3
answers106
viewsDifferent layout for landscape
good afternoon. I don’t know how to make a different layout, specific to landscape...but I wanted to do it in storyboard not in code, someone knows? Thanks.
-
0
votes1
answer24
viewsHow to enter a specific date in the Swift3 Calendar?
I need to enter a specific date in the Calendar, but I’m only able to add values based on the current date (maybe because when I do, I give a Calendar.Current). Someone knows how to enter (day,…
-
0
votes1
answer389
viewsChange Button label with typed value
I have an application that when I touch the button should open the keyboard and the value that the user needs to be inserted in the button label, I do not know how to do this, someone can help, in…
-
0
votes1
answer30
viewsHow to redeem an item from a relationship with Swift?
Hello I am trying to store in a variable the value of an item of a relationship. The relationship is "friends" and in it there are some attributes like "friendship". I would like to store the value…
-
0
votes2
answers114
viewsError Swift Objectmapper 3.2
I’m trying to update my app to iOS 11, but the framework Objectmapper is giving this error message. Module Compiled with Swift 3.1 cannot be Imported in Swift 3.2:…
-
0
votes2
answers117
viewsWhether or not to use Mainstoryboard Swift
I started my studies in Swift, currently I am studying Swift 4, but I have come across a question, which I believe many people who are starting have (or not). In the course I see, the teacher…
-
0
votes1
answer387
viewsremove parts of a string and return the removed parts - Swift
How do I remove parts of a string and return those parts removed to another string on Swift? Example: var myString = "10setembro2017" let newString = myString.removeAndReturn(index:1..2)…
-
0
votes1
answer43
viewsAutologin sem firebase SWIFT3 IOS
I wanted to know how do I save the user information program and the same need not log in whenever minimize or close the app without using firebase.
-
0
votes1
answer445
viewsReload View Controller Swift 3
Hello, I have an app and I entered the check of connection to the internet in viewDidAppear, I wanted to know how to give a Reload on this screen when the user click in RETRY of Alert, to make the…
-
0
votes1
answer81
viewsstartMonitoringSignificantLocationChanges Does not work in background
I’m making an app that uses the device’s location service. It necessarily needs to be capturing the positions when there is a change of location and should capture in all situations…
-
0
votes1
answer76
viewsHow to use the Search Bar with the person class - Swift 3
Good morning. I have the class person class pessoa { var nome : String = “”; var idade : Int = 0; var foto : UIImage!; } extension pessoa { class func Gerar_Registros(pQtd : Int) ->…
-
0
votes1
answer1138
viewsConverting String to date Swfit 3
Hello, I’m trying to convert a String in Date in Swift 3. However the date is always returning me with two hours more. Below is my code. let dateFormatter = DateFormatter() dateFormatter.dateFormat…
-
0
votes1
answer72
viewsHow to pick up the iPhone model
I’m starting with Swift and I need to get the exact model of IPHONE of the client, already tried the Uidevice() but he only returns to me Iphone or Ipad and I need to know if the device is a SE, 7,…
-
0
votes1
answer95
viewsHow to mount an array dynamically
I’d like to make a func that returns me the following array, however I don’t know the return type or how to dynamically assemble this array: vDataSource_Detalhe = NSArray(objects: NSArray(objects:…
-
0
votes1
answer256
viewsChange font size of pickerview
Good afternoon. 09/05/2017 I have the following pickerview: As you can see right away the first item of the two lists does not appear the whole name. I guess because of the size. On the left side…
-
0
votes1
answer118
viewsObjective-C inside the Swift?
Is there any way to place Objective-C classes within Swift projects?
-
0
votes1
answer403
viewsWhat is the difference between Codable and Decodable
I’m kind of torn between Codable and Decodable on Swift. In which situations I should use codable and decodable. I’m a beginner on Swift and the articles I found didn’t help me as much Thanks in…
-
0
votes2
answers356
viewsSwift 3 - How to make an alert appear after and load screen?
Hello I am building an app that needs an alert to be presented as soon as the User accesses the screen. For this I made a Viewcontroller and linked the view that is being accessed class…
-
0
votes1
answer92
viewsHow to fill a tableView using for loop and Dictionary
I’m making an app that requires several tableviews. Some of them have more than 20 cells and some only 4, 5. Then I realized that making 20 and so many lines of if Is is a terrible practice. But as…
-
0
votes1
answer235
viewsLoad web page in Uiwebview Swift 3
Good morning, everyone I can easily upload a web page to a Uiwebview with the following Swift code: import UIKit class ConteudoOnlineViewController: UIViewController { @IBOutlet weak var pagina:…
-
0
votes1
answer59
viewsHow to add value of variables to the value of a saved variable in userdefaults
I will 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…
-
0
votes1
answer75
viewsTableview saving selected lines
class ViewController: UITableViewController { let dias = ["Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado","Domingo"] var selecionados = [Bool]() override func…
-
0
votes1
answer30
viewsWhy can’t I display the value in the print?
I want to display in the console the value of the name variable that appears is "(lldb)", why? @IBAction func botaoAcesse(_ sender: Any) { let cpf = self.campoCPF.text let senha =…
swift-3asked 6 years, 5 months ago GustavoSevero 2,567 -
0
votes1
answer169
viewsConstant '' " used before being initialized
How do I get access to an attribute of one class in another? It may sound silly, but I’m learning now Swift and still getting confused with simple things. I’m trying to make a movie app using an…