Post

Replies

Boosts

Views

Activity

Making the macOS sidebar visible again
I was coding a sidebar on macOS and folded it with my mouse, but every time I run the app, I can't see the sidebar, so I can't use the sidebar. If you add a new image once, you can't see the same, but the third window also shows the sidebar well. I don't know why It's similar when you run it on another computer at all. Current code import CoreData struct ContentView: View { @Environment(\.managedObjectContext) private var viewContext @State private var isSidebarVisible: Bool = true var body: some View { NavigationView { if isSidebarVisible { Sidebar() } MemoListView().environment(\.managedObjectContext, viewContext) } .frame(minWidth: 700, minHeight: 400) .toolbar { ToolbarItem(placement: .navigation) { Button(action: toggleSidebar) { Image(systemName: "sidebar.leading") } } } } private func toggleSidebar() { withAnimation { isSidebarVisible.toggle() } } struct Sidebar: View { @Environment(\.managedObjectContext) private var viewContext var body: some View { List { NavigationLink(destination: EasyWebListView().environment(\.managedObjectContext, viewContext)) { Label("Web Links", systemImage: "link") } NavigationLink(destination: MemoListView().environment(\.managedObjectContext, viewContext)) { Label("Memos", systemImage: "note.text") } NavigationLink(destination: ThemeListView().environment(\.managedObjectContext, viewContext)) { Label("Themes", systemImage: "photo.on.rectangle.angled") } NavigationLink(destination: AccessView().environment(\.managedObjectContext, viewContext)) { Label("Access Records", systemImage: "clock.fill") } } .navigationTitle("My App") } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView().environment(\.managedObjectContext, PersistenceController.preview.container.viewContext) } } And the code used when there was a problem before. import CoreData struct ContentView: View { @Environment(\.managedObjectContext) private var viewContext @State private var isSidebarVisible: Bool = true var body: some View { NavigationView { Sidebar().environment(\.managedObjectContext, viewContext) MemoListView().environment(\.managedObjectContext, viewContext) } .frame(minWidth: 700, minHeight: 400) .toolbar { ToolbarItem(placement: .navigation) { Button(action: { withAnimation { isSidebarVisible.toggle() } }) { Image(systemName: "sidebar.leading") } } } } struct Sidebar: View { @Environment(\.managedObjectContext) private var viewContext var body: some View { List { NavigationLink(destination: EasyWebListView().environment(\.managedObjectContext, viewContext)) { Label("Web Links", systemImage: "link") } NavigationLink(destination: MemoListView().environment(\.managedObjectContext, viewContext)) { Label("Memos", systemImage: "note.text") } NavigationLink(destination: ThemeListView().environment(\.managedObjectContext, viewContext)) { Label("Themes", systemImage: "photo.on.rectangle.angled") } NavigationLink(destination: AccessView().environment(\.managedObjectContext, viewContext)) { Label("Access Records", systemImage: "clock.fill") } } .listStyle(SidebarListStyle()) .navigationTitle("My App") } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView().environment(\.managedObjectContext, PersistenceController.preview.container.viewContext) } }
1
0
536
Apr ’24
Designing a custom keyboard
I am trying to make a keyboard themed app. I created a custom keyboard file through the target, but the file I created does not have keyboard keys. How can I create a keyboardView and put the image I made into the keyboardView? There are too few related materials, so I need the help of experts.
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
715
May ’22
What is the difference between swiftdata and coredata?
What is the difference between swiftdata and coredata? I am coding by integrating coreda and icloud. As introduced at wwdc, I heard that it can be used more easily in xcode. However, for me who has to sell it tomorrow, the stability of swiftdata after the official release of ios17 in the future is low, and scalability and modification are difficult. If it's difficult, it's a lot of trouble. And the most important thing, is there any difference from coredata by using swiftdata in the experience of my valuable customers who use my program? I'm well aware that everyone is learning and discussing. Thank you for sharing your experience.
2
2
1.2k
Jul ’23
compatible with vision pro and mac mini
I currently have an m1pro Macbook and m2pro high-end Macmini. I saw on wwdc that Macbook and vision pro screen sharing is possible. But I wonder if I can see the mac mini screen as it is on vision pro. Is this very smooth and can I work or use my macmini at home using Vision Pro while I am out at a cafe or going out? Of course there is a delay, but like the xbox x or ps5, the delay will be available looking forward.
2
0
1.3k
Jul ’23
vision pro keyboard
I think there is a problem with the keyboard of vision pro. I don't think it's difficult to enter another language. If you're not going to make it, shouldn't Apple provide an extended custom keyboard? Sometimes it's frustrating to see things that are intentionally restricted. If you have any information about vision pro's keyboard or want to discuss it, let's talk about your thoughts together! I don't have any information yet
2
0
904
Feb ’24
Connecting xcode with real my visionpro
Currently, the id of my actual visionpro device is different from the xcode that works on my macmini. I added a visionpro id to xcode, but I can't build it with my visionpro. Can I log out of the existing login to xcode and log in with the same ID as visionpro? However, the appleID created for visionpro does not have an Apple Developer membership, so there is no certificate that makes it run on the actual device. How can I add my visionpro ID from the ID with my apple developer membership to run the xcode project app on visionpro? This is the first time this is the first time.
2
0
6.5k
Jan ’25
How to index image from xcode storyboard to collectionview
Added imageview to cell. We have already indexed the label and implemented openurl. But, I don't know how to index the image the way I wrote it. Currently, no error code is entered, but the picture is not visible in the simulator. import UIKit private let reuseIdentifier = "Cell" class CollectionViewController: UICollectionViewController {   var modelData = ["A","B","B","D","E"]       let urls = ["h","h","h","h","h",]       let imagedata = [UIImage(named: "image1"), UIImage(named: "image2"), UIImage(named: "image3"), UIImage(named: "image4"), UIImage(named: "image5")]                   @IBAction func URLbutton(_ sender: UIButton) {         }           override func viewDidLoad() {     super.viewDidLoad()                     }   // MARK: UICollectionViewDataSource   override func numberOfSections(in collectionView: UICollectionView) -> Int {     return 1   }   override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {     return modelData.count   }       override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {     let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath)           // Configure the cell     if let label = cell.viewWithTag(100) as? UILabel {       label.text = modelData[indexPath.row]     }     if let imageview = cell.viewWithTag(200) as? UIImageView {       imageview.image = imagedata[indexPath.row]     }                                                   return cell   }   override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {     ??     }
3
0
879
Aug ’22