All Projects → niyongsheng → NYSMC

niyongsheng / NYSMC

Licence: MIT license
马甲包框架🔨Auto Choose Sheel/Application framework.

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to NYSMC

git-picked
List merged and cherry-picked branches
Stars: ✭ 30 (+36.36%)
Mutual labels:  branch
mmp
📘 Light JavaScript library to create mind map applications.
Stars: ✭ 74 (+236.36%)
Mutual labels:  branch
action
A GitHub Action that deploys live environments for your pull requests and branches
Stars: ✭ 63 (+186.36%)
Mutual labels:  branch
branch-protection-bot
A bot tool to disable and re-enable "Include administrators" option in branch protection
Stars: ✭ 57 (+159.09%)
Mutual labels:  branch
branch-name-lint
Lint your branch names
Stars: ✭ 60 (+172.73%)
Mutual labels:  branch
gradle-git-versioning-plugin
This extension will set project version, based on current Git branch or tag.
Stars: ✭ 44 (+100%)
Mutual labels:  branch
fzf-checkout.vim
Manage branches and tags with fzf
Stars: ✭ 187 (+750%)
Mutual labels:  branch
awesome-git-commands
🍴 Indispensable git commands for everyday use
Stars: ✭ 53 (+140.91%)
Mutual labels:  branch
mac-branch-deep-linking
The Branch SDK for Mac OS X - Docs:
Stars: ✭ 15 (-31.82%)
Mutual labels:  branch
branch-names
Github action to retrieve branch or tag names with support for all events.
Stars: ✭ 99 (+350%)
Mutual labels:  branch

(logo) NYSMC

  • 自动选择加载“壳应用”/“真应用”的简单框架。
  • Auto Choose Sheel/Application framework.

How to use

  • Installation with CocoaPods:pod 'NYSMC','~>0.2.0'
  • Manual import:
    • Drag All files in the NYSMC folder to project
    • Import the main file:#import <NYSMC/NYSMC.h>

Application Instance by NYSMC

Running MOV Flow Chart Image

- Example Program

Server API Pattern:

  • Step 1.Need Server API
/** 需要后端组的同学准备一个接口 */
// Method: POST
// Server: http://xxx.NYSMC.com:8080
// API: /api/getReviewData
// Parameters: PARM
/* JSON返回数据结构:*/
{
    "param": {},
    "error": null,
    "returnValue": {
        "gmtCreate": "2018-06-25 11:12:35",
        "gmtModify": null,
        "id": 1,
        "version": "1.0", //(审核中版本号)
        "reviewTime": 1534419240000, //(预计审核完成时间)
        "url": "github.com/niyongsheng", //(链接地址)
        "status": 0 //(马甲开关:0关闭  1开启)
    },
    "msg": null,
    "list": null,
    "unread": null,
    "type": null,
    "success": true
}
  • Step 2.AppDelegate.m
#import <NYSMC/NYSMC.h>
#import "tabViewController.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // I.初始化NYSC
    [NYSCake initWithEstimatedAuditDays:2 PostURL:@"http://xxx.NYSMC.com:8080/api/getReviewData" ValidateParameters:PARM BootMethod:NYSCBootMethod_Cold];
    // II.选择分支
    [NYSCake chooseViewControllerWithPriorityType:NYSCPriorityType_Server_Status errorBootFromType:BootFrom_Sheel matchSheelBlock:^{
        // 马甲
        self.window.rootViewController = [[tabViewController alloc] init];
        [self.window makeKeyAndVisible];
    } ApplicationBlock:^{
        // 应用
        self.window.rootViewController = [[NYSWebViewController alloc] init];
        [self.window makeKeyAndVisible];
    }];
    
    // III.获取服务器中的配置参数(热启动不需要调用此方法)
    [NYSCake updataServerParameters];
    
    return YES;
}

NO Server API Pattern:

  • Step 1.Add Shell

    XCode->Product->Scheme->Edit Scheme->Build->Pre-actions->Add new shell(New run script action)

echo "In the build time script run."
infoplist="$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"
builddate=`date`
if [[ -n "$builddate" ]]; then
# if BuildDateString doesn't exist, add it
/usr/libexec/PlistBuddy -c "Add :BuildDate string $builddate" ${infoplist}
# and if BuildDateString already existed, update it
/usr/libexec/PlistBuddy -c "Set :BuildDate string $builddate" ${infoplist}
fi
  • Step 2.AppDelegate.m
#import <NYSMC/NYSMC.h>

#import "SheelViewController.h"
#import "ApplicationViewController.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // I.初始化NYSC
    [NYSCake initWithEstimatedAuditDays:2 PostURL:nil ValidateParameters:nil BootMethod:NYSCBootMethod_Cold];
    // II.选择分支
    [NYSCake chooseViewControllerWithPriorityType:NYSCPriorityType_Server_Version errorBootFromType:BootFrom_Application matchSheelBlock:^{
    	// 马甲
        self.window.rootViewController = [[SheelViewController alloc] init];
        [self.window makeKeyAndVisible];
    } ApplicationBlock:^{
    	// 应用
        self.window.rootViewController = [[ApplicationViewController alloc] init];
        [self.window makeKeyAndVisible];
    }];
    
    return YES;
}

Remind

  • ARC
  • iOS >= 8.0
  • iPhone \ iPad screen anyway

Contribution

Reward🍭 Encourage❤️

Contact Me :octocat:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].