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 } } } } }
Oct ’21
Reply to Access iOS Directory from Javascript
Thank you for the help and confirmation. This open source library does not have a file system from any of its documentation. They support things like Cordova which has other plug-ins but that doesn't help with a native approach. At this point I am using socket.io to provide binary to the JS locally. Thanks again for your time and expertise.
Mar ’21
Reply to Access iOS Directory from Javascript
I've looked at the documentation for both, but don't see anything specific to the file system. Is there some Apple documentation or suite of methods you can point to? For the moment the only solution I can see here is to read the file natively and then socket the contents to the JS/Node side. Another method could be a multipart transfer via URLSession. Is this the kind of thing you are referring to or are you aware of other methods in JSCore or WKWeb? Thanks.
Mar ’21
Reply to Access iOS Directory from Javascript
I am running a node.js server on device called Nodejs-mobile. When that is spun up it runs a JavaScript file that is also located in the app's bundle. I can interact with the JS through any number of means such as a WKWebView or a URLSession. In either case I have, at the iOS app level, the path to an on-device resource that I provide to JS. The desire here is for the local JS to then use that path to access the file. I am flexible to use differing mechanisms here if it enables JS to directly read a file. The JS uses fs.opensync in it's current attempt. Thanks.
Mar ’21