The requested version of macOS is not available. Please check if your Mac is compatible with this software.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I remembered there's a message that says that you cannot modify this video or whatever at the end of every session. So, if I trim the video and send it to my friend, is it allowed?
Bonus: where can I find the background music for every daily debrief video (if I can)?
I know this is really easy
I want to get the absolute path for the current app
And I can achieve using
String(reflecting: Bundle.main.bundleURL)
But what outputs isn't like /User/xxx/.....
but file:///User/xx/...
so
what can I do to get a absolute path in /xxx/xxx/xxx format?
thanks
I know how to use Virtualization now
But I don't know how to write interface in AppKit
So I should find a way to embed a NSView(the VM's UI) in a SwiftUI View
However
I couldn't find any reference on how except NSViewRepresentable which, of course, will not work
I know there must be a easy way to do this
But I'm just can't find it...
any help is appreciated
I'm trying out Swift Charts and I'm pretty messed up
After I deleted all of my items, I couldn't add items anymore
import SwiftUI
extension Array where Element == ChartsData {
mutating func delete(_ item: ChartsData) {
self.removeAll {
$0 == item
}
}
}
struct ContentView: View {
var ofType: ChartsType
@State var data: [ChartsData] = []
var body: some View {
List {
VStack {
HStack {
Spacer()
// MARK - add button
Button {
data.append(ChartsData(item: "item"))
} label: {
Image(systemName: "plus").imageScale(.large)
}.buttonStyle(.plain).padding()
}
List {
ForEach(data) { datum in
TableRow(data: datum).swipeActions {
Button(role: .destructive) {
data.delete(datum)
} label: {
Label("Delete", systemImage: "trash")
}
}
}
}
NavigationLink{
ChartsView(ofType: .BarChart, data: data)
} label: {
Text("Generate").font(.largeTitle).foregroundStyle(.linearGradient(colors: [.orange, .yellow, .blue, .purple], startPoint: .topTrailing, endPoint: .bottomLeading))
}.padding()
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView(ofType: .BarChart, data: [
ChartsData(item: "testItem1", value: 10),
ChartsData(item: "testItem2", value: 20)
])
}
}
I'm trying out weather kit and I'm using swiftUI
I have a view that accepts a CurrentWeather type value in initailizer
I cannot find a way to initialize a CurrentWeather
How can I preview It?
This won't work:
// forecaster and forecast is defined by me
struct WeatherView_Previews: PreviewProvider {
static var previews: some View { // <- static
WeatherView(weather: await forecaster.forcast(latitude: 0, longtitude: 0)) // <- concurrency
}
}
Is it legal if I distribute Ventura 13.0 beta 1 to a beta tester?
It doesn’t seems to
I have a structure TodoItem
struct TodoItem: Codable, Hashable, Identifiable {
var id: UUID = UUID()
var item: String
var done: Bool = false
}
How can I use AppStorage on [TodoItem]?
I want to change a binding value to just a normal one. How?
just curious about it
I tried to implement ExpressibleByIntegerLiteral to my code and it has been terrible.
At last, it asked me to implement this init
// Cannot find type 'Builtin' in scope
init(_builtinIntegerLiteral value: Builtin.IntLiteral) {
}
I have a M2, 13" MacBook Pro
import Cocoa
import IOKit
import Foundation
var blob = IOPSCopyPowerSourcesInfo() // cannot find 'IOPSCopyPowerSourcesInfo' in scope
SwiftUI's Refreshing mechanism is driving me crazy.
Say that I have this view:
NavigationView {
List($datasource) { $item in
NavigationLink {
SubView(item: $item)
} label: {
Text(item.someAttribute)
}
}
}
SubView:
TextField("Placeholder", text: $item.someAttribute)
And each time I edit the value in the SubView, the SwiftUI's navigation controller retreats the view to the home page(the initial view). Why?