Giter VIP home page Giter VIP logo

stylist's People

Contributors

drekka avatar yonaskolb 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

stylist's Issues

stylist_willMove optimization

Original

    @objc func stylist_willMove(toSuperview: UIView) {
        stylist_willMove(toSuperview: toSuperview)
        Stylist.shared.style(self)
    }

Should be able to skip the styling if the superview is nil because the view will not be visible

    @objc func stylist_willMove(toSuperview: UIView) {
        stylist_willMove(toSuperview: toSuperview)
        if toSuperview != nil {
                  Stylist.shared.style(self)
        }
    }

Enhancements proposal

First of all I love Stylist! You've really made something great here, especially with that live reload.
I've got some feedback so far:

  • Styles designable comma separated styles
  • Update Xibs via IBInspectable and prepareForInterfaceBuilder (I already got this working by adding the code that loads the stylist into the stylist_willMove swizzled method. It works as long as you use a designable view).
  • Optimize finding the right theme using a dictionary instead of looping through all styles?
        for theme in themes.values {
            for style in theme.styles {
                guard style.applies(to: styleable) else { continue }
                apply(style: style, to: styleable)
            }
        }

I'm curious what your thoughts are on these.

Stylist breaks my Carthage deps a bit

Can't fetch Carthage deps with the following Cartfile:

github "ReactiveX/RxSwift" ~> 4.4.0
github "Moya/Moya" ~> 11.0.2
github "SwifterSwift/SwifterSwift" ~> 1.6.2
github "SwiftyBeaver/SwiftyBeaver" ~> 1.6.1
github "adamwaite/Validator" ~> 3.1.1
github "SnapKit/SnapKit" ~> 4.0.0
github "yonaskolb/Stylist" 
github "Skyvive/Swiftstraints" ~> 4.0.0
github "yonaskolb/Codability" ~> 0.2.1
github "ReSwift/ReSwift" ~> 4.0.1
github "Decybel07/L10n-swift" ~> 5.4.1

Probably conflicts with github "jpsim/Yams" "master" or krzysztofzablocki/KZFileWatchers...

*** Fetching KZFileWatchers
*** Fetching KZFileWatchers
*** Fetching ReactiveSwift
*** Fetching ReactiveSwift
*** Fetching KZFileWatchers
*** Fetching ReactiveSwift
*** Fetching KZFileWatchers
*** Fetching KZFileWatchers
*** Fetching KZFileWatchers
*** Fetching KZFileWatchers
*** Fetching KZFileWatchers
*** Fetching KZFileWatchers
*** Fetching KZFileWatchers
*** Fetching ReactiveSwift
*** Fetching KZFileWatchers
*** Fetching ReactiveSwift
*** Fetching KZFileWatchers
*** Fetching KZFileWatchers
Failed to check out repository into /Users/yura/Library/Caches/org.carthage.CarthageKit/dependencies/Yams: No object named "nn-dylib-versions" exists (Error Domain=CarthageKit.CarthageError Code=24 "(null)")

Not working when built using Carthage

I've tried to include Stylist in my Carthage dependencies. But there are two issues I've found. Firstly Stylist needs a Cartfile like this:

github "krzysztofzablocki/KZFileWatchers"
github "jpsim/Yams"

However when I then tried to get Carthage to update, it tells me there is a circular dependency.

So next I tried adding KZFileWatcher and Yams to my project's Cartfile. It built ok, but when the app started, it checked the frameworks and crashes, reporting that Yams is version 0.0.0 instead of the required 1.0.0.

So at the moment I can't use Stylist.

Any ideas?

Performance impact

I'm experiencing severe performance reduction in UICollectionViews, even if no cells (or subviews) are styled at all. I'm guessing that this is caused by the swizzling of func willMove(toSuperview newSuperview: UIView?) that will check every view ever moved to a parent to see if a style should be applied? Any input, past experience, or other help of how to work around the performance reduction would be highly appreciated!

when open example get Error loading theme: notFound

Error loading theme: notFound , when open example

test on xcode 8.3.3 , iphone 4 , ios 9.3.

i fix it like this , in AppDelegate didFinishLaunchingWithOptions .

    if let path = Bundle.main.url(forResource: "Style", withExtension: "yaml") {
        Stylist.shared.watch(url: path, animateChanges: true) { error in
            print("Error loading theme:\n\(error)")
        }

    }

thanks

Enabling Stylist designable

Using Carthage, Stylist is added to my project as a framework. This means that the @IBDesignable and @IBInspectable annotations are not visible to IB and therefore I'd have to set the styles programmatically.

Instead I added the following code to the project and thought you might want to provide it as a work-a-round for other people. Just add it to the project where Stylist is being included as a framework.

import Stylist
import UIKit

/// Extensions to enable IB

@IBDesignable extension UIView {
    @IBInspectable var styleName: String? {
        get { return style }
        set { style = newValue }
    }
}

@IBDesignable extension UIViewController {
    @IBInspectable var styleName: String? {
        get { return style }
        set { style = newValue }
    }
}

@IBDesignable extension UIBarItem {
    @IBInspectable var styleName: String? {
        get { return style }
        set { style = newValue }
    }
}

Note: I don't use CocoaPods so I'm not sure if it will have the same issue.

Cocoapod

Hey love what you are doing with Stylist. I was keeping an eye on StyleKit but it never matured into a framework I would use.

The issue: pod 'Stylist' isn't working.

Unable to find a specification for Stylist

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.