Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

About UIKIT_EXTERN in FBShimmeringLayer.m #24

Closed
zixun opened this issue Apr 28, 2014 · 5 comments
Closed

About UIKIT_EXTERN in FBShimmeringLayer.m #24

zixun opened this issue Apr 28, 2014 · 5 comments

Comments

@zixun
Copy link

zixun commented Apr 28, 2014

I was see such code in FBShimmeringLayer.m

UIKIT_EXTERN float UIAnimationDragCoefficient(void); 

I'm not so clear about the UIKIT_EXTERN.

please give your comments~thx!

@travisjeffery
Copy link

#ifdef __cplusplus
#define UIKIT_EXTERN        extern "C" __attribute__((visibility ("default")))
#else
#define UIKIT_EXTERN            extern __attribute__((visibility ("default")))
#endif

Here's how it's defined. If you don't know what extern does, then start here: http://www.geeksforgeeks.org/understanding-extern-keyword-in-c/

@grp
Copy link
Contributor

grp commented Apr 28, 2014

UIAnimationDragCoefficient is a private function defined in UIKit. It's used in Shimmer to add support for the slow animations feature when debugging in the simulator. By using UIKIT_EXTERN, it tells the compiler that the function is implemented in UIKit rather than in Shimmer itself.

@grp grp closed this as completed Apr 28, 2014
@zzz6519003
Copy link

private function? wow so many hacks there!

@grp
Copy link
Contributor

grp commented May 6, 2014

It's only used to help debugging in the simulator. It's not required to use Shimmer and won't affect your apps on the App Store.

@zzz6519003
Copy link

🆒

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants