• Stars
    star
    158
  • Rank 237,131 (Top 5 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Make steps to help users do specific operations without breaking the structure of the project. 一个用于制作多步骤用户操作引导的框架,基于AOP,对原工程几乎无任何侵入。

SGUserGuide

SGUserGuide is a framework for programmers to make steps to guide users, every step will restrict users to do a specific operation by adding masks to other regions. The framework can help you implement this without breaking the structure of the project based on AOP and KeyPath.

A Simple Guide ScreenShot

You can implement a step just by creating an SGGuideNode object and add it to node list.

ScreenShot     WiFi Page

How To Get Started

Installation

Drag the SGUserGuide folder to your project.

Usage

Import header

#import "SGGuideDispatcher.h"

Create a node to describe a step

@interface SGGuideNode : NSObject

@property (nonatomic, assign) Class controllerClass;
@property (nonatomic, strong) NSString *permitViewPath;
@property (nonatomic, copy) NSString *message;
@property (nonatomic, assign) BOOL reverse;

+ (instancetype)nodeWithController:(Class)controller permitViewPath:(NSString *)permitViewPath message:(NSString *)message reverse:(BOOL)reverse;
+ (instancetype)endNodeWithController:(Class)controller;

@end

A Node has four main properties:
1.controllerClass: The class of the controller displaying for this step.
2.permitViewPath: The keyPath of the view which is permit to interactive of the controller, for example, if the tableViewController has a subview topView, and the topView has a subview btn, you can pass topView.btn to it.
3.message: The message showing on the screen to tell uses how to do.
4.reverse: Reverse the mask and the allow region.

Create steps by node array

Create nodes in an array and pass it to the singleton SGGuideDispatcher, if this step trig a switch of the view, it can be handled automatically, every node list must have a endNode, it's the end of the guide. For example:

SGGuideDispatcher *dp = [SGGuideDispatcher sharedDispatcher];
dp.nodes = @[
             [SGGuideNode nodeWithController:[ESHomeViewController class] permitViewPath:@"tabBarController.tabBar" message:@"Please Choose '公告'(Notice) Item on Bottom Bar" reverse:NO],
             [SGGuideNode nodeWithController:[SGNoticeTableViewController class] permitViewPath:@"navigationItem.rightBarButtonItem" message:@"Please Click the '发布'(POST) Button" reverse:NO],
             [SGGuideNode nodeWithController:[SGNoticePublishViewController class] permitViewPath:@"navigationController.navigationBar" message:@"Type anything you like" reverse:YES],
             [SGGuideNode nodeWithController:[SGNoticePublishViewController class] permitViewPath:@"navigationItem.rightBarButtonItem" message:@"Please Click the '发布'(POST) Button" reverse:NO],
             [SGGuideNode endNodeWithController:[SGNoticeTableViewController class]]
             ];

There are four steps, it describes the steps below.

WiFi Page

Attention Please: If a step occured without a switch of view, such as the 2th(start from 0) step 'Type anything you like' above , you must handle this step yourself by calling the next method in the singleton SGGuideDispatcher.
Don't worry about surplus calls of next, the dispatcher will filter them.

- (void)textViewDidChange:(UITextView *)textView {
    self.publishBtn.enabled = textView.text.length != 0;
    [[SGGuideDispatcher sharedDispatcher] next];
}

Reset guide steps

The framework will record the steps that has been made using NSUserDefaults, you can reset it by calling reset method in the singleton SGGuideDispatcher. You must reset steps before pass node array to the dispatcher

SGGuideDispatcher *dp = [SGGuideDispatcher sharedDispatcher];
[dp reset];

Custom Settings

The color of the mask and the region which allow interactive.

These properties are in the singleton SGGuideDispatcher.

The attributes of the messageLabel

You can access the label in the singleton SGGuideMaskView.

UILabel *messageLabel = [SGGuideMaskView sharedMask].messageLabel;

More Repositories

1

iblessing

iblessing is an iOS security exploiting toolkit, it mainly includes application information gathering, static analysis and dynamic analysis. It can be used for reverse engineering, binary analysis and vulnerability mining.
C++
619
star
2

SGWiFiUpload

Upload files through WiFi. 通过WiFi上传文件
Objective-C
334
star
3

SGPhotoBrowser

A simple iOS photo browser with grid view.
Objective-C
84
star
4

InfiniteSpringBoard

锤子科技无限屏的iOS实现
Objective-C++
77
star
5

SGGestureRecognizer

An graphics gesture recognizer for iOS based on dollar one algorithm. 基于$1算法的图形手势识别器。
Objective-C
73
star
6

Dyamk

iOS native code injector at runtime, only for debug.
Objective-C
66
star
7

SGSecurityAlbum

Open source security album for iOS. 开源iOS加密相册
Objective-C
52
star
8

Rust101

This is my Rust playground, where I will be rewriting many interesting projects in Rust.
Rust
35
star
9

AppleCellularFixup

fixup network issues for iPhone in China.
Objective-C
21
star
10

play_with_siguza_first_0day

a toy to play with siguza's very first 0 day - sandbox escape
Objective-C
20
star
11

SuperKVC

Cocoa Model Framework with a simplified, chainable and expressive syntax. 支持链式编程的JSON转模型框架。
Objective-C
13
star
12

SGFuncDeal

用于处理数学表达式运算的开源库,支持常见的数学函数、符号混合运算。
Objective-C
9
star
13

ida_scripts

IDA scripts
Python
9
star
14

Parse_MachO_Tutorial

Parse Mach-O file and get executable part to deassembly.
C++
3
star
15

caidao

Java
2
star
16

Weibo-Photo-Eraser

A Chrome Extension to erase top photos in album photo wall to get rid of page stuck. Chrome插件,在浏览微博照片墙时,不断移除顶部不可见的图片来防止页面卡顿。
JavaScript
2
star
17

Legend

Legend of Mir Light.
C++
1
star
18

XiMaLaYa_Mac

A XiMaLaYa Mac Container to use shortcut key control. 一个喜马拉雅Web版的Mac容器,支持快捷键开始、暂停播放
Objective-C
1
star
19

Soulghost

1
star