Category "swift"

Xcode: Own Swift packages missing in Schema selector

I have some SPM swift packages as part of my swift project. After some Xcode crashes, those packages don't appear in the Schema selector (black arrow in image)

How to access NSWindow from @main App using only SwiftUI?

At this answer the solution work for Scene plus swiftUI. However using @main like: @main struct MyApp: App { @StateObject private var model = MyModel()

How to fix problem with opening ViewController by action from Coordinator in Swift?

I'm trying to open another controller by tapping on the cell of my tableView. I'm coding with MVVM and Coordinator pattern. In the beginning we see this screen

iOS 13 Status bar style invalid (childForStatusBarStyle never called)

I've been searching a lot, but didn't find the same problem as my on StackOverflow or anywhere else. Setup Info.plist ViewControllerBasedStatusBar set to YES St

automatic delete token in userdefaults after 6 hours in swiftui

I have two apis Login DataShow when i login server gives me token which remains valid for only 6 hours and i am saving it in userdefaults, so that user will not

How to check if IndexPath is valid?

Prior to swift 3, i used to use for example: let path = self.tableView.indexPathForSelectedRow if (path != NSNotFound) { //do something } But now, since i u

Swift, Get action Bar Button Action from Container

I have ParentViewController.swift and ChildContainer.swift. In ParentViewController, I have bar button item action like below : @IBAction func onClickBarItemRef

How to make UIScrollView inside a UIScrollView act simultaneously

I'm using a UIScrollView (UIScrollView_1) with paging enabled to move between 3 pages horizontally. On the last page there is multiple UIScrollViews (each one i

HealthKit data is not refreshed until I force close and open the app again

I'm trying to get the steps and distance walked from a concrete day to now, on an iOS app. Also, I need to refresh that data continuously, real-time like. I tri

SwiftUI Adjusting frame size of VStacks by percent height

I have a card view. Which sizes I give myself. I know that is wrong. I want to do it resizable and divided by percent like blue = 70% & red = 30% or somethi

How do fix the "Cannot find 'NSFetchRequest' in scope error

I have tried to make an NSFetchRequest in many different ways and each time I get this error: "Cannot find type 'NSFetchRequest' in scope" Here are the specific

How to change toggle on just one Core Data item using ForEach in SwiftUI?

How to change just one toggle in a list without subviews? I know how to make it work if I extract Subview from everything inside ForEach, but how to do it on on

Gitlab CI-CD using Fastlane An error occurred while installing rake (13.0.6), and Bundler cannot continue

I am trying to integrate CI-CD using Fastlane all the lanes are working fine in my personal laptop but when I try to push it on my repo and after the job starts

Main thread blocking on scroll and Kingfisher setting the image

I've been running down slow scroll performance and I've noticed that when I scroll and setImage gets called with non-cached images, the performance lags while t

I am working on a VPN app which used Open VPN and I am not sure how to call the tunnel

I don't understand how does packet tunnel work and also don't understand where use packet tunnel in view controller. My .ovpn file is working fine but not conne

Save a PDF from a WKWebView

This questions pertains to macOS, not iOS. Note that this question is being reported as a duplicate of this question. The answers on that page pertain either t

Create Random Pixel Images in Swift

I want to create a random pixel generator in swift. How would I be able to create something like the below codes in swift? Java program to demonstrate creatio

NEHotspotConfigurationManager getting this alert:"Unable to join the network<name of network>" while error is nil

So i am trying to monitor the connection status by closers : func reconnect(success: @escaping () -> Void, failure: @escaping () -> Void) { let ma

prevent table view to scrolling top after insertRows

I have viewController with tableView inside it. this tableView has many sections and rows. when I try to add a new row in the last section using TableView.inse

NSDocumentController.openDocument not allowing selection of custom file type

I suspect this is a finicky configuration issue that I'm getting wrong with Document Type / UTI declarations in my Info.plist, but have tried several things and