Skip to content

Latest commit

 

History

History
69 lines (47 loc) · 3.46 KB

README.md

File metadata and controls

69 lines (47 loc) · 3.46 KB

Volume - Cornell News

Volume is one of the latest applications by Cornell AppDev, an engineering project team at Cornell University focused on mobile app development. Volume aims to amplify the voice of student publications, helping them reach a broader audience. Download the current release on the App Store!


System Requirements

You must have at least Xcode 14.0, iOS 15.0, and Swift 5.5 to run this app.

Dependencies

This app uses Swift Package Manager for dependencies.

Getting Started

  1. Clone the repository.
  2. Create a VolumeSecrets folder in the root directory and drag the following four files into FINDER (NOT Xcode). You must create this folder through Finder. For AppDev members, you can find these pinned in the #volume-ios Slack channel.
    • GoogleService-Info.plist
    • Secrets.plist
    • apollo-codegen-config-dev.json
    • apollo-codegen-config-prod.json
  3. Install Swiftlint with brew install swiftlint. As of SP24, there is a bug with SPM involving incompatible OS versions with package dependencies. Because the codebase uses SPM, we don't want to introduce CocoaPods, so Swiftlint will be installed via Homebrew.
  4. Open the Project, select Volume under Targets, then choose the Build Phases tab.
  • There should be a run script labeled SwiftLint. If not, create a New Run Script Phase with the following script:
if [[ "$(uname -m)" == arm64 ]]; then
    export PATH="/opt/homebrew/bin:$PATH"
fi

if which swiftlint >/dev/null; then
    swiftlint --fix && swiftlint
else
    echo "ERROR: SwiftLint not installed"
    exit 1
fi
  • The order in which the scripts are being ran matter! Make sure that the Crashlytics script is at the very bottom.
  1. Select the Volume schema to use our development server and Volume-Prod to use our production server.
  2. Generate the Apollo API:
  • Dev: ./apollo-ios-cli generate -p "VolumeSecrets/apollo-codegen-config-dev.json" -f
  • Prod: ./apollo-ios-cli generate -p "VolumeSecrets/apollo-codegen-config-prod.json" -f
  1. Build the project and you should be good to go.

Common Issues

  • If the API is not working properly, try manually generating the API with the CLI.

  • If VolumeAPI is not detected or if your new written queries/mutations are not generated by Apollo, make sure that the generated VolumeAPI folder is linked to both the main Volume and VolumeWidget targets. You can do this by simply deleting the VolumeAPI group via the project navigator on Xcode and dragging the generated VolumeAPI folder from Finder to Xcode.

Codebase Outline

  • Configs: the app environment settings, like production, staging, and development configurations.
  • Core: the app’s entry point and LaunchScreen.
  • Models: model objects used by the API and throughout the app.
  • Resources: the project assets, such as fonts.
  • Services: service helpers such as a Networking API service, CoreData, SwiftData, UserDefaults, etc.
  • Utils: other helper files such as constants, extensions, custom errors, etc.
  • ViewModels: our app’s view models which implement properties and commands to which the view can data bind to and notify the view of any state changes.
  • Views: the appearance and UI of the app.