Click here to Skip to main content
15,886,578 members
Everything / Programming Languages / Swift

Swift

Swift

Great Reads

by Paulo Zemek
Mistakes that can be made while using MVVM and how to overcome them
by Vince Chan
Pwnage Checker is an iOS app that allows users to check whether an account has been compromised in a known data breach
by raddevus
Learn to create iOS apps using Xcode while you learn Swift. (If you've ever wanted to see iOS app dev in action, take a look at the screenshots.)
by pgmr_64804
Tree View in Swift for iOS that is easy to implement and use

Latest Articles

by Serhii Krotkykh
On easy example shown how to implement UIKit and SwiftUI TableView auto resizable cells and explained difference between Nib and Xib, how to load nib file and what exactly owner parameter of the load nib file method.
by Serhii Krotkykh
Example of using result builder for the MVVM pattern
by Dearich
First part of the ultimate guide on how to add a Live Activity feature to your project
by Paulo Zemek
Mistakes that can be made while using MVVM and how to overcome them

All Articles

Sort by Updated

Swift 

10 Dec 2014 by _Maxxx_
Assuming you only want to develop for IOS / Mac and not for other platforms (Windows, Android etc.) then Swift should be your choice; It is newer, but is I think intended to be the replacement for Objective C - eventually. so learning it now you will be at an advantage over others converting...
14 Jun 2021 by Abbas Gujjar
Suppose we navigate to child view and when the Parent View updates then automatically back navigation performs up to Parent View. Can we disable this Behaviour? What I have tried: I have a list of card views and when I click on one of them...
22 Apr 2015 by Abhinav S
Trywhile (reader.HasRows){ //Code reader.NextResult();}
2 Jan 2017 by Afzaal Ahmad Zeeshan
You can develop the applications on Windows operating system, but to compile that project you will require to connect to a Mac system. Xamarin for instance, allows you to use Visual Studio for development, but it requires a Mac peer device to compile the project into native iOS based...
23 Aug 2018 by Akshay K. Bura
I am using PDFKit to display my pdf files. I've integrated the searching functionality but I want to search only bold texts/words. I'm wondering is it possible to do what I'm looking for or does Apple don't allow it? Because String data type is from Foundation class and UIFont is from UIKit. I...
4 May 2017 by Alex2 101
I want to get the equivalent MX table related to various MT messages such as MT 102/103 etc What I have tried: Has developed and extracted MT Messages such as 102,103 etc. Need to equivalent MT mapping for respective MX Messages.
15 Apr 2018 by Ali Asadi
my model class is a little complicated so swift 3 can't set the data to my model what can I do about it? if you need I my codes just ask me What I have tried: let google=GOogle(Json:myjson) class Google{ var results = [Results]() }
7 Dec 2022 by ameen khalil
Hey Guys, I am trying to build an apple watch app, which will detect when the arm of the user touches the ground or the user goes towards ground. example use case: Burpies, this is one type of excersize where a man stands up, does squats and...
18 Dec 2017 by amit_83
how to convert sqlite datetime to nsdate in swift?My sqllite column is set as default value by current time stamp. Now i am trying to get the value using but exception raise when going to formate the valueBirthAt is the NSDate typevar date: String? =...
26 Sep 2014 by amit_83
Hi All,I want to save data in to sqlite using swift. How can i handle the special character in swift when saving the data?
6 Oct 2014 by amit_83
It helped me public func getDateFromString(date: String?) -> NSDate? { if var date1 = date { let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "MM-yyyy-dd HH:mm:ss" dateFormatter.timeZone = NSTimeZone(name: "UTC") ...
10 Apr 2017 by amit_83
Hi All,I want to save UIImage in sqlite database using iOS swift. How can i do this?Also when i retrieve bytes then i want to convert this into UIImage.
30 Apr 2022 by Anar Aliyev 2022
I am trying to add Firebase Phone Authentication in my app but getting error every time when I want to send tel number to firebase. It states that - unrecognized selector sent to instance 0x20d326df8. I am using real IPhone not simulator. Here is...
28 Mar 2024 by Andre Oosthuizen
Your issue lies within the message - Quote: TypeError: object of type 'TarInfo' has no len() Your 'iter_wrapper' function in your 'swiftclient.utils' module is trying to read the length of a chunk of data, but it's encountering a 'TarInfo'...
1 Jan 2021 by Andy Allinger
Could this be done by sonar? The user puts the phone on his head, then the phone sends out a chirp, the sound wave bounces off the ground and the microphone hears it.
2 Mar 2015 by Anil Kumar Ch
Am new to swift.I have UISegmentcontrol with 3 segments i.e. New,Accepted,Completed. I need to display orders separate as New ,Accepted and Completed.and am using one tableview with custom cell for displaying orders data. am getting data from JSON and i can display the data on tableview.Now i...
9 Mar 2015 by Anil Kumar Ch
Hi,I am unable to categorize my data which i am able to get from JSON in swift.like for example: if i am having a list of data. i like to seperate my data based on one Column value. if i am having a Column named as Status under this column im having different status like: New, Accepted,...
22 Apr 2015 by ankur1163
I am making login page. Now, when i put username, password, it keeps rotating and doesnt do anything. I started it in debug mode and saw that it doesnt loop through code inside while statement>>>>>>>>>>>>>>>>>while(rdr.Read()) { int RetryAttempts =...
15 Apr 2021 by Arvind Patel Apr2021
Write a function f where f(f(x)) = -x (assume x to be an integer), any programming language would do. What I have tried: How can I write the following fuction?
3 Jun 2019 by Ash_savvy
is there any pod for giving shadow effects to buttons and other control in swift 4.2? Please help me with that! It's been only two weeks I started swift, and two weeks I spent for this!! Someone please help me!!. What I have tried: I have tried Material design MDKit! but doesn't worked in...
20 Dec 2020 by Batuhan Baran
I'm creating more than one textfield according to user's input. When user enters 3 then I will create 3 textfields using foreach loop but I don't know how I can handle inputs that will come from these textFields? also I want to save these inputs...
30 Apr 2016 by BossGiveMeArrays
I am using the Swift Programming language. Here is the code:class CalculatorBrain9iOS{ ***bunch of code*** private var accumulator = 0.0 private var pending: PendingBinaryOperationInfo? private struct PendingBinaryOperationInfo { var binaryFunction:...
19 Feb 2018 by brenntengel@yahoo.fr
i've been looking for months now to find out how to record a live audio stream using swift ? please give me a hint a small code to start . regards What I have tried: This code is in java i want the same in Swift please while ((bufferLength = inputStream.read(buffer)) > 0 ...
24 Jun 2022 by Charles Urban
I'm currently developing an app for a company who wants to be able to press a button on an iPad that will launch a program on a windows pc, gather information from the windows pc and return that info back to the iPad. What I have tried: I've...
4 May 2017 by CHill60
You will need to download the Swift specs for their messages. I used to have them but I believe they are part of the support package so I wouldn't be able to share them anyway. Contact SWIFT (SWIFT – The global provider of secure financial messaging services[^]) or you might get some luck on the...
2 Jan 2023 by chirag patel 2023
I want to create 3 headers in the tableview given in the images and 8 students in each row, my code is as follows https://i.stack.imgur.com/zynoj.png[
21 Jan 2017 by Christopher Smit
Good day,This may be a dumb question, but I only started with swift about 3 weeks ago. I am using SWRevealViewController to display a menu on my app. From this menu I am going to a certain view controller based on selection. From that selected view controller I would like to unwind back to...
23 Jan 2017 by Christopher Smit
Good day all,I recently ran into the problem where I found out that Apple does not allow developers to send an email directly from code without user interaction. This causes some difficulties on my app as I need a code generated email which is in HTML format to be sent from my website server...
25 Nov 2015 by ci3.co.uk
Hi Code Project MembersI am in dire need of some help, please see below. I am having trouble finding a solution!iPhone 6 Demo AppUsing SpriteKitWhat I would like to do is to attach two SKSpriteNodes together.Node 1 square 100x100Node 2 square 50x50I would like the two...
25 Nov 2015 by ci3.co.uk
Forgot to add, both Nodes need to be affected by Physics
14 Mar 2017 by Code Different
I am a Swift and Xcode beginner, and I have read Apple's "The Swift Programming Language" and understand the fundamentals of Swift quite well. But when I try to refer to the documentation to know what functions to call, etc to do something not often done (such as using Replay Kit) I run into...
9 Jul 2018 by Codeboyyy
I am interested in software development. I have learnt a little bit about some languages; Java, JavaScript, Python, HTML and CSS. In the future I want to get a job as a software developer and when I go on job descriptions of software developer jobs, they all say different stuff. So I am trying...
5 May 2018 by Codeboyyy
I am currently studying a BTEC level 3 General IT course. I am confused as to whether go university or do an apprenticeship. They both have their ups and downs. While an apprenticeship will more often than not, guarantee me a job, I am not sure how well it would pay as in after completing the...
30 Mar 2016 by CodeProject, Val Polouchkine
Welcome to our continuing series of CodeProject interviews in which we talk to developers about their backgrounds, projects, interests and pet peeves. In this installment we talk to Val Polouchkine, a Developer Advocate for Twitter.
19 Apr 2020 by Cody O'Meara
I am making an app that has many tabs that will go to different links on my website depending on the tab Item. I looked up how to get a website on using the webView. I added the webview and made a small area to show for showing that it is not...
15 Apr 2021 by CPallini
You know, you may accomplish this task using a function returning the complex number obtained multiplying x by sqrt(-1). Using other approaches you have to return, together with the integer result, and additional info. There are several ways to...
21 Sep 2020 by Dave Kreskowiak
You're probably going to have to ask your question on the Apple Developer Forums[^]. The chances of anyone here with experience on that library are very low.
24 Mar 2022 by Dave Kreskowiak
You're not looking at the pattern in those lines, specifically, what happens to the count of the number of stars from one line to the next. That's all the help you're going to get because the rest is easy.
5 Jan 2023 by Dearich
First part of the ultimate guide on how to add a Live Activity feature to your project
29 Jun 2021 by Dener Araújo, André Marcos (Advisor)
A Mobile Application Development for a Private Network Connection on iOS Platform Using Prococol OpenVPN
21 Aug 2016 by Dennis E White
Catching the bug… Server Side Swift
28 Apr 2017 by Dennis E White
not sure what you expect there to be inside of ar1? the way that I see it there should actually be nothing in it. I would recommend that you read up some more blocks and closure. as just a note the code block that you are running will execute separately from the thread where you are...
30 Apr 2019 by Dennis E White
Programmatic iOS UI Development
24 Mar 2022 by dex1996
Star Print Problem Using Swift For-Loop. I am a swift beginner. The teacher gave me the questions. I tried to work for it. However, the teacher expect to have another solutions. Could anybody give me some suggestions? //Question01 * *** **...
19 Apr 2017 by Dharani karuppasamy
In the below code . i want to store that url (It is JSON Data) as an array. please help me What I have tried: let ur = URL(string:"http://demo.cogzidel.com/dropinn416/mobile/search/discover?common_currency=INR&start=1") let task =...
25 Jan 2021 by dontknowwhatimdoing
Im making a simple question with answer type app, and i want there to be a reset button that brings me back to the first question each times its pressed. import UIKit struct Question { var imageName: String let...
14 Mar 2021 by dontknowwhatimdoing
I'm trying to make a tableView of cards in a deck that have two scopes Questions and Rating. this is my code: import UIKit class DeckTableViewController: UITableViewController, UISearchBarDelegate { static let...
23 Jun 2019 by drobotjosh
I am having a lot of troublefiguring out why my projectile will not shoot the image of luke. I have tried many different methods to try and counteract this but none of the strategies have seem to worked. I would really love some guidance and apologies in advance for the amount of code. import...