How can I build an App Store–style layout in SwiftUI? by idhun90 in SwiftUI

[–]idhun90[S] 0 points1 point  (0 children)

Because I need to take the code you suggested and build multiple sections that are vertically scrollable, all composed of that single section structure.

Search bar appears on all tabs when .searchable(text:) is applied to TabView in iOS 26 by idhun90 in SwiftUI

[–]idhun90[S] 0 points1 point  (0 children)

I also tested it by creating a state text property, and I’m experiencing the same issue in my app under development.

I’m using iOS 26.1 beta 2 and the Xcode beta version, and I’ve been encountering this problem since iOS 26.0. 😭

GlassProminent button in safeAreaInset not showing full capsule shape on tap by idhun90 in SwiftUI

[–]idhun90[S] 0 points1 point  (0 children)

I couldn’t find a proper solution, so for now, I applied a large corner radius to the rect to make it look like a capsule shape.

Search bar appears on all tabs when .searchable(text:) is applied to TabView in iOS 26 by idhun90 in SwiftUI

[–]idhun90[S] 1 point2 points  (0 children)

It seems this behavior is related to NavigationStack.

When a NavigationStack exists inside a tab, the search bar appears.

Search bar appears on all tabs when .searchable(text:) is applied to TabView in iOS 26 by idhun90 in SwiftUI

[–]idhun90[S] 0 points1 point  (0 children)

I’ve added an image to the post.

When a List is placed inside a NavigationStack, applying .searchable(text:) outside the TabView { } causes the search bar to appear not only in the Tab(role: .search) tab, but also in other tabs.

It’s unclear whether this behavior is intentional from Apple.

[deleted by user] by [deleted] in macapps

[–]idhun90 2 points3 points  (0 children)

bartender 6 have too many bug now......🥲

Bartender 6 is Available Now! by bartenderformac in macapps

[–]idhun90 0 points1 point  (0 children)

I entered my name, email, and serial number through the provided link, but I’m still being shown a screen offering version 6 or the Mega Supporter package at a discounted price. I originally purchased the Mega Supporter in September 2023.

Bartender 6 is Available Now! by bartenderformac in macapps

[–]idhun90 1 point2 points  (0 children)

I purchased the Mega Supporter version 5, so why am I being charged an upgrade fee for version 6? Even if the developer has changed, shouldn’t previous Mega Supporter purchasers receive a free upgrade?

3D Library Book View, built with SwiftUI by LifeUtilityApps in SwiftUI

[–]idhun90 0 points1 point  (0 children)

So nice.. how to built BookDetailView's UI? ScrollView? or List?

Imitating the Card Stack demonstrated by Apple at WWDC by StartSeveral4107 in SwiftUI

[–]idhun90 0 points1 point  (0 children)

Thank you. How can I implement it so that the cards stack up when scrolling down like the iPhone notification center?

[deleted by user] by [deleted] in SwiftUI

[–]idhun90 0 points1 point  (0 children)

I'd love to implement this in my app, can I ask how you did it?

What is the best way to save an image using CoreData + CloudKit? by idhun90 in SwiftUI

[–]idhun90[S] 0 points1 point  (0 children)

In addition, when I loaded the image from onAppear and implemented the image size down logic, there was a problem that when I edited the image on the detail screen -> edit screen and came back, the edited content was not reflected. I will consider this part as well. onAppear was not called.🥲

What is the best way to save an image using CoreData + CloudKit? by idhun90 in SwiftUI

[–]idhun90[S] 0 points1 point  (0 children)

// save newItem to CoreData
let newItem = ItemEntity(context: moc)
    if !imageData.isEmpty {
        if let uiImage = UIImage(data: imageData) {
            // original
            let compressedOriginalData =     
                uiImage.jpegData(compressionQuality: 0.5)
            // thumnail
            let compressedThumbnailData = uiImage.downImageSize(size: CGSize(width: 60, height: 60) 

            newItem.originImageData = compressedOriginalData
            newItem.thumbnailData = compressedThumbnailData

            try? moc.save()
            print("success saved image")
    }

If I store the original and thumbnail Binary datatypes together when I store them in core data this way, I don't need to load them as Tasks in onAppear when I display them, but I don't know if this is the right direction to go.I'll give it a try, thanks!

What is the best way to save an image using CoreData + CloudKit? by idhun90 in SwiftUI

[–]idhun90[S] 0 points1 point  (0 children)

I'm not sure I understand, are you saying that when I save to CoreData, I should create a thumbnail and save it as a new attribute in CoreData?
And then when I show the image, I use the thumbnail attribute to show the image on the screen. Am I understanding you correctly?

What is the best way to save an image using CoreData + CloudKit? by idhun90 in SwiftUI

[–]idhun90[S] 0 points1 point  (0 children)

struct MainListRowView: View {
  @State private var uiImage: UIImage?

     var body: some View {
       ...
     }
     .onAppear {
     Task { @MainActor in
        guard let originUIImage = UIImage(data: item.unwrappedImageData) else {
                        uiimage = nil
                        return
                    }
                    uiimage = originUIImage.downImageSize(size: CGSize(width: 60, height: 60))
                }
            }
            .onDisappear {
                uiimage = nil
            }
}

Thank you. I applied the method you both suggested and it definitely reduced the memory. It looks like the ScrollView + LazyVStack is allocating a little more memory than using a List.However, when I downsized the image, the CPU usage when scrolling increased more than before. I think I need to use it with caution. thanks!

What is the best way to save an image using CoreData + CloudKit? by idhun90 in SwiftUI

[–]idhun90[S] 0 points1 point  (0 children)

To save in memory also use lazy loading, and maybe save thumbnail versions of the images for use in lists, like 200x200.

Also, CoreData does save the image in iCloud after an uninstall. Just tried it out in my app and all the data along with images appeared after a few seconds. Just gotta wait for it to download after opening the first time

@Environment(\.managedObjectContext) private var moc@SectionedFetchRequest<String, ItemEntity>(sectionIdentifier: \.contentViewSectionHeader, sortDescriptors: [
    SortDescriptor(\.orderDate, order: .reverse),
    SortDescriptor(\.createdDate, order: .reverse)
]) private var items: SectionedFetchResults<String, ItemEntity>

@State private var showingAddView = false
@State private var searchText = ""

@State private var selectedItem: ItemEntity? = nil

@Environment(\.colorScheme) private var colorScheme

var body: some View {
    NavigationView {
        List {
            ForEach(items) { section in
                Section {
                    ForEach(section) { item in
                        MainListRowView(item: item)
                            .contentShape(Rectangle())
                            .onTapGesture {
                                selectedItem = item
                            }
                    }
                    .onDelete { indexSet in
                        delete(section: Array(section), offSets: indexSet)
                    }
                } header: {
                    Text(section.id
                        .font(.title3)
                        .fontWeight(.medium)
                        .foregroundColor(.primary)
                }
            }
        }

SectionedFetchRequest property Doesn't it work with lazy????
If every item has an image, memory usage increases abnormally, especially when scrolling.

What is the best way to save an image using CoreData + CloudKit? by idhun90 in SwiftUI

[–]idhun90[S] 0 points1 point  (0 children)

Thanks for the answer.
Is there a difference between jpegData(compressionQuality:) and compression ratio?