Search results for

column

2,062 results found

Post

Replies

Boosts

Views

Activity

Making table header opaque to scrolling rows in SwiftUI
I am working on converting an application I wrote for iOS from using UIKit to using SwiftUI. So far, it looks like I’ve been able to get just about everything working with SwiftUI except for one thing. I have a table view that displays several rows of information in a few columns. The table has a single header at the top containing titles for each column. However, there is an aspect of the table view that introduced an undesirable behavior. When scrolling the content, row scrolling upward would appear underneath the header row. The desire was to have the header row be opaque with regard to the table content yet still allow background content underneath the header to show through. In UIKit I ended up implementing a hack of sorts to prevent content of scrolling rows from appearing directly behind the header. To do this, during scrolling the code was calling the UITableView.rectForHeader method and applying a mask to the layer of any rows that might be intersecting that header rectangle. That m
1
0
684
Oct ’22
Reply to List is Disappearing
`struct ContentView: View { @Environment(.managedObjectContext) var moc @FetchRequest(sortDescriptors: [ SortDescriptor(.date) ]) var taxes: FetchedResults @State private var showingAddScreen = false // @EnvironmentObject var vm = ViewModel() @State var PDFUrls: URL? @State var showSheet: Bool = false @State private var selectedName: String? @State private var expanded: Bool = false let tax: Tax // @State private var items: [Any] = [] // @State private var sheet: Bool = false // let columns = [GridItem(.fixed(50)), GridItem(.fixed(50)), GridItem(.fixed(50)), GridItem(.fixed(50)), GridItem(.fixed(50))] var body: some View { // NavigationView { // VStack { VStack { HStack { // padding() EditButton() // .background(Color.yellow) .padding(.leading, 20) Spacer() Button { exportPDF { self } completion: { status, url in if let url = url, status { self.PDFUrls = url self.showSheet.toggle() } else { print(Failed to produce PDF) } } } label: { Image(systemName: square.and.arrow.up) //.background(Color.yellow)
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’22
Reply to Bug in StoreKit 2 in iOS 15.5-7
Hi, unfortunately this is an issue in Xcode 14.0. The issue is resolved in Xcode 14.1 RC, so if you build your app with that version it will be able to use these properties on iOS versions earlier than iOS 16.0. There is a workaround you can use to use these APIs in apps built with Xcode 14.0 and 14.0.1 listed in the Xcode 14.0 release notes, I'll quote it here: Using the following StoreKit properties and methods on apps with a minimum deployment target below iOS 16, macOS 13, watchOS 9, and tvOS 16 will cause the app to crash at launch when running on systems earlier than iOS 16, macOS 13, watchOS 9 and tvOS 16: priceFormatStyle and subscriptionPeriodFormatStyle on Product values environmentStringRepresentation and recentSubscriptionStartDate on Product.SubscriptionInfo.RenewalInfo values environmentStringRepresentation on Transaction values dateRange(referenceDate:) and formatted(_:referenceDate:) on Product.SubscriptionPeriod values (99962885) (FB11516463) Workaround: For each target using a StoreKit API l
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’22
Fit SwiftUI grid columns to the contents
My grids expand widthways to take up all the space it can. I can stick it in a frame and limit the size. But is there a way to get the columns to shrink to fit the contents plus padding? That would be neater, and probably more robust if the text changes size. FWIW most of my grids contain only text, and I don't use a lot of columns.
1
0
1.5k
Oct ’22
Reply to Passing an array into struct
Sorry this might be better than the previous post... var gameImport = 24,exam.dwindled.span,Short for examination,Reduced gradually in size,The total length of something from end to end,_ _ _ _ . _ w _ _ d _ _ d . _ _ _ n,16,///cracked.shadowed.private,The Vase was (?) when it toppled over,A part of the house is (?) by a tree every day,We like to talk in (?) when we want to keep it : secret,_ _ _ _ _ _ . _ _ _ _ _ _ . _ _ _ a t e,98,///spilling.dances.backbone,Causing or allowing liquid to flow over the edge : of its container,A series of steps that match the speed and : rhythm of a piece of music,The column of bones in the back which sustains : and gives firmness to the frame,_ p _ l l _ n . a _ c _ s._ a _ _ b _ n ,93,///inwards.habitat.buttered,Toward the centre or interior,Place where anything is commonly found,Covered or spread with butter, _ _ w _ r _ . a b t _ t._ u _ _ e _ e d, a e m x , d i l e n , p a s , d r a c c k e , d s a d o w e h , v r p i , g i s i , n d e , k o b c e , n s i a d ,
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Reply to Passing an array into struct
Thank you for your time 🙏🏻 This is what I have done in Playgrounds... var printCards = // No required if NOT printing the cards // Imported .csv file pasted in (var gameImport) below //////////////// var gameImport = 24,exam.dwindled.span,Short for examination,Reduced gradually in size,The total length of something from end to end,_ _ _ _ . _ w _ _ d _ _ d . _ _ _ n,16,///cracked.shadowed.private,The Vase was (?) when it toppled over,A part of the house is (?) by a tree every day,We like to talk in (?) when we want to keep it : secret,_ _ _ _ _ _ . _ _ _ _ _ _ . _ _ _ a t e,98,///spilling.dances.backbone,Causing or allowing liquid to flow over the edge : of its container,A series of steps that match the speed and : rhythm of a piece of music,The column of bones in the back which sustains : and gives firmness to the frame,_ p _ l l _ n . a _ c _ s._ a _ _ b _ n ,93,///inwards.habitat.buttered,Toward the centre or interior,Place where anything is commonly found,Covered or spread with butter, _ _ w _
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Develop In Swift Explorations - Unit 1 Build
In Part 1 of Unit 1 Build Students must set up the project using the App template feature. On page 55 the viewer window shows in the left column a list of files that should be in the photo frame. These include: AppDelegate, SceneDelegate, ViewController, Main, Assets and LaunchScreen. I can see this on my computer, however when my students follow the same steps. They only see the files name ad ContentView What are we doing wrong?!
3
0
800
Oct ’22
Reply to Implementing a cursor on both a cell and a row while using NSTableView
I forgot to show how to call this func: func control(_ control: NSControl, textView: NSTextView, doCommandBy commandSelector: Selector) -> Bool { // 1. get row and column, multiplexed in sender's tag guard let textField = control as? TextField else { return false } let rowIndiv = textField.tag % (256 * 256) let colVar = (highWordTag - rowIndiv) / (256 * 256) selectedRowInDataTable = rowIndiv // a var of the class selectedColInDataTable = colVar // var of the class if commandSelector == #selector(NSResponder.insertNewline(_:)) { doMovement(.return) return true } if commandSelector == #selector(NSResponder.cancelOperation(_:)) { doMovement(.cancel) return true } if commandSelector == #selector(NSResponder.moveDown(_:)) { doMovement(.down) return true } if commandSelector == #selector(NSResponder.moveUp(_:)) { doMovement(.up) return true } if commandSelector == #selector(NSResponder.insertTab(_:)) { doMovement(.tab) return true } if commandSelector == #selector(NSResponder.insertBacktab(_:)) { doMove
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’22
Reply to Implementing a cursor on both a cell and a row while using NSTableView
Yes you can. I implemented something similar in an app. nbIndividus is the number of rows, nbVariables is number of columns. selectedRowInDataTable and selectedColInDataTable are global var in the class. I just copy the code, you would have to adapt of course. func doMovement(_ mouvement: NSTextMovement) { if selectedRowInDataTable < 0 || selectedColInDataTable < 0 { return } var newRow = selectedRowInDataTable var newCol = selectedColInDataTable switch mouvement { // return as down case .return : newRow += 1 if newRow >= nbIndividus { newRow = nbIndividus - 1 ; playLightBeep() } case .tab : newCol += 1 if newCol >= nbVariables { newCol = 0 ; playLightBeep() } case .backtab : newCol -= 1 if newCol < 0 { newCol = nbVariables - 1 ; playLightBeep() } case .down: newRow += 1 if newRow >= nbIndividus { newRow = 0 ; playLightBeep() } case .up: newRow -= 1 if newRow < 0 { newRow = nbIndividus - 1 ; playLightBeep() } default: break } dataTableView?.selectRowIndexes([], byExtendingSelecti
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’22
Reply to App Crashes in iOS 16. Unable to find crash reason
But after symbolicating I found these runtime.mach_msg_trap + 36, runtime.mach_msg + 80. Wha!?! The second column of thread 4’s backtrace shows that these symbols are coming from Freshsales, you’re app’s Mach-O image. It sounds like you’re using third-party tooling that’s making system calls directly. This is not supported on any Apple platform. If you want to make a system call, you must call the relevant routine exported by libSystem. I recommend that you escalate this with the tool’s vendor. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Sep ’22
How to sort NSTableView Date Column?
I have a date column in a macOS NSTableView column in YYYY-MM-DD format and when using the code below the sort does not sort way I want. When sorting ascending. It has the year correct but the month is in reverse order. See image below. How can I fix this? func sortInvoices(invoiceColumn: String, ascending: Bool) { enum SortOrder { static let Date = invoiceDateCreated static let Number = invoicenumber static let Customer = invoicecustomer static let Status = invoicestatus } switch invoiceColumn { case SortOrder.Date: invoices.sort { (p1, p2) -> Bool in guard let id1 = p1.invoiceDateBilled, let id2 = p2.invoiceDateBilled else { return true } if ascending { return id1 < id2 } else { return id2 < id1 } }
1
0
914
Sep ’22
Reply to How to sort NSTableView Date Column?
I changed the code to convert date to an integer and that worked for me as well changed to a different column. let dateFormatter = DateFormatter() dateFormatter.dateFormat = YYYYMMdd dateFormatter.locale = Locale(identifier: en_US_POSIX) invoices.sort { (p1, p2) -> Bool in let p1Date: Int? = Int(dateFormatter.string(from: p1.invoiceDateCreated!)) let p2Date: Int? = Int(dateFormatter.string(from: p2.invoiceDateCreated!)) guard let id1 = p1Date, let id2 = p2Date else { return true } if ascending { return id1 < id2 } else { return id2 < id1 } }
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’22
Guideline 2.1 - Performance - App Completeness We continue to see the same bug in your app. Specifically, an activity indicator kept spinning indefinitely when we attempted to login with the demo credentials provided. Please review the details below
My app is developed with flutter and firebase Auth My app has been uploaded 10 times before and the reviewers reject it because of this reason Guideline 2.1 - Performance - App Completeness We continue to see the same bug in your app. Specifically, an activity indicator kept spinning indefinitely when we attempted to login with the demo credentials provided. Please review the details below and complete the next steps. Review device details: Device type: iPhone OS version ios 16.0I think this is because it does not send a request to Firebase to request a verification code (OTP) T his is my code body: controller.isSendingCode ? Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: const [ CustomLoader(), SizedBox(height: 50), Center( child: Text( 'يتم الان إرسال رمز التحقق', style: TextStyle(fontSize: 25), ), ), ], ) code-block
1
0
698
Sep ’22