0
API 호출을 수행하고 API 호출에서 채워진 데이터로 PickerView를 만드는 프레임 워크를 만들려고합니다. iOS 클라이언트는이 프레임 워크를 가져오고로드 된 데이터가 포함 된 PickerView를 반환해야하는 노출 된 함수를 호출합니다.데이터가있는 PickerView를 반환하는 함수를 만들 수 있습니까?
PickerView를 작성하지만 PickerView 내부에 데이터를 삽입하는 방법을 알아낼 수없는 함수를 작성할 수있었습니다.
// Framework Side
public static func returnPickerView() -> UIPickerView {
let apple = ["apple", "orange", "durian", "banana"]
let customPicker = UIPickerView()
customPicker.frame = CGRect(x: 0, y: 0, width: 300, height: 300)
customPicker.layer.borderColor = UIColor.black.cgColor
customPicker.layer.borderWidth = 1
return customPicker
}
당신은'UIPickerView'를 상속 받아 커스텀 클래스 – JuicyFruit
을 만들어야합니다. – manohjay