Git Product home page Git Product logo

safariextension's Introduction

Design:

The app has basically two tagets. One is the iOS app and the other is the share extension. Application uses the Realm as the database. This descision has been made, since realm is very fast and safe once we want to deal with database and also for this technical test since I am using App Groups(more on this later) it was faster/better to use Realm instead myself implementing the Archiving/unArchiving for the Entites. As mentioned above and since this issue came up in our first interview, I have used App Groups. As you might know App Groups allows applications to share data with their extenstions. The data is consistent and it is in realtime.

How To run the App:

Since the app uses Cocoapods first before opening the project please run pod install and then open the .xcworkspace file not the .xcodeproj. Also you might get couple of error since you have just installed a new pod. Please do a clean build first. The next step is to change the signing certificate in the project setting to your own certificate (this needs to be set in order to use App Groups otherwise the app wouldn't work). Then you need to head to the Capabilities tap and add a new Group under the App Groups section and tick that. You need to the same for the extension target as well (otherwise your app will crash since they are sharing the same data container). Since you have changed the App Groups name you need to update it in the code as well. Please head to the SharedCommon folder in the project navigator and inside the Constants.swift file update the let groupId: String = "to the App Groups name that you just set. That is all. You now can run the app. You could either choose the extension schema and run it via safari or just run the iOS app and then open up the safari and try to do share.

Note:

I have also put a demo video of the app working in order you if you had difficulties setting up the environment. About prepopulating the URL as mentioned in the code, the TextView for SLComposeServiceViewController is only a get and it gets automatically populated by iOS with URL placeholder so we can't set the URL text to it however we extract the URL string and save it along with any other notes that the user put in the TextView

What would I have changed if I have more time:

Definitely adding some unit test. But in order to have that in place I would have start by creating my own frameworks based on the common code that is being shared between the extension and the main app. Nicer UI maybe :)

safariextension's People

Contributors

siavashalipour avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.