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
answers460
viewsError when connecting app with Firebase
I’m trying to connect my App to Firebase, I’ve already followed the steps taken on the site, in addition to watching some videos from other authors, but I always come across the following problem:…
-
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
answer95
viewsSwift Jsondecoder typeMismatch error
I’m trying to use Jsondecoder to convert a JSON to structs in Swift, so I wrote down all the Structs, reviewed it for hours, and it still returns this error. I don’t know if there’s any way of…
-
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
answer359
viewsSwift: change place button according to the appearance of the keyboard
I’m making an app in Xcode and I would like the button, which is at the bottom of the screen, to move according to keyboard appearance. Thank you…
-
0
votes1
answer127
viewsHow to set maximum size of 2 textfields separately (Swift)
Next, I’m starting now with Swift and iOS programming. I have a question: how to validate 2 different textFields? For example, I managed with the code below to validate 1 single field, but the…
-
0
votes1
answer64
viewsInvalid Swift error when apple tries to process app
Hi! I’m trying to publish an app on the apple App Store. The build makes normal and also makes normal Rchive, but after processing on apple, returns the following error: Invalid Swift Support - The…
swiftasked 6 years, 9 months ago Vinicius Soccol 1 -
0
votes2
answers75
viewsHow to approach the vision of its location, and make it follow along a path?
please, I am new in the area and am creating an app that will count the distance, speed, calories spent and time by the user during a run/walk. the simulator is finding the location, but the screen…
-
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
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
answer63
viewsHow to get GPS coordinates and GPS speed using Objective-C or Swift?
#import "GetLocationViewController.h" #import "LocationDetailViewController.h" #import "SetupViewController.h" #import "CLLocation+Strings.h" @interface RoutePoint :…
-
0
votes1
answer70
viewsUitableviewcontroller cells are blank/missing when scrolling the Tableview
I’m having a problem with my tableviewcontroller, as I update some data on a textfield or roll down it goes disappearing with some cells, if I roll up and down hiding the missing cell it comes back…
-
0
votes1
answer168
viewsHow to calculate distance travelled by me in Swift
I am trying to calculate the distance I travel between my starting point, until the moment I stop my race/change screen. Can you help me? The most relevant parts of the code are listed below.…
-
0
votes1
answer95
viewsEnumeration Swift 4 - What is its usefulness and how does it work for IOS development?
Good guys, I’m studying hard to start developing an app in Swift 4 for a job interview, but the Type Enum left me a little, almost nothing, however, still confused. I wanted to know a little more…
-
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
answer36
viewsHow to change the type of iphone in the storyboard view ?
Following image below, what happens is the following, below where appears device, has some types of tablet and smartphones, but does not appear all types, I need to change to Iphone 7, how to do…
swiftasked 6 years, 3 months ago Victor Carvalho 1 -
0
votes1
answer41
viewsUitableview vs Uiscrollview which is the best option - Swift
Hello, I have the following doubt, has any problem (and a good practice) I use a Uitableview to create the layout of my apps or would it be more recommended I use a Uiview with a Uiscrollview,…
-
0
votes2
answers75
viewsHow to create a variable that only increases equal to an ID in Swift 4?
I need to create a variable, idAtual every time I go to add a new department the ID has to be the idAtual + 1, every time I create the idAtual in the Departamentoviewcontroller , he restarts with…
swiftasked 6 years, 3 months ago Victor Carvalho 1 -
0
votes1
answer131
viewsImageview with sizes for all screens
I am developing an app for iOS using Swift 4. What I have broken my head is in relation to screen sizes. I see that Auto Layout helps in some cases, among them, disposition of the elements in…
-
0
votes1
answer77
viewsSwift error - cannot invoke initializer for type int with an argument list of type ()?
I’m doing a course of Swift 2 plus the version I’m using is the 3, so I’m searching the codes when I have some error to make the fix, some more I haven’t found. I’d appreciate it if someone could…
-
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
votes0
answers60
viewsRange of a SWIFT Array
I have an array of bytes and I need to find out in which track (startindex and endindex) a byte this or if only has startindex ex: var Faixa1:Array<UInt16> = [2,4,6,8,10,11,12] var…
-
0
votes1
answer59
viewsRemove menu navigation controller
As I remove this gray menu from my webview I think it’s something related to navigation controller n I’m sure…
-
0
votes1
answer72
views -
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
answer39
viewsI overwrote a follow in Swift, do I need to overwrite them all later?
I overwrote a few seconds to use a viewController, where it will be dynamic and receiving the content according to the clicked menu. But the other seconds that I did not put an "identifier" stopped…
-
0
votes1
answer58
viewsHow to make the prepareForWhy wait for a certain processing to finish to be called?
By clicking a certain button I make a query in firebase to return data, however this same button calls another view controller, and the problem is there, the view controller is called before the…
-
0
votes1
answer126
viewsProblem changing screens with Navigation Controller
I have a small problem, my App uses the Navigation Controller and a View controller, I have declared trails that bridge the gap between Cells. When running the app starts in Navigation Controller…
-
0
votes1
answer43
viewsSet height for Uiscrollview
I’m creating an app for iOS using Swift, I’m having a lot of difficulty regarding the height of UIScrollView, I’m using auto-layout and create the following structure: Uiscrollview Uiview // View…
-
0
votes3
answers202
viewsChange entire application font without changing the size (Swift)
Boas, I wanted to find a way to change the entire app font (Swift) into a few lines of code. Right now I have extension UILabel { var substituteFontName : String { get { return self.font.fontName }…
-
0
votes1
answer40
viewsError while clicking Button
Good morning! I am studying the Swift language for iOS and I have the following problem. I made a test application, available in the book "Swift - Programe for iPhone and iPad" Code House. It is an…
-
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
answer50
viewsSwift - Pod Install Framework
Gentlemen, good afternoon! Where I work, we’re providing support for a customer who has an iOS app that uses multiple frameworks. They opened an error call, we went to analyze and the error is…
-
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
votes1
answer89
viewsHow to view recorded records in Core Data?
I’m developing a small app on Swift for Macos, Everything was fine until you got to Core Data. I was able to record and recover data, it’s okay that it wasn’t as good as I wanted, but since it’s the…
-
0
votes1
answer84
viewsLogin to Swift Authorization
I’m consuming data of a certain API for login, she returns the Token of correct access, and otherwise returns the ERROR, but I cannot move to another screen if the fields are filled correctly,…
-
0
votes1
answer280
viewsImage on IOS navigation bar button
I need to add two buttons in the navigation bar of my app, but what I need to use an external image (already imported to the project) it does not appear. override func viewDidLoad() {…
-
0
votes1
answer39
viewsProgrammatically create Entity and save to core data
Hi, I was wondering how do I save an Entity in core data programmatically. I tried the following procedure: Passing parameter MatchCoreData().createEntity(name: "Partidas123") Func creating the…
-
0
votes3
answers389
viewsChange font size according to iOS device
I have a Phrase App and each sentence has a different size (according to the amount of words) and on tablets as the resolution is the same as the iPhone 4s the phrases extrapolate the size reserved…
-
0
votes1
answer395
viewsSwift 4 http get and iterate the JSON response
Hello, I am learning Swift and am making a GET request via URL that returns me a JSON with this structure. { "data": { "response": […
-
0
votes1
answer212
viewsFirebase SWIFT and Storage Image Gallery
Good afternoon, I’m finishing a APP developed in Swift 4, with Xcode 9 and Firebase. I can already log in with Firebase, and e-mail through my App, what I need to do, which I’m not getting at all is…
-
0
votes1
answer29
viewsRegistration with Popover - Step by step Swift 4
Good morning, I have a problem using Popover, I need to do a step by step registration using Popover in the register, but when I try to close one Popover and open another, I’m not getting it closes…
-
0
votes0
answers33
viewsHow to turn a Date to Seconds on Swift?
How can I transform the Date for seconds? The code I’m trying to implement is this: let dataAtual = Date() var calendar = Calendar.current if let timeZone = TimeZone(identifier: "BRT") {…
-
0
votes1
answer325
viewsInput type file in webview - Xcode
I created a webview of a page that contains an input type file to upload photos, however, in Iphone webview, when I click the button to upload the photo, it opens a menu only with the option of…
-
0
votes2
answers101
viewsHow to show loading indicator on Swift 4 with Wkviewweb
Hi, I’m trying to show the loading indicator while my page is being read, but it didn’t work. I searched the internet, but it doesn’t have the full code and I’m a beginner on Swift. You can help?…
swiftasked 6 years, 7 months ago Roberto Luiz Teixeira Rocha 71 -
0
votes1
answer95
viewsShould I use tableview, collectionview or scrollview when dealing with vertical items that are different from each other in the Xcode?
Good night, I started learning Swift a short time ago and am trying to develop an app in Xcode. Today I found the following situation: I need to make a list of information in which it is possible to…
-
0
votes1
answer36
views -
0
votes1
answer78
viewsHow to Disable " Pinch Gesture" Effect with Swift 4 in Xcode9
How do I disable my Wkwebview zoom? My app is allowing zoom in on the screen, I would like to disable this function. How should I proceed ? import UIKit import WebKit class ViewController:…
-
0
votes1
answer142
viewsActions within webview - iOS
good afternoon! Can anyone help me? I’m starting iOS development and I have a problem. A website on which I am creating a webview (with Mkwebview) sends alerts to the user when doing some action but…