Giter Site home page Giter Site logo

re-lax's People

Contributors

jarinteractive avatar marksands avatar mcmurrym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

re-lax's Issues

Interface Builder Usage

Amazing product, thank you for your contribution to the world of tvOS ๐Ÿ‘

One thing that took me a little bit to figure out, might be good to put it in your docs or something, but this is an example of how you would make this work in Interface Builder:

// Stub container
class SimpleParallaxContainer: UIView, ParallaxContainer {
    func focusChanged(_ focus: ParallaxFocusState) {}
    func parallaxShadow(forFocus: ParallaxFocusState, defaultShadow: Shadow) -> Shadow? {
        return defaultShadow
    }
}

// Because ParallaxView doesn't implement initWith(coder:) you can't place it in Interface Builder.
// This UIView subclass substitutes itself with a ParallaxView at runtime.
class ParallaxPlaceholder: UIView {
    override func layoutSubviews() {
        super.layoutSubviews()
        guard let sup = self.superview else { return } // make sure we have a superview
        
        // Create a container
        let cont = SimpleParallaxContainer.init(frame: self.bounds)
        
        // Move all of the placeholder's subviews into the container
        self.subviews.forEach { (view) in
            let f = view.frame
            view.removeFromSuperview()
            cont.addSubview(view)
            view.frame = f
        }
        
        // Create a parallax view, using the container we just built
        let pView = ParallaxView<SimpleParallaxContainer>(layerContainer: cont)
        
        // Remove ourselves from the view hierarchy and replace with the parallax view
        sup.insertSubview(pView, aboveSubview: self)
        pView.frame = self.frame
        self.removeFromSuperview()
    }
}

Definitely no problem if I'm going about this wrong and you feel like pointing it out. Either way, thanks again!

TopShelf example not working since tvOS 13.4

In tvOS 13.4+ and 14.0 Beta, there are much stricter memory limits on top shelf extensions. The example seems to use a lot of memory and gets killed, but that can be fixed as so:

--- a/ReLaxExample/ReLaxTopShelfExample/ServiceProvider.swift
+++ b/ReLaxExample/ReLaxTopShelfExample/ServiceProvider.swift
@@ -8,7 +8,7 @@ class ServiceProvider: NSObject, TVTopShelfProvider {
     private let posterImages: [ParallaxImage] = titles
         .map { $0.lowercased().components(separatedBy: .whitespaces).joined() }
         .map { movie in
-            ["5", "4", "3", "2", "1"].map { return "\(movie)-\($0)" }
+            ["5"].map { return "\(movie)-\($0)" }
         }
         .compactMap {
             $0.compactMap { UIImage(named: $0) }

However, it seems that now disk based urls cannot be used for images in the top shelf. The image is never rendered on screen:

Screen Shot 2020-07-23 at 5 13 04 PM

Expanding subviews in UICollectionViewCell

Just implemented Re:Lax and it looks great. Thanks

I use a ParallaxContainer in my CollectionViewCell, just like in your example. Works great, except for one problem: how can I prevent a subview from "expanding" when the cell is focussed ?

Here's an example:

screen shot 2017-04-08 at 13 14 31

Here the red UIView has a constraint so that its leading lines up with the "APP STORE" label, and the trailing of the "8:AM", but when focused this is no longer the case.

Again, thanks for the great work. If you'd like to Testflight the app, let me know I'd be happy to add your email to the list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.