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
Search results for
column
2,061 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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:
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
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:
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
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
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:
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:
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:
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
I have a tableview with a column which has an inner tableview. I want to change height of the outer tableview to match the height of the inner tableview. outerTableView.reloadData() let range = outerTableView.rows(in: summaryTableView.superview!.visibleRect) outerTableView.noteHeightOfRows(withIndexesChanged: IndexSet(integersIn: range.lowerBound..
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?
With the deprecation of the airport binary in macOS 14.4 I am re-writing my own network tool to directly use CoreWLAN. In doing this and testing and comparing to previous results from the Apple airport binary under various versions of macOS I believe CoreWLAN has a 'bug' which as a result was exhibited in the Apple airport binary and equally my own code. As detailed below. This applies to the release version of macOS 14.4 (23E214) macOS Sonoma 14.3.1 and previous versions of macOS going back many, many years have included an official Apple binary at the following location. /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport Whilst this is now officially deprecated in macOS 14.4 it is obvious that this tool will have itself been utilising the official Apple framework CoreWLAN. As part of the process of re-writing my own tool which formerly used the above Apple binary, I have re-written my tool to directly utilise CoreWLAN myself via the Objc interface. In doing this I have been
Code to reproduce: struct CrashView: View { var body: some View { ScrollView { LazyVStack { ForEach(0...100, id: .self) { i in LazyVGrid(columns: Array(repeating: .init(.fixed(100)), count: 3), content: { ForEach(0...20, id: .self) { i in Color.red.opacity(Double(i + 1) / 20).frame(height: 300) } }) } } } } } Important: it crashes on iOS 16.1 !!! We have 21 grid item (3 item and 7 full lines) for every LazyVStack item. Scroll it until 5 LazyVStack item. Start scrolling to top. It blinks and show incorrect count: you see that it shows 1 item in line, but it is impossible. If you continue scrolling app crashes.
It would be much easier to debug if you provided your document, your explanation of what you are trying to achieve is not super clear to me. I assume you start with no data in sheet 2 and you don't care that I'm overwriting data in sheet 2 - is this true? Anyway, please go through this code and read the comments. It takes maybe 2-3 minutes on my computer to finish the script. tell application Numbers activate -- the following code is just to show you how do I think your document looks like make new document tell front document -- there should already be one sheet, let's rename it to GAMES set name of active sheet to GAMES -- create sheet TRIALS2 -- this should also create table 1 make new sheet set name of active sheet to TRIALS2 -- making sure table 1 has at least 67 rows, otherwise we cannot access row 67 if (row count of table 1 of sheet GAMES < 67) then set row count of table 1 of sheet GAMES to 67 end if -- making sure table 1 has at least 2 columns, otherwise we cannot access column
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags: