Latest 3.0.2
Homepage https://github.com/Daford/YFAssistiveTouch
License MIT
Platforms ios 6.0, requires ARC
Frameworks QuartzCore
Authors

YFAssistiveTouch实现应用内辅助工具条,可以动态增加功能键,etc.

https://github.com/Daford/YFAssistiveTouch.git

Author: Daford
Date: 2014/10/31

版本更新

Version: 3.0.2

Usage

1.实例化

_touchView = [[YFAssistiveTouchView alloc] init];
_touchView.frame = CGRectMake(0, 0, 50, 50);

2.设置属性

_touchView.imageObject.leftNormalImage = leftNormalImage;
_touchView.imageObject.rightNormalImage = rightNormalImage;
_touchView.imageObject.leftHighlightedImage = leftHighlightedImage;
_touchView.imageObject.rightHighlightedImage = rightHighlightedImage;
_touchView.imageObject.leftTranslucentImage = leftHideImage;
_touchView.imageObject.rightTranslucentImage = rightHideImage;

touchView.unitImageObject.leftTouchImage = leftUint1Image;
touchView.unitImageObject.rightTouchImage = rightUint1Image;
touchView.unitImageObject.leftItemBackgroundImage = leftUint2Image;
touchView.unitImageObject.rightItemBackgroundImage = rightUint2Image;

UIImage *userImage = [UIImage imageNamed:@"atv_item_user"];
UIImage *cafeImage = [UIImage imageNamed:@"atv_item_cafe"];
UIImage *csImage = [UIImage imageNamed:@"atv_item_cs"];
YFAssistiveTouchViewItemImage *itemImage = [[YFAssistiveTouchViewItemImage alloc] init];
itemImage.image = userImage;
YFAssistiveTouchViewItemImage *itemImage1 = [[YFAssistiveTouchViewItemImage alloc] init];
itemImage1.image = cafeImage;
YFAssistiveTouchViewItemImage *itemImage2 = [[YFAssistiveTouchViewItemImage alloc] init];
itemImage2.image = csImage;
_touchView.items = @[itemImage, itemImage1, itemImage2];

3.是否显示

[_touchView isShowing]

4.显示

[_touchView show];

5.隐藏

[_touchView hide];

6.设置初始显示位置

[_touchView setTouchViewPlace:YFTouchViewAtMiddleRight];

7.响应事件(二选一)

7.1.Block实现

[_touchView touchViewItemDidClickedAtIndex:^(YFAssistiveTouchView *touchView) {
    NSLog(@"index:%ld", (long)touchView.indexOfItem);
}];

7.2.代理实现

Protocol: <YFAssistiveTouchViewDelegate>

Set delegagte: _touchView.delegate = self;

- (void)touchViewItemDidClickedAtIndex:(YFAssistiveTouchView *)touchView {
    NSLog(@"index:%ld", (long)touchView.indexOfItem);
}

Latest podspec

{
    "name": "YFAssistiveTouch",
    "version": "3.0.2",
    "summary": "YFAssistiveTouchu5b9eu73b0u5e94u7528u5185u8f85u52a9u5de5u5177u6761uff0cu53efu4ee5u52a8u6001u589eu52a0u529fu80fdu952euff0cetc.",
    "homepage": "https://github.com/Daford/YFAssistiveTouch",
    "license": {
        "type": "MIT",
        "file": "FILE_LICENSE"
    },
    "authors": {
        "Daford": "[email protected]"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source": {
        "git": "https://github.com/Daford/YFAssistiveTouch.git",
        "tag": "3.0.2"
    },
    "source_files": "YFAssistiveTouchView/**/*.{h,m}",
    "public_header_files": "YFAssistiveTouchView/**/*.h",
    "frameworks": "QuartzCore",
    "requires_arc": true
}

Pin It on Pinterest

Share This