Blog Park Mac Client 1.0 source code

Source: Internet
Author: User

directly to the point ~ here is GitHub's address. This is the address of GitHub. This is the address of GitHub.

This open source is the source of the MAC 1.0 client. Amount ... It is also the version that is not intended to be maintained and is no longer maintained. After that, 2.0 of the clients will be maintained.

First of all: This is my first time using Swift to write OSX system software, code or structure have any problems also please enlighten us, thank you ~ ~ ~

Project structure

Cnblogsformac from top to bottom directory parsing:

-Lgwebimage himself wrote, useless, useless things, can be ignored. Before I wanted to use it to do the web image reference, and then found the alternative method.

-Entity Entities class: Includes two instances of "News list item" and "Blog list item".

-News NEWS: The controller that includes the list of stories, the cell in the news list, and the controller for the News detail page.

-Blogs Blog: Inside includes the controller of the blog Li Bing, the cell of the blog list and the controller of the blog detail page.

-Basecontrolleranddeletage base of Appdelegate and a baseviewcontroller.

-WEBAPI Network Request interface: It includes authentication interface, blog interface and news interface.

Think about what to write

This code is too simple, I do not know how to say, basic one to understand, think of what to write about it ...

The interface layout uses storyboard.

Webapi->basewebapi.swift, the main thing is to apply to the server Access_token process. There are some problems here, because Access_token is not only used once, but can be used multiple times, but each request in the code gets a new Access_token, which creates a certain waste, originally intended to be a cache, I didn't do it later .

Nstableview is a very pit control = =! At least I think this guy's water is so deep ... Downloaded the Apple website demo, and then looked at a lot of information, and finally written this way ... Writing this has not been written, do not know how to write ... Here is a demo for everyone to keep a look at it ~

Blogdetailviewcontroller and in Newsdetailviewcontroller, there is a Transferredstring method, this is to deal with a more wonderful problem. I did not find the specific reason, but I guess : This is the string returned by the server, is already an escaped string, such as "Aaa\\nhahah\\taa" so, when I received, as a string, it was escaped again, the string becomes a "Aaa\\\nhahah\\\taa", and then I can't turn back ... can only be replaced by ... Later also quoted some JS files, this is for the page display typesetting, no big problem.

Have any questions welcome message.

Blog Park Mac Client 1.0 source code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.