Git Product home page Git Product logo

pontus's Introduction

<<<<<<< HEAD

#简介 Pontus 是我使用 Swift 开发 iOS 应用一年下来所积累的一个工具库(当然其中深得之前共事同事的长处),这篇文章中我会简单说明一下自己是如何设计并使用 Pontus 的。

Pontus 的名字取自希腊神话名,比较喜欢他的蕴意:深不可测的大海,所以就叫这个名字了。 #Tips ·Pontus使用Swift编写,仅支持iOS平台 ·可以使用CocoaPods将Pontus集成进自己的项目(PS:pod search Pontus)

###链式语法 Pontus中很多方法都是为了实现链式语法,或者带有链式语法的特性

非链式语法:

        object.propertyA = valueA

        object.propertyB = valueB

        object.propertyC = valueC

        object.propertyD = valueD

链式语法:

        object
            
            .propertyA(valueA)
            
            .propertyB(valueB)
            
            .propertyC(valueC)
            
            .propertyD(valueD)

我这样作的主要原因有:

·不喜欢在设置 object 的若干属性时每次都要多写一个 object
·可以在 map 等函数中设置属性的同时返回结果

这种方法基本实现:

        extension Class {
            //  Chainable method of property
            func property(property: propertyType) -> Self {
                self.property = property
                return self
            }
        }

Pontus

My own iOS development kit, written by Swift.

The CocoaPods Master Repo

This repository contains the public CocoaPods specifications.

Links

License

These specifications and CocoaPods are available under the MIT license.

3a9f0f2ba2716a1e0a0974b628fa6f1a0f975843

pontus's People

Contributors

zhangzichen avatar

Watchers

 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.