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
0 votes
0 answers
8 views

Update Tab Bar Badge when a Core Data Item is added [closed]

This Problem drives me nuts: I have a small SwiftUi App which works with Core data. All works fine, I can add edit etc. But the app is tab bar based ad I want one tab updated when a record is added to ...
user avatar
0 votes
1 answer
40 views

What happened to CreateMLUI? Has it been removed?

In my Swift project in Xcode, import CreateMLUI says no such module. Has this been replaced or just removed?
user avatar
0 votes
0 answers
33 views

How change value of "Press Fn to" in Keyboard preferences programmatically?

I need to change value of "Press Fn to" programmatically to "Do Nothing". I can't find a direct way to switch this. I believe that is possible do this with AppleScript, but will ...
user avatar
  • 1
0 votes
0 answers
9 views

Run Playground Book on an emulated iPad

I'm trying to start off a Swift Playground Book from Apple's "Swift Playground Author Template" for Xcode 13. I've downgraded from Xcode 13.3 to Xcode 13.2 for compatibility issues. This ...
user avatar
  • 103
0 votes
0 answers
9 views

Is it possible to turn off live error correction in Swift Playgrounds for iPad?

Swift Playgrounds for iPad now permits you to build and publish apps. It has live error detection, so red highlighting appears to point out syntax errors. In Xcode for MacOS, this is optional and can ...
user avatar
0 votes
0 answers
14 views

The document “Build for Previews - Log” could not be autosaved

I just updated Xcode, when it prompted me to restart my computer it wouldn't let me close the app. this is what it said. can anyone help?
user avatar
0 votes
0 answers
321 views

Run an AppleScript from Swift

I'm trying to return a value from AppleScript to Swift (in XCode). If I do this simple code it works: let myAppleScript = """ return "hello world" ""&...
user avatar
  • 101
-3 votes
1 answer
82 views

apparent Obsolescence in Apple Xcode and Swift [closed]

am desperately trying to develop in Xcode, Swift, and particularly SwiftUI. have perfectly good (and incredibly expensive) Apple hardware that is now about 8 to 10 years old. apparently this means i ...
user avatar
0 votes
0 answers
26 views

Exists someway to update dock preferences plist without killall Dock?

AppleSpacesSwitchOnActivate is represented by the second button on print below In the code below, I get the current value and after I change. This can be tested in terminal with defaults read -g ...
user avatar
  • 1
3 votes
2 answers
752 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 ...
user avatar
-1 votes
1 answer
55 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 ...
user avatar
  • 7,230
0 votes
0 answers
472 views

How to resolve “App Store Connect Operation Error”?

I am trying to upload my app to App Store, but Validation process fails with the error: Unable to process app at this time due to a general error I have uploaded several apps earlier but this one is ...
user avatar
  • 101
0 votes
1 answer
93 views

Creating your own SF Symbol - for unfound emoji?

I've been looking all around SF Symbols - I can find symbols for lungs - nose - bunny - all kinds of things but no SF Icon for the emoji i want Is there a way to create my own SF Symbol ? For my use ...
user avatar
0 votes
1 answer
52 views

What password is sent when a router does not have a password set?

I promise this is not a hypothetical question. I am trying to use this GitHub repo - https://github.com/braineo/airport-bssid The latest OS X version does not allow specifying the BSSID so I am using ...
user avatar
  • 11
0 votes
2 answers
3k views

Installing cocoapods to macOS Catalina

In my mac mini I've running Catalina 10.15.7. I've also installed Xcode 12.4. Now as I'm using third party library I'm trying to install cocoapods in my mac. So I used this - sudo gem install ...
user avatar
1 vote
0 answers
93 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 ...
user avatar
2 votes
1 answer
328 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 ...
user avatar
2 votes
2 answers
227 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 :)
user avatar
1 vote
3 answers
172 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 ...
user avatar
  • 2,867
3 votes
1 answer
2k 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 ...
user avatar
0 votes
2 answers
40 views

Are there any guidelines by Apple on what content apple TV app should have

We are in the process of developing app for Apple TV, are there any guidelines that app should be either a video playing or gaming app, can I submit app with just readonly content like an iOS app and ...
user avatar
  • 101
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 ...
user avatar
  • 11
1 vote
0 answers
95 views

Upgrade to Swift 5 without upgrading OS 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 ...
user avatar
  • 121
2 votes
1 answer
563 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 ...
user avatar
  • 23
0 votes
1 answer
277 views

Swift Playgrounds on MacOS performs badly, spinning up the fans and working the CPU

Using the basic "Learn to Code 1" playground results in the MacBooks that I've tested on, including a 2020 MacBook Air, working far harder than I'd expect. The fans spin up and the CPU usage increases ...
user avatar
  • 101
2 votes
1 answer
492 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 & ...
user avatar
  • 123
0 votes
1 answer
137 views

Core Graphics or SpriteKit? [closed]

I'm a junior iOS Developer and I have the requirements for a drawing app I need to build for my employee. I need to be able to add graphic elements on the canvas on different layers. These elements ...
user avatar
  • 87
0 votes
2 answers
5k views

xCODE 11.3.1 - Failed to create provisioning profile

I'm trying to create a project, which will run on the xCODE's simulator, not on an iPhone. Right after the project is created, there are multiple errors. The first one is: Failed to create ...
user avatar
  • 19
1 vote
0 answers
112 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 ...
user avatar
  • 11
1 vote
1 answer
1k 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 ...
user avatar
4 votes
1 answer
2k views

Mac swift process blocks system, high memory pressure

Recently, since XCode 11, my Mac starts a process (it seems like it does so when indexing or building files) called swift and my Mac soon starts to lag. This process gathers a lot of memory (sometimes ...
user avatar
0 votes
1 answer
52 views

Tools, languages, libraries and API's for development of a MacOS wide application [closed]

Please just assume that the user has accepted whatever permission are required. Is it possible to listen to window actions under MacOS? In Swift preferably? For instance, if a window moves, is ...
user avatar
  • 208
4 votes
1 answer
212 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 ...
user avatar
  • 179
1 vote
0 answers
74 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 ...
user avatar
0 votes
1 answer
105 views

Why when I make a change to a project on xcode the previous project is affected? [closed]

I recognize that I'm new in using Xcode but I noticed A very strange behavior from XCODE, when I clone a project and I make changes in the Localizable.strings. these changes are automatically ...
user avatar
1 vote
1 answer
70 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 ...
user avatar
1 vote
1 answer
81 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 ...
user avatar
  • 121
3 votes
1 answer
328 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?
user avatar
  • 31
1 vote
0 answers
39 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 ...
user avatar
0 votes
1 answer
112 views

What is Visual Studio Code? Is it an efficient tool for Swift Development? [closed]

Scrolling to the #Linkedin feeds I have come across the term #VSCode. Please, anybody, explain the pure purpose of the tool or it's really trending in development Visual Studio Code combines the ...
user avatar
1 vote
0 answers
63 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 ...
user avatar
  • 111
2 votes
1 answer
787 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?
user avatar
2 votes
0 answers
579 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
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 ...
user avatar
  • 141
4 votes
1 answer
344 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 ...
user avatar
  • 141
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 ...
user avatar
  • 41
0 votes
1 answer
87 views

can't swift auth in Sierra

swift auth yields the error: error: unable to invoke subcommand: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-auth (No such file or directory) when ...
user avatar
1 vote
0 answers
90 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 ...
user avatar
4 votes
1 answer
4k 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 ...
user avatar
  • 4,390
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.
user avatar
  • 271