Git Product home page Git Product logo

Comments (5)

ctews avatar ctews commented on September 3, 2024

Hi,

could you please provide the code that throws that fatal error :) Then I'll try to reproduce and fix if there's a bug!

Cheers

from swiftpulse.

ppamidi avatar ppamidi commented on September 3, 2024

Sure,

I'm trying to add the pulsing animation under uibutton centered to its frame. It is placed under the button layer as mentioned in the readme doc

 @IBOutlet weak var beacon_one_button: UIButton!
 override func viewDidLoad() {
         super.viewDidLoad()
         // Do any additional setup after loading the view, typically from a nib   
         beacon_one_button.backgroundColor = UIColor(red:0.544,  green:0.427,   blue:0.896, alpha:1)
 }

 //function called on button click
 @IBAction func toggleBeaconOne(sender: AnyObject) {
                 beacon_one_button.backgroundColor = UIColor(red:0.909, green:0.411, blue:0.479, alpha:1)
                 var halo_layer_one = LFTPulseAnimation(repeatCount: Float.infinity, radius: 300, position: beacon_one_button.center)
                 self.view.layer.insertSublayer(halo_layer_one, below: beacon_one_button.layer)
 }

Let me know if I'm doing something wrong :)

from swiftpulse.

ctews avatar ctews commented on September 3, 2024

Do you get this at compile time or at run time? I'm currently on Swift v1.2 and it's working fine for me with the same calls. But I used to do my UI programatically. Is the error thrown when you initialize the pulse animation at var halo_layer_one = LFTPulseAnimation(...) or the line underneath when you try to apply it to the button layer? Did you import UIKit?

Can you make sure that the weak declaration of the beacon_one_button isn't raising this problem. A little bit guessing in the wild from my side at the moment, because I can't test it before this or tomorrow evening ;) Just looked at my code that at least compiles without any problems with Swift v1.2 ;)

from swiftpulse.

ppamidi avatar ppamidi commented on September 3, 2024

Yes, I did imported UIKit and also verified by removing weak reference to button attribute. It still breaks at the initialization step.

I've included couple of screenshots incase if it helps.

screen shot 2015-04-23 at 2 49 39 pm

screen shot 2015-04-23 at 2 51 35 pm

from swiftpulse.

ctews avatar ctews commented on September 3, 2024

@ppamidi Thanks for your feedback! It was actually a bug. I don't know why but it couldn't find init(layer:) even if it's a subclass of CALayer. I fixed it and it should work for you now!

Again thank you for the feedback! :)

from swiftpulse.

Related Issues (11)

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.