Posts

Post marked as solved
3 Replies
462 Views
Hi, Developers. The project I am working on includes SwiftData for storing information. When inspecting, code-wise everything looks as it should, however, sometimes when interacting with data, the app crashes. The confusing part is that it happens sometimes. On one simulator, it might crash, while on another it might not. Should I reinstall the app it seems to be working fine again. Do you have and ideas. Any advice is appreciated. Take care!
Posted Last updated
.
Post not yet marked as solved
1 Replies
275 Views
Hi to everyone! I want to make a slider like the one in iOS Health app that is used for mood logging. Do you have any idea for approach. The design is easy but problems arise with the functionality behind it. Thanks.
Posted Last updated
.
Post not yet marked as solved
0 Replies
528 Views
Hello to everyone! I’m glad to be able to inform you that with Public Beta macOS 13.4 the issue seems to be fixed:)🎉🎉🎉 Have a great day!
Posted Last updated
.
Post marked as solved
2 Replies
1.9k Views
Hello! I can't understand what am I supposed to do in this exercise. Can someone walk me through? Exercise: Leap Years To decide if a year is a leap year, there are several decisions that have to be made in the correct order. Is the year divisible by 4? If so, is the year divisible by 100? If so, is the year divisible by 400? If so, it is a leap year. If not, it is not a leap year. If it's not divisible by 100, it is a leap year. If it's not divisible by 4, it is not a leap year. These decisions can be made inside a function as a series of nested if...else statements. The number(_:, isDivisibleBy:) function has been built into this playground to make this exercise easier. Below is an incomplete function for deciding if a given year is a leap year: func isLeapYear(_ year: Int) -> Bool {     // Is the year divisible by 4?     if number(year, isDivisibleBy: 4) {         return true     } else {         return false      } // Should be true isLeapYear(2000) // Should be false isLeapYear(1900) // Should be true isLeapYear(2012) // Should be false isLeapYear(2017) Exercise Complete the function above so that the rules are all followed and the examples get the correct answers.  Hint: Try using the rules as pseudocode by making them into comments. Then write the code that goes with each comment underneath it. Exercise For a challenge, complete the function below. It should behave identically without using any nested conditional statements. Use a single level of if/else statements along with conditionals that use Boolean operators.  Hint: Create constants that represent the three key conditions, and then compose a Boolean expression with those constants. func isLeapYear2(_ year: Int) -> Bool { }
Posted Last updated
.