Category "swift"

Any way to keep gradient attached at top when scrolling?

I have a scroll view attached to superview(not safe area) and inside it there is a gradient filled view at top. However when i swipe up, the gradient gets pulle

SwiftUI: How to switch to a new navigation stack with NavigationViews

I am currently using SwiftUI Beta 5. I have a workflow which involves navigating through a series of views. The last view involves an operation which populates

How to split an array in half, and obtain two arrays

I want to split an array in two half, and then assign each half of the original array into two different string. I cannot do the first part. I have this code fo

Add swift UI support to the framework that target's IOS 10,

I wrote framework on Swift UI, then Client told me that lower IOS was required to be supported on framework. I rewrite framework on UIKit/UIViewController, And

How to remove the default Navigation Bar space in SwiftUI NavigationView

I am new to SwiftUI (like most people) and trying to figure out how to remove some whitespace above a List that I embedded in a NavigationView. In this image, y

" Duplicate keys of type ... were found in a Dictionary " when there is no Dictionary?

I'm quite new to Swift and I just encountered an error I don't find a solution for. I'm currently working on a game (Boggle, for the curious) and I want to upda

Conditional property in SwiftUI

How can I add an additional property based on a condition? With my code below I get the error: Cannot assign value of type 'some View' (result of 'Self.overlay

Is it possible to set default alert style for macOS UNNotification?

My application posts local macOS notifications. It's important that these are not banner style but alert style instead. So far I have achieved that by setting N

Swift Combine - @Published property Array

I am currently doing a project using SwiftUI and Combine. I'm on Xcode11 Beta 5. I would like to fetch my Github repositories, display them and then be able to

SwiftUI: How to pop to Root view

Finally now with Beta 5 we can programmatically pop to a parent View. However, there are several places in my App where a View has a "Save" button that conclude

SwiftUI NavigationView nested in PageTabView wrong aligned on first appear

The NavigationViews inside my PageTabView are wrong aligned on first appear. When i scroll to another page on my PageTabView and go back to the first page, the

Create a Timer Publisher using Swift Combine

I've been watching the Data Flow Through SwiftUI WWDC talk. They have a slide with a sample code where they use a Timer publisher that gets connected to a Swift

Autolayout warning when using prompt in navigation bar

I am using a navigation bar with a prompt, looking like this: I receive the following auto layout warnings in the console: 2019-09-01 21:26:03.225576+0200 Ho

SwiftUI select multiple item in a lazyhgrid

With SwiftUI this is my current code: import SwiftUI enum Items: String, CaseIterable, Equatable { case item1 case item2 case item3 case item4

SwiftUI MacOS Inset paddings of List

i have a scrollale list view using SwiftUI on a macOS app and i'm trying to add paddings inside the scrollable area, without success. Here my code: List(appList

Crash when init a Range from NSRange

I got a crash report on Crashlytics with this following exception. Fatal Exception: NSInvalidArgumentException -[__NSCFString characterAtIndex:]: Range or index

Detecting a tap on a marker in a forEach Loop and print

To detect a tap on a marker on GoogleMaps I should use this function. func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool { print("Do w

Package resolution failed. Couldn't get the list of tags

Can't add new dependency via SPM and always see this error fatal: bad numeric config value 'null' for 'tag.forcesignannotated': invalid unit Clean derived da

How can I read the value of an RxSwift property? <Driver>Bool

I'd like to read the value of a property var checkInEnabled: Driver<Bool> { get } I only need to to run a bit code once when the class has loaded, so I d

my flutter IOS project showing error "clang: error: no such file or directory: 'UserNotifications' Command Ld failed with a nonzero exit code"

Showing Recent Messages Ld /Users/shibi/Library/Developer/Xcode/DerivedData/Runner-abrxzfquusadvleimfabdvpysbkr/Build/Products/Debug-iphonesimulator/Runner.app/