简体   繁体   中英

What's the difference between FBTweakBind and FBTweakValue?

I am using FBTweak lib in my iOS project. I wonder is there difference between FBTweakBind and FBTweakValue.

For example:

FBTweakBind(self.headerView, alpha, @"Main Screen", @"Header", @"Alpha", 0.85);

can rewrite like this:

self.headerView.alpha = FBTweakValue( @"Main Screen", @"Header", @"Alpha", 0.85 );

so are they just equal ?

I figure it out.

FBTweakBinding will refresh the value it's binding. It means that FBTweak will call the setter of the property whenever you change the value while app is running.

FBTweakValue is just a variable. When program is going through that line of code, the property will be set. If you change the FBTweakValue after where it used, it did nothing, unless that line of code running again.

I am playing with FBTweak lib only since couple of minutes, but from what I understood from the documentation on github, FBTweakValue is just setting the value, but FBTweakBind is binding the changes to make tweaks update live.

Keep in mind, that both FBTweakValue and FBTweakBind might behave differently in a release builds

Source: https://github.com/facebook/Tweaks/wiki#bind

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM