Search results for

column

2,050 results found

Post

Replies

Boosts

Views

Activity

Reply to how to input user data from a tableview
I'm not sure I made my problem clearWhile I set the values in the table using the tableView method I'm allowing the user to change the values in the tableview by making the cells in the second column editable.I want to know how to retrieve the new values the user has entered from the table.I notice there are two versions of the tableView function. the first is called by the tableview to populate the cells.I'm unclear as to how/when the second version of the function is called:func tableView(tableView: NSTableView, setObjectValue object: AnyObject?, forTableColumn tableColumn: NSTableColumn?, row: Int) { an example of how to get the value for row n, column i of a tableview would be appreciated.Thanks for your help!
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’16
Reply to NavigationSplitView No Toggle Button
Why is there no toggle button above? What do you mean by toggle button? Do you mean the button that hides and shows the sidebar? This is only present when the horizontalSizeClass is .regular. On an iPhone in portrait mode, it won't appear. ‎ And why is the menu always showing? What menu are you talking about? ‎ I cant see the detiail view anymore If you want to see the detail view, you need to select an item from the list. As I said before, the two-column layout with the sidebar toggle button is only present when the horizontalSizeClass is .regular. In your screenshot (an iPhone in portrait mode) the NavigationSplitView collapses down to a single column layout and acts more like a NavigationStack.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Reply to Print something on the screen
I'm trying to do it in Swift Playgrounds and here's my code: import PlaygroundSupport let columns: [GridItem] = [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())] struct ContentView: View { var body: some View { GeometryReader { geometry in VStack { Spacer(minLength: 290) Text(text) .font(.largeTitle) ZStack { LazyVGrid(columns: columns) { Group { Button { } label: { ZStack { Circle() .frame(width: 90, height: 90) .foregroundColor(Color(.systemBlue)) .opacity(0.5) //.position(x: geometry.size.width/2, y: -100) Text(5) .font(.largeTitle) .bold() .foregroundColor(.black) } .frame(width: 90, height: 90) } } } } } } } } PlaygroundPage.current.setLiveView(ContentView()) I've created a text and I would like that the text will change on the press of the button. For example: there's a Text() witch now has written on it text and when I press the blue button (you can see it in my code), I want text to change to number 5
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to Delete items in collection view with custom layout
I edited with <> to make it more readableimport UIKit class testVCViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, ImagesCVLayoutDelegate { @IBOutlet weak var cv: UICollectionView! @IBOutlet weak var btn: UIButton! @IBAction func btn(_ sender: UIButton) { items.remove(at: 0) cv.deleteItems(at: [IndexPath(row: 0, section: 0)]) // THIS IS WHERE THE WARNINGS AND ERROR OCCUR. cv.reloadData() } var items = [1,2,3,4,5,6,7,8,9] // Data source. func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return items.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cell, for: indexPath) as! zCollectionViewCell cell.lbl.text = (items[indexPath.row]) return cell } func numberOfSections(in collectionView: UICollectionView) -> Int { return 1 } func co
Topic: Programming Languages SubTopic: Swift Tags:
May ’18
Reply to NSTableView not setting the content right
Actually, I was able to get the content displayed. Following guide was helpful although different then what is current working:https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/TableView/PopulatingView-TablesProgrammatically/PopulatingView-TablesProgrammatically.htmlI then had to match the identifier of the cell with the column.
Topic: UI Frameworks SubTopic: AppKit Tags:
Oct ’16
Reply to Checkbox in NSTableView
So I start off with a structure like so:Table ColumnTable Cell View Table View Cell Table View Cell Number FormatterText CellTable ColumnTable Cell View Table View Cell <=- I delete this one Table View CellText CellSo I then delete the one that I pointed at, which is the one I think you're telling me to, so it and the one child go away. Now I drag a check cell into that second column, and then suddenly stuff from other columns disappear as well, and I'm left with this:Table ColumnText CellTable ColumnCheckWhat did I do wrong?
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’16