TosinAF / DNManager

An Objective-C Wrapper for the Designer News API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DNManager

An Objective-C Wrapper for the Designer News API to make it easier integrate the apop in your iOS/Mac app.

This mini library includes features such as getting posts(Top & Recent) & MOTD, Comments, Searching DN, User Authentication, Commenting & Upvoting.

The definitive Cocoa framework for adding HackerNews to your iOS/Mac app. This mini library includes features such as grabbing Posts (including filtering by Top, Ask, New, Jobs, Best), Comments, Logging in, and Submitting new posts/comments!


Table of Contents

Getting Started

Installing DNManager is a easy. First things first, add all of the classes in the top-level DNManager Classes folder inside of this repository into your app. Done? Good. Now, just #import "DNManager.h" in any of your controllers, classes, or views you plan on using DNManager in. That's it. We're done here.

Please note that DNManager requires AFNetworking 2.0

Classes to add:

  • DNManager.{h,m}
  • DNStory.{h,m}
  • DNUser.{h,m}
  • DNComment.{h,m}
  • DNMOTD.{h,m}

DNManager

DNManager is a Singleton class, and has a sharedManager initialization.

I don't have time to write up some documentation at the moment but the code is simple (have a look at the header file). I implement every feature of the api as described here

The only exception is getiing the details of comment, given the ID. I replaced this to create a method that creates a flat array of all the comments for a story. This is really all you need to create a tableview for the comments.

I would appreciate any pull requests to add some documentation :)

Enjoy! It's my first proper open source contribution (there's no other ios wrapper atm), the code & its architecture is some of my best work.

Star if you like it. If you want to reach out to me about it, my twitter is @tosinaf

I can't wait to show you where I'm gonna use this api ;)

License

DNManager is licensed under the standard MIT License.

Copyright (C) 2013 by Tosin Afolabi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


About

An Objective-C Wrapper for the Designer News API


Languages

Language:Objective-C 100.0%