Posts

Post marked as solved
2 Replies
365 Views
Dear All, I want to maximise an Image above a Form. That should be easy enough but with the naive code, the Form is pushed out of the screen. I don't want to allow scrolling. This is my code: Image(systemName: "gear") .resizable() .scaledToFit() Form { Section("section 1") { Text("text 1") Text("text 2") Text("text 3") } Section("section 2") { Text("text 1") Text("text 2") Text("text 3") } } .scrollDisabled(true) Any hint on how to achieve that the Form is fully displayed and the Image dynamically maximised in the space that is left? Thanks in advance! Cheers F
Posted
by floteich.
Last updated
.
Post not yet marked as solved
0 Replies
149 Views
Dear All, I am using ImageRenderer (as well documented, i.e. here https://danielsaidi.com/blog/2022/06/20/using-the-swiftui-imagerenderer) to create images from views. This works fine with Views containing Texts and Images but fails as soon as there is a Form in the View. Failing means that the output is simply empty, no placeholder image is displayed as suggested by Apple documentation (https://developer.apple.com/documentation/swiftui/imagerenderer) and I am not using AppKit or UIKit. Any suggestions of how to create image snapshots from more 'complex' Views containing Forms and Sections? Any help appreciated. Cheers
Posted
by floteich.
Last updated
.
Post not yet marked as solved
0 Replies
185 Views
Hi Everybody, Using kerning or tracking on Text with negative values reduces the space between characters. Unfortunately, this also effects the trailing end of the text, which is then cropped. This is the expected behaviour according to Apple's documentation (https://developer.apple.com/documentation/swiftui/text/kerning(_:)) but not really what is intended (by me, at least) and looks rather weird (see example in the docs where 'raffle' is cropped). How to use kerning/tracking with negative values without cropping trailing characters? Any easy fix for that? Thanks!
Posted
by floteich.
Last updated
.
Post not yet marked as solved
0 Replies
290 Views
Hi All, I create a Swift Package (Xcode 14.3) and add a package dependency (https://github.com/stephencelis/SQLite.swift) by copying the autogenerated dependency clause into my "Package.swift" file. The "package.resolved" file is created, all good. Somehow I cannot use the package (SQLite) from my code because the "import SQLite" is not found. This happens from an empty package as well. How can I use the dependent package in my own package? Sorry for the seemingly simple question but despite a lot of googleing and fiddling with targets/products, I don't get this to work. UI options in Xcode to add targets etc. exist only for apps, not for packages. Any hints what I am doing wrong here greatly appreciated. Cheers Florian
Posted
by floteich.
Last updated
.
Post marked as solved
2 Replies
893 Views
Hi Everybody,I am trying to implement a function that returns the current UNAuthorizationStatus for use in a View to show a button or not. The function below doesn´t work because the closure is executed after the return - is there any simple way to achieve this?func getStatus() -> UNAuthorizationStatus { var result: UNAuthorizationStatus = .notDetermined UNUserNotificationCenter.current().getNotificationSettings( completionHandler: { (settings) in result = settings.authorizationStatus print("result in closure = \(result.rawValue)") } ) print("result at return = \(result.rawValue)") return result }Sorry, if this is a bit of a rookie question but I don´t seem to be able to figure this out.ThanksFlorian
Posted
by floteich.
Last updated
.
Post marked as solved
7 Replies
1.4k Views
Dear all,I am struggling with using ObservableObject in my app. In principle things work fine only view updates are not trigger when changing attributes of 'contacts.' Using 'cnt' in the same way, updates are indeed reflected in views - is there something particular I have to do with the FtContacts class to fix that?class AppEnv: ObservableObject { @Published var contacts = [FtContact]() @Published var cnt: Int = 0[...]struct ContentView: View { @EnvironmentObject var appEnv: AppEnv[...]Any idea what I am missing here?Thanks everybody
Posted
by floteich.
Last updated
.