Post

Replies

Boosts

Views

Activity

Reply to SwiftUI Locking View Rotation
When Apple implements a SwiftUIController to manage SwiftUI views ... just kidding. You need to implement an AppDelegate with the prefered interface orientations and set it as the app delegate for your swift ui application, hopefully it should work: class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { .portrait } } Then in your swiftui @main app import UIKit import SwiftUI @main struct SampleApp: App { @UIApplicationDelegateAdaptor var appDelegate: AppDelegate var body: some Scene { ... } } With some work, you can begin to architect updates between the AppDelegate and the SwiftUI App into the SwiftUI Environment for all views to have whatever data you will need.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’23
Reply to Xcode 15, how to uncheck "Connect via network" for physical device?
On an AnyConnect VPN setup, disabling Bluetooth, WIFI, and Data has no effect unless you disconnect the VPN. Making this thing exclusive to the network is crazy. What if all this traffic leaves the local network before reaching its internal point-to-point target because of how a given network is configured? USB 3+ and Thunderbolt 2+ are more reliable in the form of a cable connection. If it's not broken, don't change it.
Dec ’23
Reply to How to translate data from c language void * pointer to [UInt8 ] in swift code.
Anything that's not declared within the struct is deallocated from the stack when set data returns. typedef struct { uint8_t *memo; uint8_t array[5]; int why[4]; char *books; } Bounce; implemenation of fix. void fix(Bounce *model) { memset(model->array,0x53,5); model->why[0] = 2; model->why[1] = 3; model->why[2] = 2; model->why[3] = 2; model->books = "Hello world"; model->memo = model->array; } import Foundation var bounce = Bounce() fix(&bounce) bounce.books.map({print(String(cString: $0))}) for value in 0..<5 { print(bounce.memo.advanced(by: value).pointee) } let why = bounce.why print(why) Output: Hello world 83 83 83 83 83 (2, 3, 2, 2) Program ended with exit code: 0 With the void* or anonymous type. typedef struct { void *memo; uint8_t array[5]; int why[4]; char *books; } Bounce; for value in 0..<5 { let thing = bounce.memo.assumingMemoryBound(to: UInt8.self).advanced(by: value).pointee print(thing) }
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’23
Reply to SwiftUI Locking View Rotation
When Apple implements a SwiftUIController to manage SwiftUI views ... just kidding. You need to implement an AppDelegate with the prefered interface orientations and set it as the app delegate for your swift ui application, hopefully it should work: class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { .portrait } } Then in your swiftui @main app import UIKit import SwiftUI @main struct SampleApp: App { @UIApplicationDelegateAdaptor var appDelegate: AppDelegate var body: some Scene { ... } } With some work, you can begin to architect updates between the AppDelegate and the SwiftUI App into the SwiftUI Environment for all views to have whatever data you will need.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to SwiftUI View with variadic generics
See here: https://stackoverflow.com/questions/77101028/how-to-use-swift-parameter-packs-in-a-view
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to Is there any way to prevent macOS from moving my app’s windows?
No.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to App users receive multiple notifications. But, We sent once.
File a bug report with Apple via the feedback app Open a ticket with your push notifications service provider. If that is also you, debug the server-side script for concurrency issues.
Replies
Boosts
Views
Activity
Nov ’23
Reply to Unity.IL2CPP.Bee.BuildLogic.ToolchainNotFoundException: IL2CPP C++ code builder is unable to build C++ code. In order to build C++ code for Mac, you must have Xcode installed.
Sorry, but you must post this on the Unity & Flutter forums or revert Xcode to a version supported by Unity & Flutter.
Replies
Boosts
Views
Activity
Nov ’23
Reply to Why does it not exist via @AppStorage
@AppStorage or userdefaults is for storing small bits of data not huge binary blobs.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to Implementing passkey to password manager
That's the entire point of passkey but here you go https://developer.apple.com/documentation/authenticationservices/public-private_key_authentication/supporting_passkeys?language=objc
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to Swift Macros: Adding an enum case with an associated value produces incorrect results
You have a self-inflicted issue. Watch WWDC video on how to correctly rewrite the syntax tree instead of replace the tree. https://developer.apple.com/wwdc23/10166
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to Does Apple documentation really help you learn Swift?
Try some hands-on courses from Udemy. If you have a paid LinkedIn subscription, try the free courses there, the nano degree from udacity.com, or hacking with Swift. It's a process that takes time with practice and commitment. Don't rely on one source. All the best.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to Name clashes with SwiftData classes
Never use names already defined in the frameworks. Always use original names for your types.
Topic: App & System Services SubTopic: iCloud Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to Xcode 15, how to uncheck "Connect via network" for physical device?
On an AnyConnect VPN setup, disabling Bluetooth, WIFI, and Data has no effect unless you disconnect the VPN. Making this thing exclusive to the network is crazy. What if all this traffic leaves the local network before reaching its internal point-to-point target because of how a given network is configured? USB 3+ and Thunderbolt 2+ are more reliable in the form of a cable connection. If it's not broken, don't change it.
Replies
Boosts
Views
Activity
Dec ’23
Reply to Xcode 15, how to uncheck "Connect via network" for physical device?
The new debugger also has issues with the simulators. After 5 or 6 plus app launches, the sim will black screen and not load the app or sometimes when you close the app via Xcode, the sim will black screen and refuse to launch. Killing the simulator disconnects some debugger processes and then you're able to resume running on the sim.
Replies
Boosts
Views
Activity
Dec ’23
Reply to OS 14.3 / iOS 17.3 iphone sync and backup issues
Beta software anything is expected until kinks are ironed out.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to DataFrame's Column doesn't support array of dictionary
Try JSON encoding a data model and pass it into DataFrame.
Topic: Machine Learning & AI SubTopic: Core ML Tags:
Replies
Boosts
Views
Activity
Dec ’23
Reply to How to translate data from c language void * pointer to [UInt8 ] in swift code.
Anything that's not declared within the struct is deallocated from the stack when set data returns. typedef struct { uint8_t *memo; uint8_t array[5]; int why[4]; char *books; } Bounce; implemenation of fix. void fix(Bounce *model) { memset(model->array,0x53,5); model->why[0] = 2; model->why[1] = 3; model->why[2] = 2; model->why[3] = 2; model->books = "Hello world"; model->memo = model->array; } import Foundation var bounce = Bounce() fix(&bounce) bounce.books.map({print(String(cString: $0))}) for value in 0..<5 { print(bounce.memo.advanced(by: value).pointee) } let why = bounce.why print(why) Output: Hello world 83 83 83 83 83 (2, 3, 2, 2) Program ended with exit code: 0 With the void* or anonymous type. typedef struct { void *memo; uint8_t array[5]; int why[4]; char *books; } Bounce; for value in 0..<5 { let thing = bounce.memo.assumingMemoryBound(to: UInt8.self).advanced(by: value).pointee print(thing) }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’23