Post

Replies

Boosts

Views

Activity

Reply to SwiftUI view is in the middle instead of in the top - NavigationView
HomeScreen & SignInView will inherit the outer most NavigationView, no need to nest the NavigationView them. struct ContentView: View { @EnvironmentObject var viewModel: AppViewModel var body: some View { NavigationView { if viewModel.signedIn { HomeScreen() .navigationBarHidden(true) } else { SignInView() .navigationBarHidden(false) .navigationBarTitle("Sign In", displayMode: .inline) } } .onAppear { viewModel.signedIn = viewModel.isSignedIn } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’22
Reply to Determine error matching pattern in catch?
In the catch statement you can use a switch/case statement to look for a specific error type. I have created an errors generator example that you can place into playgrounds to see the switch/case pattern in use. /**  Errors Example code by Sean Batson (MobileTen)  */ import Foundation enum GenericErrors: Error {     case offline, certificates } extension GenericErrors: LocalizedError {     var errorDescription: String? {         switch self {         case .offline:             return "Server responded out of disk space"         case .certificates:             return "Certificates expired 24 hours ago"         }     } } enum ForumQuestionErrors: Error {     case answered, none } extension ForumQuestionErrors: LocalizedError {     var errorDescription: String? {         switch self {         case .answered:             return "Question previously answered limit reached"         case .none:             return "Ok"         }     } } class Forums {     let error = [offlineGenericError, certsGenericError, answeredForumError, noneForumError]     func generateError() {         let method = error[Int.random(in: 0..<error.count)]         do {             try method(self)()         } catch {             switch error {             case is GenericErrors:                 print(error, error.localizedDescription)             case is ForumQuestionErrors: print(error, error.localizedDescription)             default:                 print(error, error.localizedDescription)             }         }     }     func offlineGenericError() throws {         throw GenericErrors.offline     }     func certsGenericError() throws {         throw GenericErrors.certificates     }     func answeredForumError() throws {         throw ForumQuestionErrors.answered     }     func noneForumError() throws {         throw ForumQuestionErrors.none     } } let forum = Forums() forum.generateError()
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’22
Reply to How do I use NotificationCenter in mac catalyst to detect and connect an external display?
Do you have a duel display on the Mac already connected?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to My developer account closed /terminated
Pay the bill or comply with the rules.
Replies
Boosts
Views
Activity
Mar ’22
Reply to SwiftUI view is in the middle instead of in the top - NavigationView
HomeScreen & SignInView will inherit the outer most NavigationView, no need to nest the NavigationView them. struct ContentView: View { @EnvironmentObject var viewModel: AppViewModel var body: some View { NavigationView { if viewModel.signedIn { HomeScreen() .navigationBarHidden(true) } else { SignInView() .navigationBarHidden(false) .navigationBarTitle("Sign In", displayMode: .inline) } } .onAppear { viewModel.signedIn = viewModel.isSignedIn } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to Apple Music API no longer working in our app.
What is the source of your access token were you abusing the API:https://developer.apple.com/forums/thread/702228
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to Xcode 13.3: dependent dylib '@rpath/Alamofire.framework/Alamofire' not found on iOS 14 only
Embed without code sign if it is an AppName.workspace made up of an AppName.project & Alamofire.project where Alamofire is a linked framework to the AppName.project
Replies
Boosts
Views
Activity
Mar ’22
Reply to App Privacy: Should I disclose Contact usage if using CloudKit's discover user identity feature?
Yes if you're storing the identity on 3rd party servers, no if the usage is localized to just the app. Disclosing it cannot kill.
Replies
Boosts
Views
Activity
Mar ’22
Reply to Can't add a UIView loaded from XIB as a subView of a ViewController view
The implementation is wrong. See links below especially the medium link https://developer.apple.com/documentation/uikit/mac_catalyst/uikit_catalog_creating_and_customizing_views_and_controls https://medium.com/swift2go/swift-custom-uiview-with-xib-file-211bb8bbd6eb
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to C++ Default Project - Why Can't I just Compile and Run "Hello World" without a Certificate
Not sure why an error string in a c++ compiler used by platforms other than Apple will have specific Apple help strings but yes, anything that runs on macOS in binary form must be notarized through code signing. Before looking all of these things that you wish existed, learn to use the Xcode tools first.
Topic: Code Signing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to Determine error matching pattern in catch?
In the catch statement you can use a switch/case statement to look for a specific error type. I have created an errors generator example that you can place into playgrounds to see the switch/case pattern in use. /**  Errors Example code by Sean Batson (MobileTen)  */ import Foundation enum GenericErrors: Error {     case offline, certificates } extension GenericErrors: LocalizedError {     var errorDescription: String? {         switch self {         case .offline:             return "Server responded out of disk space"         case .certificates:             return "Certificates expired 24 hours ago"         }     } } enum ForumQuestionErrors: Error {     case answered, none } extension ForumQuestionErrors: LocalizedError {     var errorDescription: String? {         switch self {         case .answered:             return "Question previously answered limit reached"         case .none:             return "Ok"         }     } } class Forums {     let error = [offlineGenericError, certsGenericError, answeredForumError, noneForumError]     func generateError() {         let method = error[Int.random(in: 0..<error.count)]         do {             try method(self)()         } catch {             switch error {             case is GenericErrors:                 print(error, error.localizedDescription)             case is ForumQuestionErrors: print(error, error.localizedDescription)             default:                 print(error, error.localizedDescription)             }         }     }     func offlineGenericError() throws {         throw GenericErrors.offline     }     func certsGenericError() throws {         throw GenericErrors.certificates     }     func answeredForumError() throws {         throw ForumQuestionErrors.answered     }     func noneForumError() throws {         throw ForumQuestionErrors.none     } } let forum = Forums() forum.generateError()
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to Invalid IBAN
Please contact the App Store Connect directly as this is not a developer related issue.
Replies
Boosts
Views
Activity
Mar ’22
Reply to Custom Video Out Through CarPlay?
Apple CarPlay doesn't allow video playback due to safety concerns.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to Prevent Save Panel in SwiftUI Mac app from saving as file type my app exports
I'm assuming you're following this: https://developer.apple.com/documentation/swiftui/building_a_document-based_app_with_swiftui and https://developer.apple.com/documentation/uniformtypeidentifiers/defining_file_and_data_types_for_your_app
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to xcode on windows 10
You can't it requires macOS - use VmWare or Parallels to probably run a copy of macOS or invest in a Mac.
Replies
Boosts
Views
Activity
Mar ’22
Reply to How to construct GKGridGraph using only traversable nodes
Quadtrees?
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’22
Reply to Awful display out put on 2022 M1 Macbook Pro
This is a developer forum please ask your question or visit the nearest apple store: https://discussions.apple.com/welcome
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Apr ’22