https://github.com/keenteam1990/ktdantang
🍩Swift开源项目-单糖
https://github.com/keenteam1990/ktdantang
swift
Last synced: 3 months ago
JSON representation
🍩Swift开源项目-单糖
- Host: GitHub
- URL: https://github.com/keenteam1990/ktdantang
- Owner: KeenTeam1990
- License: mit
- Created: 2017-09-15T09:37:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-15T09:40:54.000Z (over 7 years ago)
- Last Synced: 2024-12-31T03:23:34.581Z (5 months ago)
- Topics: swift
- Language: Swift
- Homepage:
- Size: 5.69 MB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### 单糖——良品生活指南:家居零食、礼物美妆、海淘购物
---
> 说明
> 本程序仅供学习交流,不可用于任何商业用途。## 说明
因为公司使用的是 Objective-C 开发 app,没有使用 swift 来开发,所以决定自己研究 Swift,研究 Swift 的时间不长,对于 Swift 的基本语法有了大致的了解,但是对有些概念和语法还是理解的不深,所以决定模仿一些已经发布的 app,一方面可以让自己更好地理解和使用 Swift,另一方面可以和志同道合的人一起交流,共同进步。
使用 Swift 模仿的第一个 app 是单糖,总体来说界面搭建还算简单,而且结构不是很复杂,本次项目完成了大部分界面,对于项目中的数据接口都是通过 Charles 抓包获得,基本每个界面都是有数据请求,不会抓包的朋友可以看我 [这一篇文章](http://www.jianshu.com/p/3b7959c25eb4)。
项目中有的地方代码写的不是很简洁,毕竟自己能力有限,对 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## 项目文档和数据接口
### 抓取的数据接口请看 [单糖数据接口](https://github.com/KeenTeam1990/KTDanTang/blob/master/单糖数据接口.md) 和 [单糖数据接口详细数据](https://github.com/KeenTeam1990/KTDanTang/blob/master/单糖数据接口详细数据.md)。
#### 下载项目之后,点击此处,查看项目文档 [项目文档](https://github.com/KeenTeam1990/KTDanTang/blob/master/docs/index.html) 或者直接打开文件目录 『docs/index.html』。
## 运行项目出现的问题都可以给我留言或者直接加我的 QQ 联系,我会尽快回复。
## [github下载地址](https://github.com/KeenTeam1990/KTDanTang.git)
## 喜欢的朋友希望可以给个 Star,十分感谢您的支持!~