Giter Club home page Giter Club logo

swift_project's Introduction

swift_project

之前的项目,用swift敲了一遍,目前主体已经完成,只剩下一些小页面了,算是自己认真对待的一份代码。有意见和建议请指出,万分感谢。

另外,目前运行项目会报错,原因是由于版权问题,所以里面的接口和图片名称都没加上。后面我会加上运行效果图,到时候大家可以根据效果图查看代码了。

自定义控件

这里面,我自己封装了一些经常用到的控件,如Segment、Refresh、PictureShow、Progress等,可以很方便地调用。

  • GJSegment

GJSegment

  • GJRefresh

GJRefreshGJRefresh

  • GJPictureShow

GJPictureShow

  • GJProgressView

GJProgressView

后面还会继续对项目里面的一些其他内容,比如倒计时按钮进行封装。

代码结构

  • 项目主要采用MVC的设计模式,在ViewControllers文件夹中包含所有的页面:登录相关、主页、出借、个人中心。每一块下面又分为三个文件夹:Model、View、Controller。

  • 封装了网络请求,基于Alamofire。文件夹NetWork下有GJNetwork、GJNetWorkTool、GJNetworkReachability三个类,其中GJNetworkReachability用来检查网络状态,GJNetWorkTool用来实现每一个网络请求,GJNetwork是直接与Alamofire交互的类。

  • NetWorkFile类存放所有请求的URL;VariableDefineFile类存放所有的变量,相当于宏。

  • GJUtil是工厂类,里面封装了几个常用UI控件的创建方法,还包含一些类似于检测手机号码、MD5加密、base64加密等常用方法。

  • Base文件夹下是几个基类。GJBaseViewController是所有视图的父类,GJBaseWebViewController是所有需要加载H5页面的父类。

项目才创建不久,平时编写的时候难免会有纰漏的地方,请大家不吝赐教。

swift_project's People

Contributors

manofit avatar

Watchers

James Cloos 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.