Releases: cbpowell/MarqueeLabel
v2.0.2: Bug fixes & improvements
- Use
instancetype
instead ofid
for init methods. - More code reuse.
- Remove call to remove all animations on own layer (which could affect animations added to the MarqueeLabel itself, not the intent).
- Better handling of AutoLayout constraints tied to the text baseline (issue #68).
v2.0.1: Scrolling logic tweaks
- Improved code reuse in the logic which tries to determine whether or not a MarqueeLabel instance should scroll. This should also make debugging easier, as you can set breakpoints on specific lines to determine why your label isn't moving.
- Added overridden
willMoveToWindow:
anddidMoveToWindow
UIView methods. These methods are used to hopefully improve stopping scrolling animations when they're no longer needed (which helps prevent jumpiness if they're re-added to a window) and to better restart scrolling during view controller transitions. - Re-implemented the modal view controller in the demo.
- Added label pause switch to demo.
- Corrected some other errors in the demo.
v2.0.0: Now more Apple-like!
MarqueeLabel has been re-written to use Core Animation, and now better mimics the marquee-type labels found in iOS. Check out the new features and changes:
Big changes
MLContinuous
is now the default marquee type.- Edge fades are now better integrated, and fade in and out automatically during the scroll animation. This means you no longer need to adjust your view positioning to account for the fade length you'd like to use! Note: this will affect how you position MarqueeLabels in their superview!
- Specifying the length of the scroll is now done either through the
scrollDuration
property or during initialization, and the duration specified is now less confusing (at least in my opinion). The scroll duration specified will be the amount of time the label takes to make one scroll cycle. Note: this may affect your timing! - Fixes some of the calculation that decides if the label should scroll based on the text length. Also edge gradients will not appear when the text fits (even if just barely).
Other stuff
- Improved documentation here and there.
- Cleaned up the demo project, and moved it to a Storyboard. Forgot to include the modal-presentation test, but will include that shortly.
Technical
MarqueeLabel now uses CAMediaTimingFunction
when creating its animations, although the external interface for scroll timing still utilizes the standard curve types in UIViewAnimationOptions
. However it would be very easy to tweak MarqueeLabel to use a custom timing function by modifying the (private) timingFunctionForAnimationOptions:
function to provide a timing function with your custom control points. The timing of gradient and position animations should just work™, even with a custom timing function.
The Core Animation foundation for scrolling should also provide for some cool future functionality in MarqueeLabel. Having finer control over animation speed, timing, and offset allows for things that weren't possible before, such as using pan gestures to control label scroll!
v1.5.0: Add pre- and post-scroll hooks
- Added a
labelWillBeginScroll
public method, which may be overridden by subclasses to perform custom actions before scrolling begins. - Added the
labelReturnedToHome:
method, which maybe overridden by subclasses to perform custom actions immediately after the label has returned to the "home" position.
v1.4.3: Fix double-drawing
- Fixes double-drawing of label text on Interface Builder created MarqueeLabel instances (ref issue #58)
v1.4.2: Revised frame/bounds checking
- Uses overridden
layoutSubviews
to detect frame and bounds changes, which prevents some cases from slipping by (ref #51) - Removes an empty
drawRect
function, which is stated to be a performance hit
v1.4.1: Checks for non-integral frames; eliminate strong references to self
v1.4.0: Scroll speed properties
- Converted
lengthOfScroll
andrate
properties to public properties, so that they can be changed after label creation, and when creating a MarqueeLabel via Interface Builder (ref #47)
v1.3.1: Bulk manipulation and fixes
- Fixed the
minimizeLabelFrameWithMaximumSize:adjustHeight:
method, which had been broken for awhile. - Corrected how the bulk label manipulation methods are intended to be used.
- Added a 'generic' bulk manipulation class method,
restartLabelsOfController:
, to try and avoid confusion on when they should be used (ref issue #44) - Added a bit more documentation.
v1.3.0: Added Appledoc documentation
- Added Appledoc documentation, incorporating Cocoadocs support.