Skip to content

doubleencore/MPA-Horatio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Horatio

Introduction

Horatio is a library of patterns, protocols, and classes typical for the "skeleton" of a modern app. This includes:

  1. Operations queue with conditions, observers, and improved error handling (based on Apple’s "Advanced NSOperations" sample code).
  2. HTTP requests for standard REST services.
  3. An injection container.
  4. A feature availability system for global or per-subject behaviors.

By implementing concrete implementations of various protocols, you can quickly implement complex, testable network apps.

Horatio relies on the Advanced NSOperations sample code from Apple.

This document contains the following sections:

  1. Requirements
  2. Setup
  3. Documentation
  4. Troubleshooting
  5. Contributing
  6. Contributor License
  7. Contact
  8. Future Work

1. Requirements

Horatio is delivered as Swift 3.1 source files. Due to Swift’s current lack of ABI-compatibility, there is no pre-compiled framework delivery for it at the moment.

Horatio requires compilation against iOS SDK 9.0 or higher.

2. Setup

2.1 Download the source

  1. Download the latest MPA-Horatio framework, provided as source files.

2.2 Copy the SDK into your projects directory in Finder

Typically, 3rd-party libraries reside inside a folder in your Xcode project (for example purposes, we assume your folder is called "Vendor"). Create a folder and copy the SDK source files into it (the Demo source files are not part of the main SDK, but could be copied into your app as a starting point for various behaviors and patterns beyond that which is provided by the SDK itself).

2.4 Add the SDK to the project in Xcode

We recommend to use Xcode's group-feature to create a group for 3rd-party-libraries similar to the structure of our files on disk. For example, similar to the file structure in 2.2 above, our projects have a group called Vendor.

  1. Make sure the Project Navigator is visible (⌘+1).
  2. Drag & drop Horatio.xcodeproj from your Finder to the Vendor group in Xcode using the Project Navigator on the left side.

2.4 Modify Code

  1. Open your AppDelegate.swift file.
  2. Search for the method
application(application: UIApplication, didFinishLaunchingWithOptions launchOptions:[NSObject: AnyObject]?) -> Bool
  1. Add the following lines to create a shared Container for use throughout your application:
Container.register(OperationQueue.self) { _ in OperationQueue() }

In addition, register Services, Bridges, Feeds, etc. Typically, you'll provide a startup manager class to handle the startup sequence.

3. Documentation

Documentation for Horatio can be found on (TBD).

5.Troubleshooting

iTunes Connect rejection

Make sure none of the following files are added to any target:

  • CalendarCondition.swift (except if your app asks for permission to access the user’s calendar)
  • CloudCondition.swift (except if your app includes the CloudKit entitlement and at least one CloudKit container)
  • HealthCondition.swift (except if your app includes the HealthKit entitlement)
  • PassbookCondition.swift (except if your app uses Passbook API)
  • PhotosCondition.swift (except if your app asks for permission to access the user’s Photos data)
  • UserNotificationCondition.swift (except if your app includes the Push entitlement and has a valid APNS certificate for its bundle)

In the framework version of the project, these files are under the Optional group, and are not compiled by default into the generated framework.

5. Contributing

We're looking forward to your contributions via pull requests.

Development environment

  • Mac running the latest version of OS X
  • Get the latest Xcode from the Mac App Store

6. Contributor License

You must sign a Contributor License Agreement (TBD).

7. Contact

If you have further questions or are running into trouble that cannot be resolved by any of the steps here, feel free to open a Github issue here, contact us at support@mudpotapps.com.

8. Future Work

Horatio's roadmap is somewhat flexible, based on contributor's needs at any given point. Currently, the following items are being tackled in experimental branches for inclusion at a later date:

  • Finishing the demo app, including documenting the app startup code.
  • Moving the Startup Sequence feature into the framework.
  • Moving the Environment/Config work into the framework.
  • Adding stacks and updates to Features.
  • Better pipelining of fetched files for faster and lower battery profile parsing.
  • Rewritten operations system based on Javascript's Promises system.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 98.8%
  • Other 1.2%