added radio button sample
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
ad55818218
commit
75ab6294c7
@ -46,18 +46,19 @@
|
||||
EAF7F0CA289DA24F00B287F5 /* ArtifactoryItems.txt in Resources */ = {isa = PBXBuildFile; fileRef = EAF7F0C5289DA24F00B287F5 /* ArtifactoryItems.txt */; };
|
||||
EAF7F0CC289DA24F00B287F5 /* DownloadArtifactoryItems.sh in Resources */ = {isa = PBXBuildFile; fileRef = EAF7F0C8289DA24F00B287F5 /* DownloadArtifactoryItems.sh */; };
|
||||
EAF7F0CD289DA24F00B287F5 /* Artifactory.sh in Resources */ = {isa = PBXBuildFile; fileRef = EAF7F0C9289DA24F00B287F5 /* Artifactory.sh */; };
|
||||
EAF7F0F6289DB12E00B287F5 /* VDS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0F5289DB12E00B287F5 /* VDS.framework */; };
|
||||
EAF7F0F7289DB12E00B287F5 /* VDS.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0F5289DB12E00B287F5 /* VDS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EAF7F0FD289DB1D400B287F5 /* VDSFormControlsTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0DB289DB0B400B287F5 /* VDSFormControlsTokens.xcframework */; };
|
||||
EAF7F0FE289DB1D400B287F5 /* VDSFormControlsTokens.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0DB289DB0B400B287F5 /* VDSFormControlsTokens.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EAF7F0FF289DB1D400B287F5 /* VDSTypographyTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0DA289DB0B400B287F5 /* VDSTypographyTokens.xcframework */; };
|
||||
EAF7F100289DB1D400B287F5 /* VDSTypographyTokens.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0DA289DB0B400B287F5 /* VDSTypographyTokens.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EAF7F101289DB1D400B287F5 /* VDSLayoutTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0DD289DB0B400B287F5 /* VDSLayoutTokens.xcframework */; };
|
||||
EAF7F102289DB1D400B287F5 /* VDSLayoutTokens.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0DD289DB0B400B287F5 /* VDSLayoutTokens.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EAF7F103289DB1D400B287F5 /* VDSColorTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0DC289DB0B400B287F5 /* VDSColorTokens.xcframework */; };
|
||||
EAF7F104289DB1D400B287F5 /* VDSColorTokens.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0DC289DB0B400B287F5 /* VDSColorTokens.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EAF7F105289DB1D400B287F5 /* VDSAccessibilityTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0D9289DB0B400B287F5 /* VDSAccessibilityTokens.xcframework */; };
|
||||
EAF7F106289DB1D400B287F5 /* VDSAccessibilityTokens.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0D9289DB0B400B287F5 /* VDSAccessibilityTokens.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EAF7F108289DB90400B287F5 /* VDS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F107289DB90400B287F5 /* VDS.framework */; };
|
||||
EAF7F109289DB90400B287F5 /* VDS.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F107289DB90400B287F5 /* VDS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EAF7F10A289DB93500B287F5 /* VDSTypographyTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA3C3BBA289968A0000CA526 /* VDSTypographyTokens.xcframework */; };
|
||||
EAF7F10B289DB93500B287F5 /* VDSTypographyTokens.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EA3C3BBA289968A0000CA526 /* VDSTypographyTokens.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EAF7F10C289DB93500B287F5 /* VDSAccessibilityTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0D4289DA4A900B287F5 /* VDSAccessibilityTokens.xcframework */; };
|
||||
EAF7F10D289DB93500B287F5 /* VDSAccessibilityTokens.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0D4289DA4A900B287F5 /* VDSAccessibilityTokens.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EAF7F10E289DB93500B287F5 /* VDSFormControlsTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA3C3BBB289968A0000CA526 /* VDSFormControlsTokens.xcframework */; };
|
||||
EAF7F10F289DB93500B287F5 /* VDSFormControlsTokens.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EA3C3BBB289968A0000CA526 /* VDSFormControlsTokens.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EAF7F110289DB93500B287F5 /* VDSColorTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA3C3BB9289968A0000CA526 /* VDSColorTokens.xcframework */; };
|
||||
EAF7F111289DB93500B287F5 /* VDSColorTokens.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EA3C3BB9289968A0000CA526 /* VDSColorTokens.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EAF7F112289DB93500B287F5 /* VDSLayoutTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0D3289DA4A900B287F5 /* VDSLayoutTokens.xcframework */; };
|
||||
EAF7F113289DB93500B287F5 /* VDSLayoutTokens.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = EAF7F0D3289DA4A900B287F5 /* VDSLayoutTokens.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
EAF7F11A28A14A0E00B287F5 /* RadioButtonViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F11928A14A0E00B287F5 /* RadioButtonViewController.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
@ -67,12 +68,12 @@
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
EAF7F0F7289DB12E00B287F5 /* VDS.framework in Embed Frameworks */,
|
||||
EAF7F102289DB1D400B287F5 /* VDSLayoutTokens.xcframework in Embed Frameworks */,
|
||||
EAF7F106289DB1D400B287F5 /* VDSAccessibilityTokens.xcframework in Embed Frameworks */,
|
||||
EAF7F104289DB1D400B287F5 /* VDSColorTokens.xcframework in Embed Frameworks */,
|
||||
EAF7F100289DB1D400B287F5 /* VDSTypographyTokens.xcframework in Embed Frameworks */,
|
||||
EAF7F0FE289DB1D400B287F5 /* VDSFormControlsTokens.xcframework in Embed Frameworks */,
|
||||
EAF7F10B289DB93500B287F5 /* VDSTypographyTokens.xcframework in Embed Frameworks */,
|
||||
EAF7F109289DB90400B287F5 /* VDS.framework in Embed Frameworks */,
|
||||
EAF7F111289DB93500B287F5 /* VDSColorTokens.xcframework in Embed Frameworks */,
|
||||
EAF7F10D289DB93500B287F5 /* VDSAccessibilityTokens.xcframework in Embed Frameworks */,
|
||||
EAF7F10F289DB93500B287F5 /* VDSFormControlsTokens.xcframework in Embed Frameworks */,
|
||||
EAF7F113289DB93500B287F5 /* VDSLayoutTokens.xcframework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@ -108,6 +109,8 @@
|
||||
EAF7F0DC289DB0B400B287F5 /* VDSColorTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSColorTokens.xcframework; path = SharedFrameworks/VDSColorTokens.xcframework; sourceTree = "<group>"; };
|
||||
EAF7F0DD289DB0B400B287F5 /* VDSLayoutTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSLayoutTokens.xcframework; path = SharedFrameworks/VDSLayoutTokens.xcframework; sourceTree = "<group>"; };
|
||||
EAF7F0F5289DB12E00B287F5 /* VDS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = VDS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
EAF7F107289DB90400B287F5 /* VDS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = VDS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
EAF7F11928A14A0E00B287F5 /* RadioButtonViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RadioButtonViewController.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -115,12 +118,12 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
EAF7F0F6289DB12E00B287F5 /* VDS.framework in Frameworks */,
|
||||
EAF7F101289DB1D400B287F5 /* VDSLayoutTokens.xcframework in Frameworks */,
|
||||
EAF7F105289DB1D400B287F5 /* VDSAccessibilityTokens.xcframework in Frameworks */,
|
||||
EAF7F103289DB1D400B287F5 /* VDSColorTokens.xcframework in Frameworks */,
|
||||
EAF7F0FF289DB1D400B287F5 /* VDSTypographyTokens.xcframework in Frameworks */,
|
||||
EAF7F0FD289DB1D400B287F5 /* VDSFormControlsTokens.xcframework in Frameworks */,
|
||||
EAF7F10A289DB93500B287F5 /* VDSTypographyTokens.xcframework in Frameworks */,
|
||||
EAF7F108289DB90400B287F5 /* VDS.framework in Frameworks */,
|
||||
EAF7F110289DB93500B287F5 /* VDSColorTokens.xcframework in Frameworks */,
|
||||
EAF7F10C289DB93500B287F5 /* VDSAccessibilityTokens.xcframework in Frameworks */,
|
||||
EAF7F10E289DB93500B287F5 /* VDSFormControlsTokens.xcframework in Frameworks */,
|
||||
EAF7F112289DB93500B287F5 /* VDSLayoutTokens.xcframework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -160,6 +163,7 @@
|
||||
EA3C3BB8289968A0000CA526 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
EAF7F107289DB90400B287F5 /* VDS.framework */,
|
||||
EAF7F0F5289DB12E00B287F5 /* VDS.framework */,
|
||||
EAF7F0D4289DA4A900B287F5 /* VDSAccessibilityTokens.xcframework */,
|
||||
EAF7F0D3289DA4A900B287F5 /* VDSLayoutTokens.xcframework */,
|
||||
@ -199,9 +203,10 @@
|
||||
EAF7F07F28996A1900B287F5 /* ViewControllers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
EA3C3BB228996775000CA526 /* MenuViewController.swift */,
|
||||
EA3C3BB328996775000CA526 /* ToggleViewController.swift */,
|
||||
EAF7F09B2899B92400B287F5 /* CheckboxViewController.swift */,
|
||||
EA3C3BB228996775000CA526 /* MenuViewController.swift */,
|
||||
EAF7F11928A14A0E00B287F5 /* RadioButtonViewController.swift */,
|
||||
EA3C3BB328996775000CA526 /* ToggleViewController.swift */,
|
||||
);
|
||||
path = ViewControllers;
|
||||
sourceTree = "<group>";
|
||||
@ -350,6 +355,7 @@
|
||||
EA3C3BB528996775000CA526 /* StoryboardInitable.swift in Sources */,
|
||||
EA3C3BB628996775000CA526 /* MenuViewController.swift in Sources */,
|
||||
EA3C3B9D289966EF000CA526 /* AppDelegate.swift in Sources */,
|
||||
EAF7F11A28A14A0E00B287F5 /* RadioButtonViewController.swift in Sources */,
|
||||
EA3C3B9F289966EF000CA526 /* SceneDelegate.swift in Sources */,
|
||||
EA3C3BB428996775000CA526 /* PickerBase.swift in Sources */,
|
||||
EAF7F09C2899B92400B287F5 /* CheckboxViewController.swift in Sources */,
|
||||
|
||||
@ -19,10 +19,15 @@
|
||||
<key>orderHint</key>
|
||||
<integer>3</integer>
|
||||
</dict>
|
||||
<key>VDS Artifactory.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>7</integer>
|
||||
</dict>
|
||||
<key>VDSSample.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
<integer>6</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
|
||||
@ -468,6 +468,194 @@
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-3880" y="-313"/>
|
||||
</scene>
|
||||
<!--Radio Button View Controller-->
|
||||
<scene sceneID="dZR-JE-vBA">
|
||||
<objects>
|
||||
<viewController storyboardIdentifier="radioButton" id="h42-mH-KC1" customClass="RadioButtonViewController" customModule="VDSSample" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ytk-pf-MbX">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="heD-pc-AZz">
|
||||
<rect key="frame" x="16" y="60" width="382" height="786"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jWf-eh-zqg" userLabel="Top">
|
||||
<rect key="frame" x="0.0" y="0.0" width="382" height="100"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oFp-K6-Ybr" userLabel="Bottom">
|
||||
<rect key="frame" x="0.0" y="115" width="382" height="671"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillProportionally" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="Hmj-Yn-sy0">
|
||||
<rect key="frame" x="16" y="20" width="350" height="254"/>
|
||||
<subviews>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="sp0-qf-Npb">
|
||||
<rect key="frame" x="0.0" y="0.0" width="350" height="31"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Disabled" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yg0-Jx-t9l">
|
||||
<rect key="frame" x="0.0" y="0.0" width="175" height="31"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="9XX-VQ-7L8">
|
||||
<rect key="frame" x="175" y="0.0" width="177" height="31"/>
|
||||
<connections>
|
||||
<action selector="disabledChanged:" destination="h42-mH-KC1" eventType="touchUpInside" id="zcl-pg-mxh"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
</stackView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="Agq-5i-fya">
|
||||
<rect key="frame" x="0.0" y="41" width="350" height="40"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Surface" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="F7F-I8-8pi">
|
||||
<rect key="frame" x="0.0" y="0.0" width="175" height="40"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="xol-id-IIm">
|
||||
<rect key="frame" x="175" y="0.0" width="175" height="40"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="light" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JEA-YN-Jd2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="87.5" height="40"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="agh-2t-ckA">
|
||||
<rect key="frame" x="87.5" y="0.0" width="87.5" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="BZf-4Q-mhL"/>
|
||||
</constraints>
|
||||
<state key="normal" title="Button"/>
|
||||
<buttonConfiguration key="configuration" style="filled" title="Select"/>
|
||||
<connections>
|
||||
<action selector="surfaceClick:" destination="h42-mH-KC1" eventType="touchUpInside" id="NI1-hp-mOq"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</stackView>
|
||||
</subviews>
|
||||
</stackView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="amp-aE-0oq">
|
||||
<rect key="frame" x="0.0" y="91" width="350" height="34"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label Text" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ig5-kl-0jR">
|
||||
<rect key="frame" x="0.0" y="0.0" width="175" height="34"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="J94-IQ-J53">
|
||||
<rect key="frame" x="175" y="0.0" width="175" height="34"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
<connections>
|
||||
<action selector="onLabelTextDidEnd:" destination="h42-mH-KC1" eventType="editingDidEnd" id="Mbu-b7-lHg"/>
|
||||
</connections>
|
||||
</textField>
|
||||
</subviews>
|
||||
</stackView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="3Ov-DD-rlD">
|
||||
<rect key="frame" x="0.0" y="135" width="350" height="34"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Child Text" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ae5-Qx-XEy">
|
||||
<rect key="frame" x="0.0" y="0.0" width="175" height="34"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="G5B-ka-c0V">
|
||||
<rect key="frame" x="175" y="0.0" width="175" height="34"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
<connections>
|
||||
<action selector="onChildTextDidEnd:" destination="h42-mH-KC1" eventType="editingDidEnd" id="R6o-mF-xSf"/>
|
||||
</connections>
|
||||
</textField>
|
||||
</subviews>
|
||||
</stackView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="h4Z-dP-R3h">
|
||||
<rect key="frame" x="0.0" y="179" width="350" height="31"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Error" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SXF-6g-bfu">
|
||||
<rect key="frame" x="0.0" y="0.0" width="175" height="31"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="Fm6-Ej-sVV">
|
||||
<rect key="frame" x="175" y="0.0" width="177" height="31"/>
|
||||
<connections>
|
||||
<action selector="showErrorChanged:" destination="h42-mH-KC1" eventType="touchUpInside" id="LI8-e4-97G"/>
|
||||
</connections>
|
||||
</switch>
|
||||
</subviews>
|
||||
</stackView>
|
||||
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="eSa-mA-9Ph">
|
||||
<rect key="frame" x="0.0" y="220" width="350" height="34"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Error Text" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9EW-kc-8cA">
|
||||
<rect key="frame" x="0.0" y="0.0" width="175" height="34"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="baM-I1-jMF">
|
||||
<rect key="frame" x="175" y="0.0" width="175" height="34"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
<connections>
|
||||
<action selector="onErrorTextDidEnd:" destination="h42-mH-KC1" eventType="editingDidEnd" id="ImV-fK-60i"/>
|
||||
</connections>
|
||||
</textField>
|
||||
</subviews>
|
||||
</stackView>
|
||||
</subviews>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Hmj-Yn-sy0" firstAttribute="top" secondItem="oFp-K6-Ybr" secondAttribute="top" constant="20" id="252-hF-Bdj"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Hmj-Yn-sy0" secondAttribute="trailing" constant="16" id="DQe-g6-T6Y"/>
|
||||
<constraint firstItem="Hmj-Yn-sy0" firstAttribute="leading" secondItem="oFp-K6-Ybr" secondAttribute="leading" constant="16" id="pVb-Da-Gc6"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
</stackView>
|
||||
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JpA-y5-M2q">
|
||||
<rect key="frame" x="0.0" y="646" width="414" height="216"/>
|
||||
</pickerView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="3ug-md-MzH"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="JpA-y5-M2q" firstAttribute="leading" secondItem="3ug-md-MzH" secondAttribute="leading" id="7YR-n9-LLy"/>
|
||||
<constraint firstItem="heD-pc-AZz" firstAttribute="leading" secondItem="3ug-md-MzH" secondAttribute="leading" constant="16" id="C2J-UI-Zbp"/>
|
||||
<constraint firstItem="JpA-y5-M2q" firstAttribute="trailing" secondItem="3ug-md-MzH" secondAttribute="trailing" id="Pwq-WZ-Hst"/>
|
||||
<constraint firstItem="3ug-md-MzH" firstAttribute="trailing" secondItem="heD-pc-AZz" secondAttribute="trailing" constant="16" id="Sqz-SG-UqR"/>
|
||||
<constraint firstItem="heD-pc-AZz" firstAttribute="top" secondItem="3ug-md-MzH" secondAttribute="top" constant="16" id="czo-AK-a7O"/>
|
||||
<constraint firstItem="3ug-md-MzH" firstAttribute="bottom" secondItem="JpA-y5-M2q" secondAttribute="bottom" id="r6l-uE-Kqt"/>
|
||||
<constraint firstItem="3ug-md-MzH" firstAttribute="bottom" secondItem="heD-pc-AZz" secondAttribute="bottom" constant="16" id="xNF-6q-Apu"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="childTextField" destination="G5B-ka-c0V" id="weU-KZ-YAB"/>
|
||||
<outlet property="componentContainerView" destination="jWf-eh-zqg" id="1KC-GB-6bt"/>
|
||||
<outlet property="disabledSwitch" destination="9XX-VQ-7L8" id="z36-Tq-9ER"/>
|
||||
<outlet property="errorTextField" destination="baM-I1-jMF" id="Yam-GG-fRI"/>
|
||||
<outlet property="labelTextField" destination="J94-IQ-J53" id="lfR-Ez-6H2"/>
|
||||
<outlet property="picker" destination="JpA-y5-M2q" id="hqU-6W-iK0"/>
|
||||
<outlet property="showErrorSwitch" destination="Fm6-Ej-sVV" id="MiC-BD-a4I"/>
|
||||
<outlet property="surfaceLabel" destination="JEA-YN-Jd2" id="ZB6-Aa-rZj"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="eCF-B0-LZF" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-3880" y="-313"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
|
||||
@ -16,7 +16,8 @@ struct MenuComponent {
|
||||
class MenuViewController: UITableViewController {
|
||||
let items: [MenuComponent] = [
|
||||
MenuComponent(title: "Toggle", viewController: ToggleViewController.self),
|
||||
MenuComponent(title: "Checkbox", viewController: CheckboxViewController.self)
|
||||
MenuComponent(title: "Checkbox", viewController: CheckboxViewController.self),
|
||||
MenuComponent(title: "RadioButton", viewController: RadioButtonViewController.self)
|
||||
]
|
||||
|
||||
override func numberOfSections(in tableView: UITableView) -> Int {
|
||||
|
||||
120
VDSSample/ViewControllers/RadioButtonViewController.swift
Normal file
120
VDSSample/ViewControllers/RadioButtonViewController.swift
Normal file
@ -0,0 +1,120 @@
|
||||
//
|
||||
// RadioButtonViewController.swift
|
||||
// VDSSample
|
||||
//
|
||||
// Created by Matt Bruce on 8/1/22.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import VDS
|
||||
import VDSColorTokens
|
||||
|
||||
class RadioButtonViewController: UIViewController, StoryboardInitable {
|
||||
enum PickerType {
|
||||
case surface
|
||||
}
|
||||
static var storyboardId: String = "radioButton"
|
||||
static var storyboardName: String = "Components"
|
||||
|
||||
@IBOutlet weak var componentContainerView: UIView!
|
||||
@IBOutlet weak var picker: UIPickerView!
|
||||
@IBOutlet weak var surfaceLabel: UILabel!
|
||||
|
||||
@IBOutlet weak var disabledSwitch: UISwitch!
|
||||
@IBOutlet weak var labelTextField: UITextField!
|
||||
@IBOutlet weak var childTextField: UITextField!
|
||||
@IBOutlet weak var showErrorSwitch: UISwitch!
|
||||
@IBOutlet weak var errorTextField: UITextField!
|
||||
|
||||
var radioButton: RadioButton!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
var model = DefaultRadioButtonModel()
|
||||
model.labelText = "Terms and conditions"
|
||||
model.childText = "I agree to Verizon's terms and conditions click here"
|
||||
model.childTextAttributes = [
|
||||
LabelAttributeUnderline(location: 11, length: 10),
|
||||
LabelAttributeStrikeThrough(location: 22, length: 5),
|
||||
LabelAttributeColor(location: 31, length: 10, color: UIColor.blue.hexString!),
|
||||
LabelAttributeActionModel(location: 31, length: 10){ print("clicked on the word 'conditions'") },
|
||||
LabelAttributeFont(location: 2, length: 5, style: .BoldTitleLarge, color: UIColor.red.hexString!)
|
||||
]
|
||||
model.errorText = "Error Text"
|
||||
|
||||
surfaceLabel.text = model.surface.rawValue
|
||||
disabledSwitch.isOn = model.on
|
||||
labelTextField.text = model.labelText
|
||||
childTextField.text = model.childText
|
||||
showErrorSwitch.isOn = model.showError
|
||||
errorTextField.text = model.errorText
|
||||
|
||||
radioButton = RadioButton(with: model)
|
||||
radioButton.translatesAutoresizingMaskIntoConstraints = false
|
||||
componentContainerView.addSubview(radioButton)
|
||||
radioButton.leadingAnchor.constraint(equalTo: componentContainerView.leadingAnchor, constant: 10).isActive = true
|
||||
radioButton.bottomAnchor.constraint(equalTo: componentContainerView.bottomAnchor, constant: -20).isActive = true
|
||||
radioButton.topAnchor.constraint(equalTo: componentContainerView.topAnchor, constant: 20).isActive = true
|
||||
radioButton.trailingAnchor.constraint(equalTo: componentContainerView.trailingAnchor, constant: 10).isActive = true
|
||||
view.addGestureRecognizer(UITapGestureRecognizer(target: self.view, action: #selector(UIView.endEditing(_:))))
|
||||
setupPicker()
|
||||
}
|
||||
|
||||
@IBAction func disabledChanged(_ sender: UISwitch) {
|
||||
radioButton.disabled = sender.isOn
|
||||
}
|
||||
|
||||
@IBAction func onLabelTextDidEnd(_ sender: UITextField) {
|
||||
radioButton.labelText = sender.text
|
||||
sender.resignFirstResponder()
|
||||
}
|
||||
|
||||
@IBAction func onChildTextDidEnd(_ sender: UITextField) {
|
||||
radioButton.childText = sender.text
|
||||
sender.resignFirstResponder()
|
||||
}
|
||||
|
||||
@IBAction func showErrorChanged(_ sender: UISwitch) {
|
||||
radioButton.showError = sender.isOn
|
||||
}
|
||||
|
||||
@IBAction func onErrorTextDidEnd(_ sender: UITextField) {
|
||||
radioButton.errorText = sender.text
|
||||
sender.resignFirstResponder()
|
||||
}
|
||||
|
||||
@IBAction func surfaceClick(_ sender: Any) {
|
||||
pickerType = .surface
|
||||
}
|
||||
|
||||
//Picker
|
||||
var surfacePicker = SurfacePicker()
|
||||
|
||||
var pickerType: PickerType = .surface {
|
||||
didSet {
|
||||
func update(object: UIPickerViewDelegate & UIPickerViewDataSource){
|
||||
picker.delegate = object
|
||||
picker.dataSource = object
|
||||
}
|
||||
|
||||
switch pickerType{
|
||||
case .surface:
|
||||
update(object: surfacePicker)
|
||||
}
|
||||
picker.reloadAllComponents()
|
||||
picker.selectRow(0, inComponent: 0, animated: false)
|
||||
picker.isHidden = false
|
||||
}
|
||||
}
|
||||
|
||||
func setupPicker(){
|
||||
picker.isHidden = true
|
||||
surfacePicker.onPickerDidSelect = { item in
|
||||
self.radioButton.surface = item
|
||||
self.componentContainerView.backgroundColor = item.color
|
||||
self.surfaceLabel.text = item.rawValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user