Tagged both PickerView...Still no luck :(

This commit is contained in:
Andrew
2021-01-27 00:44:08 -05:00
parent fcf3c6d312
commit 0a50eb6dd8
2 changed files with 40 additions and 30 deletions
+37 -27
View File
@@ -204,37 +204,47 @@ class WVMDataSource: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource
func pickerView(_ v: UIPickerView, numberOfRowsInComponent: Int) -> Int
{
return wvms.count
if v.tag == 2{
return ringtones.count
}
else {
return wvms.count
}
}
func pickerView(_ v: UIPickerView, titleForRow r: Int, forComponent: Int) -> String?
{
return wvms[r].name + " - " + wvms[r].desc
if v.tag == 2{
return ringtones[r].name
}
else {
return wvms[r].name + " - " + wvms[r].desc
}
}
}
class RingtonesDataSource: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource
{
required init?(coder: NSCoder)
{
super.init(coder: coder)
delegate = self
dataSource = self
}
func numberOfComponents(in pickerView: UIPickerView) -> Int
{
return 1
}
func pickerView(_ v: UIPickerView, numberOfRowsInComponent: Int) -> Int
{
return ringtones.count
}
func pickerView(_ v: UIPickerView, titleForRow r: Int, forComponent: Int) -> String?
{
return ringtones[r].name
}
}
//class RingtonesDataSource: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource
//{
// required init?(coder: NSCoder)
// {
// super.init(coder: coder)
// delegate = self
// dataSource = self
// }
//
// func numberOfComponents(in pickerView: UIPickerView) -> Int
// {
// return 1
// }
//
// func pickerView(_ v: UIPickerView, numberOfRowsInComponent: Int) -> Int
// {
// return ringtones.count
// }
//
// func pickerView(_ v: UIPickerView, titleForRow r: Int, forComponent: Int) -> String?
// {
// return ringtones[r].name
//
// }
//}
+3 -3
View File
@@ -459,7 +459,7 @@
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="N7f-vi-SFU">
<rect key="frame" x="0.0" y="-15.5" width="374" height="811"/>
<subviews>
<datePicker multipleTouchEnabled="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="time" minuteInterval="1" style="wheels" translatesAutoresizingMaskIntoConstraints="NO" id="qSt-1V-2DQ">
<datePicker multipleTouchEnabled="YES" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="time" minuteInterval="1" style="wheels" translatesAutoresizingMaskIntoConstraints="NO" id="qSt-1V-2DQ">
<rect key="frame" x="0.0" y="0.0" width="374" height="220"/>
<constraints>
<constraint firstAttribute="height" constant="220" id="VCm-rY-H4H"/>
@@ -477,7 +477,7 @@
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="bCI-jj-foN">
<rect key="frame" x="0.0" y="258.5" width="374" height="150"/>
<subviews>
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JbI-Jp-vvx">
<pickerView tag="2" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JbI-Jp-vvx">
<rect key="frame" x="0.0" y="0.0" width="374" height="150"/>
<constraints>
<constraint firstAttribute="height" constant="150" id="OgV-hH-xcq"/>
@@ -491,7 +491,7 @@
<color key="textColor" systemColor="secondaryLabelColor"/>
<nil key="highlightedColor"/>
</label>
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oae-b2-SoF" customClass="WVMDataSource" customModule="ProjectClock" customModuleProvider="target">
<pickerView tag="1" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oae-b2-SoF" customClass="WVMDataSource" customModule="ProjectClock" customModuleProvider="target">
<rect key="frame" x="0.0" y="457" width="374" height="150"/>
<constraints>
<constraint firstAttribute="height" constant="150" id="C0G-jE-CPx"/>