Comments (2)
This seems to be a 64 bit v 32 bit issue.
CGFloat is typealiased to Float. However, Float is always 32 bits, whereas CGFloat is meant to be 64 bits on 64 bit hardware.
We may need to use CGFloat until Apple figures out just how broken their code is.
--------- Original Message --------- Subject: [SKTUtils] The Swift version of SKTUtils gives many compilation errors on OS X (#1)
From: "Matthijs Hollemans" [email protected]
Date: 6/13/14 6:14 am
To: "raywenderlich/SKTUtils" [email protected]
For some reason, the compiler on OS X is more strict about its types. On iOS this works fine:
extension CGPoint {
init(angle: Float) {
return self.init(x: cosf(angle), y: sinf(angle))
}
But on OS X it needs to be written as:
extension CGPoint {
init(angle: Float) {
return self.init(x: CGFloat(cosf(CFloat(angle))), y: CGFloat(sinf(CFloat(angle))))
}
Maybe this is a different build setting, maybe it's a compiler feature/bug. Let's wait until we get a new beta.
Maybe we should also use CGFloat in the API instead of Swift's own Float.
Reply to this email directly or view it on GitHub.
from sktutils.
Resolved by renaming all uses of Float to CGFloat.
from sktutils.
Related Issues (11)
- Could not found file xxx.caf
- CocoaPods support HOT 1
- Support for SKAction.speed ?
- RubyMotion version HOT 1
- Adding keys to the methods in SKAction+SpecialEffects.swift HOT 1
- I made a ring chart library that relies on this project HOT 1
- swift 3 xcode 8? HOT 1
- Demo: Balls don't always collide with screen borders HOT 2
- Naming conflicts (due to public extensions)
- Building SKTTimingFunctions fails without importing Foundation in Xcode 6 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 sktutils.