Code Monkey home page Code Monkey logo

spring's People

Contributors

0oneo avatar attilaszasz avatar brandonminch avatar chohey avatar giacomopiva avatar giolin avatar hamzaansari09 avatar imkevinxu avatar jaisonv avatar jakemanning avatar jamztang avatar jasdev avatar jpachecou avatar jpwharton avatar larryaasen avatar mengto avatar naoyashiga avatar nolanw avatar pglongo avatar phatmann avatar rastersize avatar rcgary avatar ricardopereira avatar rishabhtayal avatar schneiderandre avatar shoheiyokoyama avatar thedoritos avatar victors1681 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  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

spring's Issues

check the animation is complete

This method does not wait for the animation is complete.
Removing immediately, and no animation.
Is it possible to determine when the animation is completed in full?
How to fix?

layer.animation = "pop" 
layer.duration = 1.0
layer.animateToNext {  
    removeView()
} 

At the moment I can only do this through dispatch_after.

Not able to run a project

Hello,

I have downloaded this project and build it.
It builds successfully.

I am now trying to run it in iOS simulator, but it is not running in iOS simulator.

Help me..

Thanks in advance.

update to Swift 2.0

Hi, I'm getting errors in Xcode 7. Do you have plans to update to Swift 2.0?

Thanks,
Kris

Revert animations

It would be nice to revert the animation.

Ex. the slideUp is great for showing content, but when i want to hide it again the only possible animations is right now fall or fadeOut or zoomOut.

I think it would be great if there where a revert property (BOOL), so the animation to "go back".

Correct me if i am wrong.

Back button does not nothing

I'm starting the Tutorial from your book but I've imported the Spring framework to the project and when I've set the segue to "unwindToViewController" and Run the project, the Back button does nothing....Please help me ;) Regards,

Álvaro.

Add Tests

It would be good to replace the boilerplate tests with ones that actually determine whether the library is working properly or not.

AddSubView to SpringView

Hi everyone !
Why is it not possible to add a subview in a SpringView ?
addSubView(myView) does not work...

I have a custom subclass ChooseButton of SpringView and I want to add a subview (mySubView in this case) to this view :

class ChooseButton: SpringView {
     enum TypeButton {
        case YES, NO
    }

    var type:TypeButton!
    var size:CGFloat = 90

    var enabled: Bool!
    var delegateButton: ChooseButtonDelegate?

    init (type: TypeButton) {
        super.init(frame: CGRectMake(0,0,size,size))
        self.type = type
        enabledButton()
        if type == TypeButton.YES {
            self.backgroundColor = CustomColor.Emeralde
            self.center = CGPointMake(gScreenSize.width*3/4, gScreenSize.height-self.frame.size.height)
        } else {
            self.backgroundColor = CustomColor.Alizarin
            self.center = CGPointMake(gScreenSize.width/4, gScreenSize.height-self.frame.size.height)
        }
        self.layer.cornerRadius = size/2

        var mySubView = UIView(frame: frame)
        mySubView.backgroundColor = UIColor.blackColor()
        addSubview(mySubView)
    }

But my Subview does not shows up... I can't see why.

How to set the image with rounded corner by `DesignableButton` with `cornerRadius`?

I have a DesignableButton of size 80x80 with cornerRadius of 40, aiming to change the avatar image when clicked. However, when I invoke setImage with normal control state, the avatar image is all shown in the button with any rounded corner. I have also tried to set cornerRadius to 40 after setImage, but it still fails. So I wonder how to do it. Thank you.

Zoom Transition messing up CollectionView Flow Layout Causing Jerk on Return

The title says it all but because the transform is applied, the collectionview tries to constantly update the flow layout so it jerks when you return to that view. I have written a fix but being a Github Newbie I don't know what to do with it. Advise and I will share. You can review and decide if it is better or should be an additional transition. I also have a couple of other transitions that I would be willing to add.

Thanks,
Alex

fadeOutUp? How could I do this?

I'd like to fadeOut while moving Up. I don't think I would get the desired effect by calling fadeOut after slide up. Any suggestions?

Possible retain Cycle?

Hi!,

Please correct me if I'm wrong.

I'm looking at your SpringButton:

lazy private var spring : Spring = Spring(self)

and the Spring:

    private var view : Springable

    init(_ view: Springable) {
        self.view = view
    }

Won't this be a retain cycle, preventing to release the button from memory?

error: 'AsyncImageView' is ambiguous for type lookup in this context

When using AsyncImageView 1.5.1 and Spring, both as pods in a Swift project, the following compile-time error occurs:

error: 'AsyncImageView' is ambiguous for type lookup in this context
    @IBOutlet weak var myvariable:AsyncImageView!
                                  ^~~~~~~~~~~~~~
AsyncImageView.AsyncImageView:1:29: note: found this candidate
@objc(AsyncImageView) class AsyncImageView : UIImageView
                            ^
Spring.AsyncImageView:1:13: note: found this candidate
@objc class AsyncImageView : UIImageView

The traditional tool to fix such problems is separate namespaces, but there are no namespaces.

Based on similar problem Haneke/HanekeSwift#147 and instructions in https://github.com/raywenderlich/swift-style-guide#class-prefixes or http://stackoverflow.com/questions/24214863/swift-class-prefix-needed, I tried to prefix the type specification like this:

@IBOutlet weak var myvariable:AsyncImageView.AsyncImageView!

but it produced the exact same error message.

How to use both pods in a project ?

Use enum for keys, not plain strings

Using these magic keywords is not very extensible or easy to use. Having predefined constants would be a step up, but you can even do better with an enum for all the animation options. If you wanted, you could use these strings to define the enum values in the inner workings not to break the current code.

How to define the background color with DesignableButton?

There is no any background color option in Attributes inspector panel, only Border, Shadow,Text Color and Background Image. And I download your Xcode project, there is only cornerRadius in Runtime Attributes, but your button is right in BLUE although you don't have any blue color defined in Attributes inspector panel.
How to define the background color with DesignableButton?

Is there anybody know how to call "springWithComlpetion" in Object-C code?

I'm so confuse about using Spring framework in OC.
I already have read the another example which made by author about using Spring in OC.
But the example code is no enough for me to understand.
I'm the freshman on the way of changing Swift to OC.
I hope anyone can answer my question.
Thank you!

Designable UITextField rightPadding doesn't work

Designable UITextField rightPadding doesn't work, and it also disable Clear Button, even set as always appears.
Reset the rightPadding to "0" is no helping, have to delete the Key Path in Id inspector so that the Clear Button comes back.

Back Buttons Not Working (From book tutorial)

Hi =-)

I'm following the "Quick Prototyping in Xcode" chapter of the book and when I first import the Spring Framework, then CTRL + drag from the back button to the exit icon ... I don't seem to get any options to choose like in the video (the single option shown is never seen).

It just cancels out and the back button fails to work?

Any ideas?

I'm using:

Version 6.1.1

I disabled auto layout and tried doing this in a simplified app with only two view controllers but still no luck.

Thanks!

EDIT: Also I downloaded TransitionsDemo and that works fine.. but my own hello world app doesnt. I even copied over the Spring framework fromt here to my app and I still don't get the Presenting Segues unwindToViewController for the Exit component

animation autostart doesn't work properly

a noticed autostart issue found that running on device (I'm tested on iPhone 6 Plus and 5s).
The animation is start properly once the page appeared when we are running using xCode.
If we stop running from xCode, kill the app on phone and restart the app, the animation will not appeared.

unless there is a delayed set on autostart which is more than 0.3

Trigger animation more than once

Is there any way to run an animation more than once? I see that the spring resets itself after I call any animate method, so if I call animate again nothing happens. I'd like to apply whatever animation is set in Interface Builder each time I call animate.

Unwind to ViewController

I can't get the unwind to viewcontroller working. I followed the exact steps shown in the "Quick Prototyping in Xcode" chapter on DesignCode.io

Thing is, in my version of Xcode (Version 6.3.2 (6D2105)) it says "modal" segue is deprecated. "present modally" is available, but it does not play nice when I try to get a back button working.

Or am I doing something wrong?

Simple scene with two view controllers;
View 1: A button that is ctrl-dragged to View 2: Present modally
View 2: A button that is ctrl-dragged to the exit of View 2: Unwind to Viewcontroller

» Animated GIF with my example

Swift Compiler Error

Didn't have this problem last night. Not sure what cause this? Help, please.

/Spring-master/Spring/LoadingView.swift
/Spring-master/Spring/LoadingView.swift:40:99: 'AnyObject' is not convertible to 'UIView'; did you mean to use 'as!' to force downcast?
/Spring-master/Spring/Misc.swift
/Spring-master/Spring/Misc.swift:26:37: 'countElements' has been renamed to count
/Spring-master/Spring/Misc.swift:75:21: 'countElements' has been renamed to count
/Spring-master/Spring/DesignableTabBarController.swift
/Spring-master/Spring/DesignableTabBarController.swift:36:35: 'selectedImageTintColor' was deprecated in iOS version 8.0: Use tintColor
/Spring-master/Spring/DesignableTabBarController.swift:49:46: '?' must be followed by a call, member lookup, or subscript
/Spring-master/Spring/DesignableTabBarController.swift:50:53: '[AnyObject]?' is not convertible to '[UITabBarItem]'; did you mean to use 'as!' to force downcast?
/Spring-master/Spring/DesignableTabBarController.swift:58:47: '?' must be followed by a call, member lookup, or subscript
/Spring-master/Spring/DesignableTabBarController.swift:59:53: '[AnyObject]?' is not convertible to '[UITabBarItem]'; did you mean to use 'as!' to force downcast?
/Spring-master/Spring/DesignableTabBarController.swift:67:46: '?' must be followed by a call, member lookup, or subscript
/Spring-master/Spring/DesignableTabBarController.swift:68:53: '[AnyObject]?' is not convertible to '[UITabBarItem]'; did you mean to use 'as!' to force downcast?
/Spring-master/Spring/DesignableTabBarController.swift:76:47: '?' must be followed by a call, member lookup, or subscript
/Spring-master/Spring/DesignableTabBarController.swift:77:53: '[AnyObject]?' is not convertible to '[UITabBarItem]'; did you mean to use 'as!' to force downcast?
/Spring-master/Spring/DesignableTabBarController.swift:85:46: '?' must be followed by a call, member lookup, or subscript
/Spring-master/Spring/DesignableTabBarController.swift:86:53: '[AnyObject]?' is not convertible to '[UITabBarItem]'; did you mean to use 'as!' to force downcast?
/Spring-master/Spring/DesignableTabBarController.swift:95:39: '[AnyObject]?' is not convertible to '[UITabBarItem]'; did you mean to use 'as!' to force downcast?
/Spring-master/Spring/Spring.swift
/Spring-master/Spring/Spring.swift:450:35: Missing argument label 'completion:' in call

cornerRadius property override error

I'm getting an error on the cornerRadius property declaration: "Overriding declaration requires an 'override' keyword"

@IBInspectable public var cornerRadius: CGFloat = 0 {
    didSet {
        layer.cornerRadius = cornerRadius
    }
}

Anyone is getting the same eerror with iOS 8.3 SDK ?

It is possible to fix by replacing the declaration with:
@IBInspectable public override var cornerRadius: CGFloat {
didSet {
layer.cornerRadius = cornerRadius
}
}

Note that the compiler complains also about the initialization value.

'selectedImageTintColor' was deprecated in iOS 8.0: Use tintColor

Hi,

In the new XCode 6.3 beta (6D543q), I got the following warning :

/…/Spring/DesignableTabBarController.swift:22:35: 'selectedImageTintColor' was deprecated in iOS version 8.0: Use tintColor

I don't have the last version of the file, but the line still exists in the last version.

I don't use this class in my app, so I will change the value locally, but I don't know if it can be changed for people who use the class. :)

CGBlendMode.Type' does not have a member named 'Normal'

I'm currently running Swift 2, with Xcode 7 and using the swift2 branch of Spring. Upon building the project I am given this error

/Desktop/Swift/Dynamic/Pods/Spring/Spring/DesignableTabBarController.swift:110:40: 'CGBlendMode.Type' does not have a member named 'Normal'

Any ideas? I've already tried building and cleaning.

Extraneous files in Spring folder

There seem to be a lot of extraneous files in the Spring folder like Data.swift and Info.plist or LoadingView.xib and I'm not sure what is absolutely necessary for Spring to run while integrated with my project. Could you look into separating the absolutely necessary files for animation vs the demo app? Thanks!

AllowUserInteraction during animations

Currently, user interaction on SpringViews being animated is disabled... ie, they don't respond to touch events during the animation. To remedy this, the getAnimationOptions() function needs to be modified with something like: return UIViewAnimationOptions.CurveEaseIn | UIViewAnimationOptions.AllowUserInteraction (for each case)

See the first answer regarding this here: http://stackoverflow.com/questions/3614116/uiscrollview-touch-events-during-animation-not-firing-with-animatewithduration

Spin Animation & Animation Loop

Hello,
Let me just start and say I'm a really hyped about Spring :-)

I was wondering if there's a way to animate a spinner through storyboard properties. e.g make an image rotate a in a loop.

I did found this in the code:
https://github.com/MengTo/Spring/blob/master/Spring/LoadingView.swift#L30-L36

but I think this kind of simple animation would be easier to customize from a storyboard.

also, in the source code I saw that looping the animation was done via animation.repeatCount = HUGE
shouldn't there just be a flag for animation.repeatsForever = true
which you can toggle from the storyboard

@MengTo WDYT?

zoomOut issue on Image view

zoomOut does not work on ImageView : SpringImageView

I have tried almost all combination on Interface Builder but nothing is working. zoomIn and other animation works but zoomOut does not work.

I am trying it in XCode: 6.2 (6C131e), swift and iOS 8.2 sdk
Testing on Simulator with iOS 8.2

There might be some issue or I need to do some extra code for zoomOut animation for ImageView. Please suggest.

Many Thanks!

Licencing Issues

Hello Meng, Thanks for your contribution.
Although there's a couple licensing issues of your new framework which may get you into troubles.

You may consider remove Proxima Pro from your library. It's a commercial software and it cannot redistribute like this. If you really care about fonts, You may consider changing to an open license font.

You may need to add a LICENCE file to your open source framework, also.

Thats all. Wish you all the best.

Force animation stop

HI,
Spring is amazing lib, I do like it. When I set a 9999 repeat count for the animation. How I can stop it ? I search the code and issues, did not find the solution yet. Any solution about this?

Thanks!

setValue:forUndefinedKey

2015-03-03 19:55:52.507 demos[24988:4604020] Failed to set (animation) user defined inspected property on (UIView): [<UIView 0x7a8860b0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key animation.

Swift Cocoapod Issue

I am trying to compile my project with Spring as its cocoapod dependency.

I am using xcode 6.4 and I keep getting this segmentation fault 11 error.

  1. While type-checking 'viewDidLoad' at /Users/samuelkitono/Airward/airward-client-swift/AirwardLoadingViewController.swift:18:14
  2. While type-checking expression at [/Users/samuelkitono/Airward/airward-client-swift/AirwardLoadingViewController.swift:20:9 - line:20:142] RangeText="self.checkmarkSpringImageView.image = self.checkmarkSpringImageView.image?.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate)"
  3. While deserializing 'init' (ConstructorDecl #330)
  4. While deserializing decl #573 (XREF)
  5. Cross-reference to module 'UIKit'
    ... UIImageView

Tried cleaning the project and rebuild.
Tried quitting xcode and rebuild
None of them work...

iOS 7 not supported when adding animation in Storyboard

This is probably intended behavior but there should be a note in the README at least.

I set up an animation for a view in Storyboard and it worked great in iOS 8. When I tested it on iOS 7 the animation defaulted to the slide from right animation. I had to manually add the animation code in a view controller for it to work for iOS 7.

Just a heads up for other people and maybe a note in the README could help!

Warnings on Storyboard since Xcode 6.3

Since Xcode update (6.3), I have warnings that appears on storyboard :

Main.storyboard: warning: IB Designables: Ignoring user defined runtime attribute for key path "animation" on instance of "UIView". Hit an exception when attempting to set its value: [<UIView 0x7fcc64aa4630> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key animation.

I have the same warning for "autostart" and "cornerRadius". But when I build, that still working.

KeyboardLayoutConstraint.swift using programmatically?

When working with the storyboard and the KeyboardLayoutConstraint.swift file, the keyboard is working great and the view attached to the bottom goes up. However I want to do everything pure programmatically.

I have something like below:

let views = ["messagesTableView": messagesTableView,"addMessageView": addMessageView,"addMessageTextField": addMessageTextField]

let keyboardViewV = KeyboardLayoutConstraint(item: addMessageView, attribute: NSLayoutAttribute.Bottom, relatedBy: NSLayoutRelation.Equal, toItem: self.bottomLayoutGuide, attribute: NSLayoutAttribute.Bottom, multiplier: 1.0, constant: 0.0)
self.view.addConstraint(keyboardViewV)

let messagesViewV = NSLayoutConstraint.constraintsWithVisualFormat("V:|[messagesTableView][addMessageView]", options: NSLayoutFormatOptions(0), metrics: nil, views: views)
self.view.addConstraints(messagesViewV)

I've added all the constraints, but when I run my app, the keyboard goes up, but the addMessageView which is attached to the bottom layout guide, doesn't go up. The awakeFromNib function should fire, but nothing happens. What is going wrong? Is it even possible to do something like this programmatically? I tried a lot, but nothing works. I even changed the KeyboardLayoutConstraint.swift file to look for a better function than awakeFromNib, but this also doesn't work.

Installation problem

Hi, i downloaded the sample project and it works as expected. I have started a new swift project in xcode (6.3) and copied the "Spring" folder to my files.

In my storyboard i put in a simple UIView and i can set the class to "SpringView". In the inspector i see the new Spring fields, i set Autostart to on and put in the value "shake" for Animation. If i start my project the UIView stays where it is. it does not work.

if i put a new UIView to your sample-project and set the Class to SpringView. The module is automatically filled with "Spring". This does not happen on my new projected.

So i think i am missing something.

thanks for help.
dd

LoadingView.xib missing?

I'm using CocoaPods to integrate Spring, but the app crashes when calling view.showLoading( ):
"Could not load NIB in bundle...with name 'LoadingView'"

Could this be because LoadingView.xib is not included in the podspec? I'm new to CocoaPods, but the podspec has: "s.source_files = 'Spring/.swift' " -- should there also be: ",.xib" ?

Thanks

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.