Skip to content

Migrating UIKit Controls to XAML

Arnaud Montembault edited this page Nov 10, 2016 · 14 revisions

#Status of the migration of UIKit controls to XAML [Page in progress...] We announced back in July that part of our new UIKit approach included re-implementing the UIKit controls to have them backed by XAML controls. So far, we migrated UITextField, UISlider, UIActivityIndicatorView, UIScrollView and UIButton. We created issues on GitHub when publishing some of these changes but we also wanted to share here a full status of what has been done so far and what's coming next.

UITextField

The XAML-backed implementation of UITextField (using XAML Textbox and PasswordBox controls) was first released on May 5, 2016 and you can find more details about what methods and properties are supported with this implementation here. One thing we lost with the new implementation is the participation of the UITextField control in the iOS hit-testing mechanism. That means, for instance, that scrolling on a UITextField embedded in a view will no longer trigger the view to scroll. The view will only scroll if the gesture is being done outside of the UITextField.

UISlider

The XAML-backed implementation of UISlider (using a XAML Slider) was first released on July 5, 2016 and here's the list of changes that came with this new implementation:

Feature Initial Implementation Xaml-backed Implementation
value Yes Yes
minimumValue Yes Yes
maximumValue Yes Yes
continuous Yes Yes
minimumTrackTintColor No No
maximumTrackTintColor No No
thumbTintColor No Yes
minimumValueImage Yes No
maximumValueImage Yes No
currentMinimumTrackImage Yes No
currentMaximumTrackImage No No
currentThumbImage Yes No
- setValue:animated: Partial Partial
- setMaximumTrackImage:forState: Yes No
- setMinimumTrackImage:forState: Yes No
- setThumbImage:forState: Yes No
- thumbImageForState: No No
- maximumTrackImageForState: No No
- minimumTrackImageForState: No No
trackRectForBounds No No
minimumValueImageRectForBounds No No
maximumValueImageRectForBounds No No
thumbRectForBounds:trackRect:value No No

UIActivityIndicatorView

The XAML-backed implementation of UIActivityIndicatorView (using a XAML Progress Ring) was first released on July 5, 2016 and here's the list of changes that came with this new implementation:

Feature Initial Implementation Xaml-backed Implementation
- initWithActivityIndicatorStyle Caveat Yes
- initWithCoder: Yes Yes
- initWithFrame: Yes Yes
- startAnimating Yes Yes
- stopAnimating Yes Yes
activityIndicatorViewStyle Yes Yes
color Yes Yes
hideWhenStopped Yes Caveat
isAnimating Yes Yes
UIActivityIndicatorViewStyleGray Yes Yes
UIActivityIndicatorViewStyleWhite Yes Yes
UIActivityIndicatorViewStyleWhiteLarge Yes Yes

UIScrollView

The XAML-backed implementation of UIScrollView (using a XAML ScrollViewer control) was first published on September 6, 2016 and here is the list of changes that came with this implementation:

Feature Current Implementation New implementation
- setContentOffset:animated: Yes Yes
contentOffset Yes Yes
contentSize Yes Yes
contentInset Yes Yes
scrollEnabled Yes Yes
directionalLockEnabled No Yes
scrollsToTop No No
- scrollRectToVisible:animated: Yes Yes
pagingEnabled Yes Yes
bounces Yes No
alwaysBounceVertical Yes No
alwaysBounceHorizontal Yes No
- touchesShouldBegin:withEvent:inContentView: No No
- touchesShouldCancelInContentView: No No
delaysContentTouches No No
decelerationRate No No
dragging Yes Yes
tracking Yes Yes
decelerating Yes Yes
indicatorStyle No No
showsHorizontalScrollIndicator Yes Yes
showsVerticalScrollIndicator Yes Yes
- flashScrollIndicators No No
panGestureRecognizer Yes No
pinchGestureRecognizer Yes No
- zoomToRect:animated: Yes Yes
zoomScale Yes Yes
- setZoomScale:animated: Yes Yes
maximumZoomScale Yes Yes
minimumZoomScale Yes Yes
zoomBouncing Yes No
zooming Yes Yes
bouncesZoom Yes No
Double tap auto-zooming Yes Yes
delegate Yes Yes
- scrollViewDidScroll: Yes Yes
- scrollViewWillBeginDragging: Yes Yes
- scrollViewWillEndDragging:withVelocity:targetContentOffset: Yes Yes
- scrollViewDidEndDragging:willDecelerate: Yes Yes
- scrollViewShouldScrollToTop: No No
- scrollViewDidScrollToTop: No No
- scrollViewWillBeginDecelerating: Yes Yes
- scrollViewDidEndDecelerating: Yes Yes
- viewForZoomingInScrollView: Yes Yes
- scrollViewWillBeginZooming:withView: Yes Yes
- scrollViewDidEndZooming:withView:atScale: Yes Yes
- scrollViewDidZoom: Yes Yes
- scrollViewDidEndScrollingAnimation: Yes Yes
keyboardDismissMode No No

UIButton

The XAML-backed implementation of UIButton (using a XAML Image and a XAML TextBlock controls) was first published on November 7,2016 and here is the list of changes that came with this implementation:

Feature Current Implementation New Implementation
adjustsImageWhenDisabled No No
adjustsImageWhenHighlighted No No
- attributedTitle:forState No No
- backgroundImageForState: Yes Yes
- backgroundRectForBounds: No No
buttonType Yes No
+ buttonWithType: Yes Caveat
contentEdgeInsets Yes yes
- contentRectForBounds: Yes Yes
currentAttributedTitle No No
currentBackgroundImage Yes Caveat
currentImage Yes Caveat
currentTitle Yes Yes
currentTitleColor Yes Yes
currentTitleShadowColor Yes No
font Yes Yes
imageEdgeInsets Yes Yes
- imageForState: Yes Caveat
- imageRectForContentRect: Yes Yes
imageView Yes Caveat
lineBreakMode No No
reversesTitleShadowWhenHighlighted No No
- setAttributedTitle:forState No No
- setBackgroundImage:forState Yes Caveat
- setImage:forState: Yes Caveat
- setTitle:forState: Yes Yes
- setTitleColor:forState: Yes Yes
- setTitleShadowColor:forState: Yes No
showsTouchWhenHighlighted No No
tintColor Yes No
- titleColorForState: Yes Caveat
titleEdgeInsets Yes Yes
- titleForState: yes Caveat
titleLabel Yes Caveat
- titleRectForContentRect: Yes Yes
- titleShadowColorForState: Yes No
titleShadowOffset No No
touchesBegan:withEvent: Yes Yes
touchesCancelled:withEvent: Yes Yes
touchesEnded:withEvent: Yes Yes
touchesMoved:withEvent: Yes Yes