Post

Replies

Boosts

Views

Activity

Reply to low-level graphic programming in C++
Metal runtime is strongly and tightly coupled with the Apple's UI frameworks -- intended to be used with ObjC or Swift. So, you should better give up the option -- hack my way to Metal in C++. Meaning use openGL anyway and cry when it will no longer works ? (meh) would be the only options if you insist on denying to learn ObjC or Swift. And Deprecated in Apple's frameworks means that it is not recommended to use it any more and will be removed at any time in the future. So, if your M1 Mac can run OpenGL apps currently, it would work for a while -- an unpredictable period. It may be months or less, or years.
Topic: Graphics & Games SubTopic: General Tags:
Oct ’21
Reply to Static method 'buildBlock' requires that 'Group' conform to 'View'
As far as I read the messages, it looks like you have another type named Group (which is an NSManagedObject -- Core Data entity) in your project. Please try something like this: struct LostFindView: View { var body: some View { VStack { SwiftUI.Group { //<- Text("1") Text("2") Text("3") Text("4") Text("5") Text("6") Text("7") Text("8") Text("9") Text("10") } Text("11") } } } Please use Code Block when you show some code, better read the hint from @robnotyou.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’21
Reply to Cannot find 'PhotogrammetrySession' in scope
I am running xcode 13, and I am on MacOS 12.0 Beta (21A5522h). If you are using the released version of Xcode 13, it does not contain macOS SDK 12, which is needed to build the object capture command line program example. https://developer.apple.com/download/release/ Xcode 13 Xcode 13 includes everything you need to create and submit apps to the App Store for all Apple platforms. It Includes the SDKs for iOS 15, iPadOS 15, watchOS 8, tvOS 15, and macOS Big Sur. To continue developing apps for macOS Monterey, use Xcode 13 beta 5. If you want to try it now, you need to get Xcode 13 beta 5. Or else, you may need to wait till the new version of Xcode 13, that contains macOS SDK 12, will be released.
Topic: Graphics & Games SubTopic: General Tags:
Sep ’21
Reply to UITableView refresh issue
Thanks for showing your code. There are many things I do not see, but as far as I check the currently shown parts of your code, you need to keep two properties glimpse and lastDocument consistent. When you remove all the elements from glimpse, you need to set lastDocument to nil. glimpse.removeAll(keepingCapacity: false) lastDocument = nil //<- There may be other parts you need to fix, frankly I do not understand why the app crashes because the indexPath.row is out of range. But please try adding one line shown above and tell us what happens.
Topic: UI Frameworks SubTopic: UIKit Tags:
Sep ’21
Reply to Error with: Binding, ForEach and TextField
I guess, what is bad in your code is that TextField changes the value used as id:. Please try something like this: struct RowModel: Identifiable { let id = UUID() var name: String } struct ContentView: View { @State var rows: [RowModel] = [ RowModel(name: "Orange"), RowModel(name: "Apple"), ] var body: some View { NavigationView { List { ForEach($rows) { $row in TextField("Fruit", text: $row.name) } } .navigationTitle("Fruit List") } .navigationViewStyle(.stack) } } It is not clearly documented how SwiftUI works, but with TextField changing the value used as id:, whole the row is redrawn which may cause the keyboard unfocuses the Field.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’21
Reply to SwiftUI dynamic positioning of a subview
You may want to try offset or position.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to How can I give an SkSpriteNode an initial push?
You should better check SKActions. Maybe applyForce or applyImpulse is the one you want.
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to A crash when launching App (Performing @selector(_close:) from sender _NSThemeCloseWidget)
As far as I see your crash log, it seems to be caused by an infinite recursive call. You may be doing something which triggers the same notification inside a notification handler.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Screen blinking when key press
Can you show a complete code to reproduce the issue? You have not written on which component you have overridden keyUp(with:).
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to low-level graphic programming in C++
Metal runtime is strongly and tightly coupled with the Apple's UI frameworks -- intended to be used with ObjC or Swift. So, you should better give up the option -- hack my way to Metal in C++. Meaning use openGL anyway and cry when it will no longer works ? (meh) would be the only options if you insist on denying to learn ObjC or Swift. And Deprecated in Apple's frameworks means that it is not recommended to use it any more and will be removed at any time in the future. So, if your M1 Mac can run OpenGL apps currently, it would work for a while -- an unpredictable period. It may be months or less, or years.
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to SwiftUI iOS 15 NavigationLink pops out when press in textfield
Can you show enough code to reproduce the issue as text using Code Block? Not many readers would like to dive in to the external site.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Static method 'buildBlock' requires that 'Group' conform to 'View'
As far as I read the messages, it looks like you have another type named Group (which is an NSManagedObject -- Core Data entity) in your project. Please try something like this: struct LostFindView: View { var body: some View { VStack { SwiftUI.Group { //<- Text("1") Text("2") Text("3") Text("4") Text("5") Text("6") Text("7") Text("8") Text("9") Text("10") } Text("11") } } } Please use Code Block when you show some code, better read the hint from @robnotyou.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to How to I get MacOS Build Number programmatically?
As far as I tried, operatingSystemVersionString returns a version string containing the build number: (In Swift) print(ProcessInfo.processInfo.operatingSystemVersionString) Output (on my Mac): Version 11.6 (Build 20G165) I'm not sure if there is any API which returns only the build number.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Xcode 13 cannot run project generated by Xcode 12.5.1
Usual projects created with Xcode 12.5.1 build and run without any issues using Xcode 13. Does your project have any third party libraries?
Replies
Boosts
Views
Activity
Sep ’21
Reply to Cannot find 'PhotogrammetrySession' in scope
I am running xcode 13, and I am on MacOS 12.0 Beta (21A5522h). If you are using the released version of Xcode 13, it does not contain macOS SDK 12, which is needed to build the object capture command line program example. https://developer.apple.com/download/release/ Xcode 13 Xcode 13 includes everything you need to create and submit apps to the App Store for all Apple platforms. It Includes the SDKs for iOS 15, iPadOS 15, watchOS 8, tvOS 15, and macOS Big Sur. To continue developing apps for macOS Monterey, use Xcode 13 beta 5. If you want to try it now, you need to get Xcode 13 beta 5. Or else, you may need to wait till the new version of Xcode 13, that contains macOS SDK 12, will be released.
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to What is the replacement for deprecated contentEdgeInsets
UIButton.Configuration has a property named contentInsets. As far as I tried, it can be dynamically changed. button.configuration?.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 20, bottom: 0, trailing: 20)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to UINavigationBarAppearance problem in iOS12, XCode13
Do you use UINavigationBarAppearance explicitly in your app? Or is it used implicitly somewhere else? Can you show more info such as all the message in the debug console or the stack traces?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to UITableView refresh issue
Thanks for showing your code. There are many things I do not see, but as far as I check the currently shown parts of your code, you need to keep two properties glimpse and lastDocument consistent. When you remove all the elements from glimpse, you need to set lastDocument to nil. glimpse.removeAll(keepingCapacity: false) lastDocument = nil //<- There may be other parts you need to fix, frankly I do not understand why the app crashes because the indexPath.row is out of range. But please try adding one line shown above and tell us what happens.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Error with: Binding, ForEach and TextField
I guess, what is bad in your code is that TextField changes the value used as id:. Please try something like this: struct RowModel: Identifiable { let id = UUID() var name: String } struct ContentView: View { @State var rows: [RowModel] = [ RowModel(name: "Orange"), RowModel(name: "Apple"), ] var body: some View { NavigationView { List { ForEach($rows) { $row in TextField("Fruit", text: $row.name) } } .navigationTitle("Fruit List") } .navigationViewStyle(.stack) } } It is not clearly documented how SwiftUI works, but with TextField changing the value used as id:, whole the row is redrawn which may cause the keyboard unfocuses the Field.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Cursor in CloudKit does not work. Where is mistake?
I haven't tried CloudKit ever, and just have read the docs. But you get cursor in the closure passed to queryCompletionBlock, but you are not using it to get the remaining result. So it is quite reasonable that If I set limit 5, then I can see only 5 records.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’21