├── images
├── index.png
├── Icon-180.png
├── Icon-28.png
├── Icon-40.png
├── deveInfo.png
├── deveList.png
├── repoList.png
└── repoinfo.png
├── YZGithub
├── Assets.xcassets
│ ├── Contents.json
│ ├── Github
│ │ ├── Contents.json
│ │ ├── git_fork.imageset
│ │ │ ├── git_fork@2x.png
│ │ │ └── Contents.json
│ │ ├── git_star.imageset
│ │ │ ├── git_star@2x.png
│ │ │ └── Contents.json
│ │ └── git_starred.imageset
│ │ │ ├── git_starred@2x.png
│ │ │ └── Contents.json
│ ├── Logo
│ │ ├── Contents.json
│ │ ├── app_logo_90.imageset
│ │ │ ├── Icon-180.png
│ │ │ ├── Icon-256.png
│ │ │ └── Contents.json
│ │ └── github_signin_logo.imageset
│ │ │ ├── signin_logo@2x.png
│ │ │ └── Contents.json
│ ├── Profile
│ │ ├── Contents.json
│ │ ├── settingsicon
│ │ │ ├── Contents.json
│ │ │ ├── set_about.imageset
│ │ │ │ ├── Info-52.png
│ │ │ │ └── Contents.json
│ │ │ ├── set_rate.imageset
│ │ │ │ ├── Thumb Up-52.png
│ │ │ │ └── Contents.json
│ │ │ ├── set_share.imageset
│ │ │ │ ├── Share-70 (1).png
│ │ │ │ └── Contents.json
│ │ │ ├── set_feedback.imageset
│ │ │ │ ├── Feedback-48.png
│ │ │ │ └── Contents.json
│ │ │ ├── set_watched.imageset
│ │ │ │ ├── set_watched@2x.png
│ │ │ │ └── Contents.json
│ │ │ └── set_settings.imageset
│ │ │ │ ├── set_settings@2x.png
│ │ │ │ └── Contents.json
│ │ ├── default.imageset
│ │ │ ├── default@3x.png
│ │ │ └── Contents.json
│ │ ├── profile_bg.imageset
│ │ │ ├── profile_bg.jpg
│ │ │ └── Contents.json
│ │ ├── profile_bk.imageset
│ │ │ ├── profile_bk.png
│ │ │ └── Contents.json
│ │ ├── edit_profile.imageset
│ │ │ ├── Edit Image-50.png
│ │ │ └── Contents.json
│ │ └── lab_award_50.imageset
│ │ │ ├── lab_award_50@2x.png
│ │ │ └── Contents.json
│ ├── arrow
│ │ ├── Contents.json
│ │ ├── arrow_up.imageset
│ │ │ ├── arrow_up@2x.png
│ │ │ └── Contents.json
│ │ ├── arrow_down.imageset
│ │ │ ├── arrow_down@2x.png
│ │ │ └── Contents.json
│ │ ├── arrow_left.imageset
│ │ │ ├── arrow_left@2x.png
│ │ │ └── Contents.json
│ │ └── arrow_right.imageset
│ │ │ ├── arrow_right@2x.png
│ │ │ └── Contents.json
│ ├── Octicon_15
│ │ ├── Contents.json
│ │ ├── octicon_fork_15.imageset
│ │ │ ├── octicon_fork_15@2x.png
│ │ │ ├── octicon_fork_15@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_repo_15.imageset
│ │ │ ├── octicon_repo_15@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_star_15.imageset
│ │ │ ├── octicon_star_15@2x.png
│ │ │ ├── octicon_star_15@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_time_15.imageset
│ │ │ ├── octicon_time_15@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_state_15.imageset
│ │ │ ├── octicon_state_15@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_comment_15.imageset
│ │ │ ├── octicon_comment_45@3x.png
│ │ │ └── Contents.json
│ │ └── octicon_person_15.imageset
│ │ │ ├── octicon_person_15@3x.png
│ │ │ └── Contents.json
│ ├── Octicon_20
│ │ ├── Contents.json
│ │ ├── octicon_fork_20.imageset
│ │ │ ├── octicon_fork_20@2x.png
│ │ │ ├── octicon_fork_20@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_star_20.imageset
│ │ │ ├── octicon_star_20@2x.png
│ │ │ ├── octicon_star_20@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_issue_20.imageset
│ │ │ ├── octicon_issue_20@2x.png
│ │ │ ├── octicon_issue_20@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_watch_20.imageset
│ │ │ ├── octicon_watch_20@2x.png
│ │ │ ├── octicon_watch_20@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_private_20.imageset
│ │ │ ├── octicon_private_20@2x.png
│ │ │ ├── octicon_private_20@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_filesize_20.imageset
│ │ │ ├── octicon_filesize_20@2x.png
│ │ │ ├── octicon_filesize_20@3x.png
│ │ │ └── Contents.json
│ │ └── octicon_language_20.imageset
│ │ │ ├── octicon_language_20@2x.png
│ │ │ ├── octicon_language_20@3x.png
│ │ │ └── Contents.json
│ ├── Octicon_25
│ │ ├── Contents.json
│ │ ├── coticon_tag_25.imageset
│ │ │ ├── coticon_tag_25@3x.png
│ │ │ ├── octicon_tag_25@2x.png
│ │ │ └── Contents.json
│ │ ├── octicon_loc_25.imageset
│ │ │ ├── octicon_loc_25@2x.png
│ │ │ ├── octicon_loc_25@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_org_25.imageset
│ │ │ ├── octicon_org_25@2x.png
│ │ │ ├── octicon_org_25@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_issue_25.imageset
│ │ │ ├── octicon_issue@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_push_25.imageset
│ │ │ ├── octicon_push_25@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_time_25.imageset
│ │ │ ├── octicon_time_25@2x.png
│ │ │ ├── octicon_time_25@3x.png
│ │ │ └── Contents.json
│ │ ├── coticon_branch_25.imageset
│ │ │ ├── coticon_branch_25@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_commit_25.imageset
│ │ │ ├── octicon_commit_25@2x.png
│ │ │ ├── octicon_commit_25@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_person_25.imageset
│ │ │ ├── octicon_person_25@2x.png
│ │ │ ├── octicon_person_25@3x.png
│ │ │ └── Contents.json
│ │ ├── coticon_repository_25.imageset
│ │ │ ├── coticon_repos_25@3x.png
│ │ │ └── Contents.json
│ │ └── octicon_pull_request_25.imageset
│ │ │ ├── octicon_pull_request@3x.png
│ │ │ └── Contents.json
│ ├── Octicon_35
│ │ ├── Contents.json
│ │ └── octicon_star_35.imageset
│ │ │ ├── octicon_star_35@2x.png
│ │ │ └── Contents.json
│ ├── Octicon_Red
│ │ ├── Contents.json
│ │ ├── octicon_fork_red_25.imageset
│ │ │ ├── octicon_fork_red_25@2x.png
│ │ │ ├── octicon_fork_red_25@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_watch_red_25.imageset
│ │ │ ├── octicon_watch_red_25@2x.png
│ │ │ ├── octicon_watch_red_25@3x.png
│ │ │ └── Contents.json
│ │ ├── octicon_star_red_20.imageset
│ │ │ ├── octicon-star_40_0_e31100_none.png
│ │ │ ├── octicon-star_60_0_e31100_none.png
│ │ │ └── Contents.json
│ │ ├── octicon_watch_red_20.imageset
│ │ │ ├── octicon-eye_40_0_e31100_none.png
│ │ │ ├── octicon-eye_60_0_e31100_none.png
│ │ │ └── Contents.json
│ │ └── octicon_fork_red_20.imageset
│ │ │ ├── octicon-repo-forked_40_0_e31100_none.png
│ │ │ ├── octicon-repo-forked_60_0_e31100_none.png
│ │ │ └── Contents.json
│ ├── bar_icon
│ │ ├── Contents.json
│ │ ├── nav_funnel.imageset
│ │ │ ├── Filter-60.png
│ │ │ └── Contents.json
│ │ ├── tab_gist.imageset
│ │ │ ├── tab_gist@2x.png
│ │ │ └── Contents.json
│ │ ├── tab_star.imageset
│ │ │ ├── tab_star@2x.png
│ │ │ └── Contents.json
│ │ ├── tab_message.imageset
│ │ │ ├── tab_message@2x.png
│ │ │ └── Contents.json
│ │ ├── tab_profile.imageset
│ │ │ ├── tab_profile@2x.png
│ │ │ └── Contents.json
│ │ ├── nav_share_35.imageset
│ │ │ ├── nav_search_35@2x.png
│ │ │ └── Contents.json
│ │ ├── tab_gist_sel.imageset
│ │ │ ├── tab_gist_sel@2x.png
│ │ │ └── Contents.json
│ │ ├── tab_star_sel.imageset
│ │ │ ├── tab_star_sel@2x.png
│ │ │ └── Contents.json
│ │ ├── tab_trending.imageset
│ │ │ ├── tab_trending@2x.png
│ │ │ └── Contents.json
│ │ ├── nav_funnel_sel.imageset
│ │ │ ├── Filter Filled-60.png
│ │ │ └── Contents.json
│ │ ├── nav_search_35.imageset
│ │ │ ├── nav_search_35@2x.png
│ │ │ └── Contents.json
│ │ ├── tab_message_sel.imageset
│ │ │ ├── tab_message_sel@2x.png
│ │ │ └── Contents.json
│ │ ├── tab_profile_sel.imageset
│ │ │ ├── tab_profile_sel@2x.png
│ │ │ └── Contents.json
│ │ └── tab_trending_sel.imageset
│ │ │ ├── tab_trending_sel@2x.png
│ │ │ └── Contents.json
│ ├── AppIcon.appiconset
│ │ ├── Icon-120.png
│ │ ├── Icon-121.png
│ │ ├── Icon-180.png
│ │ ├── Icon-58.png
│ │ ├── Icon-80.png
│ │ ├── Icon-87.png
│ │ └── Contents.json
│ ├── ArrowLeft.imageset
│ │ ├── IQButtonBarArrowLeft.png
│ │ ├── IQButtonBarArrowLeft@2x.png
│ │ ├── IQButtonBarArrowLeft@3x.png
│ │ └── Contents.json
│ ├── ArrowRight.imageset
│ │ ├── IQButtonBarArrowRight.png
│ │ ├── IQButtonBarArrowRight@2x.png
│ │ ├── IQButtonBarArrowRight@3x.png
│ │ └── Contents.json
│ ├── Image.imageset
│ │ └── Contents.json
│ └── LaunchImage.launchimage
│ │ └── Contents.json
├── ThridParty
│ ├── WX
│ │ ├── libWeChatSDK.a
│ │ ├── README.txt
│ │ ├── WechatAuthSDK.h
│ │ └── WXApi.h
│ └── JWSheet
│ │ ├── JWSheet.h
│ │ ├── JWSheetItem.h
│ │ ├── JWSheetItem.m
│ │ └── JWSheet.m
├── Helper
│ ├── GlobalHubHelper.swift
│ ├── NSString+TranToRich.h
│ ├── YZGithub-Bridging-Header.h
│ ├── NetworkHelper.swift
│ ├── NSString+TranToRich.m
│ └── UserInfoHelper.swift
├── Sences
│ ├── Base
│ │ ├── BaseViewModel.swift
│ │ └── BaseView
│ │ │ └── BaseCell.swift
│ ├── BaseViewController
│ │ ├── BaseTabBarViewController.swift
│ │ ├── BaseNavController.swift
│ │ ├── YZWebViewController.swift
│ │ └── BaseTableViewController.swift
│ ├── Profile
│ │ ├── View
│ │ │ └── SettingCell.swift
│ │ ├── ViewModel
│ │ │ ├── LoginViewModel.swift
│ │ │ └── ProfileViewModel.swift
│ │ └── Controller
│ │ │ ├── LoginViewController.swift
│ │ │ └── SettingViewController.swift
│ ├── Repos
│ │ ├── View
│ │ │ ├── RepoCodeInfoCell.swift
│ │ │ ├── RepoInfoCell.swift
│ │ │ ├── PRCell.swift
│ │ │ ├── RepoIntroCell.swift
│ │ │ └── RepoCodeInfoCell.xib
│ │ ├── Model
│ │ │ ├── SearchUserResponse.swift
│ │ │ ├── Commit.swift
│ │ │ ├── Branches.swift
│ │ │ └── PullRequest.swift
│ │ └── Controller
│ │ │ ├── PRListViewController.swift
│ │ │ ├── ReadmeViewController.swift
│ │ │ └── RepoListViewController.swift
│ ├── Developer
│ │ ├── Model
│ │ │ ├── ObjPermissions.swift
│ │ │ ├── ObjEmail.swift
│ │ │ └── ObjPlan.swift
│ │ ├── View
│ │ │ └── UserBaseInfoCell.swift
│ │ ├── ViewModel
│ │ │ └── DevelopListViewModel.swift
│ │ └── Controller
│ │ │ └── DeveloperListViewController.swift
│ ├── Message
│ │ ├── Model
│ │ │ ├── Subject.swift
│ │ │ └── Message.swift
│ │ ├── View
│ │ │ └── MessageCell.swift
│ │ └── Controller
│ │ │ └── MessagesViewController.swift
│ ├── Stars
│ │ ├── Model
│ │ │ └── Event.swift
│ │ └── Controller
│ │ │ └── NewsViewController.swift
│ ├── Explore
│ │ ├── View
│ │ │ ├── DeveloperTableViewCell.swift
│ │ │ └── RepoTableViewCell.swift
│ │ └── Controller
│ │ │ ├── ExploreViewController.swift
│ │ │ └── ExploreReposViewController.swift
│ └── CommanModel
│ │ ├── Network
│ │ └── AppToken.swift
│ │ └── Parameters
│ │ └── ParaSerachUser.swift
├── Config
│ ├── NotiName.swift
│ └── KeysConfig.swift
├── Extension
│ ├── NSMutableAttributedString+RichText.swift
│ ├── String+Range.swift
│ ├── MBProcessHUD+Show.swift
│ ├── UIColor+yztc.swift
│ ├── UINavigationBar+yztc.swift
│ └── ParallaxHeaderView.swift
├── Service
│ ├── NetLayer
│ │ ├── UserEngine.swift
│ │ ├── LoginEngine.swift
│ │ ├── Response+ObjectMapper.swift
│ │ └── BaseEngine.swift
│ └── Router
│ │ └── Router.swift
├── Info.plist
├── AppDelegate.swift
└── Base.lproj
│ └── LaunchScreen.storyboard
├── YZGithub.xcodeproj
└── project.xcworkspace
│ └── contents.xcworkspacedata
├── YZGithub.xcworkspace
└── contents.xcworkspacedata
├── README.md
├── YZGithubTests
├── Info.plist
└── YZGithubTests.swift
├── Podfile
├── LICENSE
├── .gitignore
└── Podfile.lock
/images/index.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/images/index.png
--------------------------------------------------------------------------------
/images/Icon-180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/images/Icon-180.png
--------------------------------------------------------------------------------
/images/Icon-28.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/images/Icon-28.png
--------------------------------------------------------------------------------
/images/Icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/images/Icon-40.png
--------------------------------------------------------------------------------
/images/deveInfo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/images/deveInfo.png
--------------------------------------------------------------------------------
/images/deveList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/images/deveList.png
--------------------------------------------------------------------------------
/images/repoList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/images/repoList.png
--------------------------------------------------------------------------------
/images/repoinfo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/images/repoinfo.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Github/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Logo/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/arrow/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_35/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YZGithub/ThridParty/WX/libWeChatSDK.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/ThridParty/WX/libWeChatSDK.a
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/AppIcon.appiconset/Icon-120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/AppIcon.appiconset/Icon-120.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/AppIcon.appiconset/Icon-121.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/AppIcon.appiconset/Icon-121.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/AppIcon.appiconset/Icon-180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/AppIcon.appiconset/Icon-180.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/AppIcon.appiconset/Icon-58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/AppIcon.appiconset/Icon-58.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/AppIcon.appiconset/Icon-80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/AppIcon.appiconset/Icon-80.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/AppIcon.appiconset/Icon-87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/AppIcon.appiconset/Icon-87.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Logo/app_logo_90.imageset/Icon-180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Logo/app_logo_90.imageset/Icon-180.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Logo/app_logo_90.imageset/Icon-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Logo/app_logo_90.imageset/Icon-256.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/default.imageset/default@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Profile/default.imageset/default@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/arrow/arrow_up.imageset/arrow_up@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/arrow/arrow_up.imageset/arrow_up@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Github/git_fork.imageset/git_fork@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Github/git_fork.imageset/git_fork@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Github/git_star.imageset/git_star@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Github/git_star.imageset/git_star@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/ArrowLeft.imageset/IQButtonBarArrowLeft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/ArrowLeft.imageset/IQButtonBarArrowLeft.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/profile_bg.imageset/profile_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Profile/profile_bg.imageset/profile_bg.jpg
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/profile_bk.imageset/profile_bk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Profile/profile_bk.imageset/profile_bk.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/arrow/arrow_down.imageset/arrow_down@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/arrow/arrow_down.imageset/arrow_down@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/arrow/arrow_left.imageset/arrow_left@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/arrow/arrow_left.imageset/arrow_left@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/nav_funnel.imageset/Filter-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/nav_funnel.imageset/Filter-60.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_gist.imageset/tab_gist@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/tab_gist.imageset/tab_gist@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_star.imageset/tab_star@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/tab_star.imageset/tab_star@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/ArrowLeft.imageset/IQButtonBarArrowLeft@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/ArrowLeft.imageset/IQButtonBarArrowLeft@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/ArrowLeft.imageset/IQButtonBarArrowLeft@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/ArrowLeft.imageset/IQButtonBarArrowLeft@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/ArrowRight.imageset/IQButtonBarArrowRight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/ArrowRight.imageset/IQButtonBarArrowRight.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Github/git_starred.imageset/git_starred@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Github/git_starred.imageset/git_starred@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/arrow/arrow_right.imageset/arrow_right@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/arrow/arrow_right.imageset/arrow_right@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/ArrowRight.imageset/IQButtonBarArrowRight@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/ArrowRight.imageset/IQButtonBarArrowRight@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/ArrowRight.imageset/IQButtonBarArrowRight@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/ArrowRight.imageset/IQButtonBarArrowRight@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/edit_profile.imageset/Edit Image-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Profile/edit_profile.imageset/Edit Image-50.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/lab_award_50.imageset/lab_award_50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Profile/lab_award_50.imageset/lab_award_50@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_message.imageset/tab_message@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/tab_message.imageset/tab_message@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_profile.imageset/tab_profile@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/tab_profile.imageset/tab_profile@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Logo/github_signin_logo.imageset/signin_logo@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Logo/github_signin_logo.imageset/signin_logo@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/set_about.imageset/Info-52.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Profile/settingsicon/set_about.imageset/Info-52.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/nav_share_35.imageset/nav_search_35@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/nav_share_35.imageset/nav_search_35@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_gist_sel.imageset/tab_gist_sel@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/tab_gist_sel.imageset/tab_gist_sel@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_star_sel.imageset/tab_star_sel@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/tab_star_sel.imageset/tab_star_sel@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_trending.imageset/tab_trending@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/tab_trending.imageset/tab_trending@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/set_rate.imageset/Thumb Up-52.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Profile/settingsicon/set_rate.imageset/Thumb Up-52.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/nav_funnel_sel.imageset/Filter Filled-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/nav_funnel_sel.imageset/Filter Filled-60.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/nav_search_35.imageset/nav_search_35@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/nav_search_35.imageset/nav_search_35@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/coticon_tag_25.imageset/coticon_tag_25@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/coticon_tag_25.imageset/coticon_tag_25@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/coticon_tag_25.imageset/octicon_tag_25@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/coticon_tag_25.imageset/octicon_tag_25@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_loc_25.imageset/octicon_loc_25@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_loc_25.imageset/octicon_loc_25@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_loc_25.imageset/octicon_loc_25@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_loc_25.imageset/octicon_loc_25@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_org_25.imageset/octicon_org_25@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_org_25.imageset/octicon_org_25@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_org_25.imageset/octicon_org_25@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_org_25.imageset/octicon_org_25@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/set_share.imageset/Share-70 (1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Profile/settingsicon/set_share.imageset/Share-70 (1).png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_message_sel.imageset/tab_message_sel@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/tab_message_sel.imageset/tab_message_sel@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_profile_sel.imageset/tab_profile_sel@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/tab_profile_sel.imageset/tab_profile_sel@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_fork_15.imageset/octicon_fork_15@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_15/octicon_fork_15.imageset/octicon_fork_15@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_fork_15.imageset/octicon_fork_15@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_15/octicon_fork_15.imageset/octicon_fork_15@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_repo_15.imageset/octicon_repo_15@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_15/octicon_repo_15.imageset/octicon_repo_15@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_star_15.imageset/octicon_star_15@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_15/octicon_star_15.imageset/octicon_star_15@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_star_15.imageset/octicon_star_15@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_15/octicon_star_15.imageset/octicon_star_15@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_time_15.imageset/octicon_time_15@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_15/octicon_time_15.imageset/octicon_time_15@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_fork_20.imageset/octicon_fork_20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_fork_20.imageset/octicon_fork_20@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_fork_20.imageset/octicon_fork_20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_fork_20.imageset/octicon_fork_20@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_star_20.imageset/octicon_star_20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_star_20.imageset/octicon_star_20@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_star_20.imageset/octicon_star_20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_star_20.imageset/octicon_star_20@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_issue_25.imageset/octicon_issue@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_issue_25.imageset/octicon_issue@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_push_25.imageset/octicon_push_25@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_push_25.imageset/octicon_push_25@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_time_25.imageset/octicon_time_25@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_time_25.imageset/octicon_time_25@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_time_25.imageset/octicon_time_25@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_time_25.imageset/octicon_time_25@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_35/octicon_star_35.imageset/octicon_star_35@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_35/octicon_star_35.imageset/octicon_star_35@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/set_feedback.imageset/Feedback-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Profile/settingsicon/set_feedback.imageset/Feedback-48.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_trending_sel.imageset/tab_trending_sel@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/bar_icon/tab_trending_sel.imageset/tab_trending_sel@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_state_15.imageset/octicon_state_15@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_15/octicon_state_15.imageset/octicon_state_15@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_issue_20.imageset/octicon_issue_20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_issue_20.imageset/octicon_issue_20@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_issue_20.imageset/octicon_issue_20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_issue_20.imageset/octicon_issue_20@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_watch_20.imageset/octicon_watch_20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_watch_20.imageset/octicon_watch_20@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_watch_20.imageset/octicon_watch_20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_watch_20.imageset/octicon_watch_20@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/set_watched.imageset/set_watched@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Profile/settingsicon/set_watched.imageset/set_watched@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_comment_15.imageset/octicon_comment_45@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_15/octicon_comment_15.imageset/octicon_comment_45@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_person_15.imageset/octicon_person_15@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_15/octicon_person_15.imageset/octicon_person_15@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_private_20.imageset/octicon_private_20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_private_20.imageset/octicon_private_20@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_private_20.imageset/octicon_private_20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_private_20.imageset/octicon_private_20@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/coticon_branch_25.imageset/coticon_branch_25@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/coticon_branch_25.imageset/coticon_branch_25@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_commit_25.imageset/octicon_commit_25@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_commit_25.imageset/octicon_commit_25@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_commit_25.imageset/octicon_commit_25@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_commit_25.imageset/octicon_commit_25@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_person_25.imageset/octicon_person_25@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_person_25.imageset/octicon_person_25@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_person_25.imageset/octicon_person_25@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_person_25.imageset/octicon_person_25@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/set_settings.imageset/set_settings@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Profile/settingsicon/set_settings.imageset/set_settings@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_filesize_20.imageset/octicon_filesize_20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_filesize_20.imageset/octicon_filesize_20@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_filesize_20.imageset/octicon_filesize_20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_filesize_20.imageset/octicon_filesize_20@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_language_20.imageset/octicon_language_20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_language_20.imageset/octicon_language_20@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_language_20.imageset/octicon_language_20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_20/octicon_language_20.imageset/octicon_language_20@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/coticon_repository_25.imageset/coticon_repos_25@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/coticon_repository_25.imageset/coticon_repos_25@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_fork_red_25.imageset/octicon_fork_red_25@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_Red/octicon_fork_red_25.imageset/octicon_fork_red_25@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_fork_red_25.imageset/octicon_fork_red_25@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_Red/octicon_fork_red_25.imageset/octicon_fork_red_25@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_watch_red_25.imageset/octicon_watch_red_25@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_Red/octicon_watch_red_25.imageset/octicon_watch_red_25@2x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_watch_red_25.imageset/octicon_watch_red_25@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_Red/octicon_watch_red_25.imageset/octicon_watch_red_25@3x.png
--------------------------------------------------------------------------------
/YZGithub.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_pull_request_25.imageset/octicon_pull_request@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_25/octicon_pull_request_25.imageset/octicon_pull_request@3x.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_star_red_20.imageset/octicon-star_40_0_e31100_none.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_Red/octicon_star_red_20.imageset/octicon-star_40_0_e31100_none.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_star_red_20.imageset/octicon-star_60_0_e31100_none.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_Red/octicon_star_red_20.imageset/octicon-star_60_0_e31100_none.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_watch_red_20.imageset/octicon-eye_40_0_e31100_none.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_Red/octicon_watch_red_20.imageset/octicon-eye_40_0_e31100_none.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_watch_red_20.imageset/octicon-eye_60_0_e31100_none.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_Red/octicon_watch_red_20.imageset/octicon-eye_60_0_e31100_none.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_fork_red_20.imageset/octicon-repo-forked_40_0_e31100_none.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_Red/octicon_fork_red_20.imageset/octicon-repo-forked_40_0_e31100_none.png
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_fork_red_20.imageset/octicon-repo-forked_60_0_e31100_none.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JWLAZY/GithubClient/HEAD/YZGithub/Assets.xcassets/Octicon_Red/octicon_fork_red_20.imageset/octicon-repo-forked_60_0_e31100_none.png
--------------------------------------------------------------------------------
/YZGithub/Helper/GlobalHubHelper.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GlobalHubHelper.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/10.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import MBProgressHUD
11 |
12 | class GlobalHubHelper {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/YZGithub.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Base/BaseViewModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewModel.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/12/8.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import RxCocoa
11 | import RxSwift
12 |
13 | class BaseViewModel {
14 | var disposeBag = DisposeBag()
15 | }
16 |
--------------------------------------------------------------------------------
/YZGithub/Helper/NSString+TranToRich.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSString+TranToRich.h
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/29.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @interface NSString (TranToRich)
13 |
14 | - (NSAttributedString *)richText;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/YZGithub/Config/NotiName.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NotiName.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/25.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | public let NotificationGitLoginSuccessful = "GitLoginSuccessfulNotification"
12 | public let NotificationGitLogOutSuccessful = "GitLogOutSuccessfulNotification"
13 |
14 |
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Image.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "scale" : "3x"
14 | }
15 | ],
16 | "info" : {
17 | "version" : 1,
18 | "author" : "xcode"
19 | }
20 | }
--------------------------------------------------------------------------------
/YZGithub/Helper/YZGithub-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
5 | #import "AttributedMarkdown/markdown_lib.h"
6 | #import "AttributedMarkdown/markdown_peg.h"
7 | #import "NSString+TranToRich.h"
8 |
9 | #import "JWSheet.h"
10 | #import "JWSheetItem.h"
11 | //#import "UMSocial.h"
12 | //#import "UMSocialSinaSSOHandler.h"
13 |
--------------------------------------------------------------------------------
/YZGithub/ThridParty/JWSheet/JWSheet.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWSheet.h
3 | // FMDBDemo
4 | //
5 | // Created by 郑建文 on 16/6/30.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef void(^ClickBlock)(NSInteger index);
12 |
13 | @interface JWSheet : UIView
14 |
15 | - (instancetype)initWithFrame:(CGRect)frame items:(NSArray *)items click:(ClickBlock)block;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Github/git_fork.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "git_fork@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Github/git_star.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "git_star@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/default.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "default@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/arrow/arrow_up.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "arrow_up@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Github/git_starred.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "git_starred@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/profile_bg.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "profile_bg.jpg",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/profile_bk.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "profile_bk.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/arrow/arrow_down.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "arrow_down@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/arrow/arrow_left.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "arrow_left@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/arrow/arrow_right.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "arrow_right@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/nav_funnel.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Filter-60.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_gist.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_gist@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_star.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_star@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/ThridParty/JWSheet/JWSheetItem.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWSheetItem.h
3 | // FMDBDemo
4 | //
5 | // Created by 郑建文 on 16/6/30.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef void(^clickAction)(NSInteger index);
12 |
13 | @interface JWSheetItem : UIView
14 |
15 | - (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title index:(NSInteger)index action:(clickAction)action;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Logo/github_signin_logo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "signin_logo@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/edit_profile.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Edit Image-50.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/lab_award_50.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "lab_award_50@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/set_about.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Info-52.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/nav_share_35.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "nav_search_35@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_gist_sel.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_gist_sel@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_message.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_message@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_profile.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_profile@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_star_sel.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_star_sel@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_trending.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_trending@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/set_rate.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Thumb Up-52.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/set_share.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Share-70 (1).png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/nav_funnel_sel.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Filter Filled-60.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/nav_search_35.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "nav_search_35@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_message_sel.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_message_sel@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_profile_sel.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_profile_sel@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_repo_15.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "octicon_repo_15@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_state_15.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "octicon_state_15@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_time_15.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "octicon_time_15@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_issue_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "octicon_issue@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_push_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "octicon_push_25@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_35/octicon_star_35.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_star_35@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/set_feedback.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Feedback-48.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/set_watched.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "set_watched@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/bar_icon/tab_trending_sel.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tab_trending_sel@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_comment_15.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "octicon_comment_45@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_person_15.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "octicon_person_15@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/coticon_branch_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "coticon_branch_25@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/coticon_repository_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "coticon_repos_25@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Profile/settingsicon/set_settings.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "set_settings@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_pull_request_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "octicon_pull_request@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Logo/app_logo_90.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Icon-180.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "Icon-256.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/YZGithub/Helper/NetworkHelper.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NetworkHelper.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/24.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | open class NetworkHelper: NSObject {
12 |
13 | open static func clearCookies() {
14 |
15 | let storage : HTTPCookieStorage = HTTPCookieStorage.shared
16 | for cookie in storage.cookies! {
17 | storage.deleteCookie(cookie)
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/coticon_tag_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_tag_25@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "coticon_tag_25@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_loc_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_loc_25@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_loc_25@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_org_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_org_25@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_org_25@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_fork_15.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_fork_15@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_fork_15@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_15/octicon_star_15.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_star_15@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_star_15@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_time_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_time_25@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_time_25@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_commit_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_commit_25@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_commit_25@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_25/octicon_person_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_person_25@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_person_25@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/ArrowLeft.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "IQButtonBarArrowLeft.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "IQButtonBarArrowLeft@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "IQButtonBarArrowLeft@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/ArrowRight.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "IQButtonBarArrowRight.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "IQButtonBarArrowRight@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "IQButtonBarArrowRight@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/YZGithub/Sences/BaseViewController/BaseTabBarViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseTabBarViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/13.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class BaseTabBarViewController: UITabBarController {
12 |
13 | override func viewDidLoad() {
14 | super.viewDidLoad()
15 |
16 | // Do any additional setup after loading the view.
17 | custemUI()
18 | }
19 |
20 | func custemUI() {
21 | self.tabBar.tintColor = UIColor.white
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_fork_20.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_fork_20@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_fork_20@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | },
22 | "properties" : {
23 | "template-rendering-intent" : "original"
24 | }
25 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_issue_20.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_issue_20@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_issue_20@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | },
22 | "properties" : {
23 | "template-rendering-intent" : "original"
24 | }
25 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_star_20.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_star_20@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_star_20@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | },
22 | "properties" : {
23 | "template-rendering-intent" : "original"
24 | }
25 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_watch_20.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_watch_20@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_watch_20@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | },
22 | "properties" : {
23 | "template-rendering-intent" : "original"
24 | }
25 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_private_20.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_private_20@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_private_20@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | },
22 | "properties" : {
23 | "template-rendering-intent" : "original"
24 | }
25 | }
--------------------------------------------------------------------------------
/YZGithub/Extension/NSMutableAttributedString+RichText.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NSMutableAttributedString+RichText.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/29.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension NSMutableAttributedString {
12 | func linkWithString(_ string:String,inString:String,url:String) {
13 | let range = inString.NSRangeFromRange(inString.range(of: string)!)
14 | self.addAttributes([NSFontAttributeName:UIFont.italicSystemFont(ofSize: 16),NSLinkAttributeName:URL(string:url)!], range: range)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Profile/View/SettingCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SettingCell.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/11/30.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class SettingCell: UITableViewCell {
12 |
13 | override func awakeFromNib() {
14 | super.awakeFromNib()
15 | // Initialization code
16 | }
17 |
18 | override func setSelected(_ selected: Bool, animated: Bool) {
19 | super.setSelected(selected, animated: animated)
20 |
21 | // Configure the view for the selected state
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_filesize_20.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_filesize_20@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_filesize_20@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | },
22 | "properties" : {
23 | "template-rendering-intent" : "original"
24 | }
25 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_20/octicon_language_20.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_language_20@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_language_20@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | },
22 | "properties" : {
23 | "template-rendering-intent" : "original"
24 | }
25 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_fork_red_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_fork_red_25@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_fork_red_25@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | },
22 | "properties" : {
23 | "template-rendering-intent" : "original"
24 | }
25 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_watch_red_25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon_watch_red_25@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon_watch_red_25@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | },
22 | "properties" : {
23 | "template-rendering-intent" : "original"
24 | }
25 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_star_red_20.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon-star_40_0_e31100_none.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon-star_60_0_e31100_none.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | },
22 | "properties" : {
23 | "template-rendering-intent" : "original"
24 | }
25 | }
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_watch_red_20.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon-eye_40_0_e31100_none.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon-eye_60_0_e31100_none.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | },
22 | "properties" : {
23 | "template-rendering-intent" : "original"
24 | }
25 | }
--------------------------------------------------------------------------------
/YZGithub/Sences/Repos/View/RepoCodeInfoCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RepoCodeInfoCell.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/27.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class RepoCodeInfoCell: UITableViewCell {
12 |
13 | override func awakeFromNib() {
14 | super.awakeFromNib()
15 | // Initialization code
16 | }
17 |
18 | override func setSelected(_ selected: Bool, animated: Bool) {
19 | super.setSelected(selected, animated: animated)
20 |
21 | // Configure the view for the selected state
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/Octicon_Red/octicon_fork_red_20.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "octicon-repo-forked_40_0_e31100_none.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "octicon-repo-forked_60_0_e31100_none.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | },
22 | "properties" : {
23 | "template-rendering-intent" : "original"
24 | }
25 | }
--------------------------------------------------------------------------------
/YZGithub/Extension/String+Range.swift:
--------------------------------------------------------------------------------
1 | //
2 | // String+Range.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/29.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Foundation
11 |
12 | extension String {
13 | func NSRangeFromRange(_ range:Range) -> NSRange {
14 | let utf16view = self.utf16
15 | let from = String.UTF16View.Index(range.lowerBound, within: utf16view)
16 | let to = String.UTF16View.Index(range.upperBound, within: utf16view)
17 | return NSMakeRange(utf16view.startIndex.distance(to: from), from.distance(to: to))
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/YZGithub/Helper/NSString+TranToRich.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSString+TranToRich.m
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/29.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | #import "NSString+TranToRich.h"
10 | #import "AttributedMarkdown/markdown_lib.h"
11 | #import "AttributedMarkdown/markdown_peg.h"
12 |
13 |
14 | @implementation NSString (TranToRich)
15 |
16 | - (NSAttributedString *)richText{
17 | NSString *str = [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
18 | NSAttributedString *prettyText = markdown_to_attr_string(str,0,nil);
19 | return prettyText;
20 | }
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Developer/Model/ObjPermissions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ObjPermissions.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/25.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ObjectMapper
11 |
12 | class ObjPermissions: NSObject,Mappable {
13 | var admin:Int?
14 | var pull:Int?
15 | var push:Int?
16 |
17 | required init?(map: Map) {
18 | // super.init(map)
19 | }
20 |
21 | func mapping(map: Map) {
22 | // super.mapping(map)
23 | admin <- map["admin"]
24 | pull <- map["pull"]
25 | push <- map["push"]
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Message/Model/Subject.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Subject.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/24.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ObjectMapper
11 |
12 | class Subject:NSObject,Mappable {
13 | var title:String?
14 | var type:String?
15 | var latest_comment_url:String?
16 | var url:String?
17 | required init?(map: Map) {
18 |
19 | }
20 |
21 | func mapping(map: Map) {
22 | title <- map["title"]
23 | type <- map["type"]
24 | latest_comment_url <- map["latest_comment_url"]
25 | url <- map["url"]
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Base/BaseView/BaseCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseCell.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/24.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class BaseCell: UITableViewCell {
12 |
13 | // var model:T?
14 |
15 | func setModel(_ model:T) {
16 |
17 | }
18 |
19 | override func awakeFromNib() {
20 | super.awakeFromNib()
21 |
22 | }
23 |
24 | override func setSelected(_ selected: Bool, animated: Bool) {
25 | super.setSelected(selected, animated: animated)
26 |
27 | // Configure the view for the selected state
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Developer/Model/ObjEmail.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ObjEmail.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/25.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ObjectMapper
11 |
12 | class ObjEmail: NSObject,Mappable {
13 | var email:String?
14 | var primary:Bool?
15 | var verified:Bool?
16 |
17 |
18 | required init?(map: Map) {
19 | // super.init(map)
20 | }
21 |
22 | func mapping(map: Map) {
23 | // super.mapping(map)
24 | email <- map["email"]
25 | primary <- map["primary"]
26 | verified <- map["verified"]
27 | }
28 |
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Repos/Model/SearchUserResponse.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SearchUserResponse.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/27.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import Alamofire
11 | import ObjectMapper
12 |
13 | class SearchUserResponse: NSObject,Mappable{
14 |
15 | var totalCount:Int?
16 | var incompleteResults:Bool?
17 | var items:[ObjUser]?
18 |
19 | required init?(map: Map) {
20 |
21 | }
22 |
23 | func mapping(map: Map) {
24 | // super.mapping(map)
25 | totalCount <- map["total_count"]
26 | incompleteResults <- map["incomplete_results"]
27 | items <- map["items"]
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Developer/View/UserBaseInfoCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UserBaseInfoCell.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/28.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class UserBaseInfoCell: UITableViewCell {
12 |
13 | @IBOutlet weak var attrNameLabel: UILabel!
14 | @IBOutlet weak var attrValueLabel: UILabel!
15 |
16 | override func awakeFromNib() {
17 | super.awakeFromNib()
18 | }
19 |
20 | override func setSelected(_ selected: Bool, animated: Bool) {
21 | super.setSelected(selected, animated: animated)
22 | }
23 | func customUI(name:String, value:String) {
24 | attrNameLabel.text = name
25 | attrValueLabel.text = value
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # YZGithub 
2 | > Github客户端.获取github中的个人或者别人的消息.
3 |
4 |
5 | **已经支持swift 3.0**
6 |
7 |
8 | | 分支 | swift 版本 | 状态 |
9 | | ------------- |:-------------:| -----:|
10 | | v2 | swift2.2 | 停止更新 |
11 | | swift3version | swift3.0 | 开发中 |
12 |
13 |
14 | #### 关键字
15 | * SWITF 2.2/3.0
16 | * MOYA
17 | * GITHUB
18 | * NETWORK
19 | * RxSwift
20 |
21 | #### 效果图
22 |  - - 
23 |
24 | ---
25 |  - - 
26 |
27 | ---
28 | 
29 |
30 | # 功能
31 | * [x] 授权登陆
32 | * [x] 趋势界面(仓库,开发者)
33 | * [x] 网络公用库
34 | * [x] 仓库详情页面(分支,PR,开发者)
35 | * [x] 开发者详情页面(仓库列表)
36 | * [x] 个人界面
37 | * [x] 分享功能
38 | * [x] 消息界面
39 | * [x] 动态界面
40 | * [ ] 分支详情
41 |
42 |
43 |
--------------------------------------------------------------------------------
/YZGithub/Config/KeysConfig.swift:
--------------------------------------------------------------------------------
1 | //
2 | // KeysConfig.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/13.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public let GithubClientID = "8bea5da7a3e34cd621a6"
12 |
13 | public let GithubClientSecret = "df4312673d6b57fd1e6290dcbccea3e7ff227959"
14 |
15 | public let GithubRedirectUrl = "https://www.baidu.com"
16 |
17 | public let GithubAuthUrl = String(format: "https://github.com/login/oauth/authorize/?client_id=%@&redirect_uri=%@&scope=%@", GithubClientID,GithubRedirectUrl,"user,user:email,user:follow,public_repo,repo,repo_deployment,repo:status,delete_repo,notifications,gist,read:repo_hook,write:repo_hook,admin:repo_hook,admin:org_hook,read:org,write:org,admin:org,read:public_key,write:public_key,admin:public_key")
18 |
--------------------------------------------------------------------------------
/YZGithubTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Repos/Model/Commit.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Commit.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/29.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ObjectMapper
11 |
12 | //"commit": {
13 | // "sha": "7fd1a60b01f91b314f59955a4e4d4e80d8edf11d",
14 | // "url": "https://api.github.com/repos/octocat/Hello-World/commits/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d"
15 | // }
16 | class Commit: NSObject,Mappable {
17 | var sha:String?
18 | var url:String?
19 | var message:String?
20 | required init?(map: Map) {
21 |
22 | }
23 | override init() {
24 |
25 | }
26 | func mapping(map: Map) {
27 | sha <- map["sha"]
28 | url <- map["url"]
29 | message <- map["message"]
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Repos/View/RepoInfoCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RepoInfoCell.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/27.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Kingfisher
11 | class RepoInfoCell: UITableViewCell {
12 |
13 | @IBOutlet weak var imageIcon: UIImageView!
14 | @IBOutlet weak var actionName: UILabel!
15 |
16 | func customUI(_ image:UIImage,actionName:String) {
17 | imageIcon.image = image
18 | self.actionName.text = actionName
19 | }
20 |
21 | override func awakeFromNib() {
22 | super.awakeFromNib()
23 | // Initialization code
24 | }
25 |
26 | override func setSelected(_ selected: Bool, animated: Bool) {
27 | super.setSelected(selected, animated: animated)
28 |
29 | // Configure the view for the selected state
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/YZGithub/Sences/BaseViewController/BaseNavController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseNavController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/24.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import MBProgressHUD
11 |
12 | class BaseNavController: UINavigationController {
13 |
14 | override func viewDidLoad() {
15 | super.viewDidLoad()
16 |
17 | /// 感觉不同的导航控制器跳转到不同的界面
18 | if let ident = self.restorationIdentifier {
19 | switch ident {
20 | case "new":
21 | let vc = NewsViewController(nibName: nil, bundle: nil)
22 | self.pushViewController(vc, animated: true)
23 | default:
24 | MBProgressHUD.showError("没有这个控制器")
25 | }
26 | }
27 |
28 |
29 | }
30 |
31 | override func didReceiveMemoryWarning() {
32 | super.didReceiveMemoryWarning()
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Stars/Model/Event.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Event.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/24.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ObjectMapper
11 |
12 | enum EventType:String {
13 | case IssueCommentEvent
14 | case PullRequestEvent
15 | case WatchEvent
16 | case CreateEvent
17 | case PushEvent
18 | case ForkEvent
19 | }
20 |
21 | class Event:NSObject,Mappable {
22 | var created_at:String?
23 | var type:EventType?
24 | var payload:NSDictionary?
25 | var id:String?
26 | var actor:ObjUser?
27 | var repo:Repository?
28 | var ispublic:Bool?
29 | required init?(map: Map) {
30 |
31 | }
32 |
33 | func mapping(map: Map) {
34 | created_at <- map["created_at"]
35 | type <- map["type"]
36 | payload <- map["payload"]
37 | id <- map["id"]
38 | actor <- map["actor"]
39 | repo <- map["repo"]
40 | ispublic <- map["public"]
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Repos/View/PRCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PRCell.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/29.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Kingfisher
11 |
12 | class PRCell: UITableViewCell {
13 |
14 | @IBOutlet weak var PRUserImage: UIImageView!
15 | @IBOutlet weak var PRTitle: UILabel!
16 | @IBOutlet weak var PRBody: UILabel!
17 |
18 | var prinfo:PullRequest? {
19 | didSet{
20 | PRUserImage.kf.setImage(with:URL(string: prinfo!.user!.avatar_url!)!)
21 | PRTitle.text = prinfo!.title!
22 | PRBody.attributedText = prinfo!.body!.richText()
23 |
24 | }
25 | }
26 |
27 |
28 | override func awakeFromNib() {
29 | super.awakeFromNib()
30 | // Initialization code
31 | }
32 |
33 | override func setSelected(_ selected: Bool, animated: Bool) {
34 | super.setSelected(selected, animated: animated)
35 |
36 | // Configure the view for the selected state
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '10.0'
2 | use_frameworks!
3 |
4 | def common_pods
5 | #pod 'Iconic', :git => 'https://github.com/dzenbot/Iconic.git', :submodules => true
6 | end
7 |
8 | target :YZGithub do
9 | pod 'Alamofire','~> 4.0'
10 | pod 'RxSwift', '~> 3.0'
11 | pod 'RxCocoa', '~> 3.0'
12 | pod 'IQKeyboardManagerSwift'
13 | pod 'SwiftyJSON'
14 | pod 'SnapKit'
15 | pod 'Moya', '8.0.0-beta.4'
16 | pod 'ObjectMapper'
17 | pod 'Kingfisher'
18 | pod 'ReachabilitySwift'
19 | pod 'MBProgressHUD'
20 | pod 'DGElasticPullToRefresh'
21 | pod "SwiftDate"
22 | pod 'Bugly'
23 | pod 'Static', git: 'https://github.com/flexih/Static.git'
24 | pod 'AttributedMarkdown', :git => 'https://github.com/dreamwieber/AttributedMarkdown.git'
25 | pod "WeiboSDK", :git => "https://github.com/sinaweibosdk/weibo_ios_sdk.git"
26 | common_pods
27 | end
28 |
29 | post_install do |installer|
30 | installer.pods_project.targets.each do |target|
31 | target.build_configurations.each do |config|
32 | config.build_settings['SWIFT_VERSION'] = '3.0'
33 | end
34 | end
35 | end
36 |
--------------------------------------------------------------------------------
/YZGithubTests/YZGithubTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // YZGithubTests.swift
3 | // YZGithubTests
4 | //
5 | // Created by 郑建文 on 16/7/11.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import YZGithub
11 |
12 | class YZGithubTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | // Use XCTAssert and related functions to verify your tests produce the correct results.
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measure {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 JW
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Explore/View/DeveloperTableViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DeveloperTableViewCell.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/26.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Alamofire
11 | import Kingfisher
12 |
13 | class DeveloperTableViewCell: UITableViewCell {
14 |
15 | @IBOutlet weak var indexLable: UILabel!
16 |
17 | @IBOutlet weak var userImage: UIImageView!
18 | @IBOutlet weak var userName: UILabel!
19 | @IBOutlet weak var userInfo: UILabel!
20 |
21 | var deve:ObjUser? {
22 | didSet{
23 | userImage.kf.setImage(with:URL(string: deve!.avatar_url!)!)
24 | userName.text = deve!.login
25 | userInfo.text = deve!.email
26 | }
27 | }
28 |
29 | override func awakeFromNib() {
30 | super.awakeFromNib()
31 | // Initialization code
32 | }
33 |
34 | override func setSelected(_ selected: Bool, animated: Bool) {
35 | super.setSelected(selected, animated: animated)
36 |
37 | // Configure the view for the selected state
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Profile/ViewModel/LoginViewModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LoginViewModel.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/11/30.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import RxSwift
11 | import MBProgressHUD
12 |
13 | class LoginViewModel {
14 |
15 | deinit {
16 |
17 | }
18 | func loginin(code: String) -> Observable {
19 | return Observable.create({ (observer) -> Disposable in
20 | let para = [
21 | "client_id":GithubClientID,
22 | "client_secret":GithubClientSecret,
23 | "code":code,
24 | "redirect_uri":GithubRedirectUrl,
25 | ]
26 | let task = LoginEngine.loginIn(parameters: para, onCompletion: { (result) in
27 | observer.onNext(result)
28 | print("---result---\(result)")
29 | }, onError: { (error) in
30 | observer.onError(error)
31 | })
32 | return Disposables.create {
33 | task.cancel()
34 | }
35 | })
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Message/Model/Message.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Message.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/24.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ObjectMapper
11 |
12 | enum Reason:String {
13 | case subscribed
14 | case manual
15 | case author
16 | case comment
17 | case mention
18 | case team_mention
19 | case state_change
20 | case assign
21 | }
22 |
23 | class Message:NSObject,Mappable {
24 | var subject:Subject?
25 | var last_read_at:String?
26 | var unread:Int?
27 | var id:String?
28 | var updated_at:String?
29 | var reason:Reason?
30 | var repository:Repository?
31 | var url:String?
32 | required init?(map: Map) {
33 |
34 | }
35 |
36 | func mapping(map: Map) {
37 | subject <- map["subject"]
38 | last_read_at <- map["last_read_at"]
39 | unread <- map["unread"]
40 | id <- map["id"]
41 | updated_at <- map["updated_at"]
42 | reason <- map["reason"]
43 | repository <- map["repository"]
44 | url <- map["url"]
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Repos/Model/Branches.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Branches.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/29.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import ObjectMapper
11 |
12 | //[
13 | // {
14 | // "name": "master",
15 | // "commit": {
16 | // "sha": "7fd1a60b01f91b314f59955a4e4d4e80d8edf11d",
17 | // "url": "https://api.github.com/repos/octocat/Hello-World/commits/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d"
18 | // }
19 | // },
20 | // {
21 | // "name": "test",
22 | // "commit": {
23 | // "sha": "b3cbd5bbd7e81436d2eee04537ea2b4c0cad4cdf",
24 | // "url": "https://api.github.com/repos/octocat/Hello-World/commits/b3cbd5bbd7e81436d2eee04537ea2b4c0cad4cdf"
25 | // }
26 | // }
27 | //]
28 | class Branches: NSObject,Mappable {
29 | var name:String?
30 | var commit:Commit?
31 | override init() {
32 |
33 | }
34 | required init?(map: Map) {
35 |
36 | }
37 | func mapping(map: Map) {
38 | name <- map["name"]
39 | commit <- map["commit"]
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Repos/View/RepoIntroCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RepoIntroCell.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/27.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Kingfisher
11 |
12 | class RepoIntroCell: UITableViewCell {
13 |
14 | @IBOutlet weak var repoImage: UIImageView!
15 | @IBOutlet weak var repoName: UILabel!
16 | @IBOutlet weak var repoAuthor: UILabel!
17 | @IBOutlet weak var repoIntro: UILabel!
18 | var repoinfo:Repository? {
19 | didSet{
20 | repoImage.kf.setImage(with:URL(string: (repoinfo!.owner!.avatar_url)!)!)
21 | repoName.text = repoinfo?.name
22 | repoAuthor.text = repoinfo?.owner?.login
23 | repoIntro.text = repoinfo?.cdescription
24 | }
25 | }
26 |
27 | override func awakeFromNib() {
28 | super.awakeFromNib()
29 | // Initialization code
30 | }
31 |
32 | override func setSelected(_ selected: Bool, animated: Bool) {
33 | super.setSelected(selected, animated: animated)
34 |
35 | // Configure the view for the selected state
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/YZGithub/Extension/MBProcessHUD+Show.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MBProcessHUD+Show.swift
3 | // YZGithub
4 | //
5 | // Created by wmg on 16/9/1.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import MBProgressHUD
11 |
12 | extension MBProgressHUD{
13 |
14 |
15 | class func showMsg(_ msg:String?, view:UIView? = UIApplication.shared.keyWindow){
16 |
17 | if msg == nil || msg!.isEmpty {
18 | return;
19 | }
20 |
21 | let hub = MBProgressHUD.showAdded(to: view!, animated: true)
22 | hub.label.text = msg!
23 | hub.mode = .text
24 | hub.hide(animated: true, afterDelay: 2)
25 | }
26 |
27 | class func showError(_ msg:String?,view:UIView? = UIApplication.shared.keyWindow){
28 |
29 | if msg == nil || msg!.isEmpty {
30 | return;
31 | }
32 |
33 | let hub = MBProgressHUD.showAdded(to: view!, animated: true)
34 | hub.label.text = msg!
35 | hub.mode = .text
36 | hub.label.textColor = UIColor.navBarTintColor()
37 | hub.hide(animated: true, afterDelay: 3)
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/YZGithub/Service/NetLayer/UserEngine.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UserEngine.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/11/30.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ObjectMapper
11 |
12 | class UserEngine: BaseEngine {
13 | class func getUserInfo(token:String, onCompletion: @escaping Completion, onError:@escaping EngineError) {
14 | fetchData(api: GitHubAPI.myInfo, model: ObjUser.self, onCompetion: {
15 | result in
16 | ObjUser.saveUserInfo(result)
17 | NotificationCenter.default.post(name: NSNotification.Name(rawValue: NotificationGitLoginSuccessful), object:nil)
18 | onCompletion(result)
19 | }, onError: {error in
20 | onError(error)
21 | })
22 | }
23 | class func getFollowers(userName:String, onCompletion:@escaping Completion,onError:@escaping EngineError) {
24 | fetchDatas(api: GitHubAPI.followers(username: userName), model: ObjUser.self, onCompetion: {
25 | result -> () in
26 | onCompletion(result)
27 | }, onError: { error in
28 | onError(error)
29 | })
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/YZGithub/Extension/UIColor+yztc.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIColor+yztc.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/13.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Foundation
11 |
12 | extension UIColor{
13 | class func hexStr(_ hexStr : NSString,alpha : CGFloat) -> UIColor {
14 | let realHexStr = hexStr.replacingOccurrences(of: "#", with: "")
15 | let scanner = Scanner(string: realHexStr as String)
16 | var color:UInt32 = 0
17 |
18 | // 把16进制的字符串转成 Int 数据放到color变量中
19 | // bool
20 | if scanner.scanHexInt32(&color) {
21 | // & 与运算符
22 | let r = CGFloat( (color & 0xFF0000) >> 16 ) / 255.0
23 | let g = CGFloat( (color & 0x00FF00) >> 8) / 255.0
24 | let b = CGFloat( (color & 0x0000FF) ) / 255.0
25 | return UIColor(red: r, green: g, blue: b, alpha: alpha)
26 | }else{
27 | print("invalid hex string",terminator:"")
28 | return UIColor.white
29 | }
30 | }
31 | class func navBarTintColor() -> UIColor {
32 | return UIColor.hexStr("00631B", alpha: 1)
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Profile/ViewModel/ProfileViewModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ProfileViewModel.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/11/30.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import RxCocoa
11 | import RxSwift
12 | class ProfileViewModel {
13 |
14 | var user = Variable(UserInfoHelper.sharedInstance.user)
15 |
16 | init() {
17 | NotificationCenter.default.addObserver(self, selector: #selector(updateUserInfo), name: NSNotification.Name(rawValue: NotificationGitLoginSuccessful), object: nil)
18 | NotificationCenter.default.addObserver(self, selector: #selector(updateUserInfo), name: NSNotification.Name(rawValue: NotificationGitLogOutSuccessful), object: nil)
19 | }
20 | @objc func updateUserInfo() {
21 | user.value = UserInfoHelper.sharedInstance.user
22 | }
23 | deinit {
24 | NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NotificationGitLoginSuccessful), object: nil)
25 | NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NotificationGitLogOutSuccessful), object: nil)
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Message/View/MessageCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MessageCell.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/24.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class MessageCell: UITableViewCell {
12 |
13 | var message:Message? {
14 | didSet{
15 | if let reason = message?.reason {
16 | switch reason {
17 | case Reason.subscribed:
18 | messageTypeImage.image = UIImage(named: "octicon_watch_20")
19 | default:
20 | messageTypeImage.image = UIImage(named: "octicon_pull_request_25")
21 | }
22 | }
23 | if let title = message?.subject?.title {
24 | messageTitle.text = title
25 | }
26 | if let time = message?.updated_at {
27 | messageTime.text = time
28 | }
29 | }
30 | }
31 |
32 | @IBOutlet weak var messageTypeImage: UIImageView!
33 | @IBOutlet weak var messageTitle: UILabel!
34 | @IBOutlet weak var messageTime: UILabel!
35 | override func awakeFromNib() {
36 | super.awakeFromNib()
37 | }
38 |
39 | override func setSelected(_ selected: Bool, animated: Bool) {
40 | super.setSelected(selected, animated: animated)
41 |
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/YZGithub/Helper/UserInfoHelper.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UserInfoHelper.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/26.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class UserInfoHelper: NSObject {
12 |
13 | static let sharedInstance = UserInfoHelper()
14 |
15 | var user:ObjUser? {
16 | get{
17 | let user = ObjUser.loadUserInfo()
18 | return user
19 | }
20 | set(newValue){
21 | ObjUser.saveUserInfo(newValue)
22 | }
23 | }
24 | var isLogin:Bool{
25 | get {
26 | if let u = user {
27 | guard let _ = u.name,let _ = AppToken().access_token else {
28 | return false
29 | }
30 | return true
31 | }
32 | return false
33 | }
34 | }
35 | var isUser:Bool {
36 | get {
37 | guard isLogin,let t = user?.type, t == "User" else {
38 | return false
39 | }
40 | return true
41 | }
42 | }
43 |
44 | var userToken:String {
45 | get {
46 | return AppToken().access_token!
47 | }
48 | set(newtoken) {
49 | var token = AppToken.shareInstance
50 | token.access_token = newtoken
51 | }
52 | }
53 | func deleteUser() {
54 | _ = ObjUser.deleteUserInfo()
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Repos/View/RepoCodeInfoCell.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/YZGithub/ThridParty/WX/README.txt:
--------------------------------------------------------------------------------
1 | 重要!
2 |
3 | SDK1.7.4
4 | 1. 更新支持iOS启用 ATS(App Transport Security)
5 | 2. 需要在工程中链接CFNetwork.framework
6 | 3. 在工程配置中的”Other Linker Flags”中加入”-Objc -all_load”
7 | 4. 此版本使用Xcode8编译
8 |
9 | SDK1.7.3
10 | 1. 增强稳定性,适配iOS10
11 | 2. 修复小于32K的jpg格式缩略图设置失败的问题
12 |
13 | SDK1.7.2
14 | 1. 修复因CTTeleponyNetworkInfo引起的崩溃问题
15 |
16 | SDK1.7.1
17 | 1. 支持兼容ipv6(提升稳定性)
18 | 2. xCode Version 7.3.1 (7D1014) 编译
19 |
20 | SDK1.7
21 | 1. 支持兼容ipv6
22 | 2. 修复若干问题增强稳定性
23 |
24 | SDK1.6.3
25 | 1. xCode7.2 构建的sdk包。
26 | 2. 请使用xCode7.2进行编译。
27 | 3. 需要在Build Phases中Link Security.framework
28 | 4. 修复若干小问题。
29 |
30 | SDK1.6.2
31 | 1、xCode7.1 构建的sdk包
32 | 2、请使用xCode7.1进行编译
33 |
34 | SDK1.6.1
35 | 1、修复armv7s下,bitcode可能编译不过
36 | 2、解决warning
37 |
38 | SDK1.6
39 | 1、iOS 9系统策略更新,限制了http协议的访问,此外应用需要在“Info.plist”中将要使用的URL Schemes列为白名单,才可正常检查其他应用是否安装。
40 | 受此影响,当你的应用在iOS 9中需要使用微信SDK的相关能力(分享、收藏、支付、登录等)时,需要在“Info.plist”里增加如下代码:
41 | LSApplicationQueriesSchemes
42 |
43 | weixin
44 |
45 | NSAppTransportSecurity
46 |
47 | NSAllowsArbitraryLoads
48 |
49 |
50 | 2、开发者需要在工程中链接上 CoreTelephony.framework
51 | 3、解决bitcode编译不过问题
52 |
53 | SDK1.5
54 | 1、废弃safeSendReq:接口,使用sendReq:即可。
55 | 2、新增+(BOOL) sendAuthReq:(SendAuthReq*) req viewController : (UIViewController*) viewController delegate:(id) delegate;
56 | 支持未安装微信情况下Auth,具体见WXApi.h接口描述
57 | 3、微信开放平台新增了微信模块用户统计功能,便于开发者统计微信功能模块的用户使用和活跃情况。开发者需要在工程中链接上:SystemConfiguration.framework,libz.dylib,libsqlite3.0.dylib。
58 |
--------------------------------------------------------------------------------
/YZGithub/Extension/UINavigationBar+yztc.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UINavigationBar+yztc.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/14.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import UIKit
11 |
12 | var key: String = "coverView"
13 |
14 | extension UINavigationBar {
15 | //计算属性
16 | var coverView: UIView? {
17 | get {
18 | return objc_getAssociatedObject(self, &key) as? UIView
19 | }
20 | set {
21 | objc_setAssociatedObject(self, &key, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
22 | }
23 | }
24 |
25 | func setMyBackgroundColor(_ color: UIColor) {
26 | if self.coverView != nil {
27 | self.coverView!.backgroundColor = color
28 | }else {
29 | self.setBackgroundImage(UIImage(), for: .default)
30 | self.shadowImage = UIImage()
31 | let view = UIView(frame: CGRect(x: 0, y: -20, width: UIScreen.main.bounds.size.width, height: self.bounds.height + 20))
32 | view.isUserInteractionEnabled = false
33 | view.autoresizingMask = [.flexibleHeight, .flexibleWidth]
34 | self.insertSubview(view, at: 0)
35 | view.backgroundColor = color
36 | self.coverView = view
37 | }
38 | }
39 | func setMyBackgroundColorAlpha(_ alpha: CGFloat) {
40 | guard let coverView = self.coverView else {
41 | return
42 | }
43 | self.coverView!.backgroundColor = coverView.backgroundColor?.withAlphaComponent(alpha)
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/YZGithub/ThridParty/JWSheet/JWSheetItem.m:
--------------------------------------------------------------------------------
1 | //
2 | // JWSheetItem.m
3 | // FMDBDemo
4 | //
5 | // Created by 郑建文 on 16/6/30.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | #import "JWSheetItem.h"
10 |
11 | @interface JWSheetItem (){
12 | clickAction block;
13 | NSInteger index;
14 | }
15 | @end
16 |
17 | @implementation JWSheetItem
18 |
19 |
20 | - (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title index:(NSInteger)index1 action:(clickAction)action
21 | {
22 | self = [super initWithFrame:frame];
23 | if (self) {
24 | self.backgroundColor = [UIColor whiteColor];
25 | block = action;
26 | index = index1;
27 | [self createButton:title index:index1];
28 | }
29 | return self;
30 | }
31 |
32 | - (void)createButton:(NSString *)title index:(NSInteger)index{
33 | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
34 | button.frame = CGRectMake(0, 0, self.frame.size.width, CGRectGetHeight(self.frame));
35 | [button setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
36 | [button setTitle:title forState:UIControlStateNormal];
37 | [button addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
38 | [self addSubview:button];
39 | }
40 |
41 | - (void)click:(UIButton *)btn{
42 | if (block) {
43 | block(index);
44 | }
45 | }
46 |
47 | /*
48 | // Only override drawRect: if you perform custom drawing.
49 | // An empty implementation adversely affects performance during animation.
50 | - (void)drawRect:(CGRect)rect {
51 | // Drawing code
52 | }
53 | */
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Developer/ViewModel/DevelopListViewModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DevelopListViewModel.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/12/3.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import RxSwift
11 | class DevelopListViewModel:BaseViewModel {
12 |
13 | var user:Variable?
14 | var users:Variable<[ObjUser]>?
15 |
16 | override init() {
17 |
18 | }
19 |
20 | func fetchList() -> Observable<[ObjUser]> {
21 | return Observable.create({[weak self](observer) -> Disposable in
22 | guard let name = self?.user?.value.login else {
23 | observer.onError(NetError.parameterError("name"))
24 | return Disposables.create()
25 | }
26 | UserEngine.getFollowers(userName: name, onCompletion: { (users) in
27 | observer.onNext(users as! [ObjUser])
28 | if let us = users as? [ObjUser] {
29 | self?.users = Variable<[ObjUser]>(us)
30 | }
31 | }, onError: { (error) in
32 | observer.onError(error)
33 | })
34 | return Disposables.create()
35 | })
36 | }
37 | func fetchListNoRx(){
38 | guard let name = self.user?.value.login else {
39 | return
40 | }
41 | UserEngine.getFollowers(userName: name, onCompletion: { [weak self](users) in
42 | if let us = users as? [ObjUser] {
43 | self?.users?.value = us
44 | }
45 | }, onError: { (error) in
46 |
47 | })
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/YZGithub/Service/Router/Router.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Router.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/12/1.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import RxSwift
11 |
12 | public enum RouterPage {
13 | case setting
14 | case login(url:String)
15 | case DeveList(ofUser:ObjUser?)
16 |
17 | static var rlues:Dictionary = [:]
18 |
19 | func addPath(viewController:AnyClass) {
20 | RouterPage.rlues[self.path()] = viewController
21 | }
22 | func path() -> String {
23 | switch self {
24 | case .setting:
25 | return "setting"
26 | case .login(_):
27 | return "login"
28 | case .DeveList(_):
29 | return "develist"
30 | }
31 | }
32 | func vc() -> UIViewController {
33 | var vc = (RouterPage.rlues[self.path()] as! UIViewController.Type).init()
34 | switch self {
35 | case .login(let url):
36 | let loginvc = vc as! LoginViewController
37 | loginvc.url = url
38 | vc = loginvc
39 | vc.hidesBottomBarWhenPushed = true
40 | case .DeveList(let user):
41 | let listvc = vc as! DeveloperListViewController
42 | listvc.vm.user = Variable(user!)
43 | listvc.listType = .follewers
44 | default:
45 | print("")
46 | }
47 | return vc
48 | }
49 | }
50 |
51 | class Router {
52 | class func push(form vc:UIViewController,page:RouterPage) {
53 | vc.navigationController?.pushViewController(page.vc(), animated: true)
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xcuserstate
23 |
24 | ## Obj-C/Swift specific
25 | *.hmap
26 | *.ipa
27 | *.dSYM.zip
28 | *.dSYM
29 |
30 | ## Playgrounds
31 | timeline.xctimeline
32 | playground.xcworkspace
33 |
34 | # Swift Package Manager
35 | #
36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
37 | # Packages/
38 | .build/
39 |
40 | # CocoaPods
41 | #
42 | # We recommend against adding the Pods directory to your .gitignore. However
43 | # you should judge for yourself, the pros and cons are mentioned at:
44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
45 | #
46 | Pods/
47 |
48 | # Carthage
49 | #
50 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
51 | # Carthage/Checkouts
52 |
53 | Carthage/Build
54 |
55 | # fastlane
56 | #
57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
58 | # screenshots whenever they are needed.
59 | # For more information about the recommended setup visit:
60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
61 |
62 | fastlane/report.xml
63 | fastlane/Preview.html
64 | fastlane/screenshots
65 | fastlane/test_output
66 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Explore/View/RepoTableViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RepoTableViewCell.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/26.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SwiftDate
11 | import Kingfisher
12 |
13 | class RepoTableViewCell: UITableViewCell {
14 |
15 | @IBOutlet weak var repoImage: UIImageView!
16 | @IBOutlet weak var repoName: UILabel!
17 | @IBOutlet weak var repoLastActiveTime: UILabel!
18 | @IBOutlet weak var repoStarNumber: UILabel!
19 | @IBOutlet weak var repoInfo: UILabel!
20 | @IBOutlet weak var repoForkNumber: UILabel!
21 | @IBOutlet weak var repoLanguage: UILabel!
22 |
23 | var repo:Repository? {
24 | didSet{
25 | updateUI()
26 | }
27 | }
28 | override func awakeFromNib() {
29 | super.awakeFromNib()
30 | }
31 | override func setSelected(_ selected: Bool, animated: Bool) {
32 | super.setSelected(selected, animated: animated)
33 | }
34 | func updateUI() {
35 | repoName.text = repo?.name
36 | repoInfo.text = repo?.cdescription
37 | if let forkNumber = repo?.forks_count {
38 | repoForkNumber.text = "\(forkNumber)"
39 | }
40 | if let starNumber = repo?.stargazers_count {
41 | repoStarNumber.text = "\(starNumber)"
42 | }
43 | // repoLastActiveTime.text = (repo?.pushed_at?.date(format: DateFormat.iso8601)?.toRelativeString(abbreviated: false, maxUnits: 1))! + " age"
44 | if let lan = repo?.language {
45 | repoLanguage.text = lan
46 | }
47 | repoImage.kf.setImage(with: URL(string: (repo?.owner!.avatar_url)!)!)
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "8.0",
8 | "subtype" : "736h",
9 | "scale" : "3x"
10 | },
11 | {
12 | "orientation" : "landscape",
13 | "idiom" : "iphone",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "8.0",
16 | "subtype" : "736h",
17 | "scale" : "3x"
18 | },
19 | {
20 | "orientation" : "portrait",
21 | "idiom" : "iphone",
22 | "extent" : "full-screen",
23 | "minimum-system-version" : "8.0",
24 | "subtype" : "667h",
25 | "scale" : "2x"
26 | },
27 | {
28 | "orientation" : "portrait",
29 | "idiom" : "iphone",
30 | "extent" : "full-screen",
31 | "minimum-system-version" : "7.0",
32 | "scale" : "2x"
33 | },
34 | {
35 | "orientation" : "portrait",
36 | "idiom" : "iphone",
37 | "extent" : "full-screen",
38 | "minimum-system-version" : "7.0",
39 | "subtype" : "retina4",
40 | "scale" : "2x"
41 | },
42 | {
43 | "orientation" : "portrait",
44 | "idiom" : "iphone",
45 | "extent" : "full-screen",
46 | "scale" : "1x"
47 | },
48 | {
49 | "orientation" : "portrait",
50 | "idiom" : "iphone",
51 | "extent" : "full-screen",
52 | "scale" : "2x"
53 | },
54 | {
55 | "orientation" : "portrait",
56 | "idiom" : "iphone",
57 | "extent" : "full-screen",
58 | "subtype" : "retina4",
59 | "scale" : "2x"
60 | }
61 | ],
62 | "info" : {
63 | "version" : 1,
64 | "author" : "xcode"
65 | }
66 | }
--------------------------------------------------------------------------------
/YZGithub/Sences/Developer/Model/ObjPlan.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ObjPlan.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/25.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ObjectMapper
11 | class ObjPlan: NSObject, NSCoding,Mappable{
12 |
13 | var private_repos:Int?
14 | var collaborators:Int?
15 | var space:Int?
16 | var name:String?
17 |
18 | struct PlanKey {
19 |
20 | static let privateReposKey = "private_repos"
21 | static let collaboratorsKey = "collaborators"
22 | static let spaceKey = "space"
23 | static let nameKey = "name"
24 |
25 | }
26 |
27 | required init?(map: Map) {
28 | // super.init(map)
29 | }
30 |
31 | func mapping(map: Map) {
32 | // super.mapping(map)
33 | private_repos <- map[PlanKey.privateReposKey]
34 | collaborators <- map[PlanKey.collaboratorsKey]
35 | space <- map[PlanKey.spaceKey]
36 | name <- map[PlanKey.nameKey]
37 | }
38 |
39 | func encode(with aCoder: NSCoder) {
40 | aCoder.encode(private_repos, forKey:PlanKey.privateReposKey)
41 | aCoder.encode(collaborators, forKey:PlanKey.collaboratorsKey)
42 | aCoder.encode(space, forKey:PlanKey.spaceKey)
43 | aCoder.encode(name, forKey:PlanKey.nameKey)
44 | }
45 |
46 | required init?(coder aDecoder: NSCoder) {
47 | super.init()
48 | private_repos = aDecoder.decodeObject(forKey: PlanKey.privateReposKey) as? Int
49 | collaborators = aDecoder.decodeObject(forKey: PlanKey.collaboratorsKey) as? Int
50 | space = aDecoder.decodeObject(forKey: PlanKey.spaceKey) as? Int
51 | name = aDecoder.decodeObject(forKey: PlanKey.nameKey) as? String
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/YZGithub/ThridParty/WX/WechatAuthSDK.h:
--------------------------------------------------------------------------------
1 | //
2 | // WechatAuthSDK.h
3 | // WechatAuthSDK
4 | //
5 | // Created by 李凯 on 13-11-29.
6 | // Copyright (c) 2013年 Tencent. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | enum AuthErrCode {
13 | WechatAuth_Err_Ok = 0, //Auth成功
14 | WechatAuth_Err_NormalErr = -1, //普通错误
15 | WechatAuth_Err_NetworkErr = -2, //网络错误
16 | WechatAuth_Err_GetQrcodeFailed = -3, //获取二维码失败
17 | WechatAuth_Err_Cancel = -4, //用户取消授权
18 | WechatAuth_Err_Timeout = -5, //超时
19 | };
20 |
21 | @protocol WechatAuthAPIDelegate
22 | @optional
23 |
24 | - (void)onAuthGotQrcode:(UIImage *)image; //得到二维码
25 | - (void)onQrcodeScanned; //二维码被扫描
26 | - (void)onAuthFinish:(int)errCode AuthCode:(NSString *)authCode; //成功登录
27 |
28 | @end
29 |
30 | @interface WechatAuthSDK : NSObject{
31 | NSString *_sdkVersion;
32 | __weak id _delegate;
33 | }
34 |
35 | @property(nonatomic, weak) id delegate;
36 | @property(nonatomic, readonly) NSString *sdkVersion; //authSDK版本号
37 |
38 | /*! @brief 发送登录请求,等待WechatAuthAPIDelegate回调
39 | *
40 | * @param appId 微信开发者ID
41 | * @param nonceStr 一个随机的尽量不重复的字符串,用来使得每次的signature不同
42 | * @param timeStamp 时间戳
43 | * @param scope 应用授权作用域,拥有多个作用域用逗号(,)分隔
44 | * @param signature 签名
45 | * @param schemeData 会在扫码后拼在scheme后
46 | * @return 成功返回YES,失败返回NO
47 | 注:该实现只保证同时只有一个Auth在运行,Auth未完成或未Stop再次调用Auth接口时会返回NO。
48 | */
49 |
50 | - (BOOL)Auth:(NSString *)appId
51 | nonceStr:(NSString *)nonceStr
52 | timeStamp:(NSString*)timeStamp
53 | scope:(NSString *)scope
54 | signature:(NSString *)signature
55 | schemeData:(NSString *)schemeData;
56 |
57 |
58 | /*! @brief 暂停登录请求
59 | *
60 | * @return 成功返回YES,失败返回NO。
61 | */
62 | - (BOOL)StopAuth;
63 |
64 | @end
65 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Profile/Controller/LoginViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LoginViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/24.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import MBProgressHUD
11 | import Alamofire
12 | import ObjectMapper
13 | import SwiftyJSON
14 | import RxCocoa
15 | import RxSwift
16 |
17 | class LoginViewController: YZWebViewController {
18 |
19 | let viewModel:LoginViewModel = LoginViewModel()
20 | let bag = DisposeBag()
21 | override func viewDidLoad() {
22 | super.viewDidLoad()
23 | }
24 | deinit{
25 | print("登陆界面销毁")
26 | }
27 |
28 | override func didReceiveMemoryWarning() {
29 | super.didReceiveMemoryWarning()
30 | }
31 |
32 | override func webViewDidStartLoad(_ webView: UIWebView) {
33 | super.webViewDidStartLoad(webView)
34 | }
35 | override func webViewDidFinishLoad(_ webView: UIWebView) {
36 | super.webViewDidFinishLoad(webView)
37 | let url:String = (webView.request?.url?.absoluteString)!
38 | let codePrefix:String = "code="
39 | if url.contains("code=") {
40 | let range = url.range(of: codePrefix)!
41 | let index = url.characters.distance(from: url.startIndex, to: range.lowerBound) + 5
42 | let codeR = url.characters.index(url.startIndex, offsetBy: index) ..< url.endIndex
43 | let code = url.substring(with: codeR)
44 |
45 | viewModel.loginin(code: code).subscribe(onNext: { [weak self](msg) in
46 | _ = self?.navigationController?.popViewController(animated: true)
47 | }, onError: { (error) in
48 | MBProgressHUD.showMsg("\(error)")
49 | }, onCompleted: nil, onDisposed: nil).addDisposableTo(bag)
50 |
51 | }
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/YZGithub/Service/NetLayer/LoginEngine.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LoginEngine.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/11/30.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Alamofire
11 |
12 | class LoginEngine: BaseEngine {
13 | class func loginIn(parameters:Dictionary, onCompletion: @escaping Completion, onError:@escaping EngineError) -> URLSessionTask{
14 | let request = Alamofire.request("https://github.com/lovar/oauth/access_token", method: HTTPMethod.post, parameters: parameters, encoding: JSONEncoding.default).responseString { (response) in
15 | switch response.result {
16 | case .failure(let error):
17 | onError(error)
18 | case .success(_):
19 | let str = String(data: response.data!, encoding: String.Encoding.utf8)
20 | if let str = str {
21 | let arr:[String] = (str.components(separatedBy: "&"))
22 | if arr.count > 0 {
23 |
24 | let accesstoken = arr[0].substring(from: arr[0].index(arr[0].startIndex, offsetBy: 13))
25 | let scope = arr[1].substring(from: arr[1].index(arr[1].startIndex, offsetBy: 7))
26 | let tokentype = arr[2].substring(from: arr[2].index(arr[2].startIndex, offsetBy: 11))
27 |
28 | //获取token 并保存到userdefault中
29 | AppToken.shareInstance.setData(token: accesstoken, token_type: tokentype, scope: scope)
30 |
31 | UserEngine.getUserInfo(token: accesstoken, onCompletion: { (result) in
32 | onCompletion(result)
33 | }, onError: { (error) in
34 | onError(error)
35 | })
36 | }
37 | }
38 | }
39 |
40 | }
41 | return request.task!
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/YZGithub/Service/NetLayer/Response+ObjectMapper.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Response+ObjectMapper.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/26.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import Moya
11 | import ObjectMapper
12 |
13 | public enum PageType:String {
14 | case last
15 | case next
16 | case first
17 | case prev
18 | }
19 |
20 | public extension Response{
21 | public func mapObject(_ type: T.Type) throws -> T {
22 |
23 | guard let object = Mapper().map(JSONObject: try mapJSON()) else {
24 | throw Error.jsonMapping(self)
25 | }
26 | return object
27 | }
28 | public func mapArray(_ type: T.Type) throws -> [T] {
29 |
30 | guard let objects = Mapper().mapArray(JSONObject: try mapJSON()) else {
31 | throw Error.jsonMapping(self)
32 | }
33 | return objects
34 | }
35 | public func pageNumberWithType(_ type:PageType) -> Int? {
36 | if let linkString = self.Link() {
37 | let linkArray = linkString.components(separatedBy: ",")
38 | for link in linkArray {
39 | if link.contains(type.rawValue) {
40 | let startindex = link.range(of:"page=")?.upperBound
41 | let endindex = link.range(of: ">;")?.lowerBound
42 | if let start = startindex , let end = endindex {
43 | let page = link.substring(with: start.. String? {
52 | let httpresponse = self.response as? HTTPURLResponse
53 | if let httpresponse = httpresponse {
54 | let allHeader = httpresponse.allHeaderFields as? [String:AnyObject]
55 | return allHeader?["Link"] as? String
56 | }
57 | return nil
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/YZGithub/Sences/CommanModel/Network/AppToken.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppToken.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/24.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | struct AppToken {
12 | enum DefaultsKeys:String {
13 | case TokenKey = "TokenKey"
14 | case TokenType = "TokenType"
15 | case TokenScope = "TokenScope"
16 | case TokenExpiry = "TokenExpiry"
17 | }
18 |
19 | let defaults : UserDefaults
20 |
21 | static var shareInstance = AppToken()
22 |
23 | init(defaults:UserDefaults){
24 | self.defaults = defaults
25 | }
26 | init(){
27 | self.defaults = UserDefaults.standard
28 | }
29 | var access_token:String?{
30 | get{
31 | let key = defaults.string(forKey: DefaultsKeys.TokenKey.rawValue)
32 | return key
33 | }
34 | set(newToken){
35 | defaults.set(newToken, forKey: DefaultsKeys.TokenKey.rawValue)
36 | }
37 | }
38 | var token_type:String? {
39 | get {
40 |
41 | let key = defaults.string(forKey: DefaultsKeys.TokenType.rawValue)
42 | return key
43 | }
44 | set(newType) {
45 | defaults.set(newType, forKey: DefaultsKeys.TokenType.rawValue)
46 | }
47 | }
48 |
49 | var scope:String? {
50 | get {
51 | let key = defaults.string(forKey: DefaultsKeys.TokenScope.rawValue)
52 | return key
53 | }
54 | set(newScope) {
55 | defaults.set(newScope, forKey: DefaultsKeys.TokenScope.rawValue)
56 | }
57 | }
58 | mutating func setData(token:String,token_type:String,scope:String) {
59 | self.access_token = String(format: "token %@", token)
60 | self.token_type = token_type
61 | self.scope = scope
62 |
63 | }
64 | var isValid: Bool {
65 | if let token = access_token {
66 | return token.isEmpty
67 | }
68 | return false
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/YZGithub/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleURLTypes
22 |
23 |
24 | CFBundleTypeRole
25 | Editor
26 | CFBundleURLSchemes
27 |
28 | wb233232332
29 |
30 |
31 |
32 | CFBundleTypeRole
33 | Editor
34 | CFBundleURLSchemes
35 |
36 | yzgithub
37 |
38 |
39 |
40 | CFBundleVersion
41 | 1
42 | LSRequiresIPhoneOS
43 |
44 | NSAppTransportSecurity
45 |
46 | NSAllowsArbitraryLoads
47 |
48 |
49 | UILaunchStoryboardName
50 | LaunchScreen
51 | UIMainStoryboardFile
52 | Main
53 | UIRequiredDeviceCapabilities
54 |
55 | armv7
56 |
57 | UIStatusBarStyle
58 | UIStatusBarStyleLightContent
59 | UISupportedInterfaceOrientations
60 |
61 | UIInterfaceOrientationPortrait
62 | UIInterfaceOrientationLandscapeLeft
63 | UIInterfaceOrientationLandscapeRight
64 |
65 | UIViewControllerBasedStatusBarAppearance
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/YZGithub/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "29x29",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-58.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "29x29",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-87.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "40x40",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-80.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "40x40",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-120.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "size" : "60x60",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-121.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "size" : "60x60",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-180.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "size" : "24x24",
41 | "idiom" : "watch",
42 | "scale" : "2x",
43 | "role" : "notificationCenter",
44 | "subtype" : "38mm"
45 | },
46 | {
47 | "size" : "27.5x27.5",
48 | "idiom" : "watch",
49 | "scale" : "2x",
50 | "role" : "notificationCenter",
51 | "subtype" : "42mm"
52 | },
53 | {
54 | "size" : "29x29",
55 | "idiom" : "watch",
56 | "role" : "companionSettings",
57 | "scale" : "2x"
58 | },
59 | {
60 | "size" : "29x29",
61 | "idiom" : "watch",
62 | "role" : "companionSettings",
63 | "scale" : "3x"
64 | },
65 | {
66 | "size" : "40x40",
67 | "idiom" : "watch",
68 | "scale" : "2x",
69 | "role" : "appLauncher",
70 | "subtype" : "38mm"
71 | },
72 | {
73 | "size" : "86x86",
74 | "idiom" : "watch",
75 | "scale" : "2x",
76 | "role" : "quickLook",
77 | "subtype" : "38mm"
78 | },
79 | {
80 | "size" : "98x98",
81 | "idiom" : "watch",
82 | "scale" : "2x",
83 | "role" : "quickLook",
84 | "subtype" : "42mm"
85 | }
86 | ],
87 | "info" : {
88 | "version" : 1,
89 | "author" : "xcode"
90 | }
91 | }
--------------------------------------------------------------------------------
/YZGithub/Sences/Stars/Controller/NewsViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NewsViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/24.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import MBProgressHUD
11 | //import JLSwiftRouter
12 |
13 | class NewsViewController: BaseTableViewController {
14 |
15 |
16 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
17 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
18 | }
19 |
20 | required init?(coder aDecoder: NSCoder) {
21 | fatalError("init(coder:) has not been implemented")
22 | }
23 | override func viewDidLoad() {
24 | super.viewDidLoad()
25 | title = "动态"
26 | }
27 | func fetchData(success:@escaping ()->()) {
28 | if page == -1 {
29 | MBProgressHUD.showError("没有数据了")
30 | }
31 | let hub = MBProgressHUD.showAdded(to: self.view, animated: true)
32 | hub.label.text = "网络请求中..."
33 | Provider.sharedProvider.request(GitHubAPI.userEvent(username: UserInfoHelper.sharedInstance.user!.login!, page: page)) { (result) in
34 | switch result {
35 | case .success(let response):
36 | do {
37 | let array = try response.mapArray(Event.self)
38 | if self.page == 1 {
39 | self.dataArray = array
40 | }else {
41 | self.dataArray?.append(contentsOf: array)
42 | }
43 | if let nextpage = response.pageNumberWithType(PageType.next) {
44 | self.page = nextpage
45 | }else {
46 | self.page = -1
47 | }
48 | hub.hide(animated: true)
49 | }catch{
50 | MBProgressHUD.showError("数据解析失败")
51 | }
52 | case .failure(let error):
53 | MBProgressHUD.showError("网络请求失败:\(error)")
54 | }
55 | if self.ifloading == IfloadMore.loading {
56 | self.ifloading.change()
57 | success()
58 | }
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Explore/Controller/ExploreViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ExploreViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/26.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SnapKit
11 |
12 | class ExploreViewController: BaseViewController {
13 |
14 | let scrollView:UIScrollView = UIScrollView()
15 | var scrollHeight:CGFloat {
16 | return UIScreen.main.bounds.height - 66 - 44
17 | }
18 | var viewWidth:CGFloat {
19 | return self.view.bounds.size.width
20 | }
21 | override func viewDidLoad() {
22 | super.viewDidLoad()
23 | customUI()
24 | }
25 | func customUI() {
26 | self.view.addSubview(scrollView)
27 | scrollView.snp.makeConstraints { (make) in
28 | make.top.equalTo(self.view)
29 | make.width.equalTo(self.view)
30 | make.bottom.equalTo(self.view.snp.bottom)
31 | }
32 | scrollView.delegate = self
33 | scrollView.contentSize = CGSize(width: self.view.frame.width * 2, height: scrollView.bounds.height)
34 | scrollView.isPagingEnabled = true
35 | scrollView.backgroundColor = UIColor.red
36 |
37 | //仓库页面
38 | let repo = ExploreReposViewController()
39 | let table1 = repo.tableView
40 | table1.frame = CGRect(x: 0, y: 0, width: viewWidth, height: scrollHeight)
41 | scrollView.addSubview(table1)
42 | self.addChildViewController(repo)
43 |
44 | //开发者页面
45 | let deve = ExploreDevelopersViewController()
46 | let table2 = deve.tableView
47 | table2.frame = CGRect(x: viewWidth, y: 0, width: viewWidth, height: scrollHeight)
48 | scrollView.addSubview(table2)
49 | self.addChildViewController(deve)
50 |
51 | }
52 | override func didReceiveMemoryWarning() {
53 | super.didReceiveMemoryWarning()
54 |
55 | }
56 |
57 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
58 |
59 | }
60 | }
61 | extension ExploreViewController:UIScrollViewDelegate{
62 | func scrollViewDidScroll(_ scrollView: UIScrollView) {
63 | // if scrollView.contentOffset.x > viewWidth {
64 | // segmentView.selectedSegment = 1
65 | // }else{
66 | // segmentView.selectedSegment = 0
67 | // }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Repos/Model/PullRequest.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PullRequest.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/29.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ObjectMapper
11 |
12 |
13 | class PullInfo :NSObject,Mappable{
14 | var sha: String?
15 | var label: String?
16 | var user: ObjUser?
17 | var repo: Repository?
18 | var ref: String?
19 |
20 | override init() {
21 |
22 | }
23 | required init?(map: Map) {
24 |
25 | }
26 | func mapping(map: Map) {
27 | sha <- map["sha"]
28 | label <- map["label"]
29 | user <- map["User"]
30 | repo <- map["Repo"]
31 | ref <- map["ref"]
32 | }
33 |
34 | }
35 |
36 | class PullRequest: NSObject,Mappable {
37 |
38 | func mapping(map: Map) {
39 | milestone <- map["milestone"]
40 | locked <- map["locked"]
41 | title <- map["title"]
42 | url <- map["url"]
43 | merge_commit_sha <- map["merge_commit_sha"]
44 | commits_url <- map["commits_url"]
45 | review_comment_url <- map["review_comment_url"]
46 | updated_at <- map["updated_at"]
47 | review_comments_url <- map["review_comments_url"]
48 | updated_at <- map["updated_at"]
49 | review_comments_url <- map["review_comments_url"]
50 | user <- map["user"]
51 | body <- map["body"]
52 | }
53 | var milestone: String?
54 | var locked: NSNumber?
55 | var title: String?
56 | var url: String?
57 | var merge_commit_sha: String?
58 | var commits_url: String?
59 | var review_comment_url: String?
60 | var updated_at: String?
61 | var review_comments_url: String?
62 | var comments_url: String?
63 | var assignee: String?
64 | var Base: PullInfo?
65 | var patch_url: String?
66 | var merged_at: String?
67 | var state: String?
68 | var body: String?
69 | var id: NSNumber?
70 | var number: NSNumber?
71 | var issue_url: String?
72 | var user: ObjUser?
73 | var closed_at: String?
74 | var Head: PullInfo?
75 | // var assignees: Array?
76 | var statuses_url: String?
77 | var created_at: String?
78 | // var _links: _links?
79 | var diff_url: String?
80 | var html_url: String?
81 | required init?(map: Map) {
82 | }
83 | override init() {
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/YZGithub/ThridParty/JWSheet/JWSheet.m:
--------------------------------------------------------------------------------
1 | //
2 | // JWSheet.m
3 | // FMDBDemo
4 | //
5 | // Created by 郑建文 on 16/6/30.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | #import "JWSheet.h"
10 | #import "JWSheetItem.h"
11 |
12 | @interface JWSheet (){
13 | CGSize size;
14 | }
15 | @property (nonatomic,strong) UIView * sheetView;
16 | @end
17 |
18 | @implementation JWSheet
19 |
20 |
21 | - (instancetype)initWithFrame:(CGRect)frame items:(NSArray *)items click:(ClickBlock)block{
22 | self = [super initWithFrame:frame];
23 | size = [UIScreen mainScreen].bounds.size;
24 | [self setBackgroundColor:[UIColor colorWithWhite:0.5 alpha:0.5]];
25 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hiddenSheet)];
26 | [self addGestureRecognizer:tap];
27 |
28 | [self createSheetItems:items block:block];
29 | return self;
30 | }
31 | - (void)createSheetItems:(NSArray *)items block:(ClickBlock)block{
32 |
33 | self.sheetView = [[UIView alloc] initWithFrame:CGRectMake(0, size.height, size.width, items.count * 50 + 1)];
34 | self.sheetView.backgroundColor = [UIColor clearColor];
35 | [self addSubview:_sheetView];
36 | CGFloat y = 0;
37 | NSInteger index = 0;
38 | for (NSString *title in items) {
39 | __weak typeof(self) weakself = self;
40 | JWSheetItem *item = [[JWSheetItem alloc] initWithFrame:CGRectMake(0, y, size.width, 50) title:title index:index++ action:^(NSInteger index) {
41 | if (block) {
42 | block(index);
43 | [weakself hiddenSheet];
44 | }
45 | }];
46 | y+=51;
47 | [self.sheetView addSubview:item];
48 | }
49 |
50 |
51 | [UIView animateWithDuration:0.3 animations:^{
52 | CGRect frame = _sheetView.frame;
53 | frame.origin.y -= frame.size.height;
54 | _sheetView.frame = frame;
55 | }];
56 |
57 | }
58 |
59 | - (void)hiddenSheet{
60 | [UIView animateWithDuration:0.3 animations:^{
61 | CGRect frame = _sheetView.frame;
62 | frame.origin.y += frame.size.height;
63 | _sheetView.frame = frame;
64 | }];
65 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
66 | [self removeFromSuperview];
67 | });
68 | }
69 | /*
70 | // Only override drawRect: if you perform custom drawing.
71 | // An empty implementation adversely affects performance during animation.
72 | - (void)drawRect:(CGRect)rect {
73 | // Drawing code
74 | }
75 | */
76 |
77 | @end
78 |
--------------------------------------------------------------------------------
/YZGithub/Service/NetLayer/BaseEngine.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseEngine.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/11/30.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ObjectMapper
11 |
12 | typealias Completion = (Any)->()
13 | typealias EngineError = (Error) -> ()
14 |
15 | enum NetError:Error {
16 | case seriaelError(String)
17 | case httpError(Error)
18 | case parameterError(String)
19 |
20 | var localizedDescription: String{
21 | switch self {
22 | case .httpError(let error):
23 | return ("网络请求错误: \(error)")
24 | case .seriaelError(let msg):
25 | return (msg)
26 | case .parameterError(let para):
27 | return "没有 \(para) 参数"
28 | }
29 | }
30 | }
31 |
32 | class BaseEngine {
33 | let provider = Provider.sharedProvider
34 | class func fetchDatas(api:GitHubAPI,model:T.Type,onCompetion:@escaping (([T])->()),onError:@escaping (Error)->()){
35 | let engine = BaseEngine()
36 | engine.provider.request(api, completion: {
37 | (result) -> () in
38 | switch result{
39 | case .success(let res):
40 | do {
41 | let objects = Mapper().mapArray(JSONObject: try res.mapJSON())
42 | guard let r = objects else {
43 | onError(NetError.seriaelError("no data"))
44 | return
45 | }
46 | onCompetion(r)
47 | }catch{
48 | onError(NetError.seriaelError("result is not json "))
49 | }
50 | case .failure(let error):
51 | onError(NetError.httpError(error))
52 | }
53 | })
54 | }
55 | class func fetchData(api:GitHubAPI,model:T.Type,onCompetion: @escaping (T)->(), onError:@escaping (Error)->()) {
56 | let engine = BaseEngine()
57 | engine.provider.request(api, completion: {
58 | (result) -> () in
59 | switch result{
60 | case .success(let res):
61 | do {
62 | let object = Mapper().map(JSON: try res.mapJSON() as! [String : Any])
63 | guard let r = object else {
64 | onError(NetError.seriaelError("no data"))
65 | return
66 | }
67 | onCompetion(r)
68 | }catch{
69 | onError(NetError.seriaelError("result is not json "))
70 | }
71 | case .failure(let error):
72 | onError(NetError.httpError(error))
73 | }
74 | })
75 | }
76 | }
77 |
78 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Repos/Controller/PRListViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PRListViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/29.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SnapKit
11 | import MBProgressHUD
12 |
13 |
14 | class PRListViewController: UIViewController {
15 |
16 | lazy var tableView: UITableView? = {
17 | let table = UITableView()
18 | // table.delegate = self
19 | table.dataSource = self
20 | return table
21 | }()
22 | var repoinfo:Repository? {
23 | didSet{
24 | fetchPRS()
25 | }
26 | }
27 | var prArray:[PullRequest]?
28 |
29 |
30 | override func viewDidLoad() {
31 | super.viewDidLoad()
32 | customUI()
33 | }
34 | func customUI() {
35 | title = "PR列表"
36 | view.addSubview(tableView!)
37 | tableView?.estimatedRowHeight = 100
38 | tableView?.rowHeight = UITableViewAutomaticDimension
39 | tableView?.tableFooterView = UIView()
40 | tableView?.register(UINib(nibName: "PRCell",bundle: nil), forCellReuseIdentifier: "cell")
41 | tableView?.snp.makeConstraints({ (make) in
42 | make.top.bottom.equalTo(view)
43 | make.leading.trailing.equalTo(view)
44 | })
45 | }
46 | deinit{
47 | print("释放")
48 | }
49 | func fetchPRS() {
50 | Provider.sharedProvider.request(GitHubAPI.repoPullRequest(owner: repoinfo!.owner!.login!, repo: repoinfo!.name!)) { (result) in
51 | switch result {
52 | case let .success(response):
53 | do{
54 | let prs:[PullRequest] = try response.mapArray(PullRequest.self)
55 | if prs.count == 0 {
56 | MBProgressHUD.showMsg("这个仓库太冷清,没人提PR")
57 | return
58 | }
59 | self.prArray = prs
60 | self.tableView?.reloadData()
61 |
62 | }catch{
63 |
64 | }
65 | case let .failure(error):
66 | print(error)
67 | }
68 | }
69 | }
70 | }
71 | extension PRListViewController:UITableViewDataSource{
72 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
73 | if prArray != nil {
74 | return prArray!.count
75 | }
76 | return 0
77 | }
78 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
79 | let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as? PRCell
80 | cell?.prinfo = prArray![indexPath.row]
81 | return cell!
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Message/Controller/MessagesViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MessagesViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/23.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SnapKit
11 | import MBProgressHUD
12 |
13 | class MessagesViewController: UIViewController {
14 |
15 | var messageArray = [Message]()
16 |
17 | let tableView = UITableView(frame: CGRect.zero, style: .plain)
18 |
19 | override func viewDidLoad() {
20 | super.viewDidLoad()
21 | customUI()
22 | isLogin()
23 | NotificationCenter.default.addObserver(self, selector: #selector(fetchData), name: NSNotification.Name(rawValue: NotificationGitLoginSuccessful), object: nil)
24 | // NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(fetchData), name: NotificationGitLogOutSuccessful, object: nil)
25 | }
26 | func customUI() {
27 | view.addSubview(tableView)
28 | tableView.snp.makeConstraints { (make) in
29 | make.size.left.top.equalTo(self.view)
30 | }
31 | tableView.dataSource = self
32 | tableView.delegate = self
33 | tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
34 | tableView.register(UINib(nibName: "MessageCell",bundle: nil), forCellReuseIdentifier: "messageCell")
35 | tableView.estimatedRowHeight = 100
36 | tableView.rowHeight = UITableViewAutomaticDimension
37 | }
38 | func fetchData() {
39 | let hub = MBProgressHUD.showAdded(to: self.view, animated: true)
40 | hub.label.text = "加载数据中"
41 | Provider.sharedProvider.request(GitHubAPI.message(page: 0)) { (result) in
42 | switch result {
43 | case .success(let response):
44 | do{
45 | let array = try response.mapArray(Message.self)
46 | self.messageArray.append(contentsOf: array)
47 | hub.hide(animated: true)
48 | self.tableView.reloadData()
49 | }catch {
50 | MBProgressHUD.showMsg("数据解析失败")
51 | }
52 | case .failure(let error):
53 | MBProgressHUD.showError("error:\(error.response)")
54 | }
55 | }
56 | }
57 | func isLogin() {
58 | if UserInfoHelper.sharedInstance.isLogin {
59 | fetchData()
60 | }else {
61 | MBProgressHUD.showError("请先登录...")
62 | }
63 | }
64 | }
65 | extension MessagesViewController:UITableViewDataSource{
66 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
67 | return messageArray.count
68 | }
69 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
70 | let cell = tableView.dequeueReusableCell(withIdentifier: "messageCell", for: indexPath) as? MessageCell
71 | cell?.message = messageArray[indexPath.row]
72 | return cell!
73 | }
74 | }
75 | extension MessagesViewController:UITableViewDelegate {
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Alamofire (4.2.0)
3 | - AttributedMarkdown (0.9.2)
4 | - Bugly (2.4.2)
5 | - DGElasticPullToRefresh (1.1)
6 | - IQKeyboardManagerSwift (4.0.7)
7 | - Kingfisher (3.2.1)
8 | - MBProgressHUD (1.0.0)
9 | - Moya (8.0.0-beta.4):
10 | - Moya/Core (= 8.0.0-beta.4)
11 | - Moya/Core (8.0.0-beta.4):
12 | - Alamofire (~> 4.0)
13 | - Result (~> 3.0)
14 | - ObjectMapper (2.2.1)
15 | - ReachabilitySwift (3)
16 | - Result (3.0.0)
17 | - RxCocoa (3.0.1):
18 | - RxSwift (~> 3.0)
19 | - RxSwift (3.0.1)
20 | - SnapKit (3.0.2)
21 | - Static (2.0.0)
22 | - SwiftDate (4.0.7)
23 | - SwiftyJSON (3.1.3)
24 | - WeiboSDK (3.1.4)
25 |
26 | DEPENDENCIES:
27 | - Alamofire (~> 4.0)
28 | - AttributedMarkdown (from `https://github.com/dreamwieber/AttributedMarkdown.git`)
29 | - Bugly
30 | - DGElasticPullToRefresh
31 | - IQKeyboardManagerSwift
32 | - Kingfisher
33 | - MBProgressHUD
34 | - Moya (= 8.0.0-beta.4)
35 | - ObjectMapper
36 | - ReachabilitySwift
37 | - RxCocoa (~> 3.0)
38 | - RxSwift (~> 3.0)
39 | - SnapKit
40 | - Static (from `https://github.com/flexih/Static.git`)
41 | - SwiftDate
42 | - SwiftyJSON
43 | - WeiboSDK (from `https://github.com/sinaweibosdk/weibo_ios_sdk.git`)
44 |
45 | EXTERNAL SOURCES:
46 | AttributedMarkdown:
47 | :git: https://github.com/dreamwieber/AttributedMarkdown.git
48 | Static:
49 | :git: https://github.com/flexih/Static.git
50 | WeiboSDK:
51 | :git: https://github.com/sinaweibosdk/weibo_ios_sdk.git
52 |
53 | CHECKOUT OPTIONS:
54 | AttributedMarkdown:
55 | :commit: 4aef3c80e0ffe6c7011c20c7f703ea56af774861
56 | :git: https://github.com/dreamwieber/AttributedMarkdown.git
57 | Static:
58 | :commit: d347ed3e0f371bcb043f3a2d4eefb422027004d8
59 | :git: https://github.com/flexih/Static.git
60 | WeiboSDK:
61 | :commit: 3daf7147ddd0fde3b04a61d8d94327d41d0c239c
62 | :git: https://github.com/sinaweibosdk/weibo_ios_sdk.git
63 |
64 | SPEC CHECKSUMS:
65 | Alamofire: aa2e09d871c9160ac53c90e83c68064a94e3dfbe
66 | AttributedMarkdown: ac5060667280be8cc8ee33a46c73e4ec6b17ca1a
67 | Bugly: b09cd3c7e54048a0e079be88a7a99610f14eab8f
68 | DGElasticPullToRefresh: 28f11a6026302a90f8ffebbc6e24748e584dddd3
69 | IQKeyboardManagerSwift: 58bbcf46b5cf9fd4ed625d28a60cb2fbae4ab0f4
70 | Kingfisher: 64ef28c6d3d6f344e3ae2d7f5c9da80439505d99
71 | MBProgressHUD: 4890f671c94e8a0f3cf959aa731e9de2f036d71a
72 | Moya: bad6f72ec40661f09a8cd85ab470226d2795a485
73 | ObjectMapper: 41e43e1a89f8060ef5ea5d04ba852e269a621d68
74 | ReachabilitySwift: f5b9bb30a0777fac8f09ce8b067e32faeb29bb64
75 | Result: 1b3e431f37cbcd3ad89c6aa9ab0ae55515fae3b6
76 | RxCocoa: 15a52fc590dcc700cb4a690a633b5c5184ce3a78
77 | RxSwift: af5680055c4ad04480189c52d28385b1029493a6
78 | SnapKit: 2e456761aa92d4d4067a7a5594c18769d451a8ad
79 | Static: 024f1707c8b150599931560f62afce772dcca884
80 | SwiftDate: 0efb04a6751b1ab804049b2b09a69848cd304c12
81 | SwiftyJSON: 38a8ea2006779c0fc4c310cb2ee8195327740faf
82 | WeiboSDK: bceab625ec59b7039ba721cc4ba9f5868804f63e
83 |
84 | PODFILE CHECKSUM: 20cb424bd710ce1f083c46d30618024e36639c63
85 |
86 | COCOAPODS: 1.1.1
87 |
--------------------------------------------------------------------------------
/YZGithub/Sences/CommanModel/Parameters/ParaSerachUser.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ParaSerachUser.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/27.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public enum SearchUserQueryPrefix:String {
12 | case `Type` = "type"
13 | case In = "in"
14 | case Repos = "repos"
15 | case Location = "location"
16 | case Language = "language"
17 | case Followers = "followers"
18 | case Created = "created"
19 | }
20 | public enum UserType:String {
21 | case Default = ""
22 | case User = "user"
23 | case Org = "org"
24 | }
25 |
26 | public enum UserInField : String {
27 | case Default = ""
28 | case Email = "email"
29 | case UserName = "login"
30 | case FullName = "fullname"
31 | }
32 | open class ParaSearchUser : NSObject {
33 | var q:String
34 | var sort:String
35 | var order:String
36 |
37 |
38 | var keyword:String?
39 | var typePara:UserType?
40 | var inPara:UserInField?
41 | var reposPara:String?
42 | var locationPara:String?
43 | var languagePara:String?
44 | var createdPara:String?
45 | var followersPara:String?
46 |
47 | var page:Int = 1
48 | var perPage:Int = 10
49 |
50 | init(query:String ,sort:String ,order:String) {
51 |
52 | self.q = query
53 | self.sort = sort
54 | self.order = order
55 |
56 | }
57 |
58 | convenience override init() {
59 | self.init(query:"type:user" ,sort:"followers" ,order:"desc")
60 | }
61 |
62 | func combineQuery()->String {
63 |
64 | var query = ""
65 |
66 | if(keyword != nil){
67 | query += "\(keyword!)"
68 | }
69 |
70 | //type:org
71 | if(typePara != nil){
72 | let typeStr = typePara!.rawValue
73 | query += " type:\(typeStr)"
74 | }
75 |
76 | //in:email
77 | if(inPara != nil){
78 | let inStr = inPara!.rawValue
79 | query += " in:\(inStr)"
80 | }
81 |
82 | //repos:>9000
83 | if(reposPara != nil){
84 | query += " repos:\(reposPara!)"
85 | }
86 |
87 | //location:iceland
88 | if(locationPara != nil){
89 | query += " location:\(locationPara!)"
90 | }
91 |
92 | //language:javascript
93 | if(languagePara != nil){
94 | query += " language:\(languagePara!)"
95 | }
96 |
97 | //created:<2011-01-01
98 | if(createdPara != nil){
99 | query += " created:\(createdPara!)"
100 | }
101 |
102 | //followers:>=1000
103 | if(followersPara != nil){
104 | query += " followers:\(followersPara!)"
105 | }
106 |
107 | if(query.isEmpty || (query == "") ){
108 | query = "type:user"
109 | }
110 |
111 | return query
112 | }
113 |
114 | }
115 |
116 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Repos/Controller/ReadmeViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ReadmeViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/28.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SnapKit
11 | import ObjectMapper
12 | import SwiftyJSON
13 | import Alamofire
14 | //import
15 |
16 |
17 | class ReadmeViewController: UIViewController {
18 |
19 | var contentView:UITextView?
20 |
21 | var repo:Repository?
22 |
23 | override func viewDidLoad() {
24 | super.viewDidLoad()
25 |
26 | customUI()
27 | fetchReadMeFile()
28 | }
29 |
30 | deinit{
31 | // print("释放")
32 | }
33 | func customUI() {
34 | contentView = UITextView()
35 | view.addSubview(contentView!)
36 | contentView?.snp.makeConstraints({ (make) in
37 | make.size.top.leading.equalTo(view)
38 | })
39 | }
40 |
41 | func fetchReadMeFile() {
42 | Provider.sharedProvider.request(GitHubAPI.repoReadme(owner: repo!.owner!.login!, repo: repo!.name!)) { (result) in
43 | switch result {
44 | case let .success(response):
45 | if response.statusCode == 404 {
46 | self.contentView?.text = "作者太懒,什么都没有写"
47 | return
48 | }
49 | do{
50 | if Thread.current.isMainThread {
51 | DispatchQueue.global(qos: .utility).async(execute: {
52 | do{
53 | let string = try JSONSerialization.jsonObject(with: response.data, options: .allowFragments)
54 | // let content = string as []
55 | let decodedData = NSData(base64Encoded: string as! String, options: NSData.Base64DecodingOptions(rawValue: 1))!
56 | let decodedString = NSString(data: decodedData as Data, encoding: String.Encoding.utf8.rawValue)!
57 | let prettyText = decodedString.richText()
58 | DispatchQueue.main.async(execute: {
59 | self.contentView?.attributedText = prettyText
60 | })
61 | }catch{
62 | }
63 | })
64 | }else{
65 | let string = try JSONSerialization.jsonObject(with: response.data, options: .allowFragments)
66 | let decodedData = NSData(base64Encoded: string as! String, options: NSData.Base64DecodingOptions(rawValue: 1))!
67 | let decodedString = NSString(data: decodedData as Data, encoding: String.Encoding.utf8.rawValue)!
68 | let prettyText = decodedString.richText()
69 | self.contentView?.attributedText = prettyText
70 | }
71 | }catch{
72 |
73 | }
74 | case let .failure(error):
75 | print(error)
76 | }
77 | }
78 | }
79 |
80 | override func didReceiveMemoryWarning() {
81 | super.didReceiveMemoryWarning()
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Explore/Controller/ExploreReposViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ExploreReposViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/26.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ObjectMapper
11 | import MBProgressHUD
12 |
13 | class ExploreReposViewController: UIViewController {
14 |
15 | let cellIdentifier = "RepoTableViewCell"
16 | var reposData:[Repository]! = []
17 |
18 | // MARK: request parameters
19 |
20 |
21 | var paraSince:String = "daily"
22 | var paraLanguage:String = "all"
23 |
24 |
25 |
26 | lazy var tableView: UITableView = {
27 | var table:UITableView = UITableView(frame: self.view.bounds)
28 | table.dataSource = self
29 | table.delegate = self
30 |
31 | table.register(UINib(nibName: "RepoTableViewCell", bundle: nil), forCellReuseIdentifier: "RepoTableViewCell")
32 | return table
33 | }()
34 |
35 | override func viewDidLoad() {
36 | super.viewDidLoad()
37 | fetchData()
38 | }
39 |
40 | func fetchData() {
41 | let provider = Provider.sharedProvider
42 | provider.request(GitHubAPI.trendingRepos(since: "daily", language: "ALL")){ result in
43 |
44 | switch result {
45 | case let .success(response):
46 | do{
47 | let repos:[Repository] = try response.mapArray(Repository.self)
48 | self.reposData.removeAll()
49 | self.reposData = repos
50 | self.tableView.reloadData()
51 | self.tableView.setContentOffset(CGPoint.zero, animated:true)
52 | }catch {
53 | }
54 | case let .failure(error):
55 | print(error)
56 | guard error is CustomStringConvertible else {
57 | MBProgressHUD.showError("网络请求失败")
58 | break
59 | }
60 | }
61 | }
62 | }
63 | }
64 | extension ExploreReposViewController:UITableViewDataSource{
65 | func numberOfSections(in tableView: UITableView) -> Int {
66 | return 1
67 | }
68 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
69 | return reposData.count
70 | }
71 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
72 | return 100
73 | }
74 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
75 | let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as! RepoTableViewCell
76 | cell.repo = reposData[indexPath.row]
77 | return cell
78 | }
79 | }
80 | extension ExploreReposViewController:UITableViewDelegate{
81 |
82 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
83 | let infoVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "repoinfo") as? RepoInfoViewController
84 | infoVC?.repoInfo = reposData[indexPath.row]
85 | self.parent?.navigationController?.pushViewController(infoVC!, animated: true)
86 | }
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Profile/Controller/SettingViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SettingViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/10.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SnapKit
11 | import Kingfisher
12 | import MBProgressHUD
13 |
14 | class SettingViewController: BaseViewController {
15 |
16 | var tableView = UITableView(frame: CGRect.zero, style: .grouped)
17 | override func viewDidLoad() {
18 | super.viewDidLoad()
19 | customUI()
20 | }
21 | func customUI() {
22 | view.addSubview(tableView)
23 | tableView.delegate = self
24 | tableView.dataSource = self
25 | tableView.register(UITableViewCell.self, forCellReuseIdentifier: "settingCell")
26 | tableView.snp.makeConstraints { (make) in
27 | make.size.equalTo(self.view)
28 | make.left.top.equalTo(self.view)
29 | }
30 | }
31 | override func didReceiveMemoryWarning() {
32 | super.didReceiveMemoryWarning()
33 | }
34 | deinit{
35 | print("销毁")
36 | }
37 | }
38 | extension SettingViewController:UITableViewDelegate{
39 | func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
40 | return 10.0
41 | }
42 | func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
43 | return 1.0
44 | }
45 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
46 | let index = (indexPath.section,indexPath.row)
47 |
48 | switch index {
49 | case (0,0):
50 | let cell = tableView.viewWithTag(101) as! UITableViewCell
51 | KingfisherManager.shared.cache.clearDiskCache(completion: {
52 | MBProgressHUD.showError("缓存清除成功")
53 | cell.textLabel?.text = "无缓存"
54 | })
55 | default:
56 | if ObjUser.deleteUserInfo() {
57 | MBProgressHUD.showMsg("退出成功")
58 | _ = self.navigationController?.popViewController(animated: true)
59 | NotificationCenter.default.post(name: Notification.Name(rawValue: NotificationGitLogOutSuccessful), object: nil)
60 |
61 | }else{
62 | MBProgressHUD.showError("退出失败")
63 | }
64 | }
65 | }
66 | }
67 | extension SettingViewController:UITableViewDataSource{
68 | func numberOfSections(in tableView: UITableView) -> Int {
69 | return 2
70 | }
71 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
72 | return 1
73 | }
74 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
75 | let cell = tableView.dequeueReusableCell(withIdentifier: "settingCell", for: indexPath)
76 |
77 | let index = (indexPath.section,indexPath.row)
78 | switch index {
79 | case (0,0):
80 | KingfisherManager.shared.cache.calculateDiskCacheSize(completion: { (size) in
81 | cell.textLabel?.text = "清除缓存 (\(size / 1024 / 1024) M)"
82 | })
83 | cell.textLabel?.text = "清除缓存"
84 | cell.tag = 101
85 | case(1,0):
86 | cell.textLabel?.text = "退出"
87 | default:
88 | print("等待")
89 | }
90 | return cell
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/YZGithub/Sences/BaseViewController/YZWebViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // YZWebViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/24.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import WebKit
11 | import MBProgressHUD
12 |
13 | class YZWebViewController: BaseViewController, WKNavigationDelegate {
14 |
15 | var webView:UIWebView?
16 | var hub:MBProgressHUD?
17 |
18 | var url:String? {
19 | didSet{
20 | let urlTemp = URL(string: url!)
21 | let urlRequest = URLRequest(url: urlTemp!)
22 | if webView != nil {
23 | self.webView!.loadRequest(urlRequest)
24 | }
25 | }
26 | }
27 | var html:String?{
28 | didSet{
29 | if webView != nil {
30 | self.webView?.loadHTMLString(html!, baseURL: nil)
31 | }
32 | }
33 | }
34 |
35 | override func viewDidLoad() {
36 | super.viewDidLoad()
37 | self.navigationController?.navigationBar.setMyBackgroundColor(UIColor.navBarTintColor())
38 | customInit()
39 | }
40 |
41 | func customInit() {
42 | configWebView()
43 | }
44 | func configWebView() {
45 |
46 | var frame = self.view.bounds
47 | frame.origin.y = -44
48 | frame.size.height += 44
49 | webView = UIWebView(frame: frame)
50 |
51 | self.view.addSubview(webView!)
52 |
53 | if url != nil {
54 | let urlTmp = URL(string: url!)
55 | let urlRequest = URLRequest(url: urlTmp!)
56 | self.webView!.loadRequest(urlRequest)
57 | }
58 | if html != nil {
59 | self.webView?.loadHTMLString(html!, baseURL: nil)
60 | }
61 |
62 | webView?.delegate = self
63 |
64 | }
65 |
66 | override func didReceiveMemoryWarning() {
67 | super.didReceiveMemoryWarning()
68 |
69 | }
70 | }
71 | extension YZWebViewController:UIWebViewDelegate{
72 |
73 | func webViewDidStartLoad(_ webView: UIWebView) {
74 | hub = MBProgressHUD.showAdded(to: self.view, animated: true)
75 | }
76 |
77 | func webViewDidFinishLoad(_ webView: UIWebView) {
78 | hub?.hide(animated: true)
79 | self.webView!.scrollView.contentInset = UIEdgeInsetsMake(self.topOffset, 0, 0, 0)
80 | self.webView!.scrollView.scrollRectToVisible(CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 0.1), animated: true)
81 |
82 | }
83 | func webView(_ webView: UIWebView, didFailLoadWithError error: Error) {
84 | hub?.hide(animated: true)
85 | }
86 |
87 | func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
88 | UIApplication.shared.isNetworkActivityIndicatorVisible = true
89 | }
90 |
91 | func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
92 | UIApplication.shared.isNetworkActivityIndicatorVisible = false
93 | }
94 | func goBack() {
95 |
96 | if (webView!.canGoBack) {
97 | webView!.goBack()
98 | }else {
99 | leftItemAction(nil)
100 | }
101 | }
102 |
103 | func goForward() {
104 | if webView!.canGoForward {
105 | webView!.goForward()
106 | }else {
107 |
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Developer/Controller/DeveloperListViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DeveloperListViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/28.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ObjectMapper
11 | import Alamofire
12 | import MBProgressHUD
13 |
14 | enum DeveListType {
15 | case follewers
16 | }
17 |
18 | class DeveloperListViewController: BaseViewController {
19 |
20 | let vm = DevelopListViewModel()
21 | var developer:ObjUser?
22 | var developers:[ObjUser] = [ObjUser]()
23 | var listType:DeveListType? {
24 | didSet{
25 | switch listType! {
26 | case .follewers:
27 | fetchFollewers()
28 | }
29 | }
30 | }
31 | lazy var tableView: UITableView? = {
32 | let table = UITableView()
33 | table.dataSource = self
34 | table.tableFooterView = UIView()
35 | return table
36 | }()
37 |
38 |
39 | override func viewDidLoad() {
40 | super.viewDidLoad()
41 | customUI()
42 |
43 | vm.user?.asObservable().subscribe({ [weak self](event) in
44 | self?.fetchFollewers()
45 | }).addDisposableTo(disposeBag)
46 | }
47 | func customUI() {
48 | view.addSubview(tableView!)
49 | title = "成员列表"
50 | tableView?.snp.makeConstraints({ (make) in
51 | make.bottom.top.equalTo(view)
52 | make.width.height.equalTo(view)
53 | })
54 | tableView?.register(UINib(nibName: "DeveloperTableViewCell",bundle: nil), forCellReuseIdentifier: "DeveloperTableViewCell")
55 | tableView?.rx.setDelegate(self).addDisposableTo(disposeBag)
56 | // tableView?.rx.setDataSource(self).addDisposableTo(disposeBag)
57 | vm.users?.asObservable().bindTo(self.tableView!.rx.items(cellIdentifier: "DeveloperTableViewCell", cellType: DeveloperTableViewCell.self)){ (row,element,cell) in
58 | cell.deve = element
59 | }.addDisposableTo(disposeBag)
60 | }
61 |
62 | func fetchFollewers() {
63 | // vm.fetchListNoRx()
64 | vm.fetchList().subscribe(onNext: { [weak self](users) in
65 | self?.tableView?.reloadData()
66 | }, onError: nil, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag)
67 | }
68 | override func didReceiveMemoryWarning() {
69 | super.didReceiveMemoryWarning()
70 |
71 | }
72 | }
73 | extension DeveloperListViewController:UITableViewDelegate{
74 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
75 | let devInfo = DeveloperViewController()
76 | if listType != nil{
77 | devInfo.developer = developers[indexPath.row]
78 | }else{
79 | devInfo.developer = developer
80 | }
81 | self.navigationController?.pushViewController(devInfo, animated: true)
82 | }
83 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
84 | return 70
85 | }
86 | }
87 | extension DeveloperListViewController:UITableViewDataSource{
88 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
89 | if listType != nil{
90 | if let c = vm.users?.value {
91 | return c.count
92 | }
93 | return 0
94 | }else{
95 | return 1
96 | }
97 | }
98 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
99 | let cell = tableView.dequeueReusableCell(withIdentifier: "DeveloperTableViewCell",for: indexPath) as? DeveloperTableViewCell
100 | if listType != nil{
101 | cell?.deve = vm.users?.value[indexPath.row]
102 | }else{
103 | cell?.deve = vm.user?.value
104 | }
105 | return cell!
106 | }
107 |
108 | }
109 |
--------------------------------------------------------------------------------
/YZGithub/Sences/BaseViewController/BaseTableViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseTableViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/8/24.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SnapKit
11 | import MBProgressHUD
12 |
13 | enum IfloadMore {
14 | case loading
15 | case noload
16 | mutating func change() {
17 | switch self {
18 | case .loading:
19 | self = .noload
20 | case .noload:
21 | self = .loading
22 | }
23 | }
24 | }
25 |
26 | class BaseTableViewController: UIViewController,UITableViewDataSource,UITableViewDelegate,UIScrollViewDelegate {
27 |
28 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
29 | super.init(nibName: nibNameOrNil , bundle: nibBundleOrNil)
30 | }
31 |
32 | required init?(coder aDecoder: NSCoder) {
33 | fatalError("init(coder:) has not been implemented")
34 | }
35 |
36 | var page : Int = 1
37 | var ifloading = IfloadMore.noload
38 | var dataArray:[T]? {
39 | didSet{
40 | self.tableView.reloadData()
41 | }
42 | }
43 | let tableView = UITableView(frame: CGRect.zero, style: .plain)
44 | var cellName:String? {
45 | let name = NSStringFromClass(T.self as! AnyClass) + "Cell"
46 | let cellname = name.components(separatedBy: ".")
47 | return cellname[1]
48 | }
49 |
50 | override func viewDidLoad() {
51 | super.viewDidLoad()
52 |
53 | NotificationCenter.default.addObserver(self, selector: #selector(fetchData), name: NSNotification.Name(rawValue: NotificationGitLoginSuccessful), object: nil)
54 | // NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(fetchData), name: NotificationGitLogOutSuccessful, object: nil)
55 | customTableView()
56 | isLogin()
57 | }
58 | func customTableView() {
59 | view.addSubview(tableView)
60 | tableView.snp.makeConstraints { (make) in
61 | make.size.left.top.equalTo(self.view)
62 | }
63 | tableView.dataSource = self
64 | tableView.delegate = self
65 | tableView.register(UINib(nibName: cellName!,bundle: nil), forCellReuseIdentifier: cellName!)
66 | tableView.estimatedRowHeight = 100
67 | tableView.rowHeight = UITableViewAutomaticDimension
68 | }
69 |
70 | func isLogin() {
71 | if UserInfoHelper.sharedInstance.isLogin {
72 | fetchData({})
73 | }else {
74 | MBProgressHUD.showError("请先登录...")
75 | }
76 | }
77 | //MARK: NOTI
78 | func fetchData(_ success:()->()){
79 |
80 | }
81 | //MARK: DataSource
82 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
83 | if dataArray != nil {
84 | return dataArray!.count
85 | }
86 | return 0
87 | }
88 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
89 | let cell = tableView.dequeueReusableCell(withIdentifier: cellName!, for: indexPath) as? BaseCell
90 | cell?.setModel(dataArray![indexPath.row])
91 | cell!.selectionStyle = .none
92 | return cell!
93 | }
94 | //上拉加载
95 | func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
96 | if scrollView.contentOffset.y >= fmax(0.0, scrollView.contentSize.height - scrollView.frame.size.height) + 60 {
97 | if ifloading == .noload {
98 | UIView.commitAnimations()
99 | UIView.animate(withDuration: 1.0, animations: {
100 | self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0)
101 | }, completion: { (result) in
102 | self.ifloading.change()
103 | self.fetchData({
104 | self.tableView.contentInset = UIEdgeInsetsMake(64, 0, 50, 0)
105 | })
106 | })
107 | }
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/YZGithub/ThridParty/WX/WXApi.h:
--------------------------------------------------------------------------------
1 | //
2 | // WXApi.h
3 | // 所有Api接口
4 | //
5 | // Created by Wechat on 12-2-28.
6 | // Copyright (c) 2012年 Tencent. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "WXApiObject.h"
11 |
12 |
13 | #pragma mark - WXApiDelegate
14 | /*! @brief 接收并处理来自微信终端程序的事件消息
15 | *
16 | * 接收并处理来自微信终端程序的事件消息,期间微信界面会切换到第三方应用程序。
17 | * WXApiDelegate 会在handleOpenURL:delegate:中使用并触发。
18 | */
19 | @protocol WXApiDelegate
20 | @optional
21 |
22 | /*! @brief 收到一个来自微信的请求,第三方应用程序处理完后调用sendResp向微信发送结果
23 | *
24 | * 收到一个来自微信的请求,异步处理完成后必须调用sendResp发送处理结果给微信。
25 | * 可能收到的请求有GetMessageFromWXReq、ShowMessageFromWXReq等。
26 | * @param req 具体请求内容,是自动释放的
27 | */
28 | -(void) onReq:(BaseReq*)req;
29 |
30 |
31 |
32 | /*! @brief 发送一个sendReq后,收到微信的回应
33 | *
34 | * 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。
35 | * 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。
36 | * @param resp具体的回应内容,是自动释放的
37 | */
38 | -(void) onResp:(BaseResp*)resp;
39 |
40 | @end
41 |
42 |
43 |
44 | #pragma mark - WXApi
45 |
46 | /*! @brief 微信Api接口函数类
47 | *
48 | * 该类封装了微信终端SDK的所有接口
49 | */
50 | @interface WXApi : NSObject
51 |
52 | /*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。
53 | *
54 | * 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现。
55 | * iOS7及以上系统需要调起一次微信才会出现在微信的可用应用列表中。
56 | * @attention 请保证在主线程中调用此函数
57 | * @param appid 微信开发者ID
58 | * @param typeFlag 应用支持打开的文件类型
59 | * @return 成功返回YES,失败返回NO。
60 | */
61 | +(BOOL) registerApp:(NSString *)appid;
62 |
63 |
64 | /*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。
65 | *
66 | * 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现。
67 | * @see registerApp
68 | * @param appid 微信开发者ID
69 | * @param appdesc 应用附加信息,长度不超过1024字节
70 | * @return 成功返回YES,失败返回NO。
71 | */
72 | +(BOOL) registerApp:(NSString *)appid withDescription:(NSString *)appdesc;
73 |
74 |
75 | /*! @brief WXApi的成员函数,向微信终端程序注册应用支持打开的文件类型。
76 | *
77 | * 需要在每次启动第三方应用程序时调用。调用后并第一次成功分享数据到微信后,会在微信的可用应用列表中出现。
78 | * @see registerApp
79 | * @param typeFlag 应用支持打开的数据类型, enAppSupportContentFlag枚举类型 “|” 操作后结果
80 | */
81 | +(void) registerAppSupportContentFlag:(UInt64)typeFlag;
82 |
83 |
84 |
85 | /*! @brief 处理微信通过URL启动App时传递的数据
86 | *
87 | * 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。
88 | * @param url 微信启动第三方应用时传递过来的URL
89 | * @param delegate WXApiDelegate对象,用来接收微信触发的消息。
90 | * @return 成功返回YES,失败返回NO。
91 | */
92 | +(BOOL) handleOpenURL:(NSURL *) url delegate:(id) delegate;
93 |
94 |
95 |
96 | /*! @brief 检查微信是否已被用户安装
97 | *
98 | * @return 微信已安装返回YES,未安装返回NO。
99 | */
100 | +(BOOL) isWXAppInstalled;
101 |
102 |
103 |
104 | /*! @brief 判断当前微信的版本是否支持OpenApi
105 | *
106 | * @return 支持返回YES,不支持返回NO。
107 | */
108 | +(BOOL) isWXAppSupportApi;
109 |
110 |
111 |
112 | /*! @brief 获取微信的itunes安装地址
113 | *
114 | * @return 微信的安装地址字符串。
115 | */
116 | +(NSString *) getWXAppInstallUrl;
117 |
118 |
119 |
120 | /*! @brief 获取当前微信SDK的版本号
121 | *
122 | * @return 返回当前微信SDK的版本号
123 | */
124 | +(NSString *) getApiVersion;
125 |
126 |
127 |
128 | /*! @brief 打开微信
129 | *
130 | * @return 成功返回YES,失败返回NO。
131 | */
132 | +(BOOL) openWXApp;
133 |
134 |
135 |
136 | /*! @brief 发送请求到微信,等待微信返回onResp
137 | *
138 | * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持以下类型
139 | * SendAuthReq、SendMessageToWXReq、PayReq等。
140 | * @param req 具体的发送请求,在调用函数后,请自己释放。
141 | * @return 成功返回YES,失败返回NO。
142 | */
143 | +(BOOL) sendReq:(BaseReq*)req;
144 |
145 | /*! @brief 发送Auth请求到微信,支持用户没安装微信,等待微信返回onResp
146 | *
147 | * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持SendAuthReq类型。
148 | * @param req 具体的发送请求,在调用函数后,请自己释放。
149 | * @param viewController 当前界面对象。
150 | * @param delegate WXApiDelegate对象,用来接收微信触发的消息。
151 | * @return 成功返回YES,失败返回NO。
152 | */
153 | +(BOOL) sendAuthReq:(SendAuthReq*)req viewController:(UIViewController*)viewController delegate:(id)delegate;
154 |
155 |
156 | /*! @brief 收到微信onReq的请求,发送对应的应答给微信,并切换到微信界面
157 | *
158 | * 函数调用后,会切换到微信的界面。第三方应用程序收到微信onReq的请求,异步处理该请求,完成后必须调用该函数。可能发送的相应有
159 | * GetMessageFromWXResp、ShowMessageFromWXResp等。
160 | * @param resp 具体的应答内容,调用函数后,请自己释放
161 | * @return 成功返回YES,失败返回NO。
162 | */
163 | +(BOOL) sendResp:(BaseResp*)resp;
164 |
165 |
166 | @end
167 |
--------------------------------------------------------------------------------
/YZGithub/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/11.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import Alamofire
11 | import MBProgressHUD
12 |
13 | @UIApplicationMain
14 | class AppDelegate: UIResponder, UIApplicationDelegate {
15 |
16 | var window: UIWindow?
17 |
18 | override init() {
19 | super.init()
20 | }
21 |
22 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
23 | customUI()
24 | customSocial()
25 | customRouter()
26 | return true
27 | }
28 |
29 | func applicationWillResignActive(_ application: UIApplication) {
30 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
31 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
32 | }
33 |
34 | func applicationDidEnterBackground(_ application: UIApplication) {
35 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
36 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
37 | }
38 |
39 | func applicationWillEnterForeground(_ application: UIApplication) {
40 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
41 | }
42 |
43 | func applicationDidBecomeActive(_ application: UIApplication) {
44 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
45 | }
46 |
47 | func applicationWillTerminate(_ application: UIApplication) {
48 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
49 | }
50 | func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
51 | return true
52 | }
53 |
54 | func customUI() {
55 | UINavigationBar.appearance().tintColor = UIColor.white
56 | UINavigationBar.appearance().barTintColor = UIColor.navBarTintColor()
57 | UINavigationBar.appearance().titleTextAttributes = NSDictionary.init(object: UIColor.white, forKey: NSForegroundColorAttributeName as NSCopying) as? [String : AnyObject]
58 | }
59 | func customSocial() {
60 | // UMSocialData.setAppKey("56025946e0f55a744000439c")
61 | // UMSocialSinaSSOHandler.openNewSinaSSO(withAppKey: "3006877935", secret: "46fd11d135010fcc578a1b0ced7e50d4", redirectURL: "https://api.weibo.com/oauth2/default.html")
62 | }
63 | func customRouter() {
64 | RouterPage.setting.addPath(viewController: SettingViewController.self)
65 | RouterPage.login(url: "").addPath(viewController: LoginViewController.self)
66 | RouterPage.DeveList(ofUser: nil).addPath(viewController: DeveloperListViewController.self)
67 | }
68 | func showDetailPage(_ vc:UIViewController) {
69 | let rootvc = self.window?.rootViewController
70 | if rootvc is UINavigationController{
71 | let nav = rootvc as! UINavigationController
72 | nav.pushViewController(vc, animated: true)
73 | }else if rootvc is UITabBarController {
74 | let tabvc = rootvc as! UITabBarController
75 | let selectVc = tabvc.selectedViewController
76 | if selectVc is UINavigationController {
77 | let nav = selectVc as! UINavigationController
78 | nav.pushViewController(vc, animated: true)
79 | }else{
80 | MBProgressHUD.showError("待模态")
81 | }
82 | }else {
83 | MBProgressHUD.showError("待模态")
84 | }
85 |
86 | }
87 | }
88 |
89 |
--------------------------------------------------------------------------------
/YZGithub/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/YZGithub/Sences/Repos/Controller/RepoListViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RepoListViewController.swift
3 | // YZGithub
4 | //
5 | // Created by 郑建文 on 16/7/28.
6 | // Copyright © 2016年 Zheng. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SnapKit
11 |
12 | class RepoListViewController: UIViewController {
13 |
14 | //MARK: 搜索属性
15 | var page = 1
16 | var perpage = 10
17 | var type = "owner"
18 | var sort = "created"
19 | var direction = "desc"
20 |
21 | //MARK: DATA
22 | var developer:ObjUser? = nil
23 | var reposArray:[Repository]?
24 |
25 | lazy var tableView:UITableView? = {
26 | let table = UITableView()
27 | table.dataSource = self
28 | table.delegate = self
29 | return table
30 | }()
31 |
32 | override func viewDidLoad() {
33 | super.viewDidLoad()
34 |
35 | customUI()
36 | fetchRepoList()
37 | }
38 | func customUI() {
39 | view.addSubview(tableView!)
40 | title = "仓库列表"
41 | tableView?.snp.makeConstraints({ (make) in
42 | make.top.bottom.leading.trailing.equalTo(view)
43 | })
44 | // tableView?.estimatedRowHeight = 100
45 | // tableView?.rowHeight = UITableViewAutomaticDimension
46 | tableView?.register(UINib(nibName: "RepoTableViewCell",bundle: nil), forCellReuseIdentifier: "RepoTableViewCell")
47 | tableView?.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
48 | }
49 | func fetchRepoList() {
50 | Provider.sharedProvider.request(GitHubAPI.userRepos(username: (developer?.login)!, page: page, perpage: perpage, type: type, sort: sort, direction: direction)) { (result) in
51 | switch result {
52 | case let .success(response):
53 | do{
54 | let repos:[Repository] = try response.mapArray(Repository.self)
55 | if self.page == 1 {
56 | self.reposArray?.removeAll()
57 | self.reposArray = repos
58 | }else{
59 | self.reposArray = self.reposArray! + repos
60 | }
61 | self.page += 1
62 | self.tableView?.reloadData()
63 | }catch{
64 |
65 | }
66 | case let .failure(error):
67 | print(error)
68 | }
69 | }
70 | }
71 | }
72 | extension RepoListViewController:UITableViewDataSource{
73 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
74 | if let a = reposArray {
75 | return a.count + 1
76 | }
77 | return 0
78 | }
79 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
80 | if indexPath.row == reposArray?.count {
81 | let cell = UITableViewCell(style: .default, reuseIdentifier: "cell")
82 | let label = UILabel()
83 | label.frame.size = CGSize(width: 120, height: 40)
84 | label.textColor = UIColor.white
85 | label.text = "点击加载更多"
86 | label.textAlignment = .center
87 | cell.addSubview(label)
88 | label.snp.makeConstraints({ (make) in
89 | make.center.equalTo(cell)
90 | })
91 | cell.backgroundColor = UIColor.hexStr("00631b", alpha: 1)
92 | return cell
93 | }
94 | let cell = tableView.dequeueReusableCell(withIdentifier: "RepoTableViewCell", for: indexPath) as? RepoTableViewCell
95 | cell?.repo = reposArray![indexPath.row]
96 | return cell!
97 | }
98 | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
99 | if indexPath.row == reposArray?.count{
100 | return 40
101 | }
102 | return 100
103 | }
104 | }
105 | extension RepoListViewController:UITableViewDelegate{
106 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
107 | if indexPath.row == reposArray?.count {
108 | fetchRepoList()
109 | return
110 | }
111 | let sb = UIStoryboard(name: "Main", bundle: nil)
112 | let repoInfoVC = sb.instantiateViewController(withIdentifier: "repoinfo") as? RepoInfoViewController
113 | repoInfoVC!.repoInfo = reposArray![indexPath.row]
114 | navigationController?.pushViewController(repoInfoVC!, animated: true)
115 | }
116 | }
117 |
118 |
--------------------------------------------------------------------------------
/YZGithub/Extension/ParallaxHeaderView.swift:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // ParallaxHeaderView.swift
4 | // ParallaxHeaderView
5 | //
6 | // Created by wl on 15/11/3.
7 | // Copyright © 2015年 wl. All rights reserved.
8 | //
9 |
10 | import UIKit
11 |
12 | protocol ParallaxHeaderViewDelegate: class {
13 | func LockScorllView(_ maxOffsetY: CGFloat)
14 | func autoAdjustNavigationBarAplha(_ aplha: CGFloat)
15 | }
16 |
17 | extension ParallaxHeaderViewDelegate where Self : UITableViewController {
18 | func LockScorllView(_ maxOffsetY: CGFloat) {
19 | self.tableView.contentOffset.y = maxOffsetY
20 | }
21 | func autoAdjustNavigationBarAplha(_ aplha: CGFloat) {
22 | self.navigationController?.navigationBar.setMyBackgroundColorAlpha(aplha)
23 | }
24 | }
25 |
26 | enum ParallaxHeaderViewStyle {
27 | case `default`
28 | case thumb
29 | }
30 |
31 | class ParallaxHeaderView: UIView {
32 |
33 | var subView: UIView
34 | var contentView: UIView = UIView()
35 | /// 最大的下拉限度(因为是下拉所以总是为负数),超过(小于)这个值,下拉将不会有效果
36 | var maxOffsetY: CGFloat
37 | /// 是否需要自动调节导航栏的透明度
38 | var autoAdjustAplha: Bool = true
39 |
40 | weak var delegate: ParallaxHeaderViewDelegate!
41 |
42 |
43 |
44 | /// 模糊效果的view
45 | fileprivate var blurView: UIVisualEffectView?
46 | fileprivate let defaultBlurViewAlpha: CGFloat = 0.5
47 | fileprivate let style: ParallaxHeaderViewStyle
48 |
49 | fileprivate let originY:CGFloat = -64
50 |
51 | // MARK: - 初始化方法
52 | init(style: ParallaxHeaderViewStyle,subView: UIView, headerViewSize: CGSize, maxOffsetY: CGFloat, delegate: ParallaxHeaderViewDelegate) {
53 |
54 | self.subView = subView
55 | self.maxOffsetY = maxOffsetY < 0 ? maxOffsetY : -maxOffsetY
56 | self.delegate = delegate
57 | self.style = style
58 |
59 | super.init(frame: CGRect(x: 0, y: 0, width: headerViewSize.width, height: headerViewSize.height))
60 | //这里是自动布局的设置,大概意思就是subView与它的superView拥有一样的frame
61 | subView.autoresizingMask = [.flexibleLeftMargin, .flexibleRightMargin, .flexibleTopMargin, .flexibleBottomMargin, .flexibleWidth, .flexibleHeight]
62 | self.clipsToBounds = false; //必须得设置成false
63 | self.contentView.frame = self.bounds
64 | self.contentView.addSubview(subView)
65 | self.contentView.clipsToBounds = true
66 | self.addSubview(contentView)
67 |
68 | self.setupStyle()
69 | }
70 |
71 | required init?(coder aDecoder: NSCoder) {
72 | fatalError("init(coder:) has not been implemented")
73 | }
74 |
75 | fileprivate func setupStyle() {
76 | switch style {
77 | case .default:
78 | self.autoAdjustAplha = true
79 | case .thumb:
80 | self.autoAdjustAplha = false
81 | let blurEffect = UIBlurEffect(style: .light)
82 | let blurView = UIVisualEffectView(effect: blurEffect)
83 | blurView.alpha = defaultBlurViewAlpha
84 | blurView.frame = self.subView.frame
85 | blurView.autoresizingMask = self.subView.autoresizingMask
86 |
87 | self.blurView = blurView
88 | self.contentView.addSubview(blurView)
89 | }
90 |
91 | }
92 |
93 | // MARK: - 其他方法
94 | func layoutHeaderViewWhenScroll(_ offset: CGPoint) {
95 |
96 | let delta:CGFloat = offset.y
97 |
98 | if delta < maxOffsetY {
99 | self.delegate.LockScorllView(maxOffsetY)
100 |
101 | }else if delta < 0{
102 |
103 | var rect = CGRect(x: 0, y: 0, width: self.bounds.size.width, height: self.bounds.size.height)
104 |
105 | rect.origin.y += delta ;
106 | rect.origin.x += delta
107 | rect.size.height -= delta;
108 | rect.size.width -= delta;
109 | self.contentView.frame = rect;
110 | }
111 |
112 | switch style {
113 | case .default:
114 | self.layoutDefaultViewWhenScroll(delta)
115 |
116 | case .thumb:
117 | self.layoutThumbViewWhenScroll(delta)
118 | }
119 |
120 | if self.autoAdjustAplha {
121 | let alpha = CGFloat((-originY + delta) / (self.frame.size.height))
122 | self.delegate.autoAdjustNavigationBarAplha(alpha)
123 | }
124 | }
125 |
126 | fileprivate func layoutDefaultViewWhenScroll(_ delta: CGFloat) {
127 | // do nothing
128 | }
129 |
130 | fileprivate func layoutThumbViewWhenScroll(_ delta: CGFloat) {
131 |
132 | if delta > 0 {
133 | self.contentView.frame.origin.y = delta
134 | }
135 |
136 | if let blurView = self.blurView, delta < 0{
137 | blurView.alpha = defaultBlurViewAlpha - CGFloat(delta / maxOffsetY) < 0 ? 0 : defaultBlurViewAlpha - CGFloat(delta / maxOffsetY)
138 | }
139 | }
140 |
141 | }
142 |
143 |
--------------------------------------------------------------------------------