Comments (5)
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.
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.
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.
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.
from swiftpulse.
@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)
- stop/start pulse HOT 16
- Add Pod Support
- support marker google map?
- Background thread UI violation in iOS 14
- Use of unresolved Identifier 'Async' in LFTPulseAnimation.swift File HOT 2
- Can't get it to work HOT 1
- Any extra tips on how to use it? HOT 4
- How can I use with auto-layout? HOT 1
- Add more layer HOT 1
- How do i make a pulse like the one on the readme with multiple pulses? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftpulse.