美文网首页iosiOS_UIKit
UIFeedbackGenerator触感反馈

UIFeedbackGenerator触感反馈

作者: 絮语时光杨 | 来源:发表于2018-05-14 11:38 被阅读4次

    抽象类

    • (void)private_systemFeedbackGeneratorType:(AN_RESET_ACTION_TYPE)type {
      if (type==AN_RESET_ACTION_FEEDBACK_LIGHT) {//轻度点击
      UIImpactFeedbackGenerator *impactLight = [[UIImpactFeedbackGenerator alloc]initWithStyle:UIImpactFeedbackStyleLight];
      [impactLight impactOccurred];
      } else if (type==AN_RESET_ACTION_FEEDBACK_MEDIUM){//中度点击
      UIImpactFeedbackGenerator *impactLight = [[UIImpactFeedbackGenerator alloc]initWithStyle:UIImpactFeedbackStyleMedium];
      [impactLight impactOccurred];
      } else if (type==AN_RESET_ACTION_FEEDBACK_HEAVY){//重度点击
      UIImpactFeedbackGenerator *impactLight = [[UIImpactFeedbackGenerator alloc]initWithStyle:UIImpactFeedbackStyleHeavy];
      [impactLight impactOccurred];
      } else if (type==AN_RESET_ACTION_FEEDBACK_SELECTIONCHANGE){//选择切换
      UISelectionFeedbackGenerator *feedbackSelection = [[UISelectionFeedbackGenerator alloc] init];
      [feedbackSelection selectionChanged];
      }
      }

    相关文章

      网友评论

        本文标题:UIFeedbackGenerator触感反馈

        本文链接:https://www.haomeiwen.com/subject/mtmddftx.html