GithubHelp home page GithubHelp logo

dantang's Introduction

单糖——良品生活指南:家居零食、礼物美妆、海淘购物

感兴趣的朋友可以去 app store 下载


说明 本程序仅供学习交流,不可用于任何商业用途。

说明

因为公司使用的是 Objective-C 开发 app,没有使用 swift 来开发,所以决定自己研究 Swift,研究 Swift 的时间不长,对于 Swift 的基本语法有了大致的了解,但是对有些概念和语法还是理解的不深,所以决定模仿一些已经发布的 app,一方面可以让自己更好地理解和使用 Swift,另一方面可以和志同道合的人一起交流,共同进步。

使用 Swift 模仿的第一个 app 是单糖,总体来说界面搭建还算简单,而且结构不是很复杂,本次项目完成了大部分界面,对于项目中的数据接口都是通过 Charles 抓包获得,基本每个界面都是有数据请求,不会抓包的朋友可以看我 这一篇文章

项目中有的地方代码写的不是很简洁,毕竟自己能力有限,对 Swift 使用不是很熟练,还请各位朋友不喜勿喷。在本文的最后,有项目的完整源码,喜欢的朋友可以下载下来,如果您感觉我写的代码对您有所帮助,还请在 github 给个 star,非常感谢您的支持!~

项目截图

单糖

首页

单品

单品详情

攻略详情

图文介绍

评论

分享

分类

搜索

我

设置

项目环境

项目使用 cocoapods 来管理第三方库,所以需要安装 cocoapods,安装方式网上有很多教程,这里不在详述。

  • Xcode 8.2.1
  • Swift 3.0
  • iOS 8.0

使用到的第三方库:

  • SwiftyJSON - 解析 JSON 数据
  • SnapKit - 设置约束
  • Kingfisher - 缓存图片
  • SVProgressHUD - 提示框
  • FDFullscreenPopGesture - 侧滑手势
  • Alamofire - 网络请求

项目结构

项目结构

由于刚接触 Swift,以及对 MVVM 的理解的不深,所以没有使用 MVVM 设计模式,项目使用传统的 MVC 设计模式。

下面是项目的完整结构

  • 首页(单糖)
  • Model
  • YMChannel.swift
  • YMHomeItem.swift
  • YMSearchResult.swift
  • View
  • YMHomeCell.swift
  • YMHomeCell.xib
  • YMRefreshControl.swift
  • YMRefreshView.swift
  • YMRefreshView.xib
  • YMSearchRecordView.swift
  • YMSortCell.swift
  • YMSortCell.xib
  • YMSortTableView.swift
  • Controller
  • YMDanTangViewController.swift
  • YMTopicViewController.swift
  • YMDetailViewController.swift
  • YMSearchViewController.swift
  • Product(单品)
  • Model
  • YMProduct.swift
  • YMProductDetail.swift
  • YMComment.swift
  • View
  • YMActionSheet.swift
  • YMCollectionViewCell.swift
  • YMCollectionViewCell.xib
  • YMDetailChoiceButtonView.swift
  • YMDetailChoiceButtonView.xib
  • YMDetailCollectionViewCell.swift
  • YMDetailCollectionViewCell.xib
  • YMProductDetailBottomView.swift
  • YMProductDetailToolBar.swift
  • YMProductDetailToolBar.xib
  • YMProductDetailTopView.swift
  • YMShareButtonView.swift
  • YMDetailScrollView.swift
  • YMCommentCell.swift
  • YMCommentCell.xib
  • Controller
  • YMProductViewController.swift
  • YMProductDetailViewController.swift
  • YMTMALLViewController.swift
  • YMTMALLViewController.xib
  • Classify(分类)
  • Model
  • YMCollection.swift
  • YMCollectionPost.swift
  • YMGroup.swift
  • View
  • YMCategoryBottomView.swift
  • YMCategoryCollectionViewCell.swift
  • YMCategoryCollectionViewCell.xib
  • YMCollectionTableViewCell.swift
  • YMCollectionTableViewCell.xib
  • YMSeeAllTopicCell.swift
  • YMSeeAllTopicCell.xib
  • YMTopHeaderView.swift
  • YMTopHeaderView.xib
  • YMVerticalButton.swift
  • Controller
  • YMCategoryHeaderViewController.swift
  • YMCategoryViewController.swift
  • YMCollectionDetailController.swift
  • YMCollectionDetailController.xib
  • YMPostDetailViewController.swift
  • YMPostDetailViewController.xib
  • YMSeeAllController.swift
  • YMSeeAllController.xib
  • Me(我)
    • Model
      • YMSetting.swift
    • View
    • YMMeChoiceView.swift
    • YMMeFooterView.swift
    • YMMineHeaderView.swift
    • YMSettingCell.swift
    • YMSettingCell.xib
    • Controller
    • YMMessageViewController.swift
    • YMMeViewController.swift
    • YMSettingViewController.swift
  • Login&Register(登录和注册)
  • Controller
  • YMLoginViewController.swift
  • YMLoginViewController.xib
  • YMRegisterViewController.swift
  • YMRegisterViewController.xib
  • YMNewfeatureViewController.swift
  • Main(主要)
  • Category
  • String+Extension.swift
  • UITableView+EmptyData.swift
  • UIView+Extension.swift
  • Controller
  • YMBaseViewController.swift
  • YMNavigationController.swift
  • YMTabBarController.swift
  • Tools
  • YMConst.swift
  • YMNetworkTool.swift

项目文档和数据接口

抓取的数据接口请看 单糖数据接口单糖数据接口详细数据

下载项目之后,点击此处,查看项目文档 项目文档 或者直接打开文件目录 『docs/index.html』。

运行项目出现的问题都可以给我留言或者直接加我的 QQ 联系,我会尽快回复。

喜欢的朋友希望可以给个 Star,十分感谢您的支持!~

dantang's People

Contributors

hrscy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dantang's Issues

好像内存有点小问题

hi,hrscy!
我任意点击几个界面进去以后,打开内存Debug Memory Graph,会出现很多相关的内存问题,不知道是不是用了webview的原因?或者是其他内存方面的原因?如下图:

image

English

Can somebody translate this project on english?

Xcode8 报错怎么处理?

SwiftyJSON will not be code signed because its settings don't specify a development team.
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

运行报错

你QQ多少,我加你QQ,我这边运行报错了

首页滚动条

hello, 作者代码写得不错,学习了. 个人小小建议 网络框架请求可以加入RxSwift, 直接用字典取其实容易崩溃 然后首页的滚动条如果不是写组件的话,个人建议可以写到BaseViewController里面. 这样结果更加清晰明了

黑屏

第一次build 运行,黑屏,杀掉进程后,重新启动就ok了。
7 plus

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.