Post

Replies

Boosts

Views

Activity

View appears transparent over tableView, whatever alpha channel
I have a view in storyboard, with a tableView and a coloured UIView. The UIView is declared after tableView, so it appears on top of tableView. However, it appears semi transparent over the tableView. In addition, I cannot set its alpha channel to values other than 1 or 0 (e.g., 0.9) But if I create the view programmatically, the view if fully opaque as expected. What am I missing ?
1
0
829
Dec ’23
Why does the superview of a UITableViewController turns nil after unwindSegue ?
Here is the set up. I have a UITableViewController (controller 1), to which I get from a controller (0) As I need to add a searchView atop the tableView, I addSubview to the superview. This is done in viewWillAppear self.view.superview?.addSubview(searchView) // AboveTableView searchView.isHidden = true print("willAppear", self.view.superview, self.tableView.superview) It works perfectly well, I get: willAppear Optional(<UIViewControllerWrapperView: 0x103d2eef0; frame = (0 0; 393 852); autoresize = W+H; layer = <CALayer: From this VC, I segue to another VC (2) with a show segue and comes back with an unwindSegue to return to (1). Problem is that no, superviews are nil. @IBAction func unwindToTableViewController(_ sender: UIStoryboardSegue) { print("unwind", self.view.superview, self.tableView.superview) } gives unwind nil nil If I step back from this controller (1) to the controller (0) from which I segued and segue again to the TableViewController (1), everything works as expected. In addition, if I go from 1 -> 2 by instantiating (2), everything works OK when I unwind to (1). I know a solution is to refactor code replacing UITableViewController with a UIViewController and embed a TableView inside. But I would like to understand why my present design does not work.
3
0
943
Dec ’23
Are storyboard and UIKit due to disappear ?
I read in Xcode 15.2 release notes that @IBDesignable and @Inspectable are deprecated and will disappear in a future release. After the abandon of WatchKit and its storyboard, replaced by SwiftUI, does it mean storyboards (and consequently UIKit) will progressively disappear, leaving developers alone with SwiftUI to design apps (IMHO, inadequate to design complex UI: for instance, I always struggle to position precisely objects for all devices sizes as we miss constraints manager in SwiftUI) ? For sure, IBDesignable is (was) whimsical, but a very useful tool to design sophisticated UI. Replacing by #Preview does not make it. I also understand that Xcode is a very complex piece of code and that maintaining and evolving some tools (as IBDesignable) requires effort. But isn't it what we expect from Apple ? To provide us with the best tools and keep on the promise of WYSIWYG environments, all along ? Is it only me or do others share this view ?
2
0
1.9k
Dec ’23
AppstoreConnect does not show units and sales of last days
Today, on Dec 14, when I look for units or sales, all that occurred after December 3rd is ignored. Tens were downloaded since dec 3rd, and I could see them when connecting earlier today. When I want to set the time period, I see that any date beyond Dec 3rd is greyed (see attached screenshot). It used to work a few hours ago. This occurred immediately after updating MacOS to 14.2, but I tested on a Mac running 12.6 with the same result. Is it only me or does anyone see the same issue ? I filed a bug report: FB13468285
10
0
1.5k
Dec ’23
Swiping Watch faces always display 10:09 before exact time
I know it is not a developer question, but getting the answer may help understand what we can get or not get on Apple Watch after Watch10. Since WatchOS10.2 when swiping face, time is always displayed first as 10:09:31 before setting the correct time one second later. Just in the same way as a long press. But the interest of swipe is to have immediately a different face displaying the correct time. Why is it so ? Is it due to (probably) now using SwiftUI ? Or is it a quick fix, reusing most of code for Lon,g press case ? It did not behave so with WatchOS 9 or before. Is there a setting to change ? It is really inconvenient (and ugly). I filed a bug report: FB13466486
1
0
1k
Dec ’23
SwiftUI TUICursorUIViewService error
I get this error in console in a SwiftUI MacApp on Xcode 15.0.1 and MacOS 14.1.2 FAULT: <NSRemoteView: 0x11f03bc00 com.apple.TextInputUI.xpc.CursorUIViewService TUICursorUIViewService> determined it was necessary to configure <TUINSWindow: 0x11f1b2390> to support remote view vibrancy I found similar errors that seem to be harmless messages popping up: https://developer.apple.com/forums/thread/72133 No idea what can cause such message, even less how to correct it.
3
5
2.8k
Dec ’23
Several tags are inaccessible on the forum
I notice that several (most) tags are not accessible now (Nov 2, 19:30 GMT). For instance https://developer.apple.com/forums/tags/ios https://developer.apple.com/forums/tags/uikit https://developer.apple.com/forums/tags/macos https://developer.apple.com/forums/tags/appkit https://developer.apple.com/forums/tags/xcode https://developer.apple.com/forums/tags/interface-builder all with the same error: The page you’re looking for can’t be found But others are: https://developer.apple.com/forums/ https://developer.apple.com/forums/tags/swift Is it only me ?
4
0
863
Nov ’23
Did anything change in LazyVGrid in Xcode 15 ?
If I run the exact same code on MacOS 12.7 (Xcode 14.2) and MacOS 15.0.1 (Xcode 15.0.1). In a scrollView, I display lines (lineDivider) and then a LazyVgrid, applying some offset: ScrollView(.vertical) { ForEach(1...50, id: \.self) { index in LabelledDivider(label: "\(index)", color: .gray.opacity(0.1)) .offset(y: CGFloat(65*index - 50) } LazyVGrid(columns: gridItemLayout, spacing: 33 ) { ForEach ($allItems.theItems) { $item in ItemView(item: item) } } .offset(y: 40) } In Xcode 14.2, I get the first layout and in Xcode 15.0 the second on right: The divider line is at the same position, but the view in grid is not. If I change .offset(y: 40) to .offset(y: 60) I get the same layout. So my questions: did anyone observe similar change ? is it due to Xcode, to MacOS ? Is it documented somewhere ?
0
0
517
Oct ’23
Positioning views: is it me or SwiftUI ?
After more than 2 years of intense use of SwiftUI I appreciate many of its features, particularly the speed at which I can get some code running. But, there are some major buts … Screen Position, I keep struggling with try, test, error and retry to position views relative to each others, withy many iterations to tune the x and y parameters. And preview does not help when view is too complex: I find it more reliable to test in simulator. At the end, my code is messed with .position, .offset, … that I manually adjusted but may break if I change something elsewhere in the body. The fact that position is relative to center of view (different from UIKit) makes it even more mind boggling. For sure, UIKit constraints were not so easy, but you got a very stable code. That's not the case with SwiftUI z position In some cases, I want the View to appear on front of all others. It may be a very simple Rectangle() with overlay, e.g., to mimic an alert. And I struggle with the Rectangle drawn behind another view, even trying to adjust the zIndex to no avail… Should I create an explicit View instead of creating the Rectangle directly in the body ? So am I misusing SwiftUI, or are they points that SwiftUI should improve in the future ?
1
1
744
Aug ’23
How to declare Privacy manifest
It is stated that From Fall 2023 you’ll receive an email from Apple if you upload an app to App Store Connect that uses required reason API without describing the reason in its privacy manifest file. From Spring 2024, apps that don’t describe their use of required reason API in their privacy manifest file won’t be accepted by App Store Connect. There are some answers here : https://developer.apple.com/videos/play/wwdc2023/10060/ but far from answering all questions. I have questions on how to implement: Where exactly is the privacy manifest ? How to create it, from which file template in Xcode ? WWDC speaks of a PrivacyInfo.xcprivacy (does it require a more recent version of Xcode than 14.2). WWDC describes a framework case. Is it the same for a "final" app ? is there a specific format for describing the reason ? Or just plain text. Is this text visible to the user or only to reviewer ? does it apply retroactively to apps already in AppStore (do they need to be resubmitted ?). It seems not. So I tried, in an iOS App, to declare the PrivacyInfo.xcprivacy as explained, with Xcode 14.2, using plist template, to no avail. Really not clear on how to proceed or even start… We would need a clear step by step tutorial with all prerequisites (Xcode or MacOS versions needed for instance).
14
1
16k
Jul ’23
Default Text width in SwiftUI different for MacOS and iPadOS ?
I have an app that runs eitheir as MacOS or iPadOS. After a few changes to adapt to API differences (PasteBoard notably), app runs OK on both. But the layout of views is messy when running on iPad. Reason seems to be that Text are not using the same default font size, or that the same system font size does not use the same space. Same issue when using segmented picker for instance. Configuration: Xcode 14.2 MacOS 12.6.6 Simulator: iPad Pro (12.9") - iOS 16.2 Is it a correct analysis ? Is there a simple workaround, to avoid the need to redesign all views for iPadOS ?
0
0
670
Jun ’23
Execution order of multiple onChange
I have declared an array as a State var @State var proba : [Int] = [10, 40, 40, 10] The array is updated in onAppear : .onAppear { proba = arrayOfTuples.map { (proba, _) in proba } print("proba", proba) } The array is used for TextFields: ForEach(0..&lt;proba.count, id: \.self) { index in TextField("N", value: $proba[index], format: .number) .frame(width: 40) .onChange(of: proba_kWh[index], perform: {[oldValue = proba_kWh[index]] newValue in print("proba onChange", index, oldValue, proba[index], newValue) }) When View appears, I get some onChange (as initial values did change) proba [10, 20, 60, 10] // onAppear changes 2 values: 1 and 2 proba onChange 2 40 60 60 // index 2 is changed before 1 proba onChange 1 40 20 20 I know that order of execution is not guaranteed, but in this specific case, I did thought it would be in the order of the array reading…
0
0
587
May ’23
Dark mode switching modifies ObservedObject
This is a SwiftUI Mac App. There is an observable object with a published array class AllObjects : ObservableObject { @Published var theItems = [Item]() } In the View, observed with: @ObservedObject var allObjects : AllObjects Item class is : class Item: ObservableObject, Identifiable { let id = UUID() var placeNo = 1 // Other properties } When I switch dark / light mode within the app (with a toggle) @Environment(\.colorScheme) var colorScheme the ObservedObject allObjects is modified: array is emptied: allObjects.theItems is now an empty array. What could cause the change to theItems ? I have checked that the only func un which theItems is reset to [] is not called.
2
0
589
Apr ’23