This repository has been archived by the owner on Jun 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Known Issues
Sahand Nayebaziz edited this page May 3, 2016
·
9 revisions
Thank you for making it here to the known issues page. If you would like to contribute to this project or if you're simply curious what issues this project currently has, you're in the right place.
Before making formal Github issues around the following, here is a list of what I can think of at first release of StateView.
- StateView needs tests for core functionality.
- There are properties that should be
let
and notvar
inStateView
(likeshadow
) - There are methods that should be private in
StateView
- If you initialize and the place a
UIView
, and then place aStateView
, theStateView
and any following views can have AutoLayout constraints that directly reference theUIView
. This currently doesn't work in the opposite direction. You can't place aStateView
, and then use theShadowElement
that it returns to expose aUIView
that could be used for AutoLayout constraints. This could possibly be done by exposing some sort of placeholder UIView in theShadowElement
that returns from the placement of aStateView
so that otherUIView
instances can create AutoLayout constraints referencing that view, and then somewhere inShadow.didPlaceAll
resolving that constraint from the placeholder view to the initialized, or kept,StateView
itself. - Documentation is currently incomplete
- There are lifecycle methods that should be added to complement the render cycle, like viewDidUpdate(props, state) after a render is completed, viewWillUpdate(props, state) just before, etc
- Allowing for as much flexibility as there is in a dictionary with type
State: Any
does result in having to do a lot ofif let something = props[key] as? Type
. My intuition is that this is okay because this means more developers can useprops
andstate
in a way that works for them. Especially for developers coming from React and Javascript, this sort of flexibility is expected. Also,if let
is safe. If there is a better way to keep this freedom but also reduce the frequency of having to unwrap values, it could improve the experience. - Placing a UIView and then a StateView with correctly add the StateView above the UIView, but then the next render method will cause a re-add of the StateView but not below the existing StateView, and this UIView will cover that StateView. This does not happen with two StateViews because original place() order is kept.
- There is no way to force StateView to keep a UIView placed, without re-rendering it each time. Instead, you have to add the subview yourself once. Forcing a UIView to be placed is helpful when you'd like to do something like keep a background image that fades from one image to another. Maybe this can be done with some sort of
placeOnce
? Currently, you would have to add the subview only once inrender
by doing something like keeping an optional property for that view and checking for nil before adding it once in render, or using some other flag along those lines. - Better UIView equality checking. If there was a way to compare a UILabel with another UILabel to see if they are equal key/value for key/value in their configurations, then we could spare refresh UIViews that will be exactly the same.
Take a look at the known issues and help improve StateView.