PhotoSearcher is an iOS application that will search photos calling the public API from Instagram and Flickr. It doesn't requiere any kind of authentication.
The most interesting part of PhotoSearcher are the architectures used, MVVM and POP.
PhotoSearcher is able to search on two different APIs which are Instagram and Flickr. For this there are two model objects InstagramPhoto and FlickrPhoto which both implements the protocol called Photo. These models objects have the properties of every photo like title, number of likes, number of comments, etc. Then there is the class PhotoViewModel which is initialized with an object which implements Photo protocol. Also there is PhotoViewModel class which is in charge of downloading the pictures providing public methods wich are called from the ViewControllers.
Other interesting part of PhotoSearcher are the files SessionManager and Service. Service file is a protocol which has the necessary properties to create a web service such as url, request type, content type, time out, etc. SessionManager is a class that use objects which implements Service protocol and is the one in charge of making the request using URLSession. Also there is ServiceTracker file which is a class that will print all the logs of the requests. More detailed information can be found on the header comments of these classes. SessionManager, Service and ServiceTracker are designed in such a way can be reused on other projects which requires web services calls, just drag and drop these three files.
This way, using MVVM and POP escalete PhotoSearcher is very simple. If more APIs are added just create a class which implements Service protocol with the information of the web service and another class which implements Photo protocol for the model object.
The naming convention follows the Apple guidelines so it is very easy to understand what does all the methods and classes of PhotoSearcher.
- Search history using core data, including CRUD operations
- Images can be saved or shared
MIT License
Copyright (c) 2016 Rogelio Martinez Kobashi
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.
