alanquatermain / aqui Goto Github PK
View Code? Open in Web Editor NEWA collection of SwiftUI views and utilities.
A collection of SwiftUI views and utilities.
OptionalBinding stopped working on iOS 16.
I did try to bind a Core Data String? field to a SwiftUI TextField.
It is not possible to change the Text on the TextField, it keeps resetting to the value stored.
It seems the ShareSheet initialiser is inaccessible with this is used as a package.
I get the following error when I try to use the nullable Binding
extensions like Binding($cdObject.notes, replacingNilWith: "")
via the Swift Package Manager
'Binding<Value>' initializer is inaccessible due to 'internal' protection level
If I copy OptionalBinding.swift
into my project. It works fine. Maybe all that is needed is that the extension functions are marked as public?
UIKitSheetPresenter
does not appear to use the configured UIModalPresentationStyle
Without a licence people are not allowed to use it. Consider adding a licence.
The first form of the optional binding, as in
TextField("Name", text: Binding($thing.name, ""))
,
crashes for me if the attribute,thing.name
, truly is nil. This happens if a Core Data string attribute is not otherwise initialized. The crash that happens at
self.init(source)!
is
Fatal error: Unexpectedly found nil while unwrapping an Optional value
.
Two workarounds:
(1) Initialize the attribute to something.
(2) Use the other form of optional binding as in
TextField(text: Binding($name, replacingWithNil: ""))
Maybe I don't really understand the distinction between the two use cases, but it still seems the
binding without replacingWithNil:
should not result in a fatal error despite misuse.
I think that TextView should have a default background color of clear vs the white one it has, which prevents styling.
I can do a pull request or you can simply make the change by adding the following on line 204:
view.backgroundColor = .clear
When the text binding changes the textview doesn't allow any input (switching to a textfield works as expected)
My scenario: I have a button that when clicked changes the text binding to the next element in a list so I could edit the selected item contents.
It seems like UIVisualEffectView is getting hidden in the updateUIView
function. The guarded unwrap of context.environment.visualEffect
fails and causes the uiView
to get hidden. However, the visualEffect environment property is set on the VisualEffectView
struct and thus also the environment. Could this be a SwiftUI bug? I'm new enough to SwiftUI that I'm not quite certain how all the environment stuff works. Is there a particular reason that you want to use the environment version versus the actual value on the struct?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.