iOS ActionSheet


func showActionSheet() {
    let alert = UIAlertController(title: "Add".localized, message: "ADD_ITEM_MESSAGE".localized, preferredStyle: .actionSheet)

    let addWorkoutAction = UIAlertAction(title: "운동", style: .default, handler: { (action) in
            self.startAddAction()
        })
    let imgWorkout = UIImage(named: "add_workout")!.withRenderingMode(.alwaysOriginal)
    //okImage.tintColor = ThemeManager.o.colorOf("Theme_blue")
    addWorkoutAction.setValue(imgWorkout, forKey: "image")
    //addWorkoutAction.setValue(UIColor.red, forKey: "imageTintColor")
    addWorkoutAction.setValue(UIColor.white, forKey: "titleTextColor")
    addWorkoutAction.setValue(CATextLayerAlignmentMode.left, forKey: "titleTextAlignment")
    alert.addAction(addWorkoutAction)

    let addProgramAction = UIAlertAction(title: "프로그램", style: .default, handler: { (action) in
        self.startAddProgram()
    })
    let imgProgram = UIImage(named: "add_program")!.withRenderingMode(.alwaysOriginal)
    //okImage.tintColor = ThemeManager.o.colorOf("Theme_blue")
    addProgramAction.setValue(imgProgram, forKey: "image")
    addProgramAction.setValue(UIColor.white, forKey: "titleTextColor")
    addProgramAction.setValue(CATextLayerAlignmentMode.left, forKey: "titleTextAlignment")
    alert.addAction(addProgramAction)

    let cancelAction = UIAlertAction(title: "Cancel".localized, style: .cancel, handler: { (action) in

        })
        cancelAction.setValue(UIColor.white, forKey: "titleTextColor")
        alert.addAction(cancelAction)

        self.present(alert, animated: true, completion: { () in
            print("completion")
        })
    }
,

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다