Search results for

column

2,061 results found

Post

Replies

Boosts

Views

Activity

SwiftUI Context Menu Popping Up Whole List
When I used Context Menu for each photo in three columns. So, the code is like below: List { LazyVGrid(columns: columns) { View() .contextMenu { Button() } } } This just pop up whole list not individual element when I long press the element to see context menu. The whole list is highlighted when context menu appears. How can I make this to highlight individual element not the whole list? If I remove any of List or LazyVGrid the problem fix. But the columns are not in the way I want. Also, I don't want to change List to VStack or ScrollView which don't have refreshControl. Thanks in advance.
3
0
1.9k
Aug ’22
Reply to UITableViewAlertForLayoutOutsideViewHierarchy
just posted a bug to Apple Developer Feedback...this is still an issue in iPadOS 17 App is using a UISplitViewController with the new column style init. Both primary and secondary child view controllers are subclasses of UITableViewController (yes, I need to move to CollectionViewController ASAP)... This bug occurs when I am in landscape and select iPadOS Split View by tapping on the 3 dots menu on top of the screen. As my app slides to the left, this Xcode console occurs. The backtrace from the symbolic break point indicates there are NO calls in my code in the back trace. This is an apple UIKit bug! Workaround for overriding layouSubviews likely to work... here's the backtrace... (lldb) bt thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1 frame #0: 0x00000001942cd8dc UIKitCore`UITableViewAlertForLayoutOutsideViewHierarchy frame #1: 0x0000000193579fd0 UIKitCore`-[UITableView _updateVisibleCellsNow:] + 208 frame #2: 0x0000000193579e34 UIKitCore`-[UITableView layoutSubviews] + 1
Topic: UI Frameworks SubTopic: UIKit Tags:
Feb ’24
GPU usage constantly high after MPS test program
I did a very simple test using Metal PerformanceShaders. It is basically a MPSMatrixMultiplication.I compiled it in Terminal with 'swiftc matrixMul.swift'Then you get the executable called matrixMul.Now, execute 'time matrixMul' and after approximately 10 seconds you will get the first then elements of the result matrix prows i/nted on screen.This all works as intended, however I realized in Activity Monitor (and also because of high GPU fan speed), that somehow the GPU isn't fully released. The Activity Monitor through the GPU monitor shows 100% activity for several minutes anfter program exit. Somehow the matrixMul process keeps the GPU busy after program exit. Do I miss some statement in my code which tells the system to free resources?Below is the simple test-code------------------------------------- import Metal import Accelerateimport MetalPerformanceShaderslet n = 8192let rowsA = nlet columnsA = nlet rowsB = nlet columnsB = nlet rowsC = nlet columnsC = nvar arrayA = [Float](repeating: 1, count: rowsA *
1
0
657
Dec ’19
Reply to SwiftUI NavigationSplitView on macOS: unwanted vertical space in detail column
Thanks @Starfia, this appears to be a bug. Thanks very much for confirming that – at least it quiets my indecision about how to proceed. That advice just gives me a Content View that conforms to the detail column's resizable area, though, so I don't think it gives me the fixed-sizedness I'm looking for. The closest I've been able to come has been to hard-code the frame of the Navigation Split View itself, but that involves knowing the combined height of all views I might add to the detail column at all times (alongside which the unwanted safe area propagation persists), so it's a whole undertaking. I think for this iteration, I just have to avoid using NavigationSplitView or the Inspector; I have to implement alternatives to those provided functionalities, but the layout issues disappear the moment I sidestep them.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’24
SwiftUI NavigationSplitView on macOS: unwanted vertical space in detail column
Hi, colleagues: I've spent days trying to understand this little SwiftUI layout problem, and I've made a minimal test app to explain it. It's based on a Content View of a fixed size. import SwiftUI @main struct TestApp: App { var body: some Scene { WindowGroup { ContentView() } .windowResizability(.contentSize) .windowToolbarStyle(.unified(showsTitle: false)) } } struct ContentView: View { let complaint = What's with the vertical space around me when I'm in a detail column? var body: some View { Text(complaint) .font(.title) .frame(width: 300, height: 300) .background(.blue) } } And here's the result. As expected, the Content View is hugged nicely by the window: My goal is to place a fixed-size view like this in the detail column of a Navigation Split View. So I update the scene's root view: import SwiftUI @main struct TestApp: App { var body: some Scene { WindowGroup { NavigationSplitView( sidebar: { }, detail: { ContentView() } ) } .windowResizability(.contentSize) .windowToolbarStyle(
3
0
2.4k
Feb ’24
Reply to SwiftUI NavigationSplitView on macOS: unwanted vertical space in detail column
A fascinating update. I've tried adding the newly-introduced Inspector modifier, which I also intended to use in the app I'm making: import SwiftUI @main struct TestApp: App { @State var isShowingInspector: Bool = true var body: some Scene { WindowGroup { NavigationSplitView( sidebar: { }, detail: { ContentView() } ) .inspector(isPresented: self.$isShowingInspector) { } } .windowResizability(.contentSize) .windowToolbarStyle(.unified(showsTitle: false)) } } struct ContentView: View { let complaint = What's with the vertical space around me when I'm in a detail column? var body: some View { VStack(spacing: 0) { Text(complaint) .font(.title) .ignoresSafeArea() .frame(width: 300, height: 300) .background(.blue) } } } This time, SwiftUI apparently adds entire toolbar's height to the minimum height of the window again! Now the detail column's mysterious vertical space equals twice the height of the toolbar: It doesn't seem to matter whether the Inspector is applied to the Navigation Split Vie
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’24
wwdc2023-10162 SwiftUI cookbook: How to handle MoveCommandDirection in LazyVGrid
I was following the tutorial video to implement arrow key navigation on a LazyVGrid. (starting at 18:50: https://developer.apple.com/videos/play/wwdc2023/10162/?time=1130) In the code tab there is a full code sample but it omits the part where the MoveCommandDirection actually determines what the next grid items to select is. private func selectRecipe( _ direction: MoveCommandDirection, layoutDirection: LayoutDirection ) { // ... } Considering that the LazyVGrid actually uses an adaptive layout, what is the correct way to determine the GridItem above or below the current selected GridItem? this is the full example the tutorial provides: struct ContentView: View { @State private var recipes = Recipe.examples @State private var selection: Recipe.ID = Recipe.examples.first!.id @Environment(.layoutDirection) private var layoutDirection var body: some View { LazyVGrid(columns: columns) { ForEach(recipes) { recipe in RecipeTile(recipe: recipe, isSelected: recipe.id == selection) .id(recipe.id) #if
1
0
483
Feb ’24
Reply to Add Network Extensions capability to iOS app without joining Apple Developer Program?
So is there a way to add a Network Extensions capability to an iOS app without joining the Apple Developer Program? No. The go-to reference for this is Developer Account Help > Reference > Supported capabilities (iOS). The rightmost column in the table lists the thing you can do with a free account (aka a Personal Team). Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: App & System Services SubTopic: Core OS Tags:
Feb ’24
FileManager Has Saved My Images - yet I cannot see / display them whenever I close and reopen the application.
So basically I can tell that the images are being saved by the system (it shows it on the debug terminal) however whenever I close, and then reopen the app the images firstly aren't there at all but also whenever I search the address name I saved them as... I have tried diagonsing the problem by changing UUID's, changing PNGs to JPGS - no matter what I do it does not show once the application has closed. I think it might have to do with how the image are .HEIF (apple's standard) but I don't have any concrete evidence to back this up. If anyone can help it would be greatly apperciated. import SwiftUI import MapKit import CoreLocation struct ContentView: View { @StateObject private var mapAPI = MapAPI() @State private var text = @State private var locationInfo: String = @State private var showLocationInfo = false @State private var imageUrls = [String]() // Array to store image URLs @State private var showImagePicker = false @State private var showCamera = false @State private var selectedImage: UIImage? @Sta
1
0
710
Jul ’23
size, color formatting of DatePicker
I'm experimenting with the relatively new (to me) compact DatePicker. I'd like a column of aligned fields, the first two on top are date pickers for user input, the ones below that are dates outputted in textfields calculated from dates input by user. In Interface Builder in Xcode, it looks mostly like I want it, black text centered in white rectangular text fields. But in production on my iPhone, the DatePickers are functional, but they are not centered and they appear on a gray background. I haven't been able to figure out what settings to adjust to make the DatePicker's date centered and on white background. Screenshots attached. Grateful for help. --JS
4
0
1.3k
Feb ’24
Preview Autogenerated Code Error
Hello, Very recently, the following code has automatically appeared at the bottom of three of my SwiftUI View files: @available(iOS 17.0, macOS 14.0, tvOS 17.0, visionOS 1.0, watchOS 10.0, *) struct $s10Accent_Ace33_0BADA584A03144EFDAB57154E6FD3FBALl7PreviewfMf_15PreviewRegistryfMu_: DeveloperToolsSupport.PreviewRegistry { static let fileID: String = Accent_Ace/HistoryView.swift static let line: Int = 47 static let column: Int = 1 static func makePreview() throws -> DeveloperToolsSupport.Preview { DeveloperToolsSupport.Preview { let randomWord1 = FetchWord.getRandomWord() let randomWord2 = FetchWord.getRandomWord() @State var randomWords = [Word(word: randomWord1.0, IPA: randomWord1.1, lineNumber: randomWord1.2), Word(word: randomWord2.0, IPA: randomWord2.1, lineNumber: randomWord2.2)] HistoryView(words: $randomWords) } } } This is from one of my files but it's very similar in the other two. It seems to have something to do with my previews. The problem is that this code generates an error: Ambigu
4
0
1.5k
Feb ’24
iPhone won't sync after iOS 17.2.1 upgrade
I have an iPhone 11 (MWJE2LL/A) for personal and development use. When I upgraded it to iOS 17.2.1 it stopped sync'ing to my computers. I can't sync or restore the iPhone. Both Finder and Music show the iPhone in the left column, but time out after 60 secs of Loading..., finally stating: The selected device could not be found. Xcode also does not see the connected iPhone, and does not list it in the available iOS build destinations. I have tried sync'ing using numerous Apple USB cables and computers (Mac Pro, 16 MacBook Pro, Mac Studio) all running macOS Sonoma 14.1. Is this a known bug in iOS 17.2? Is there a workaround so I can restore the iPhone and continue development work?
1
0
760
Jan ’24