Coder Social home page Coder Social logo

mbsort's Introduction

MBSort

Sort by first letter

提供字符串通过首字母进行排序, 或者对模型对象的指定属性首字母排序

  1. 通过字符串首字母进行排序
    + (NSArray *)MB_sortOriginalStrings:(NSArray<NSString *> *)originalStrings sortType:(MBSortType)sortType;

  2. 通过模型对象的指定属性进行排序
    + (NSArray *)MB_sortOriginalObjects:(NSArray *)originalObjects keyProperty:(NSString *)key sortType:(MBSortType)sortType;

其中, 使用到的枚举对象MBSortType, 包含三个选项:

	1.默认排序结果不带对应的首字母
    	MBSortTypeNormal = 0,
    2.排序结果不带对应的首字母 [original...]
   	    MBSortTypeOriginalValue,
    3.排序结果带对应的首字母 [{key : original...}...]
    	MBSortTypeKeyValue  

获取带首字母的返回值时, 通过key获取对应的值, MBSortKey描述排序所使用的对应数据的首字母, MBSortValue描述排序所使用的对应数据.

mbsort's People

Contributors

mariobiuuuu avatar

Stargazers

garen avatar xiaofeng avatar  avatar 憂憂 avatar 风的背影 avatar Soso avatar PR avatar Eric MiAo avatar  avatar

Watchers

 avatar Eric MiAo avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.