Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ForceLeftToRight in RTL language. #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions SVPinView/Source/Classes/SVPinView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public class SVPinView: UIView {
public var didFinishCallback: ((String)->())?
public var didChangeCallback: ((String)->())?

public var forceLeftToRight: Bool = false

// MARK: - Init methods -
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
Expand Down Expand Up @@ -404,6 +406,9 @@ extension SVPinView : UICollectionViewDataSource, UICollectionViewDelegate, UICo

public override func layoutSubviews() {
flowLayout.invalidateLayout()
if forceLeftToRight {
collectionView.semanticContentAttribute = .forceLeftToRight
}
}
}
// MARK: - TextField Methods -
Expand Down
16 changes: 11 additions & 5 deletions SVPinView/Source/XIB's/SVPinView.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -17,7 +18,7 @@
<rect key="frame" x="0.0" y="0.0" width="368" height="87"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" semanticContentAttribute="forceLeftToRight" dataMode="none" prefetchingEnabled="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RCS-bi-tRO">
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" prefetchingEnabled="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RCS-bi-tRO">
<rect key="frame" x="0.0" y="0.0" width="368" height="87"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="scrollIndicatorInsets" minX="0.0" minY="20" maxX="0.0" maxY="0.0"/>
Expand All @@ -40,10 +41,10 @@
<string key="text">⚠ ERROR: Please check the console for details.
Retry?</string>
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="17"/>
<color key="textColor" systemColor="systemRedColor" red="1" green="0.23137254900000001" blue="0.18823529410000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="textColor" systemColor="systemRedColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HLL-km-Lja" userLabel="Refresh Button">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HLL-km-Lja" userLabel="Refresh Button">
<rect key="frame" x="0.0" y="0.0" width="368" height="87"/>
<connections>
<action selector="refreshPinView" destination="-1" eventType="touchUpInside" id="Xxy-7O-pgc"/>
Expand Down Expand Up @@ -77,4 +78,9 @@ Retry?</string>
<point key="canvasLocation" x="30" y="-218.5"/>
</view>
</objects>
<resources>
<systemColor name="systemRedColor">
<color red="1" green="0.23137254901960785" blue="0.18823529411764706" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>