Please use a code block next time thanks
Post
Replies
Boosts
Views
Activity
If it's a Multiplatform one it won't. Only SwiftUI is supported
Use
self.measure {
// code here
}```
in the unit test
or use Instruments
fantastic app!
Only I used my MacBook :)
You should use
if ... {
} else {
}
not
if ... {
else {
}
}
One year later, another dev also gets into the waiting line...
I'm getting this:https://developer.apple.com/forums/thread/709578
Me2
why don't try Ventura?
This will be impossible unless you update to Monterey/Ventura.
OK I figured it out my self
...There's such thing as .background
Look at my post. I solved it with some others https://developer.apple.com/forums/thread/708216
OK I found out why
Compiler found a bug in our code of the body of the Stack
Instead of telling SwiftUI checking the body of the VStack it thinks it's a faulty initialization
So when we use @absar's method it forced SwiftUI into initalizing as it should and therefore, find out the bug in our code in body.
or rather:
VStack(body: {
....
})
but after you fix your bug it should be back to normal.
Please continue to post if you have any other infos. Thanks!
OK found it out myself: https://www.jianshu.com/p/7591a7cd5eb1
I can do
extension Array: RawRepresentable where Element: Codable {
public init?(rawValue: String) {
guard let data = rawValue.data(using: .utf8),
let result = try? JSONDecoder().decode([Element].self, from: data)
else { return nil }
self = result
}
public var rawValue: String {
guard let data = try? JSONEncoder().encode(self),
let result = String(data: data, encoding: .utf8)
else {
return "[]"
}
return result
}
}
Also Date:
extension Date: RawRepresentable{
public typealias RawValue = String
public init?(rawValue: RawValue) {
guard let data = rawValue.data(using: .utf8),
let date = try? JSONDecoder().decode(Date.self, from: data) else {
return nil
}
self = date
}
public var rawValue: RawValue{
guard let data = try? JSONEncoder().encode(self),
let result = String(data:data,encoding: .utf8) else {
return ""
}
return result
}
}