如何从2个集合中加入数据,我想列出所有具有category_key的项目,集合是类别和项目: 我最初在 category.service.ts 中拥有的代码,它现在显示类别详细信息:
import AVFoundation
import UIKit
enum Vibration {
case error
case success
case warning
case light
case medium
case heavy
case selection
case oldSchool
func vibrate() {
switch self {
case .error:
let generator = UINotificationFeedbackGenerator()
generator.notificationOccurred(.error)
case .success:
let generator = UINotificationFeedbackGenerator()
generator.notificationOccurred(.success)
case .warning:
let generator = UINotificationFeedbackGenerator()
generator.notificationOccurred(.warning)
case .light:
let generator = UIImpactFeedbackGenerator(style: .light)
generator.impactOccurred()
case .medium:
let generator = UIImpactFeedbackGenerator(style: .medium)
generator.impactOccurred()
case .heavy:
let generator = UIImpactFeedbackGenerator(style: .heavy)
generator.impactOccurred()
case .selection:
let generator = UISelectionFeedbackGenerator()
generator.selectionChanged()
case .oldSchool:
AudioServicesPlaySystemSound(SystemSoundID(kSystemSoundID_Vibrate))
}
}
}
格式:
类别
项目
cat_id:“ xxxxx”
项目:“ name_of_item”