/Simplified-iOS

The iOS client for Library Simplified

Primary LanguageObjective-CApache License 2.0Apache-2.0

SimplyE Build

License

SimplyE and Open eBooks

This repo contains the client-side code for the New York Public Library's SimplyE and Open eBooks apps.

The 2 apps share most of the code base. App-specific source files will have a SE / OE prefix or suffix, while configuration files reside under the SimplyE and OpenEbooks directories at the root of the repo.

Consequently, releases in this repo track both apps. However, you won't see any Open eBooks versions before 1.9.0 because historically Open eBooks lived in a separate repo. Releases that lack an app specifier, i.e. any version before v3.6.2, are SimplyE releases.

System Requirements

  • Install Xcode 11.5 in /Applications, open it and make sure to install additional components if it asks you. (We have not upgraded to Xcode 12 yet because of issues related to Carthage.)
  • Install Carthage if you haven't already. Using brew is recommended.

Building without Adobe DRM nor Private Repos

git clone git@github.com:NYPL-Simplified/Simplified-iOS.git
cd Simplified-iOS
git checkout develop

# one-time set-up
./scripts/setup-repo-nodrm.sh

# idempotent script to rebuild all dependencies
./scripts/build-3rd-party-dependencies.sh --no-private

Open Simplified.xcodeproj and build the SimplyE-noDRM target.

Building With Adobe DRM

Building the Application from Scratch

  1. Contact project lead and ensure you have access to all the required private repos.
  2. Then simply run:
git clone git@github.com:NYPL-Simplified/Simplified-iOS.git
cd Simplified-iOS
./scripts/bootstrap-drm.sh
  1. Open Simplified.xcodeproj and build the SimplyE or Open eBooks targets.

Building Dependencies Individually

After bootstrapping, it's unlikely you'll need to do that again, because the DRM dependencies very rarely change.

More common is the case of needing to update/rebuild the 3rd party dependencies managed by Carthage. To that end (and more), the scripts directory contains a number of scripts to rebuild them and perform other build/setup tasks from the command line, such as archiving and exporting. All these scripts must be run from the root of the Simplified-iOS repo, not from the scripts directory.

For instance, to build all 3rd party dependencies minus DRM:

./scripts/build-3rd-party-dependencies.sh

In the rare event you need to build DRM-related dependencies, you can use the adobe-rmsdk-build.sh script.

Building Secondary Targets

The Xcode project contains 2 additional targets beside the main one referenced earlier and the unit tests:

  • SimplyECardCreator: This is a convenience target to use when making changes to the CardCreator-iOS framework. It takes the framework out of the normal Carthage build to instead build it directly via Xcode. Use this in conjunction with the SimplifiedCardCreator workspace. It requires DRM.
  • Open eBooks: This is an app primarily targeted toward the education space. It requires DRM.

Contributing

This codebase follows Google's Swift and Objective-C style guides, including the use of two-space indentation. More details are available in our wiki.

The primary services/singletons within the program are as follows:

  • AccountsManager
  • NYPLUserAccount
  • NYPLBookRegistry
  • NYPLMyBooksDownloadCenter
  • NYPLSettings
  • NYPLKeychain

Most of the above contain appropriate documentation in the header files.

The rest of the program follows Apple's usual pattern of passive views, relatively passive models, and one-off controllers for integrating everything. Immutability is preferred wherever possible.

Questions, suggestions, and general discussion occurs via Slack: Email swans062@umn.edu for access.

License

Copyright © 2015-2020 The New York Public Library, Astor, Lenox, and Tilden Foundations

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.