Blame view

Twear/Setting/APPRemindVC.swift 2.42 KB
75d24c15   yangbin   123
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
  //
  //  APPRemindVC.swift
  //  Twear
  //
  //  Created by yangbin on 2021/12/26.
  //
  
  import UIKit
  
  class APPRemindVC: UIViewController {
      
      @IBOutlet weak var qqSwitch: UISwitch!
      @IBOutlet weak var wechatSwitch: UISwitch!
      @IBOutlet weak var whatsAppSwitch: UISwitch!
      @IBOutlet weak var messengerSwitch: UISwitch!
      @IBOutlet weak var twitterSwitch: UISwitch!
      @IBOutlet weak var linkedinSwitch: UISwitch!
      @IBOutlet weak var insSwitch: UISwitch!
      @IBOutlet weak var facebookSwitch: UISwitch!
      @IBOutlet weak var otherSwitch: UISwitch!
    
      
      let device = CurDevice
      
      override func viewDidLoad() {
          super.viewDidLoad()
          title = LocString("应用提醒")
          qqSwitch.isOn = device.push.qq
          wechatSwitch.isOn = device.push.wechat
          whatsAppSwitch.isOn = device.push.whatsapp
          messengerSwitch.isOn = device.push.messenger
          twitterSwitch.isOn = device.push.twitter
          linkedinSwitch.isOn = device.push.linkedin
          insSwitch.isOn = device.push.ins
          facebookSwitch.isOn = device.push.facebook
          otherSwitch.isOn = device.push.other
          
          // Do any additional setup after loading the view.
      }
      
      
      @IBAction func valueChanged(_ sender: UISwitch) {
          switch sender.tag {
          case 0:
              device.push.wechat = sender.isOn
          case 1:
              device.push.qq = sender.isOn
          case 2:
              device.push.whatsapp = sender.isOn
          case 3:
              device.push.messenger = sender.isOn
          case 4:
              device.push.twitter = sender.isOn
          case 5:
              device.push.linkedin = sender.isOn
          case 6:
              device.push.ins = sender.isOn
          case 7:
              device.push.facebook = sender.isOn
          case 8:
              device.push.other = sender.isOn
          default:
              break
          }
          BluetoothManager.shared.setMessagePush(device.push) {[weak self] error in
              if error == nil {
                  AdminHelper.shared.updateDevice((self?.device)!)
              }
          }
      }
      
      
      
      /*
       // MARK: - Navigation
       
       // In a storyboard-based application, you will often want to do a little preparation before navigation
       override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
       // Get the new view controller using segue.destination.
       // Pass the selected object to the new view controller.
       }
       */
      
  }