Search results for

column

2,061 results found

Post

Replies

Boosts

Views

Activity

Swift Data value is duplicated between two variables in a class
I'm using two loops, one nested in another to create and assign a subclass to the parent class. I'm using x for one loop and y for the other loop. Print statement shows the loop variables being updated correctly, however the subclass has both variables as the same value. I'm not sure if the value is being stored as the same value or being displayed as the same value. I've checked both creation and display code. I can't find the error. var body: some View { NavigationSplitView { List { ForEach(routes) { item in NavigationLink { Text(Route: (item.route_name) nSeason: (item.route_season)nCoordinates: (item.route_coordinates)nProcessed: (String(item.route_processed))nNumber of baseboards: (item.route_baseboards.count)) } label: { Text(item.route_name) } //end route nav link } //end route for each .onDelete(perform: deleteItems) //end route nav ForEach(baseboards) { item in NavigationLink { //if let test = item.baseboard_heightPoints.count { Text(Grid Size: (String(item.baseboard_grid_size))nRow:(String(item.baseb
3
0
1.1k
May ’24
Lazyvgrid visual promblems after orientation change
I'm having issues with a Lazyvgrid displaying images after the screen orientation changes ( either from horizontal to portrait, or the reverse ) What happens is the images are not sized correctly. If 2 column , I see 1/3 of column 1 and the image in column 2 takes 2/3 of the screen width. Similar issues with 3 or 6 column layout. The Lazyvgrid is inside a ScrollView and thats inside a Tabview. I'v tried to trick an update by changing the column layout, the content mode (fit/fill) of the images, etc. but so far nothing has worked. Any suggestions ?, anyway to invalidate a lazyvgrid and have swiftui rebuild it ? Thanks.
1
0
570
May ’24
log stream command does not yield any events
We are having some trouble getting log stream to output events in real time from coreaudiod while we are in a zoom call or listening to audio. Repro steps: Open a Terminal window and execute log stream --predicate process=='coreaudiod' Create a zoom call, join it, stay for 10 seconds, leave the meeting Expected: audio events should show in log stream Terminal window Actual: no audio event shows Also, if after this test I execute log show --last 5m process=='coreaudiod' the events are showing; that is proof that coreaudiod actually emitted those events; Does anybody have any idea what could cause this? This happens on Sonoma 14.2.1, on an MBP M2 Max with 64GB memory. What we have looked at already: actually log stream does not show events from a lot of other procs on the machine; executing log stream --timeout 10s --style json | jq .[] | jq .processImagePath | sort | uniq -ic | sort --reverse yields only 3 sources (counts in the first column): 205 /kernel 10 /System/Library/CoreServices/ManagedClien
3
0
1k
Feb ’24
NavigationLinks to "Details" page do not work after data changes
I'm running into this error, when the underlying SwiftData object changes (gets an object added to it): * A NavigationLink is presenting a value of type “Project” but there is no matching navigationDestination declaration visible from the location of the link. The link cannot be activated. Note: Links search for destinations in any surrounding NavigationStack, then within the same column of a NavigationSplitView. * For instance, when I first fire up the simulator, clicking on any existing project correctly takes me to its details page. However, as soon as I add a new project or delete a project, none of the navigation links work any more. If I reload the simulator, they all work again! Makes me suspect it's an error with not recomputing the links when the underlying data change, but I can't figure out what I need to change, as everything looks correct. Any help would be appreciated! ContentView: struct ContentView: View { @Environment(.modelContext) var modelContext @Query(sort: Project.endDate) var
1
0
398
May ’24
Shopping cart count disappears after changing tabs
On my shop and content views of my app, I have a shopping cart SF symbol that I've modified with a conditional to show the number of items in the cart if the number of items is above zero. However, whenever I change tabs and back again, that icon disappears even though there should be an item in the cart. I have a video of the error, but I have no idea how to post it. Here is some of the code, let me know if you need to see more of it: CartManager.swift import Foundation import SwiftUI @Observable class CartManager { /*private(set)*/ var products: [Product] = [] private(set) var total: Int = 0 private(set) var numberofproducts: Int = 0 func count() -> Int { numberofproducts = products.count return numberofproducts } func addToCart(product: Product) { products.append(product) total += product.price numberofproducts = products.count } func removeFromCart(product: Product) { products = products.filter { $0.id != product.id } total -= product.price numberofproducts = products.count } } ShopPage.swift import Sw
4
0
1k
May ’24
UISplitViewController and UITabBarController in iOS 15 is always full screen
I'm reworking my app and update code and design. Because my app is one both iPhone and iPad, i'm using Splitview to handle the configurations. But my app has 4 section that I manage using a Tab bar and each tab has a SplitView. As you can see in images, the problem is that if I attach directly the UISplitViewController to UITabBarController you don't see two columns but only one (the primary or secondary view) both iPhone landscape orientation and iPad. A solution that I found is to attach the splitviewcontroller to a view that contains a ContainerViewController e connect the split view to this container. If you do this, you see the split view work correctly ma the problem is the customization of appearance (look at image 3) So may questions are: why I have to embed a split view in a container view controller and i can't connect it directly to tabbar as we done until now? Is there an other better solution then put a split view in a containerView? Thank you )
2
0
2.2k
Apr ’24
Reply to [bug report] Unicode characters with "variation selectors" are not rendered in the iPhone Safari browser (webkit) with iOS 17.3
This isn't working for the Variation Selector-15 (U+FE0E) for all the characters. Can you please apply that variation selector to all your Unicode characters? I) Steps to reproduce the issue: navigate in safari to the page https://eurovot.com/vs.htm II) Expected result: as the 1st column of characters have the Variation Selector-15 (U+FE0E) applied, and the 2nd column have the Variation Selector-16 (U+FE0F) applied, the first column should always display orange characters and the second column emoji characters. III) Error result: some characters are working fine in the 1st column and displayed as text in orange colour, but some other aren't displayed as text, but displayed as emojis instead.
Topic: Safari & Web SubTopic: General Tags:
Apr ’24
SKTextureAtlas Error
I am using the following code to create a texture atlas at runtime using a single .png image sprite sheet: func createSpriteTextureAtlas(atlasNumber atlas:Int, forWorld world:Int) { //load the png file let image = UIImage(named: world(world)_spritesheet(atlas)_2048x2048.png) //create the dictonary var imageDictionary = [String: UIImage]() //iterate through all rows and columns and get the subimage var imageIndex = 0 for row in 0...7 { for column in 0...7 { let sourceRect = CGRect(x:column * 256, y:row * 256, width:256, height:256) let sourceImage = image?.cgImage!.cropping(to: sourceRect) let subImage = UIImage(cgImage: sourceImage!) //add the sub image and name to the dictionary imageDictionary[(imageIndex)] = subImage imageIndex = imageIndex + 1 } } //create the texture atlas using the dictionary spriteTextureAtlas[atlas] = SKTextureAtlas(dictionary: imageDictionary) } I have a different sprite sheet for every world. I made all the sprite sheets myself using the same tool. This code works
2
0
922
Jan ’24
How to list Application hierarchy like Activity Monitor?
When I view processes in Activity Monitor's All Processes, Hierarchical view, it shows which processes launched other processes. For instance, if I have Network open inside System Preferences, then when I expand System Preferences, I see (irrelevant columns omitted):Process NamePIDSystem Preferences22033 com.apple.preference.network.remoteservice22043I.e. Activity Monitor knows that remoteservice was created by System Preferences.However, when I use 'ps' from the command line, both processes' parent PID values are 1 (launchd):$ ps -ww -o 'pid,ppid,command' -p 22033,22043PIDPPIDCOMMAND220331/Applications/System Preferences.app/Contents/MacOS/System Preferences220431/System/Library/PreferencePanes/Network.prefPane/Contents/XPCServices/com.apple.preference.network.remoteservice.xpc/Contents/MacOS/com.apple.preference.network.remoteservicesysctl(kern.proc.pid) is the same.How can I learn that remoteservice (pid 22043) was created by System Preferences (pid 22033)?This is OS X Yosemite 10.10.5, but I beli
2
0
1.6k
Dec ’15
Xcode (14 & 15 beta) not responding when creating a new project
I'm trying to use the Xcode 15.0 beta on macOS 13.4 (22F66) on a MacBook Pro 16 (2019) but whenever I try to start a new project, Xcode becomes unresponsive – seemingly indefinitely. In Activity Monitor I see Open and Save Panel Service (Xcode) (Not Responding): Even if I try to use Xcode 14.3.1 now I get the same problem. I've tried to resolve this by removing all Xcode-related files as well as the Xcode command line tools and reinstalling them but to no avail. I'd appreciate any and all help in how to fix this. EDIT: I have since found out that if I force-quit the bird process, Xcode will react again. But the bird process will start up and shoot to the top of the % CPU l column in Activity Monitor again almost instantly. It appears to be iCloud-related but I don't know what's causing it to take up so much CPU resources and make Xcode unresponsive, and how I can fix this.
4
0
2.7k
Sep ’23
Fixing offset in two axis ScrollView
Hi, I wrote the code below to demonstrate an issue I cannot handle, since I am very new to swiftui struct Cell: Identifiable { var id: UUID = UUID() var i: Int = 0 init(i: Int) { self.i = i } } struct ContentView: View { var columns: [GridItem] = [GridItem](repeating: GridItem(.fixed(40), spacing: 5), count: 60) var cells: [Cell] = [] init() { cells.removeAll() for i in 0..<180 { cells.append(Cell(i:i)) } } var body: some View { ScrollView([.horizontal, .vertical]) { LazyVGrid(columns: columns, spacing: 5) { ForEach(cells) { cell in ButtonView(cell: cell) } } } } } struct ButtonView: View { var cell: Cell @State var popOver: Bool = false var body: some View { Button { popOver.toggle() } label: { Text((cell.i)) } .popover(isPresented: $popOver, content: { Text(Information line of button (cell.i)).padding() }) } } #Preview { ContentView() } Running the code above, button clicks are not always work
3
0
426
Apr ’24
TabView's page style is broken on iOS 17.4
I have an infinite week scroller implemented using a TabView's page styling. basically when you scroll to the next week, it pre-loads the week after so that you can scroll infinitely. Since iOS 17.4, it seems to partially scroll two pages ahead. Scrolling backwards works fine. I made a radar: FB13718482 Here is a simplified implementation that has the issue reproduced. It uses the swift ordered collections library. Video of the issue: https://youtu.be/JW8dHqawURA import Foundation import OrderedCollections import SwiftUI struct ContentView: View { private let calendar: Calendar private let dateFormatter: DateFormatter @State var weeks: OrderedDictionary @State var selectedWeek: WeekView.Week.ID init() { let calendar = Calendar.autoupdatingCurrent self.calendar = calendar let formatter = DateFormatter() formatter.calendar = calendar formatter.dateFormat = MMM d dateFormatter = formatter // Setup initial week let currentDate = Date() let weekIdentifier = Self.weekIdentifier(for: currentDate, calendar: calendar)
1
0
536
Apr ’24