Category "swift"

Detect button click in WKWebview

In my IOS Application I've created a WKWebview of a website that I'm not owning myself. So inside my: func webView(_ webView: WKWebView, didFinish navigation:

How to assign default modifiers to a SwiftUI view?

I'm trying to make reusable custom views that themselves can be customized later. Ideally I'd be able to define default modifiers like Color, Font, etc that the

Swift ios check if remote push notifications are enabled in ios9 and ios10

How can I check if the user has enabled remote notifications on ios 9 or ios 10? If the user has not allowed or clicked No I want to toggle a message asking if

How to give DatePicker a minute interval in SwiftUI

does anyone know how to give the minutes DatePicker an interval? I am trying to only display multiples of 15 (0, 15, 30, 45). Is this only yet possible by inter

How to consecutively present two alert views using SwiftUI

I want to immediately present the second alert view after click the dismiss button of the first alert view. Button(action: { self.alertIsVisible = true })

How can I conform a Swift actor to a protocol while preserving isolation?

Let's say we have the following goals: We want to use actors. We want to use dependency injection and resolve actors through DI. We want to hide our actors behi

Swift function returning two different types

I need a function that can return either a String or an Int depending on the parameters entered eg: func getValue (type: String) -> (String || Int) { //thi

How to trigger Xcode's 'Update to Latest Package Versions' from command line?

Goal: I want to programmatically update the versions of Swift Packages consumed by a sample project. Problem: Xcode > 11 offers a menu option: File &

Method 'application:openURL:options:' is not called

I'm trying to open my app from a web page using custom schemes. The app is opened but the following method is not called: func application(_ app: UIApplication

Compiler error: Invalid library file - CoreLocation

I have one of my application, that is created in Xcode 8. I have used CoreLocation and MapKit in that app. I have update app with latest iOS till now. and it w

Using user input in SwiftUI to perform calculations

I'm making a school project in which I have to find the weight of a person on different planets, but I am confused about how I should use the input and multiply

Trying to convert HTML to AttributedString within a UIViewRepresentable in SwiftUI

I'm trying to create this UIViewRepresentable view with an UILabel so that I can reprersent an NSAttributedString using SwiftUI. I've tried to create a functio

Firebase Analytics for iOS — custom parameters with predefined events (Swift)

I'm trying to implement Firebase Analytics for Swift iOS app. Could you please explain, if it's possible to pass custom parameters with predefined AnalyticsEve

self.image.frame.width = 20 give get only property error

i tried to change the width of my Image view to 20 @IBOutlet weak var image: UIImageView! using this code in viewDidLoad self.image.frame.width = 20 but it giv

Why UICollectionView didSelect method does not work?

I've created my UICollectionView programmatically and in this case my didSelectItemAtIndexPath method does not call at all. let collectionView = UICollectionVi

iOS Swift UI Test tap alert button

A really small UI test fails when trying to tap an alert button, what step am I missing? I'm trying to tap the "Continue" button in the alert displayed below w

Reality Composer and dealing with multiple surfaces

I want to know if there is a way for the scenes that gets exported from the reality composer to deal with multiple surfaces in the real world. So for example,

SwiftUI display gif image

The way to display animated gif image in swiftUI because of Image Image("fall-leaves") does not support gifs answer below

How can I apply a filters to ONE image?

I'm beginner in Swift and make an app "Photo Editor". I have a problem. I need to apply a some filters to ONE image. I have four sliders(sepia, contrast, bright

iOS-charts invert the X axis direction

I have a bar chart built using Daniel Gindi iOS-charts. It represents history data over a period of time. The issue I am having is that the data is being plott