Name: material-internationalization-ios
Owner: material-foundation
Description: MDFInternationalization assists in internationalizing your IOS app or components.
Created: 2016-11-09 18:36:49.0
Updated: 2018-01-04 14:31:36.0
Pushed: 2018-01-05 22:03:45.0
Size: 826
Language: Objective-C
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
MDFInternationalization assists in internationalizing your iOS app or components' user interface.
A UIView is positioned within its superview in terms of a frame (CGRect) consisting of an origin and a size. When a device is set to a language that is written from Right-to-Left (RTL), we often want to mirror the interface around the vertical axis. This library contains functions to assist in modifying frames and edge insets for RTL.
o flip a subview's frame horizontally, pass in subview.frame and the width of its parent.
ct originalFrame = childView.frame;
ct flippedFrame = MDFRectFlippedHorizontally(originalFrame, CGRectGetWidth(self.bounds));
dView.frame = flippedFrame;
A category on UIImage backports iOS 10's [UIImage imageWithHorizontallyFlippedOrientation]
to
earlier versions of iOS.
o mirror on image, invoke mdf_imageWithHorizontallyFlippedOrientation.
age *mirroredImage = [originalImage mdf_imageWithHorizontallyFlippedOrientation];
A category on UIView backports iOS 9's -[UIView semanticContentAttribute]
and iOS 10's
-[UIView effectiveUserInterfaceLayoutDirection]
to earlier versions of iOS.
o set a semantic content attribute, set the mdf_semanticContentAttribute property.
edLTRView.mdf_semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
df_semanticContentAttribute is used to calculate the mdf_effectiveUserInterfaceLayoutDirection
customView.mdf_effectiveUserInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft) {
Update customView's layout to be in RTL mode.
See Examples/Flags for a detailed example of how to use the functionality provided by this library.
MDFInternationalization is licensed under the Apache License Version 2.0.