Post

Replies

Boosts

Views

Activity

Reply to The given data was not valid JSON.
The key line is: let decodedData = try JSONDecoder().decode(DetailResponse.self, from: recepieData) ...where you try to decode a DetailResponse from json. struct DetailResponse:Codable {     let yields:String     let name:String } If you can share some sample json (that is failing to decode), then it will be possible to comment on what might be going wrong.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Sequential execution of asynchronous functions. How?
You may have got a bit confused, between Operations and OperationQueue. Start simple: let operation1 = BlockOperation {     Thread.sleep(forTimeInterval: 5) print("Operation 1 completed") } let operation2 = BlockOperation { print("Operation 2 completed") } operation2.addDependency(operation1) let queue = OperationQueue() queue.addOperation(operation1) queue.addOperation(operation2)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to The given data was not valid JSON.
I think it's worse than Scott suggests, your JSON seems to be very badly formed. It's missing separators between items, and some of the items are ambiguous. This works: { "name":"Vegan ****** Cashew Mac", "yields":"Servings: 6" } Maybe you have chopped up your JSON, and posted something quite different to the original data?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Markdown in Xcode 12.5.1
Put the comment above the function declaration! /// this is just an example of markdown. /// /// - Parameters: ///     - someString: A simple string. ///     - someInteger: A simple integer func myFunction(someString: String, someInteger: Int) {
Aug ’21
Reply to Music shortcut
Can you share some code, then we may be able to make suggestions about a fix? There are different ways of using timers, so you could start by sharing your timer code.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Sequential execution of asynchronous functions. How?
Have you considered using Operations, and an OperationQueue? Setting maxConcurrentOperationCount = 1 will execute your operations sequentially.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to TestFlight build different to local Release build. How?
Apple say: For all distribution methods except TestFlight, choose the following options to enhance your chances of discovering a bug that manifests only in the release build: Set App Thinning to “All compatible device variants”. Check “Rebuild from Bitcode”.
Replies
Boosts
Views
Activity
Aug ’21
Reply to phone simulator
From Xcode: Window > Devices and Simulators > Simulators This gives you a list of Simulators, where you can add or remove.
Replies
Boosts
Views
Activity
Aug ’21
Reply to The given data was not valid JSON.
The key line is: let decodedData = try JSONDecoder().decode(DetailResponse.self, from: recepieData) ...where you try to decode a DetailResponse from json. struct DetailResponse:Codable {     let yields:String     let name:String } If you can share some sample json (that is failing to decode), then it will be possible to comment on what might be going wrong.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Sequential execution of asynchronous functions. How?
You may have got a bit confused, between Operations and OperationQueue. Start simple: let operation1 = BlockOperation {     Thread.sleep(forTimeInterval: 5) print("Operation 1 completed") } let operation2 = BlockOperation { print("Operation 2 completed") } operation2.addDependency(operation1) let queue = OperationQueue() queue.addOperation(operation1) queue.addOperation(operation2)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Sequential execution of asynchronous functions. How?
As I said earlier, setting maxConcurrentOperationCount = 1 will execute your operations sequentially. So they will execute in the order you add them to the queue. In that case, you don't need to set the dependencies.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to The given data was not valid JSON.
I think it's worse than Scott suggests, your JSON seems to be very badly formed. It's missing separators between items, and some of the items are ambiguous. This works: { "name":"Vegan ****** Cashew Mac", "yields":"Servings: 6" } Maybe you have chopped up your JSON, and posted something quite different to the original data?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to What's the best way for a remote team to work on an xcode project?
Use git, with a remote repository, then you get all the benefits of source control. e.g. you can review your remote worker's changes, before merging them into the main project. I use git for even the smallest Xcode project now, but for a team, it's a no-brainer. Lots of help is available online.
Replies
Boosts
Views
Activity
Aug ’21
Reply to Keyboard layout move to upper
It looks like you have turned on "split keyboard". To put it back to normal: Tap and hold the "keyboard" key (at the bottom right), and select "Merge" or "Dock and Merge"
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to you are kidding apple...
You have posted your comment to the Developer Forums. To get help with your issue, you really need to contact Apple Developer Support. Apple say: The forums are meant for code-level questions. For questions about program membership and other nontechnical developer topics, contact Apple Developer Support
Replies
Boosts
Views
Activity
Aug ’21
Reply to Value of type 'UITableViewCell' has no member 'nameLabel'
Your cell is of type UITableViewCell. UITableViewCell has no property called nameLabel. Perhaps you expect cell to be an ItemTableViewCell? You don't show your code, so I'm guessing, but perhaps ItemTableViewCell has a property called nameLabel? If so, when you dequeue your cell, you would have to cast it to the correct type.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Markdown in Xcode 12.5.1
Put the comment above the function declaration! /// this is just an example of markdown. /// /// - Parameters: ///     - someString: A simple string. ///     - someInteger: A simple integer func myFunction(someString: String, someInteger: Int) {
Replies
Boosts
Views
Activity
Aug ’21
Reply to Unable to connect multiple devices over peer to peer by using Bonjour
Look at "Multipeer Connectivity", which supports peer-to-peer connectivity and the discovery of nearby devices. https://developer.apple.com/documentation/multipeerconnectivity
Replies
Boosts
Views
Activity
Aug ’21
Reply to NWPathMonitor pathUpdateHandler invoked on App Launch every time
As I see it: On launch, there is no path status So when we get the path status, it is considered to have changed You can always check if it has really changed in pathUpdateHandler, by comparing the new status with the previous status (which you save at the end of pathUpdateHandler).
Replies
Boosts
Views
Activity
Aug ’21