Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [swift]

Swift is a general-purpose programming language developed by Apple Inc first released in 2014 for its platforms and Linux. Swift is open-source. Use the tag only for questions about language features or requiring code in Swift. Use the tags [ios], [ipados], [macos], [watch-os], [tvos], [swiftui], [cocoa-touch], and [cocoa] for (language-agnostic) questions about the platforms or frameworks.

-1 votes
0 answers
33 views

How to move between view controllers with using custom navigation controller? [closed]

I have a custom navigation controller. I want to go to next controller. And show custom back button. I use this code to do it: func collectionView(_ collectionView: UICollectionView, didSelectItemAt ...
user's user avatar
  • 27
-1 votes
1 answer
58 views

How to use a function outside of the class?

I want to use this code: var buttonNumber = 0 func settings() { CNavigationViewController().contextMenu() } class CNavigationViewController: UINavigationController { ... @objc func ...
user's user avatar
  • 27
1 vote
1 answer
28 views

How can I mock an Objective-C class from Swift code for unit testing?

I'm trying to unit test a Swift class that depends on an Objective-C class. Call these SwiftClass and ObjcClass. I created a protocol that contains the methods/properties of ObjcClass that SwiftClass ...
Cassiterite's user avatar
0 votes
2 answers
49 views

Parent view ignore safe area but child view respect safe area

I am building a custom full screen cover that can be dragged down with a gesture like the podcast app. For the transition modifier with edge as bottom, it uses the bottom edge of the parent view thus ...
SwiftUIEnthusiast's user avatar
0 votes
1 answer
59 views

Managing ViewModels

This is more of an architectural question. I am working on a personal project using the Rick and Morty API, following this design, building with Swift and SwiftUI using the MVVM pattern. I have ...
Saladel's user avatar
  • 53
-2 votes
0 answers
38 views

How to integrate SwiftBullet SDK in a Swift project using Xcode?

I am new to Swift and Xcode, and I'm currently trying to integrate the SwiftBullet SDK into my SwiftUI project. I have followed the documentation, but I haven't been able to achieve the desired ...
thantzin win's user avatar
-3 votes
0 answers
20 views

How can I create a Numbers spreadsheet programmatically using Swift? [closed]

I want to have ability for my app to export data so user can print it. Data represented as list of words. I am thought about .xlsx format but didn't found easy way to do it. Is any API or Lib or any ...
Danil's user avatar
  • 63
0 votes
1 answer
55 views

How can I make my method async when it calls a library method requiring a completion?

In my app I'm using a third party library, AppGuard, to log users in. To do so the library has a method that takes a completion. Recently I got the suggestion to convert it to async/await as actors ...
Pieter's user avatar
  • 133
-1 votes
0 answers
22 views

How to call "AutoFill Password" dialog like click password button in iOS system keyboard?

I want call "AutoFill Password" dialog like click password button in iOS system keyboard. Is Any iOS API can do that? I've try using ASAuthorizationPasswordRequest and ...
Shilai Zhang's user avatar
0 votes
1 answer
37 views

iOS Notification is permanently denied - can't find in settings for manual enabling

I implemented push notification in iOS and android, using APN Apple Push notification and firebase respectively. In iOS first request for notification is from native side (appDelegate/swift code) and ...
Inquisitive Owl's user avatar
0 votes
0 answers
36 views

App crashing when task switches to another app and goes to background when a task is ongoing

I have a view that is set to disappear after 5 seconds and it's working okay normally aside from this scenario: user does the action that makes the view show user immediately switch to another app ...
smekers's user avatar
  • 13
0 votes
0 answers
15 views

Lagging Video Feed Using VNGeneratePersonSegmentationRequest in macOS Camera Extension App

I'm developing a macOS application using Swift and a camera extension. I'm utilizing the Vision framework's VNGeneratePersonSegmentationRequest to apply a background blur effect. However, I'm ...
Yogeshwar Shelke's user avatar
0 votes
0 answers
39 views

Custom Scroll View Indicator does not animate correctly

I created a custom scrollview indicator that can be dragged but it doesn't work completely right and it's not smooth. It has a few problems: Scroll End does not fire when the scroll view stops so the ...
Ahmed Zaidan's user avatar
1 vote
0 answers
26 views

Swift faster way to retrieve exif data from PHAsset

I'm working on a photos app on iOS, where I have to extract the camera information of user's photos for displaying. The problem I am facing is that the process turns out to be extremely slow and ...
Mev's user avatar
  • 1,583
1 vote
1 answer
49 views

Update values in a dictionary based on changes made to another dictionary

I would like to know if there is a way to automatically update the value in a dictionary based on changes made to values in another dictionary. I have 2 dictionaries as follows: enum ...
Bob's user avatar
  • 192

15 30 50 per page