Fixed ringtone selection.

This commit is contained in:
Aaron
2021-01-27 11:07:20 -05:00
parent a267d00d59
commit 91e58ab328
2 changed files with 30 additions and 27 deletions
+28 -25
View File
@@ -216,6 +216,7 @@ class WVMDataSource: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource
func pickerView(_ v: UIPickerView, titleForRow r: Int, forComponent: Int) -> String?
{
if v.tag == 2{
print(v.tag)
return ringtones[r].name
}
else {
@@ -224,28 +225,30 @@ class WVMDataSource: UIPickerView, UIPickerViewDelegate, UIPickerViewDataSource
}
}
//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
}
}
+2 -2
View File
@@ -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 tag="2" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JbI-Jp-vvx">
<pickerView tag="2" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JbI-Jp-vvx" customClass="RingtonesDataSource" customModule="GetGoing" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="374" height="150"/>
<constraints>
<constraint firstAttribute="height" constant="150" id="OgV-hH-xcq"/>
@@ -911,7 +911,7 @@
<rect key="frame" x="0.0" y="0.0" width="374" height="170"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="person.crop.circle.badge.checkmark" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="yVW-fL-SIQ">
<rect key="frame" x="130.5" y="0.0" width="111.5" height="109.5"/>
<rect key="frame" x="132" y="0.0" width="110" height="109.5"/>
<constraints>
<constraint firstAttribute="width" constant="110" id="So8-k5-nLS"/>
<constraint firstAttribute="height" constant="110" id="inA-vb-CrL"/>