Search results for

column

2,047 results found

Post

Replies

Boosts

Views

Activity

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.6k
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
415
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
512
Apr ’24
Anyway to specify a unique constraint in Cloudkit record?
I see in CKError.h there is an error: CKErrorConstraintViolation.Is there a way to specify a unique constraint for a column in a CloudKit record?The only part of a CloudKit record that enforces uniqueness as far as I can is recordName (which is specified via CKRecordID). This has limitations though. One being recordName must be 255 characters or less. For the most part, using user input on some field which must be unique in a user created record can be used as a record name to ensure uniqueness. In most cases, this will be under 255 characters but not always though.During testing, I'm just using a hash string for the record name, which will fit in 255 characters:NSString *someStringThatRepresentsUniqueValue = //... NSString *ckRecordName = [NSString stringWithFormat:@%lu,someStringThatRepresentsUniqueValue.hash];But my concern with this is if that the implementation of hash could change in an OS update. Yea, I could hash myself, but my question still stands: is there no way to just make a unique cons
9
0
2.2k
Nov ’19
Reply to iOS 17.0 Webkit 'display:flex' issue
I'm late on this topic, but I'm stuck with the same issue here, with inline-flex. Deactivating and reactivating through the web inspector makes them appear. This problem only occurs since iOS 17.4, precisely. Also present in iOS 17.5. The code is: 我 Wǒ and the faulty CSS: .ttPhrase .ruby { display: inline-flex; flex-direction: column; justify-content: flex-end; text-align: center; } The chinese characters don't appear at first, but they appear after disabling/re-enabling the inline-flex through the web inspector.
Topic: Safari & Web SubTopic: General Tags:
Apr ’24
SwiftUI Table sorts only the first column if the data is loaded later
All examples regarding SwiftUI Tables and sorting work fine, but they also have all the data available immediately. If I load the data in .task, sorting only works on the first column. Test data: struct Customer: Identifiable { let id = UUID() let name: String let email: String let creationDate: Date } func parseDate(from text: String) -> Date { let formatter = DateFormatter() formatter.dateFormat = dd/MM/yyyy return formatter.date(from: text) ?? Date() } func getTestData() -> [Customer] { return [ Customer(name: John Smith, email: john.smith@example.com, creationDate: parseDate(from: 04/11/2015)), Customer(name: Jane Doe, email: jane.doe@example.com, creationDate: parseDate(from: 29/04/2009)), Customer(name: Bob Johnson, email: bob.johnson@example.com, creationDate: parseDate(from: 01/08/2010))] } And here the view: table 1 populates the array in the initializer table 2 loads the content in .task, initially it is empty table 3 loads the content in .task, initially it contains one dummy object
1
0
663
Apr ’24
Reply to iPad attempting to import Journaling Suggestions
As an update to @eskimo 's response, There's a few cases here: Case #1: Building for the simulator. Case #2: Building for a real device, but running on a device where the framework isn't present (eg: iPad, Mac) Case #3: Building for an iOS version before iOS 17.2 where the framework isn't available For case #1: use #if canImport(JournalingSuggestions) like this: #if canImport(JournalingSuggestions) import JournalingSuggestions #endif Then, in your code where you use JournalingSuggestionsPicker, check if you can import it first. This way, if you're not building for a real device, the framework will not be imported. For case #2: Since you're building for a real device, the framework can be imported. Since it's not an iPhone, your app will crash when run. Protect against this by first checking if you can import UIKit, then setting isJournalingSuggestionsAvailable to be true if you're on an iPhone. If you're on Mac, where UIKit can't be imported, isJournalingSuggestionsAvailable will be false anyways. For example
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’24
SwiftUI dropDestination location in a grid
I've put together a simplified code example to test how the location of dropDestination works within a Grid View. When I attach dropDestination to Grid, GridRow or the Text((row) , (column)) view, I get a CGPoint corresponding to the drop location within the views coordinate space. But the problem is how would I get the either the index of a grid cell eg. (1, 1) or the grid cell view itself? Apple's documentation regarding drag and drop in SwiftUI says to prefer using transferable items which I interpret as them recommending dropDestination over the older onDrop with an NSItemProvider. But unlike in a List view there doesn't seem to be away for location to return discrete values. If I instead attach dropDestination to a one of the nested ForEach loops within the Grid view, the drop gesture doesn't do anything? Also dropDestination exhibits some default behaviour that I don't want. When dragging a view a little plus symbol within a green circle appears Views can be dragged and dropped out of the apps
1
0
1.8k
Jun ’23
Football League calendar display view
Dear all, I'm quite new to SwiftUI and I'm trying to build my first app. I have a data model file like the one below (I'm just posting a portion of it): import Foundation struct CalendarioPartite: Identifiable, Hashable, Equatable { let id = UUID() let stagione: String let giornata: Int let datapartita: String let squadracasa: String let golsquadracasa: Int let squadratrasferta: String let golsquadratrasferta: Int init(stagione: String, giornata: Int, datapartita: String, squadracasa: String, golsquadracasa: Int, squadratrasferta: String, golsquadratrasferta: Int) { self.stagione = stagione self.giornata = giornata self.datapartita = datapartita self.squadracasa = squadracasa self.golsquadracasa = golsquadracasa self.squadratrasferta = squadratrasferta self.golsquadratrasferta = golsquadratrasferta } static func testCalendario() -> [CalendarioPartite] { [CalendarioPartite(stagione: 2023/2024, giornata: 1, datapartita: 04/09/2023, squadracasa: Castelnovese Castelnuovo, golsquadracasa: 1, squadratrasferta: J
3
0
689
Apr ’24
Reply to Football League calendar display view
Dear @darkpaw, I've done exactly what you suggested and got pretty good results from a data retrieval point of view (I'm displaying correctly the four football league days with the proper teams and results). Here below the code modification I've done: import SwiftUI struct CalendarioView: View { @State var Calendario: [CalendarioPartite] = CalendarioPartite.testCalendario() @State var stagione: String = 2023/2024 @State var totalePartite: Int = 4 private var giornate = Array(1...4) private let adaptiveColumn = [GridItem(.adaptive(minimum: 1500))] var partiteCampionato: [CalendarioPartite] { CalendarioPartite.testCalendario().filter{ $0.stagione == stagione } } var body: some View { ScrollView(.vertical) { LazyVGrid(columns: adaptiveColumn, spacing: 20) { ForEach(giornate, id:.self) { giornata in // Inizio schermata Giornata VStack { var partiteGiornata: [CalendarioPartite] { partiteCampionato.filter { $0.giornata == giornata } } Text(Giornata (giornata)) .fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to Failed to product diagnostic error
I think the main error comes from a missing NavigationStack in RosaView. And you should have rosa In addition, I had to test on an iPad in order for Table to show columns names and all columns (see here: https://stackoverflow.com/questions/75277014/swift-table-only-show-1-column) Finally, I made a few changes before it works ok. Please test and tell if that works for you, otherwise, explain what is failing. struct Rosa: Identifiable, Codable, Hashable, Equatable { var id = UUID() let stagione: String let nomeGiocatore: String let cognomeGiocatore: String let nascitaGiocatore: String let etàGiocatore: Int let ruoloGiocatore: String init(stagione: String, nomeGiocatore: String, cognomeGiocatore: String, nascitaGiocatore: String, etàGiocatore: Int, ruoloGiocatore: String) { self.stagione = stagione self.nomeGiocatore = nomeGiocatore self.cognomeGiocatore = cognomeGiocatore self.nascitaGiocatore = nascitaGiocatore self.etàGiocatore = etàGiocatore self.ruoloGiocatore = ruoloGiocatore let
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to Compatibility Inquiry: 8BitDo Ultimate 2.4G Wireless Controller on macOS
I do not believe Firefox, Google Chrome, or other Chromium-based browsers use the native macOS Game Controller framework. As such these browsers must add support for gamepads individually, and Nintendo controllers are popular enough that they get supported by all. If you are running macOS Sonoma, you can try turning on the 'Increase controller compatibility' option for your 8BitDo Ultimate 2.4G Wireless Controller. Open the system Settings app, navigate to the Game Controller settings, click on your 8BitDo Ultimate 2.4G Wireless Controller in the list, use the (+) button at the bottom of the left column to add app-specific customizations for Firefox/Chrome, and toggle ON the 'Increase controller compatibility' switch. This will result in the 8BitDo Ultimate 2.4G Wireless Controller appearing as an Xbox controller to Firefox/Chrome, if Firefox/Chrome support Xbox controllers.
Topic: Graphics & Games SubTopic: GameKit Tags:
Mar ’24
DataFrame's Column doesn't support array of dictionary
I'm following Apple WWDC video (https://developer.apple.com/videos/play/wwdc2021/10037/) about how to create a recommendation model. But I'm getting this error when I run the project on that like of code from their tutorial. Column keywords has element of unsupported type Dictionary. Here is the block of code took from the transcript of WWDC video that cause me issue: func featuresFromMealAndKeywords(meal: String, keywords: [String]) -> [String: Double] { // Capture interactions between content (the dish keywords) and context (meal) by // adding a copy of each keyword modified to include the meal. let featureNames = keywords + keywords.map { meal + : + $0 } // For each keyword, create an entry in a dictionary of features with a value of 1.0. return featureNames.reduce(into: [:]) { features, name in features[name] = 1.0 } } var trainingKeywords: [[String: Double]] = [] var trainingTargets: [Double] = [] for item in userPurchasedItems { // Add in the positive example. trainingKeywords.append( featur
4
0
1.1k
Jan ’24
How let scroll event 'sink' to parent view?
I have an uncommon scenario here. outer tableview +--------------------------+ | column 1| inner tableview| +--------------------------+ Now most often the out tableview has many rows and vertical scrollbar visible. When user try to scroll vertically in the inner tableview but it has no vertical scrollbar (because it has only a few items), I want the scroll event sink into its parent view or better outer tableview, so that user does not have to move cursor to first column in outer tableview and scrolls. Is this possible?
1
0
806
Mar ’24