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 Bindable is never deallocated
When a view disappears in UIKIt or SwiftUI it is torn down by the view life cycle and is no longer active nor alive to respond to anything. To see the transition from MyBar to Progress the View will have to be active. Read up on the view lifecycle for UIKit as it is the under pinnings of SwiftUI. https://developer.apple.com/documentation/uikit/uiviewcontroller
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’23
Reply to Xcode crashes when I clear the console after succesful program execution
Switching your code to use pointers yields the same outcome. You can't simultaneously have both the printf and scanf in the nested for-loop. It's one or the other. The best bet is to file a bug report. #include <stdlib.h> #include <stdio.h> #include <malloc/malloc.h> #define N 3 #define M 3 int Peak(float *a); int main(int argc, const char * argv[]) { int i, j, k; float *matrix = (float*)malloc((N * M) * sizeof(float)); printf("\nInitialising [%d][%d] matrix\n", N, M); for(i=0;i<N;i++) for(j=0;j<M;j++) { printf("\nInsert element (%d,%d)", i,j); scanf("%f", (matrix+i)+j); } k = Peak(matrix); free(matrix); printf("\nNumber of peaks: %d\n", k); return (0); } int Peak(float *a) { int i, j, varbool, peaks=0; float x; for(i=0;i<N;i++) for(j=0;j<M;j++) { varbool=1; x = *((a+i)+j)/2.0; if(j-1>=0){ if(x<=*((a+i)+j-1)) varbool=0; } else if(j+1<M) { if(x<=*((a+i)+j+1)) varbool=0; } else if(i-1>=0) { if(x<=*((a+i-1)+j)) varbool=0; } else if(i+1<N) { if(x<=*((a+i+1)+j)) varbool=0; } if(varbool) peaks++; } return peaks; } Sean.
Nov ’23
Reply to Is it possible to build a dynamic framework without the symbols of a static library that it links to?
You will have to readjust your dependencies. |--DynamicFramework1 | --DynamicFramework2 | --StaticLibrary Or Readjust your dependencies by responsibility. |--DynamicFramework1 |--StaticLibrary_A |--DynamicFramework2 |--StaticLibrary_B Where the public APIs of StaticLibrary_A and StaticLibrary_B are mutually exclusive. Or Create an Xcode project for each framework.
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 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 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 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 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 Initializing NavigationStack
Begin here -> https://developer.apple.com/xcode/swiftui/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to SwiftData PersistentIdentifier saved to UserDefaults?
If you're already using SwiftData, why rely on userdefaults? Store the last user in a swift data model and fetch it from there instead.
Replies
Boosts
Views
Activity
Nov ’23
Reply to Bug Using Ninja when Generate the Xcode project.
Ninja is not an Apple product.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to Bindable is never deallocated
When a view disappears in UIKIt or SwiftUI it is torn down by the view life cycle and is no longer active nor alive to respond to anything. To see the transition from MyBar to Progress the View will have to be active. Read up on the view lifecycle for UIKit as it is the under pinnings of SwiftUI. https://developer.apple.com/documentation/uikit/uiviewcontroller
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to Xcode 15: Unable to pair iOS 17 device for debugging via cable
This is a known issue, with all VPN software, so it is not just CISCO-related but all software VPN-related products which means this is an Apple issue if all prior versions of iOS previously worked on VPN while debugging. The quickest fix for this is @Apple. Cisco reported bug https://bst.cisco.com/quickview/bug/CSCwf98780
Replies
Boosts
Views
Activity
Nov ’23
Reply to RandomAccessCollection Performance Problems when List is paired with NavigationStack
In reality, no one will pass one million items to a List.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’23
Reply to Xcode crashes when I clear the console after succesful program execution
Switching your code to use pointers yields the same outcome. You can't simultaneously have both the printf and scanf in the nested for-loop. It's one or the other. The best bet is to file a bug report. #include <stdlib.h> #include <stdio.h> #include <malloc/malloc.h> #define N 3 #define M 3 int Peak(float *a); int main(int argc, const char * argv[]) { int i, j, k; float *matrix = (float*)malloc((N * M) * sizeof(float)); printf("\nInitialising [%d][%d] matrix\n", N, M); for(i=0;i<N;i++) for(j=0;j<M;j++) { printf("\nInsert element (%d,%d)", i,j); scanf("%f", (matrix+i)+j); } k = Peak(matrix); free(matrix); printf("\nNumber of peaks: %d\n", k); return (0); } int Peak(float *a) { int i, j, varbool, peaks=0; float x; for(i=0;i<N;i++) for(j=0;j<M;j++) { varbool=1; x = *((a+i)+j)/2.0; if(j-1>=0){ if(x<=*((a+i)+j-1)) varbool=0; } else if(j+1<M) { if(x<=*((a+i)+j+1)) varbool=0; } else if(i-1>=0) { if(x<=*((a+i-1)+j)) varbool=0; } else if(i+1<N) { if(x<=*((a+i+1)+j)) varbool=0; } if(varbool) peaks++; } return peaks; } Sean.
Replies
Boosts
Views
Activity
Nov ’23
Reply to Xcode crashes when I clear the console after succesful program execution
Removing this line printf("\nInsert element (%d,%d):\n", i,j); solves the problem.
Replies
Boosts
Views
Activity
Nov ’23
Reply to Is it possible to build a dynamic framework without the symbols of a static library that it links to?
You will have to readjust your dependencies. |--DynamicFramework1 | --DynamicFramework2 | --StaticLibrary Or Readjust your dependencies by responsibility. |--DynamicFramework1 |--StaticLibrary_A |--DynamicFramework2 |--StaticLibrary_B Where the public APIs of StaticLibrary_A and StaticLibrary_B are mutually exclusive. Or Create an Xcode project for each framework.
Replies
Boosts
Views
Activity
Nov ’23
Reply to RayCasting to Surface Returns Inconsistent Results?
File a bug with sample code.
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Nov ’23