Search results for

column

2,047 results found

Post

Replies

Boosts

Views

Activity

How to update data in a DataFrame
My project loads a CSV into a DataFrame and displays it in a Table (a MacOS app). So far so good ... but when trying to update a value in a column, I dont see anyway to update this value. The table gets the value for the column like this: func getColumnValue(row :DataFrame.Rows.Element, columnName :String) -> String { if row.base.containsColumn(columnName) { var value = if row[columnName] != nil { value = (row[columnName]!) } return value } ... But the documentation and googles dont show any way to update the same column. Any help is appreciated with cookies. Attempt to update: func setColumnValue(row :DataFrame.Rows.Element, columnName :String, value :String) { var column: [String?] = data[columnName] column[row.id] = value ... }
6
0
654
Nov ’24
mp3 audio plays on my device and simulator but some users have issue
Hi I just released an app which is live. i have a strange issue: while the audio files in the app play fine on my device, but some users are unable to hear. One friend said it played yesterday but not today. Any idea why? The files are mp3, I see them in Build Phase, and in the project obviously. Here's the audio view code, thank you! import AVFoundation struct MeditationView: View { @State private var player: AVAudioPlayer? @State private var isPlaying = false @State private var selectedMeditation: String? var isiPad = UIDevice.current.userInterfaceIdiom == .pad let columns = [GridItem(.flexible()),GridItem(.flexible())] let tracks = [Intro:intro.mp3, Peace : mysoundbath1.mp3, Serenity : mysoundbath2.mp3, Relax : mysoundbath3.mp3] var body: some View { VStack{ VStack{ VStack{ Image(dhvani).resizable().aspectRatio(contentMode: .fit) .frame(width: 120) Text(Enter the world of Dhvani soundbath sessions, click lotus icon to play.) .font(.custom(Times New Roman, size: 20)) .lineLimit(nil) .multilineTextA
1
0
337
Nov ’24
SpriteKit: SKTileMap leaks with `SKTexture(rect: CGRect)` usage
Hello reader, I am facing an issue that I am not able to resolve. I have been able to create a demo project that demonstrates the issue, which I hope enables you to have a look as well and hopefully find a way to resolve it. What is the issue: I am using SKTileMapNode in order to draw tile maps. Instead of using the tilesets as you can use from within the Xcode editor, I prefer to do it all programmatically using tilesheets (for a plethora of reasons that I will leave out of this equation). This is the code of the gameScene: import SpriteKit import GameplayKit class GameScene: SKScene { private let tileSize = CGSize(width: 32, height: 32) override func didMove(to view: SKView) { super.didMove(to: view) let tileSet = createTileSet() let tileMap = SKTileMapNode(tileSet: tileSet, columns: 100, rows: 100, tileSize: tileSize) for column in 0.. SKTileSet { let tileSheetTexture = SKTexture(imageNamed: terrain) var tileGroups = [SKTileGroup]() let relativeTileSize = CGSize(width: tileSize.width/tile
2
0
685
Nov ’24
Potential Issue in "Display Distinct Layouts Per Section" Documentation Example
Hi everyone, I was exploring the Display Distinct Layouts Per Section section of the Apple documentation and noticed a potential issue in the example code provided. Specifically, in the createLayout method of the TwoColumnViewController in the sample project, the item size appears to be incorrectly described. The documentation states that the item size is ignored because the items are organized in columns, but in practice, the size is considered. When running the sample project without any modifications, the layout doesn't behave as described or expected. Here’s what I observed: The items are not displayed as intended in a two-column layout. Modifying the item size explicitly affects the layout, contrary to the documentation's claim that the size is ignored. This seems to be a mismatch between the documentation and the actual implementation. Could this be clarified or corrected? Has anyone else encountered this issue? If so, are there any recommended adjustments to the sample code to achieve
Topic: UI Frameworks SubTopic: UIKit
0
0
259
Nov ’24
Reply to App Icon Shows Black Background in iOS 18 Settings Dark Mode
Step-by-Step Guide to Fixing the Issue 1- Open Your Project in Xcode 16 or Higher Make sure you have updated to Xcode 16 to access the new features. 2- Navigate to the App Icon Asset In the project navigator, go to Assets.xcassets and select your AppIcon asset. 3- Add Appearance Options In the App Icon editor, you will see a new “Appearance” column. By default, this is set to “None.” Click the “+” icon and add both “Light” and “Dark” options. 4- Configure the Icons for Each Appearance For the “Light” appearance, use your existing app icons. For the “Dark” appearance, you can use the same icons as the Light mode. Simply copy the icons and paste them into the corresponding slots under the “Dark” column. 5- Test the Changes Run the app on a device with iOS 18 and toggle between Light and Dark modes to ensure the icons appear correctly in all scenarios, including the home screen and the iOS Settings app. 6- Build and Deploy Once you confirm that the app icon looks good in both modes, build and d
Nov ’24
[iOS 18.2 Beta] LazyVGrid within NavigationStack breaks animations
Hello. There seems to be a bug specifically in the iOS 18.2 (both Beta 1 and 2) and not seen in the previous versions. The bug is: when LazyVGrid is nested inside NavigationStack and some elements of the LazyVGrid have animations, navigating into any nested view and then going back to the initial view with the LazyVGrid causes all animations to stop working. Here is the example code inline: struct ContentView: View { @State private var count: Int = 0 var body: some View { NavigationStack { LazyVGrid( columns: Array( repeating: GridItem(spacing: 0), count: 1 ), alignment: .center, spacing: 0 ) { VStack { Text(String(count)) .font(.system(size: 100, weight: .black)) .contentTransition(.numericText()) .animation(.bouncy(duration: 1), value: count) Button(Increment) { count += 1 } NavigationLink(destination: { Text(Test) }, label: { Text(Navigate) }) } } } .padding() } } Once you run the application on iOS 18.2 Beta (I've tried on a real device only), the steps to reproduce are: Tap on the Increment butt
8
0
949
Nov ’24
HStack required to get columns in a Grid
I've looked at lots of Grid examples. I've seen it documented that views within a GridRow are treated as if they were in an HStack. That's not happening for me. I have to explicitly put them into an HStack or they are treated as new rows. Here's my code: @State private var gridRows : Int = 4 @State private var gridCols : Int = 2 @State private var myItems : [Int] = Array(0...8) var body: some View { Group { if myItems.count > 0 { ScrollView([.vertical]) { Grid(alignment: .leading) { ForEach(0..<<--- { ForEach(0..
Topic: UI Frameworks SubTopic: SwiftUI
2
0
317
Nov ’24
Errors reported by content of WKWebView (via window.onerror) are censored to "Script error.""
Script error. We've decided to implement certain highly-dynamic content in out iOS codebase using web technologies, here's what we're doing: We download a zip file containing html, javascript, and images. We unzip the archive, construct a WKWebView, and load the content using webView.loadFileURL(indexHtmlUrl, allowingReadAccessTo: parentDirectory) This works fine, but we'd also like to be notified on any rendering errors that might be raised, so we can fix them. let errorHandlerScriptString = (function() { var oldLog = console.log; console.log = function(message) { window.webkit.messageHandlers.consoleLog.postMessage(message); oldLog.apply(console, arguments); } })(); // don't even allow asking for location permissions navigator.geolocation.getCurrentPosition = function(success, error, options) { error({ PERMISSION_DENIED: 1, code: 1 }); }; window.onerror = (msg, url, line, column, error) => { const message = { message: msg, url: url, line: line, column: column, error: JSON.stri
Topic: Safari & Web SubTopic: General Tags:
2
0
574
Nov ’24
Reply to Mac Issue with Developer ID certificate and Sign in with Apple capability
Sign in with Apple is not supported in Developer ID apps. The go-to reference for this stuff is Developer Account Help > Reference > Supported capabilities (macOS). Note that Sign in with Apple is not available in the Developer ID column. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Nov ’24
Page view in SwiftUI
I have an app for musicians that works with Songs and Setlists. The logical structure is as follows: A Setlist contains Songs. A Song has Sections, which include Lines (chords & lyrics). I want to view my Setlist in a Page View, similar to a book where I can swipe through pages. In this view, the Song Sections are wrapped into columns to save screen space. I use a ColumnsLayout to calculate and render the columns, and then a SplitToPages modifier to divide these columns into pages. Problem: The TabView sometimes behaves unexpectedly when a song spans multiple pages during rendering. This results in a transition that is either not smooth or stops between songs. Is there a better way to implement this behavior? Any advice would be greatly appreciated. struct TestPageView: View { struct SongWithSections: Identifiable { var id = UUID() var title: String var section: [String] } var songSetlistSample: [SongWithSections] { var songs: [SongWithSections] = [] //songs for i in 0...3 { var
0
0
367
Nov ’24
Reply to Error I can't seem to fix
You haven't posted enough context. If you click on the Report navigator icon (the rightmost icon at the top of the left column in Xcode, which looks like a hierarchical list), you can see the full build log, which should help you to fix errors like these. With what you've posted, we can't see the name of the first missing file. The second missing file may be missing because the first is missing, and that in turn may be due to something reported only as a warning in the detailed build log.
Oct ’24
Reply to macos menu bar color picker not working properly
First of all, thank you for your response. Since I have just started with SwiftUI, please don't mind my beginner mistakes regarding the color selection. I have shared all my codes import SwiftUI import AppKit struct RenkSecimi: View { @Binding var renk1: Color @Binding var renk2: Color @ObservedObject var short : TimerModel @State private var renkGoster = false var body: some View { Form { VStack(alignment: .center, spacing: 20) { HStack(alignment: .center) { ColorPicker(Color 1,selection: $renk2) .padding() .background(.gray) .clipShape(RoundedRectangle(cornerRadius: 10)) .shadow(radius: 2) .onTapGesture { renkGoster.toggle() } ColorPicker(Color 2, selection: $renk1) .padding() .background(.gray) .clipShape(RoundedRectangle(cornerRadius: 10)) .shadow(radius: 2) .onTapGesture { renkGoster.toggle() } } VStack(spacing: 10){ Picker(Short Break, selection: $short.shortBreakDuration) { ForEach(5...11, id: .self) { i in Text((i) Dk).tag(i * 60) } .onChange(of: short.shortBreakDuration) { oldValue, newValue in short
Oct ’24