commit | 0fd9412f9d1c073129ece06594bccae7d39d92f9 | [log] [tgz] |
---|---|---|
author | Ian Gordon <ian@rokebo.com> | Mon Sep 04 22:53:23 2017 |
committer | Ian Gordon <ian@rokebo.com> | Mon Sep 04 22:53:23 2017 |
tree | 7734cf61fd1ab4a4ba511789132cad3440340489 | |
parent | ea4158c582c5efc06999b2aa34e6437d64686e28 [diff] | |
parent | b9a0bcd0487a87502b0b5f6a78e1840354f891de [diff] |
Merge branch 'release-candidate' into stable
MDFInternationalization assists in internationalizing your iOS app or components.
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.
// To flip a subview's frame horizontally, pass in subview.frame and the width of its parent. CGRect flippedFrame = MDFRectFlippedHorizontally(originalFrame, CGRectGetWidth(self.bounds));
A category on UIImage backports iOS 10's [UIImage imageWithHorizontallyFlippedOrientation]
to earlier versions of iOS.
// To mirror on image, invoke mdf_imageWithHorizontallyFlippedOrientation. UIImage *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.
// To set a semantic content attribute, set the mdf_semanticContentAttribute property. lockedLTRView.mdf_semanticContentAttribute = UISemanticContentAttributeForceLeftToRight; // mdf_semanticContentAttribute is used to calculate the mdf_effectiveUserInterfaceLayoutDirection if ([customControl mdf_effectiveUserInterfaceLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft) { // Update customControl'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.