Most voted "swift" questions
Swift is a multi-paradigm programming language for Apple’s iOS and macOS operating systems. It was created by Chris Lattner in 2010 and released on Apple’s WWDC on 06/02/2014. It is currently in version 5.
Learn more…491 questions
Sort by count of
-
0
votes2
answers66
viewsHow do I Alert message Uialertcontroller
Good, How do I make an Alert? the way I did it seems to be all right except for the function error. some help, since thank you.…
-
0
votes0
answers89
viewsAudio playback error in video streaming
I’m trying to reproduce a video streaming but it’s giving audio problems. On the Android platform, I managed to play it without errors and on the web is also in a good quality. I’ve taken several…
-
0
votes1
answer24
viewsHow to place a title under the iten button bar
I wanted to know how to put a title under the icon on Toolbar, I tried in some ways but without success. I have tried via code and in the icon properties in the right side menu.
-
0
votes2
answers191
viewsHow to migrate data between views using Tab Bar Controller (Swift)
I have a Tab Bar Controller with three buttons. How do I take an array, loaded from data stored in Core Data, from a view (button 1) to another view (button 2)?
-
0
votes1
answer70
viewsUicollectionviewcontroller 3 columns auto layout
I’m creating a Uicollectionviewcontroller with 2 or 3 columns, when using autolayout in some devices works perfectly but in others not, I did not find anything that speaks how to dynamize these…
-
0
votes1
answer130
viewsHow to do a requisicao using alamofire and make the following lines of code wait for the reply of the request?
class func findProfessions() -> [PhotoProfession] { var professions = [PhotoProfession]() let backendless = Backendless.sharedInstance() if let p =…
-
0
votes1
answer390
viewsPopulate object in Swift using data from a JSON Return
I have a webapi that returns a list of evidence: { "Provas": [ { "Codigo": "11111111111", "Disciplina": { "Codigo": "111111", "Nome": "SOCIOLOGIA E EDUCAÇÃO" }, "Tipo": "SUB", "Correcao":…
-
0
votes1
answer39
viewsSwift does not arrow the text in Uitextfiled after upgraded to Swift 3
I updated the XCode for Swift 3 last week and he converted all my code to the version of Swift 3. After that I’m trying to set the text inside a UITextField and it doesn’t work. I’ve already redid…
-
0
votes2
answers78
viewsPicture is stretched when I turn a page on Pageviewcontroller
Hello I’m new in Swift and I don’t understand why the image stretches when I turn a page using PageViewController as I will show in the image below: This picture is normal, it’s when I haven’t…
-
0
votes1
answer61
viewsIOS - Swift Nsstring
Good, I’m making an app where I’ll measure users' BMI. I created the layout but in the code I’m having problems. I have a button that when sliding changes the value of height or weight. var w:Float…
swiftasked 7 years, 11 months ago ChrisAdler 1 -
0
votes1
answer37
viewsPass tableview value to tabbar
Hello, I’m developing my first app and I’m having a question. I have a tableview, and I would like her indexpath.Row to be visible in the 2 viewcontroller of a tabbar, to click on a label. I tried…
-
0
votes2
answers77
viewsProblems with prepareDesign method
I have a problem guys, I’m new to Swift, and I have a method that takes a result from a JSON and I wanted to store it in a local variable and then pass this variable to a viewcontroller by next,…
-
0
votes2
answers263
viewsSave object to a Swift(IOS) session
I have a class and a subclass inside import Foundation import ObjectMapper class Aluno: Mappable { var ra:String! var senha:String! var nome:String! var cpf:String! var email:String! var…
-
0
votes1
answer71
viewsError post in Swift with still
But I once came to you for help. I’m developing a Swift application using web service written in java hosted on Amazon AWS. When I try to register via post the registration is not carried out. The…
-
0
votes1
answer111
viewsInsert uilabel or uibutton into an image
I wonder if there is a way to create a link in a text using label or button inside an image. To insert text into an image just insert : campotexto.draw and to insert label or button someone knows if…
-
0
votes1
answer40
viewsUipageviewcontroller Update Content and Bounce
Have a Page in my application that works with Uipageviewcontroller, in it I implement the Uipageviewcontrollerdatasource. So I have a list of items that are listed in various views, the problem is…
swiftasked 8 years, 2 months ago Pedro Soares 1,136 -
0
votes2
answers430
viewsSwift 3 - How to instantiate a View Controller?
I need to work with a method with attributes that are in another Viewcontroller but I can’t do it. What I’m trying to do: let notasViewController: NotasViewController() And also: let…
-
0
votes1
answer85
viewsAccessing another APP within mine with Oauth 2.0
How to use Oauth 2.0 to change Apps. I have some Apps and I want that within it we can access other Apps (from the same provider), without having to login again.
-
0
votes1
answer501
viewsInstantiate Swift object and populate with webapi data
I’ve searched several Youtube sites and videos and I can’t find anything about it, if there’s anyone willing to show me that code thank you, because I can’t just look at Apple’s documentation, would…
-
0
votes0
answers184
viewsAfter formatting the date appears with 3 hours more
earlier I had trouble transforming a String in date, with a lot of cost I managed to put in the exact time, but now when I went to generate the notification the blessed date appears with a few hours…
-
0
votes1
answer543
viewsDate picking time from another time zone
I have a big problem, I need to store the date and time selected by the user in order to generate the notifications at the right time. The date and time is captured by a Picker date and when caught…
-
0
votes1
answer60
viewsProblems with Conversion of Array to Swift 3
With the swift3 update I’m having the following error "type 'Any' has on the Members subscriber", I’ve seen a lot of questions on the subject and tested most of them but without success. The code…
-
0
votes1
answer494
viewsDatabase created with Core Data on Swift
I need to create an app that is a form with basic data (name, age, email, etc.) and that saves the data for access later, but that in addition to saving in the tableView, create the database file or…
-
0
votes0
answers38
viewsHow to capture photo and video by the same Avcapturesession?
Hello I’m trying to create an app like Snapchat. From the same button, I intend to allow the user to take a photo (Touchupinside) and record a video (long press). I’m using Avfoundation for this.…
-
0
votes1
answer41
viewsHow to copy certain Bytes of a Date type in Swift
As an example I android to do what you want to use the following: byte[] byte = ....; byte[] resultado = Arrays.copyOfRange(byte, 1,3); And I intend to do the same but on Swift being that in this…
-
0
votes1
answer67
viewsArray View
I am having trouble running Xcode due to below error: override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell: TableViewCell =…
-
0
votes2
answers114
viewsTableview does not update
I am with a tableview with several times, so the user could confirm that consumed the medicine at one of the times in question, until then it is okay, only that I needed to update the tableview…
-
0
votes1
answer65
viewsHow to filter an array in Swift similar to like?
Let cast = ["Vivien", "Marlon", "Kim", "Karl"] would like to return like ('%ar%') "result expected [ "Marlon", "Karl"] "
-
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
answer103
viewsSwift json deserialize
Hello, I have the following code to deserialize a json: let urlFinal = URLSERVIDOR+"/Geral/consulta?idcliente=\(id)" let jsonUrl = urlFinal let session = NSURLSession.sharedSession() let shotsUrl =…
-
0
votes1
answer65
viewsSwift 3 how to open a Popover so that it does not cover all viewcontroller that called it?
I already use the Popover that is opened through a "follow" and I would like you to define the dimensions (height and width) of this Popover so that it does not completely cover the viewcontroller…
-
0
votes2
answers254
viewsSwift 3 - how to close one last Popover open on another Popover ?
I have a viewcontroller that opens a Popover. This first opens a second Popover. But when I give a self.Ismiss on any of the popovers is closing all the popovers and the viewcontroller that called…
-
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
answer224
viewsPublished iOS, Rejected: Guideline 2.3.3 - Performance - Accurate Metadata
Guys, I’m with this rejection of iTunes Apple 3 Performance: Accurate Metadata 3 Design: Spam and Spam but from what I understand are the prints I added, the app is just a link to the site, there is…
-
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
votes1
answer25
viewsNot accepting click on the Annotation for the second time
I am using a customization of Annotation in my mapkit design (Swift 3) to show more than one Annotation(pin) on the map. It is showing and being able to click on the annotationn, but only the first…
-
0
votes0
answers28
viewsHelp with adjustsFontSizeToFitWidth?
When using adjustsFontSizeToFitWidth in the second outlet I get error. Does anyone know how to solve? Note: The second view controller is the first in the same class! import UIKit class…
-
0
votes2
answers126
viewsSwift Way to display variables
I’m finishing a small project to learn Swift but there is a small problem in joining more variables in the output. @IBOutlet weak var Nome: UITextField! @IBAction func CalcularIMC(_ sender:…
-
0
votes1
answer115
viewsSwift - Send json body through the still
I’m on my first project on Swift, and I need to send a RequestBody in the POST by Alamofire. This is an example of JSON I need to send: { "user":{ "email":"[email protected]" } } And I have my…
-
0
votes0
answers52
viewsRest API Returning Token
I need to develop an application in Swift I’m trying to consume a API to log in and when to log in Token, but this Token is already existing in the API, would you like to know how I send it? It’s…
-
0
votes1
answer132
viewsShare iOS texts
How do I share a text on social media on an iOS App on Swift 3? I have several Random Phrases in an array and if the person likes one I would like to let them share that phrase. How would the one…
-
0
votes1
answer27
viewsMigration from Alamofire 2 to Alamofire 4. Extra Argument in call (Request)
When making requests to the server used the following code let URL = Foundation.URL(string: "http:....")! let mutableURLRequest = NSMutableURLRequest(url: URL) mutableURLRequest.httpMethod = "POST"…
-
0
votes1
answer180
viewsForce running order Swift 3/Xcode 8 - Threads
Hello, I’m new to Swift and this week I came across a problem that is already making me pull my hair out! What happens is this, I divided in my application in several classes to make my code more…
-
0
votes2
answers196
viewsBring item from an API in Swift
I am consuming a Json API and need to bring only one of the objects that it returns to me, but I am not getting, I am trying the following code: let httpStatus = response as? HTTPURLResponse if…
-
0
votes1
answer243
viewsError: Expression implicitly coerced from 'String? ' to Any
How do I correct the following error: Expression implicitly coerced from 'String? ' to Any The error is given in the code snippet below: let frase = lblFrase.text let textToShare = [ frase ] ///O…
-
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
answer118
viewsConvert Jsonarray to Object
I’m having trouble converting an array I get via webservice CustomRequest request = new CustomRequest(Request.Method.GET, "http://" + url + "/service/usuario/mural", null, new…
swiftasked 7 years, 9 months ago Bruno Nicoletti 81 -
0
votes1
answer432
viewsOpen Viewcontroller iOS
How do I make the function below (when a navigation bar item is clicked) open another screen already created on Main.storyboard? @objc func infoTapped (sender:UIButton) { }…
-
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
answer129
viewsSwift 3/Realm - How to filter an Object inside another filter
My intention is to filter a single line within the previous filter results, but returning the same type, so I can perform a third filter. This is my attempt: func salvarDadosAluno(_codPessoa:…