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
25 views

How can I tell if a macOS app is native or just a wrap around a website?

I've got a cookie notice when launching an app for the first time on macOS, which I didn't know was a thing. Looking at the processes running, I see 3 processes spawned by the app. One looks like a ...
  • 101
2 votes
1 answer
374 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 ...
1 vote
1 answer
46 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 ...
  • 113
0 votes
0 answers
65 views

Things that need to be considered for releasing an app from a specific country to world wide on App Store

Right now our iOS application is just on the Japanese App Store. But we want to release this app on the global market. Our development is perfect for all countries and there are no changes on the code ...
  • 1,217
0 votes
1 answer
188 views

Execute Swift when a Safari extension is opened

I'm trying to create a Safari App Extension that executes some local Swift code, instead of executing a classic script.js file. First of all, can I do it? If so, how? For the permissions, I need to ...
  • 103
0 votes
2 answers
271 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?
0 votes
0 answers
75 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 ...
  • 1
0 votes
0 answers
26 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 ...
  • 103
0 votes
0 answers
1k 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" ""&...
  • 101
-3 votes
1 answer
109 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 ...
0 votes
0 answers
72 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 ...
  • 1
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 ...
0 votes
1 answer
133 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 ...
  • 8,788
0 votes
1 answer
157 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 ...
0 votes
1 answer
61 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 ...
  • 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 ...
1 vote
0 answers
205 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 ...
2 votes
1 answer
532 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 ...
2 votes
2 answers
269 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 :)
1 vote
3 answers
349 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 ...
  • 3,205
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 ...
0 votes
2 answers
46 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 ...
  • 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 ...
  • 11
3 votes
1 answer
224 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 ...
  • 141
2 votes
1 answer
926 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 ...
  • 23
0 votes
1 answer
381 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 ...
  • 101
2 votes
1 answer
780 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 & ...
  • 123
0 votes
1 answer
187 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 ...
  • 87
0 votes
2 answers
6k 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 ...
  • 19
1 vote
0 answers
153 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 ...
  • 11
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 ...
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 ...
0 votes
1 answer
60 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 ...
  • 228
4 votes
1 answer
238 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 ...
  • 179
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 ...
0 votes
1 answer
237 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 ...
1 vote
1 answer
87 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 ...
1 vote
1 answer
167 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 ...
  • 121
3 votes
1 answer
335 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?
  • 31
1 vote
0 answers
45 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 ...
0 votes
1 answer
122 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 ...
1 vote
0 answers
67 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 ...
  • 111
2 votes
1 answer
905 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?
2 votes
0 answers
657 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 ...
  • 141
4 votes
1 answer
381 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 ...
  • 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 ...
  • 41
0 votes
1 answer
91 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 ...
1 vote
0 answers
110 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 ...
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 ...
  • 4,480