As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [swift]

WARNING: Questions relating to programming generally belong on Stack Overflow. Scripting and automation questions using Swift are on topic here and SO but may be received better here if the overall question is less about the details of the Swift language.

Filter by
Sorted by
Tagged with
15 votes
7 answers
47k views

Where can I download Xcode (n) Beta?

I want to start developing in Swift. I already own an apple developer account, yet am struggling to download Xcode (n) beta. How can I do this? Thank you in advance.
arled's user avatar
  • 252
15 votes
1 answer
13k views

Reopen Swift 2.0 migration tool in Xcode 7

I just opened a Swift project on the new Xcode 7. I didn't really look on what button I clicked and closed the migration tools without migrating anything. Any idea how I could reopen it?
Matthieu Riegler's user avatar
10 votes
3 answers
48k views

Is it possible to select which version of Swift to use in Xcode?

There's an update for Xcode 6.3 and it includes a new version of Swift (1.2). If I update, do I have to migrate all my Swift code to 1.2 or can I select an older version of Swift?
harinsa's user avatar
  • 203
6 votes
1 answer
17k views

Is Xcode with Swift on Mavericks possible?

My school computers have OS X 10.9.4 on them but they don't want to update them because of incompatibility with their Music class software. From what I see on Apple's website Xcode 6.4 and 6.3.1 both ...
tazboy's user avatar
  • 163
5 votes
1 answer
7k views

How to install Xcode 6? [duplicate]

I just got myself a MBA and I am wondering how do I install Xcode 6 on my MBA? In the Mac App Store I can see Xcode 5.1.1 so I have started installing that on the MBA. But, I want to install Xcode 6 ...
thatmaheshrs's user avatar
5 votes
2 answers
2k views

iOS Private APIs

I am interested in some of the technical details behind Apple's private APIs in iOS. I can't seem to find a good writeup on some of these details (beyond how to call the private API functions), though ...
Jack Humphries's user avatar
4 votes
1 answer
5k views

How to find duplicate lines of code in Xcode

When I am making applications in Xcode, I sometimes find that I write duplicate code. Is there a way in Xcode to find duplicate code in all files? I would like to know this because I would put the ...
iProgram's user avatar
  • 4,500
4 votes
1 answer
436 views

How do you install playground books on iPad?

I found a playground book from Apple online called "Talking To The Live View". It's an updated playground from the 2016 WWDC. I want to install it on my iPad and try it out. Further, I want to ...
Duncan C's user avatar
  • 495
4 votes
1 answer
241 views

VoiceOver reading results of Swift Playground print statements in Xcode

(By way of background I have been helping a local blind child learn coding. He's switching schools from a Windows based school to a Mac based school so I am trying to familiarise myself with VoiceOver ...
dumbledad's user avatar
  • 179
4 votes
1 answer
385 views

Where to find online documentation for older versions of Swift?

Is there an official online Apple source for documentation for Swift 3? (Preferably that can be accessed without signing in to a developer account.) Browser searches for "Swift 3" are finding links to ...
Cam U's user avatar
  • 141
3 votes
2 answers
370 views

Swift on Xcode 6

I'm trying to use Swift on Xcode 6 for an OS X application, but it defaults the language to Objective-C and won't let me switch it to Swift. I can use Swift for iOS but not OS X. I have the latest ...
Cody's user avatar
  • 93
3 votes
1 answer
336 views

Compiling Swift 2 code [closed]

I have an app which is written in Swift 2.1. Is it possible to build it in Xcode 9? If not, how do I build it?
Rahul D's user avatar
  • 31
3 votes
1 answer
4k views

Is there a way to prevent predictive text from learning what the user typed

I want to prevent predictive text from being stored on the iOS device. Is there a way to do it? If I turn off predictive text, the app doesn't show the predictive text toolbar, but it still learns the ...
Frank Lau's user avatar
3 votes
1 answer
248 views

Upgrade Swift without upgrading MacOS X

I am currently using Mac OS Sierra 10.12.6. I cannot upgrade to a more recent OS version as the business applications I am using for WFH will not work. The default swift installed is 3.1. I want to ...
Ali's user avatar
  • 141
3 votes
1 answer
2k views

Mac swift process blocks system, high memory pressure

Recently, since XCode 11 when I use it, builds and indexes grab a lot of memory. Activity monitor shows a process (it seems like it does so when indexing or building files) called swift and my Mac ...
Cristian Bănărescu's user avatar
3 votes
0 answers
1k views

How to disable indexing for a big Swift project?

I have a big Swift project. It's about 40 ViewControllers, 2 storyboards and some frameworks. When I make some changes XCode begins indexing all the project and it takes a very long time! How can I ...
user2308192's user avatar
2 votes
3 answers
2k views

Programming Swift without OS X [duplicate]

A friend of mine suggested that I learn Swift, as it would help me get a job that I had applied for, and I thought this was a good idea. The only problem: I don't own a Mac computer, or anything with ...
TheSoundDefense's user avatar
2 votes
1 answer
474 views

chmod +x not working as expected, running another tool instead

Just wrote a simple commandline tool which works fine with swift but doesn't run as executable after chmod +x ... This is happening on my system so might be configuration related but not sure how to ...
staticVoidMan's user avatar
2 votes
2 answers
277 views

A website to upload my ios app that anyone can download

Hi there I am looking for a website to upload my ios app(with swift) there and get it's link so that anyone can download it through the link. thanks for your help :)
Bardia Modaberi's user avatar
2 votes
1 answer
4k views

Apple guidelines for back button

Are there any guidelines for the position of the back button? I always see the back button at the top-left part of the screen, but I don't know the exact position I should place it.
Daniel's user avatar
  • 291
2 votes
4 answers
5k views

How can I download Swift?

I've been trying to get my hands on Swift, but I can't seem to find it. Is it released yet? If not, when will it be released?
David's user avatar
  • 963
2 votes
2 answers
185 views

How should I organise my plist? [closed]

I'm creating a game where the player can unlock worlds, where they can unlock levels within those worlds, each levels has a highscore, and so on. I was wondering in which way should I store this data?...
Faraday's user avatar
  • 61
2 votes
1 answer
927 views

cheapest iPad necessary for running Swift Playgrounds application

What's the oldest (read: cheapest) iPad I can purchase that will run the Swift Playgrounds app for learning the Swift programming language?
bigfacts's user avatar
2 votes
2 answers
1k views

Terminal problem: "-bash: $: command not found"

I'm trying to start learning Swift and when I use the terminal line $ export PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:"${PATH}" it gives me -bash: $: command not found ...
mutucan's user avatar
  • 41
2 votes
2 answers
14k views

ERROR ITMS-90158: URL schemes need to begin with an alphabetic character - Google client ID

When trying to Upload to App Store... received the following error: ERROR ITMS-90158: "The following URL schemes found in your app are not in the correct format: ... URL schemes need to begin with an ...
Yatko's user avatar
  • 389
2 votes
2 answers
2k views

Install unsupported iOS version

I am developing iOS apps with Swift, and don't want to buy an Apple device to test them, and have just got an iPod 4gen which supports iOS up to 6.1. I just wanna know if there is absolutely no ...
Jeggy's user avatar
  • 145
2 votes
1 answer
570 views

How can I read the battery level of a MacBook in Swift?

I have seen many post here/on SO and many docs on Apple's website about reading the battery level on iOS, but what's the best way to do this on a MacBook? In the past the only way I've found to do ...
Pixelated Fish's user avatar
2 votes
1 answer
994 views

App for macOS to add words to personal vocabulary list?

I search for a way to add unknown words in a personal dictionary or vocabulary list only by right-clicking the word and choosing the add option (in macOS). It would be very helpful for me to add the ...
Shervin's user avatar
  • 23
2 votes
1 answer
844 views

Where to find the keychain stored by KeychainSwift

I use KeychainSwift to store my user's keychain data using my created iOS app. The question is: Where can I see the data it stored? I already tried going to Settings -> Password & ...
Dylan's user avatar
  • 123
2 votes
1 answer
882 views

How to have both Swift 2 and Swift 3 books in iBooks library

I'm a professional software developer who is still supporting clients using Swift 2. However, I'd like to be getting up to speed on Swift 3 since clearly it is the wave of the future. My copy of ...
Duncan C's user avatar
  • 495
2 votes
1 answer
2k views

XCode debug error Thread 1

Ok so I'm trying to work with swift on XCode but every time I start to run my code I get this Thread 1 Queue: com.apple.main-thread(serial) What does this mean?, and how do I fix it? Also i've ...
Nathan O's user avatar
2 votes
0 answers
664 views

Apple Xcode: remapping camera's Pan, Orbit and Dolly controls in SceneKit module

I'd like to remap the following camera controls in SceneKit module of Xcode 9.2 (I'm coding in Swift): panning – alt + LMB orbiting – LMB dollying – alt + MMB Pan drags the virtual camera ...
user avatar
2 votes
0 answers
146 views

Monitoring directory in finderSync extension failed to work [closed]

I have developed a Cocoa application with a FinderSync extension through which a newly created directory is monitored. Sometimes it works fine but sometimes when I activate the Drive and Dropbox ...
Smit's user avatar
  • 121
2 votes
0 answers
507 views

What does Swift mean for people learning iOS development for the first time [closed]

I quit my job to pursue programming full time and I was planning to take an ios app development course at a college near me that teaches iphone & ipad dev using Objective C. Now that Swift has ...
Trianna Brannon's user avatar
1 vote
1 answer
92 views

Can I open any app from app store in xcode?

I just start learning iOS development and still haven't finish the course but I'm too curios to know if I can open an app from app store in xcode to see all of the code inside of it as it will make it ...
ms12's user avatar
  • 13
1 vote
3 answers
391 views

Getting Latest Version of Swift

I’m starting to learn Swift, and have tried the Swift shell. I notice that it is Apple Swift version 5.1.3 . I though it was up to 5.2 by now. How do I get the latest version of Swift on my MacOS? Is ...
Manngo's user avatar
  • 3,255
1 vote
1 answer
2k views

Cheapest mac for latest xcode? [closed]

I am doing a uni course which is called iPhone Software Engineering and it says that I need a mac that is able to run latest version of 'Xcode' for app developement and current SWIFT and the Apple iOS ...
Sabih's user avatar
  • 11
1 vote
1 answer
48 views

How to disable Apple Watch SOS crash detection temporarily out of app?

I'm currently developing a Apple Watch App for surfers. I've received many requests if we can pause or disable the crash detection of a watch in case our surfers app is running to prevent automatic ...
Mr. Jo's user avatar
  • 113
1 vote
1 answer
2k views

In iOS: Can my app launch another app and get a response/acknowledgement back? [closed]

In iOS, is there anyway i can launch another app to do something and then get a response back saying that it’s done. For example: My iOS app APP A launches another app APP B (e.g. Google Pay) to make ...
Vishnu Rana's user avatar
1 vote
1 answer
90 views

Do you need a Macbook Pro w touchID to test the authentication in your Swift app?

I'm thinking of buying a MBP base model for Swift programming, and I know that Xcode has a simulator for the touch-bar, but do I need the one with actual touchID hardware if I want my app to require a ...
Michel Buron's user avatar
1 vote
1 answer
178 views

Can I lock my app until user give me a permission (like location permission)?

I am developing an app and I am highly in need of location services and without that my app is not working. Can I block users from using my app (showing a page to them) until they go to settings and ...
aakpro's user avatar
  • 121
1 vote
0 answers
219 views

Unable to receive packets onto utun interface?

I'm using the NetworkExtension framework to create a virtual utun interface. My application receives packets from a client and the application writes the packet into the utun interface. Since I have ...
SunflowerNetworks's user avatar
1 vote
0 answers
167 views

Modify iTunes library from a script

In my project, I have a bunch of music tracks in a directory of my computer. I want to add them to my iTunes library in an automated way. I also want to group them in playlists depending on the ...
SinLey's user avatar
  • 11
1 vote
0 answers
83 views

iOS Newsstand app background mode [closed]

Does Apple still support Newsstand apps? I searched a lot but I can't find any tutorial or a demo for such an app with NewsstandKit. If this is not used anymore, why does the Newsstand background ...
Bathant Hegazy's user avatar
1 vote
0 answers
55 views

How can I remove annoying messages about versioning from Xcode?

Practicing a bit with the Swift language, I am currently using Xcode v.9.2 in the playground mode. While coding, every time I just add a single statement, the following window appears: Is it possible ...
rudicangiotti's user avatar
1 vote
0 answers
68 views

How to find out fully qualified hostname in osX (Terminal / Swift)? [duplicate]

i've checked several posts, for example - (Make `hostname -f` return fully qualified hostname) My apple machine is connected to the domain and i'm logged on with a domain user. the thing is, that ...
ArielB's user avatar
  • 111
1 vote
0 answers
70 views

iTunes Connect developer API for own statistics site [duplicate]

I'd like to setup my own statistics site for my own released apps. I'm just wondering, if it's possible to have an iTunes Connect API where I can fetch all statistics from the iTunes Analytics area ...
AlexWoe89's user avatar
  • 141
1 vote
0 answers
113 views

How do I stop Xcode from replacing "selected" character with another character?

I made some changes to some source code today, and noticed that when I replaced "inDirectory" in a Bundle.mainBundle.pathForResource call with "subdirectory" and subsequently put it back in, Xcode ...
moonman239's user avatar
1 vote
0 answers
138 views

Get Swift Playgrounds back? iOS 10 GM Warning

I just updated to the final release of iOS 10.0.1 on iPad Pro 12.9 inch Swift Playgrounds is gone, and it's not in the App Store. I've lost all my Playgrounds, I presume. No great loss. But how do ...
SKOOP's user avatar
  • 111
0 votes
1 answer
147 views

Can app developers control the way their app handles iCloud save conflicts?

I saved data to iCloud on laptop A, then opened the document on laptop B to update a part of it (with data only available on laptop B). After saving on laptop B, I realized that iCloud didn't give me ...
iconoclast's user avatar
  • 8,930