Post

Replies

Boosts

Views

Activity

Reply to Full screen lazy stacks do not scroll on AppleTV.
I struggled with this as well. However, I found a different way that achieves the same objective while working on AppleTV. That is to use a TabView which when styled works like a page controller. This allows you to swipe left/right on a an array of images. Given it works page by page and loading is as-needed so it works like a lazystack. Here is a full example for you (note I styled it so that it doesn't show page markers, but you can simply use .page if you want them). struct SlideshowViewer: View { @State private var gallery = GalleryPublisher.shared var body: some View { TabView { ForEach(gallery.slideshow, id:\.self) { slideshow in ImageView(slideshow: slideshow) .focusable(true) .frame(width:UIScreen.main.bounds.width,height: UIScreen.main.bounds.height) .edgesIgnoringSafeArea(.all) } } .tabViewStyle(.page(indexDisplayMode: .never)) } } struct ImageView: View { var slideshow:Slideshow @State private var galleryImage:UIImage? var body: some View { if let image = galleryImage { Image(uiImage: image) .resizable() .aspectRatio(contentMode:.fill) } else { ZStack { Rectangle() ProgressView() .progressViewStyle(CircularProgressViewStyle(tint: .blue)) } .foregroundColor(.white) .onAppear { NetworkManager.shared.downloadImage(urlStr: slideshow.link) { image in galleryImage = image } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to Bitbucket Cloud is Breaking Swift Package Manager
The easier workaround is to remove Bitbuck, download the packages you need, then add Bitbucket again. No need to download older versions of Xcode, etc. I probably should try to completely remove and then install again Xcode as it doesn't look like this issue is getting fixed or even acknowledged any time soon.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Full screen lazy stacks do not scroll on AppleTV.
I struggled with this as well. However, I found a different way that achieves the same objective while working on AppleTV. That is to use a TabView which when styled works like a page controller. This allows you to swipe left/right on a an array of images. Given it works page by page and loading is as-needed so it works like a lazystack. Here is a full example for you (note I styled it so that it doesn't show page markers, but you can simply use .page if you want them). struct SlideshowViewer: View { @State private var gallery = GalleryPublisher.shared var body: some View { TabView { ForEach(gallery.slideshow, id:\.self) { slideshow in ImageView(slideshow: slideshow) .focusable(true) .frame(width:UIScreen.main.bounds.width,height: UIScreen.main.bounds.height) .edgesIgnoringSafeArea(.all) } } .tabViewStyle(.page(indexDisplayMode: .never)) } } struct ImageView: View { var slideshow:Slideshow @State private var galleryImage:UIImage? var body: some View { if let image = galleryImage { Image(uiImage: image) .resizable() .aspectRatio(contentMode:.fill) } else { ZStack { Rectangle() ProgressView() .progressViewStyle(CircularProgressViewStyle(tint: .blue)) } .foregroundColor(.white) .onAppear { NetworkManager.shared.downloadImage(urlStr: slideshow.link) { image in galleryImage = image } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21