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
-
2
votes1
answer124
viewsHow to simulate a button click on Swift (for MAC OSX)
I’m making a program for Mac and need to find a way to "click" a button from a code. I’m trying to put this code on another button and I’ve tried it in the 3 following ways: func mouseDown(_…
-
2
votes2
answers371
viewsSwift Multi Selection Problem Uitableview
I have a tableView that when it is in "Edit" mode I can select each item and take an action, for example remove the selected items. When I select the items, the first ones are left without "Line…
-
2
votes1
answer72
viewsTransaction/Commit on Core Data, is it possible?
There is the concept of Transaction and Commit in Core Data? I have a database in the app that is fed by an external file, but it is a lot of data and the application takes around 2 minutes to…
-
2
votes1
answer1406
viewsHow to open another viewControler on Swift?
I’m new to Swift programming and I’m having a doubt. I have two files The main one: Viewcontroller.Swift and another one I created called Viewsegundo.Swift. I took the class import UIKit class…
-
2
votes1
answer328
viewsSwift 2 - Variable with null value
I have a web page that returns the following json structure: [ { "nomeDoServico":"fdPHost", "nomeParaExibicao":"Host de Provedor da Descoberta de Função", "status":"Iniciado" }, {…
swiftasked 9 years, 2 months ago Fábio Jânio 3,407 -
2
votes1
answer74
viewsPublish on facebook direct - iOS9
I created a code using Swift and the Facebook SDK for iOS9, I can log in and share, but to do the share need to click the share button that the sdk provides, so it opens the default Facebook share…
-
2
votes2
answers52
viewsreturn Coredat - Swift
I am unable to assign a textField with the result of a search when it is int, with the right string var results:NSArray = try context.executeFetchRequest(request) as! [NSManagedObject]…
-
2
votes2
answers125
viewsHow to get a return of an Array<String> in a GET call with task.resume()?
Good afternoon, you guys. I’m having a hard time uploading the content of a Pickerview in my app, as it needs to fetch the information in a call GET, the call works and I can assemble the array with…
-
2
votes2
answers366
viewsStart screen in storyboard
I’m using Xcode for app development. In it I use the storyboard for the canvases. Suppose the structure of canvases is as follows: I have 5 sequential screens, which one leads to the next, until…
-
2
votes1
answer237
viewsI cannot catch error using Try-Catch on Swift
I’m making a app, which is giving me a certain error at some point, but is only occurring on certain devices. I am trying to capture this error with the do/catch, but I’m having trouble catching…
-
2
votes2
answers147
viewsPopular View with JSON
I use a library called Alamofire-Swiftyjson to make a request JSON. Call example: Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"]) .responseSwiftyJSON({ (request,…
-
2
votes1
answer108
viewsHow do I activate my iTunnes Connect?
I have two Agent (Total Access) and another Development Administrator accounts. When I try to connect to iTunnes Connect with an agent user no My Apps option appears. In this way: Appears like this…
-
2
votes4
answers874
viewsHow to work and switch multiple View Controllers via code?
Without using a button to switch between views, everything happens via code. I already have the part that validates the user credentials, but when they are correct I do not know how to display the…
-
2
votes1
answer383
viewsCheck URL loaded in a Webview
Good afternoon, everyone. In Java we have a function called shouldOverrideUrlLoading that checks every URL loaded inside a Webview, so I can create conditions to decide how the APP should behave.…
-
2
votes2
answers1964
viewsConsume Json Data - Webservice Swift 2 - iOS
I need Query price in the search api (returns in json) in my app with Swift 2. Could someone help me do this or indicate a tutorial on how to do ? How you use the search api : Using the Search API…
-
2
votes1
answer138
viewsClose the IOS keyboard by clicking confirm
how do I make the keyboard disappear when I click a button confirming that name in the textbox? I want that when I click the button confirm player the keyboard disappear, because it keeps appearing…
swiftasked 8 years, 10 months ago Bruno Bafilli 327 -
2
votes2
answers168
viewsRetrieving the name of a boot on Swift
How do I recover the value of a button ? For example: I have a button in my layout with the name boot, but I want to assign the name of that button to be clicked on a variable! That is possible?…
swiftasked 8 years, 10 months ago Bruno Bafilli 327 -
2
votes1
answer311
viewsArray by Swift parameter
Good afternoon guys all right? how do I pass an array per parameter? and would like the array parameter to be optional Example: func startGame(teste: Array) -> String { let randomIndex =…
swiftasked 8 years, 10 months ago Bruno Bafilli 327 -
2
votes1
answer113
viewsObjective-c to Swift project conversion (Server call)
I have a problem that I will explain, I think I found a way to call the methods that are on the server, however when I call a method that has parameters, I get an error, and when I call a method…
-
2
votes2
answers489
viewsMaximum limit of a text box - Swift
Goodnight, I have a text box created, how do I set a maximum of characters that can be written on it ? (she has to accept any kind of character)
-
2
votes2
answers419
viewsSwift - how do I find the screen size of the user’s device?
I would like to know how I discover the screen size that the user is using or the model of your iPhone via Swift. I only know how to do it in Objective-C Response in Objective-C: CGFloat screenScale…
-
2
votes1
answer348
viewsPayment to the user using Paypal and Swift
I’ve been trying for days to find an example of Swift code needed to execute a payment to the user. Paypal’s development guide does not contain Swift syntax and every attempt I made to translate…
-
2
votes1
answer70
viewsHow to convert XML to Swift objects?
How can I convert XML request replies to objects in Swift format, just like Objectmapper does with JSON for objects?
-
2
votes1
answer82
viewsUpload image to webservice
I am using the alamofire to post pro server, I wanted to know how to send an object that has an img inside it. I saw the following excerpt to upload the image let fileURL =…
-
2
votes1
answer234
viewsChange the Bundle Identifier of an app already published in the Appstore
I published an App in the App Store with the wrong Bundle Identifier, I ended up using the name(example) "myapp" while the correct one would be "com.empresa.myapp" fixed this in the new version but…
-
2
votes1
answer115
viewsHow can I align numerous objects around a circle?
I am trying in many ways and I am not succeeding, I have managed in a way that will not be viable, someone knows how I could do more in this idea take the central position of the circle and…
-
2
votes1
answer111
viewsConsult sqlite database created by core data
I’m studying core data on Ios. I created a template and entered some records. I would like to query these records using SQL in the "DB Browser for sqlite" program, but I don’t know where Xcode…
-
2
votes2
answers66
viewsSWIFT - How to feed a Tableview with information from a Nsarray?
var nomes:NSArray = [] override func viewDidLoad() { super.viewDidLoad() Alamofire.request(.GET, MyUrl,parameters: nil,encoding: .JSON).response { (_, _, data, error) in self.nomes = try!…
-
2
votes1
answer464
viewsHow to change the color of the Ios navbar
I am developing an application, I would like the navigation bar to have the same color as the body of the project, I am trying with the following code UINavigationBar.appearance().barTintColor =…
-
2
votes1
answer61
viewsWhat is the Nslayoutconstraint "Aspect Ratio" for?
Hello, Since I started working with Autolayout, I couldn’t find anything that would explain how/for it NSLayoutConstraint Aspect Ratio. Even in the Apple documentation I couldn’t find anything to…
-
2
votes1
answer67
viewsRelationship is equal to 0
I’m new to core dating and I don’t know what’s going on. I have a many to many relationship between the entity News and Friends as shown below: I created Nsmanagedobject Subclass but I didn’t change…
-
2
votes2
answers804
viewsBrazilian telephone mask
I’m migrating from Android to iOS now, and I’m having a question. I can do on Swift something like onTextChanged java? I need a Mask for my UITextField which is dynamic according to the number of…
-
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
answer67
viewsHow to receive data of subitens from a plist?
Good! I’m having trouble receiving sub data from my plist. Note... This is my directory.plist: I want to throw it all in this one Main.storyboard: Whereas the Keys Position and Name would be in the…
-
2
votes2
answers175
viewsHow to share a pdf that is on a Swift webview
I have a webview and I call it an address that if accessed by a browser forces a PDF download, in the app I created uploaded the PDF in a webview, but I would also like to give the user the option…
-
2
votes1
answer79
viewsRandom ads between cells in a Table View
I’m trying to insert Ads totally random between cells within a UITableView. That’s kind of what I want: So is mine Table View Controller: import UIKit import GoogleMobileAds class Page1:…
-
2
votes2
answers130
viewsAuto iOS layout does not work properly Xcode 8.2
I’m developing an App in Xcode 8.x. I have a problem resizing 4 buttons on the first screen. I work on the design of iPhone 5 or 6 and configure all auto layout, when I run in all Vices is cool…
-
2
votes1
answer136
viewsHow do closures work on Swift?
Perhaps this is one of the most difficult concepts to understand for those who are beginning in language. I’ve seen some definitions but so far I can’t understand. Could someone give an explanation…
-
2
votes2
answers511
viewsiOS: open pdf of webview in browser OR download pdf
I’m working on an iOS app with Swift. It works perfectly, but when I click on the pdf download link, it just displays the pdf. I wanted him to downdload OR open the pdf in the browser outside the…
-
2
votes1
answer37
viewsUitableviewcell expression return error in Swift
class OcorrenciaVinculadaCell: UITableViewCell{ @IBOutlet weak var tipoOcorrencia: UITextField! @IBOutlet weak var descricao: UITextField! } class OcorrenciaVinculadasViewController:…
swiftasked 5 years, 2 months ago Ricardo Ribeiro 25 -
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
answer668
viewsSwift with sqlite
I’m trying to create a sqlite bank with Swift, but I’m having trouble with examples and documentation on the net, I wanted to see if anyone could connect in a sqlite bank with Swift ?
-
1
votes1
answer305
viewsQuery based on relationship, using Nspredicate in Core Data
I have a one-to-many relationship between entities Pai and Filho, where a Pai may have any or N Filho. Using the Core Data, how do I fetch all the Filho, basing my search for a Pai. For example: I…
-
1
votes2
answers412
viewsInstall IPA using Swift
I’m developing an APP for jailbreak, I would like to know how to install a .ipa that I downloaded from my server to be able to install on the device (iPhone and iPad). My app does not promote…
-
1
votes1
answer72
viewsPredicate with CAST
Accessing the database .sqlite via sql normally I can use the function CAST('coluna' as decimal). Via NSPredicate using CoreData, how do I do the same thing? I have a column like String and I need…
-
1
votes1
answer59
viewsSharing via Uiactivityviewcontroller
Could someone help me solve the problem called: "Launchservices: invalidationHandler called" whenever I press a certain BarButtonItem, follows below the excerpt of the code in SWIFT. @IBAction func…
-
1
votes1
answer59
viewsHow to use Uibutton icon
How I put an icon in a UIButton through the .storyboard? Through the .storyboard has the options of UIButton between them has the option image where I can enter a path to an image for the button.…
-
1
votes1
answer180
viewsParameters for a Container View
The scenario is as follows: I own a UIViewController and within this controller I own one UITableViewController added as a ContainerView. How do I pass parameters between my UIViewController and my…
-
1
votes3
answers342
viewsJSON integration with Swift
I wanted to know how I pass a JSON with my URL to Swift. I have one as an example: http://peps.com.br/pips/teste2.json and if someone can do the start of my JSON in the Swift language would already…
-
1
votes1
answer99
viewsClear Context using Coredata persistence
I wonder if there’s any way to "clean up" my context using the Core Data. Because I have a problem that when I update the application, the same after saving the records in the database, also keeps…