Giter Club home page Giter Club logo

cupcake's People

Contributors

nerdycat 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  avatar  avatar  avatar

cupcake's Issues

Xcode 10.2 support

After updated Xcode 10.2, swift compiler gets error following

if style != .none && style != .single && style != .thick && style != .double {
:: 'none' is unavailable: use [] to construct an empty option set

I think ".none" option is gone now.

HStack Fill equally

Hello,
I have two label inside HStack and i want to make them fill equally (each label = 50% width of content)
How can i do that ? I tried align(.fill) but didn't work

Safe Area vs Top Layout Guide

Hi! Thanks a lot for this cool library :)

I use Swift 4 with latest Xcode 9 and want to embed a table in the view of my main view controller, which I embedded in a navigation controller via the storyboard in interface builder, looks quite similar to the cupcake demo. Now on newer projects, I do not have the top and bottom layout guides, as they are deprecated, only the safe area. When I add a GroupTable to my main view now, the navigation item / bar on top overlays the group table I created. I have to add it with e.g. addTo(self.view, 60, 0, 0, 0) in setupUI so that the table is rendered below the navigation bar. If I run the same code on iOS 9.3 devices (with 60
top), this adds a not so nice margin between the header and the table, meaning I have to use different parameters for addTo for iOS 9.3 and iOS 11
to get the same result. Do you know if this needs a fix in the library or is the problem somewhere else / can be fixed otherwise?

Thanks a lot for your support!
Cheers

UITextView causes NSZomebie when deallocating.

co-worker found this issue.

I do not know what is make this problem exactly.

This issue does not appear if remove below code and KVO observes.
UITextView.cpk_swizzle(method1: "dealloc", method2: #selector(UITextView.cpk_deinit))

image

I found some answers. but I can not found the reason.

Someone did test method swizzle already(https://github.com/inamiy/Swizzle/blob/master/SwizzleTests/_TestObject.swift).

It can be a reason.

Deinitializers are called automatically, just before instance deallocation takes place. You are not allowed to call a deinitializer yourself. Superclass deinitializers are inherited by their subclasses, and the superclass deinitializer is called automatically at the end of a subclass deinitializer implementation. Superclass deinitializers are always called, even if a subclass does not provide its own deinitializer.

Value of type 'UILabel' has no member 'pin'

For the following line

indexLabel = Label.font(17).color("darkGray").align(.center).pin(.w(44))

Xcode throws the following error

Value of type 'UILabel' has no member 'pin'

Can you add shadow color ?

Thank you for this awesome library
Can you add shadow color to shadow() to fill xxx.layer.shadowColor
Cheers,

Swift 4 Support.

Hi. Thanks for helpfully lib but could you please add Swift 4 support. Thanks!

How to solve flicker?

    let bgView = View.bg(UIColor.c_mask_b)
    
    let contentView = View.bg("white").radius(Specs.metric.cornerRadius).pin(.center)
    contentView.addTo(bgView).makeCons({ (make) in
        make.right.equal(bgView).offset(Specs.metric.ratioMargin)
        make.right.equal(bgView).offset(-Specs.metric.ratioMargin)
        make.center.equal(bgView)
    })
    var stacks = [Any]()
    for (index, desc) in descs.enumerated() {
        var text = "\(index+1)"
        if !firstHasNo {
            text = "\(index)"
        }
        let icon = Button
            .bg(UIColor.c_tint)
            .str(text)
            .color("white")
            .font(Specs.font.small)
            .pin(.wh(16, 16))
            .radius(8)
        
        let label = Label
            .str(desc)
            .lines(0)
            .font(Specs.font.small)
            .color(UIColor.c_title)
        if !firstHasNo && index == 0 {
            stacks.append(
                HStack(label).align(.top)
            )
        } else {
            stacks.append(
                HStack(icon ,label).gap(Specs.metric.marginTen).align(.top)
            )
        }
        stacks.append(Specs.metric.marginTen)
    }
    
    let imgView = ImageView
        .bg("gray")
        .pin(.whRatio(1.86))
    let imgStack = HStack(Specs.metric.ratioMargin, imgView, Specs.metric.ratioMargin)
    
    let sureButton = Button
        .str("Được").color("white").font(Specs.font.llarge)
        .bg(UIColor.c_tint)
        .radius(Specs.metric.cornerRadius)
        .pin(.h(44.0))
    let buttonStack = HStack(sureButton)
    
    VStack(imgStack,
           Specs.metric.ratioMargin,
           stacks,
           Specs.metric.ratioMargin,
           buttonStack
        )
        .embedIn(contentView, Specs.metric.ratioMargin)
        .align(.fill)
    bgView.embedIn(UIApplication.shared.keyWindow!)
    bgView.setNeedsLayout()
    bgView.layoutIfNeeded()

Update constraint added in storyboard

I have two view (view1 and view2) in storyboard and i have constraints top space between them,
I want to update it by code, i did this:

view2.remakeCons({
$0.top.equal(view1).bottom.offset(40)
})

But i got this error:
'Unable to activate constraint with anchors <NSLayoutYAxisAnchor:0x1c4a70e00 "UIView:0x13dd5e590.top"> and <NSLayoutYAxisAnchor:0x1c067ca00 "View1:0x13de2fd70.bottom"> because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal.'

Failed to build with Carthage

This happened with Xcode 12.0 and Carthage:

*** Building scheme "Cupcake" in Cupcake.xcodeproj
Build Failed
Task failed with exit code 1:
/usr/bin/xcrun lipo -create /Users//Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/Cupcake/1.3.1/Build/Intermediates.noindex/ArchiveIntermediates/Cupcake/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Cupcake.framework/Cupcake /Users//Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/Cupcake/1.3.1/Build/Products/Release-iphonesimulator/Cupcake.framework/Cupcake -output /Users//Desktop//Carthage/Build/iOS/Cupcake.framework/Cupcake

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.