{"id":18544506,"url":"https://github.com/instructure/canvas-ios","last_synced_at":"2025-04-13T20:43:15.072Z","repository":{"id":37458309,"uuid":"171557612","full_name":"instructure/canvas-ios","owner":"instructure","description":"Canvas iOS apps","archived":false,"fork":false,"pushed_at":"2025-04-09T14:10:41.000Z","size":385598,"stargazers_count":909,"open_issues_count":9,"forks_count":123,"subscribers_count":83,"default_branch":"master","last_synced_at":"2025-04-09T15:25:05.058Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/instructure.png","metadata":{"files":{"readme":".github/README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-19T22:06:53.000Z","updated_at":"2025-04-09T11:57:14.000Z","dependencies_parsed_at":"2023-09-22T20:13:14.677Z","dependency_job_id":"3b3ea0ec-e1f6-4d9c-a977-3d50303b9b5e","html_url":"https://github.com/instructure/canvas-ios","commit_stats":null,"previous_names":[],"tags_count":237,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fcanvas-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fcanvas-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fcanvas-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instructure%2Fcanvas-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instructure","download_url":"https://codeload.github.com/instructure/canvas-ios/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248782283,"owners_count":21160716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T20:16:43.790Z","updated_at":"2025-04-13T20:43:15.017Z","avatar_url":"https://github.com/instructure.png","language":"Swift","funding_links":[],"categories":["iOS Apps (Search Results)"],"sub_categories":[],"readme":"# Canvas iOS Apps\n\n- [Student](https://itunes.apple.com/us/app/canvas-student/id480883488?mt=8)\n- [Teacher](https://itunes.apple.com/us/app/canvas-teacher/id1257834464?mt=8)\n- [Parent](https://itunes.apple.com/us/app/canvas-parent/id1097996698?mt=8)\n\n\n## Getting Started on Development\n\n1. Clone the repository\n\n```sh\ngit clone git@github.com:instructure/canvas-ios.git\n```\n\n2. Install Homebrew\n\n```sh\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n```\n\n3. CD to the project root folder to install project dependencies defined in the `Brewfile`\n\n```sh\nmake provision\n```\n\n4. CD to the project root folder to generate project files and build yarn dependencies\n```sh\nmake sync\n```\n\n### Troubleshooting\n\n#### make sync error\nIf you run into the error *xcrun: error: SDK \"iphoneos\" cannot be located`.*\n\nSet Xcode Command Line Tools: \n```sh\n sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer\n```\n\n#### NPM error\nIf you have an NPM related error try installing watchman directly. \n```sh\nbrew install watchman\n```\n\nand then run \n```sh\nsudo launchctl limit maxfiles 16384 16384 \u0026\u0026 ulimit -n 16384\n```\n\n### Secrets\n\nAny static keys, tokens, passwords, or other secrets that need to be available in the app bundle should be added as a case to `Secret.swift`.\n\nThe secrets necessary for a particular build are generated as data assets using a script.\n\n```sh\nyarn build-secrets \"studentPSPDFKitLicense=token1\" \"teacherPSPDFKitLicense=token2\"\n```\n\nYou will need to purchase PSPDFKitLicenses to distribute custom apps. Instructure's licenses are only used for official builds and are not included in the repository.\n\n## Contributing Guiding Principles\n\n### Simple\n\nWriting an app is complex. Decisions made from the beginning have a big impact on the end result.\n\nWe strive to maintain a simple architecture that is easy to understand and pick up. Someone familiar with the platform should be productive within a single day.\n\nCode should be self-documenting and easy to follow.\n\n```\nUgly code is easy to recognize and its cost is easy to estimate. Neither is true for a wrong abstraction.\n- Dan Abramov\n```\n\n### Easy to Debug\n\nSurprise! Apps have bugs. Industry average is 15-50 defects per 1000 lines of code.\n\nWe build our apps in a way that makes finding and fixing issues is as easy as possible.\n\n### Testable\n\nWriting code in a testable way is paramount for long term success. These apps are built in a way that makes our unit testing surface as large as possible.\n\n### Conventions\n\nWe make and keep strong [conventions](./guidelines/CONVENTIONS.md) in order to reduce mental overhead.\n\nWe adhere to our [Swift Style Guide](./guidelines/swift-style-guide.md).\n\n### No Tricky Stuff\n\nWe do things the Apple prescribed way because it offers the best long term predictability with minimal maintenance.\n\n### Fat Model, Thin Controller\n\nModels \u0026 Presenters handle as much of the business logic as possible. This allows a wide unit testing surface. Views \u0026 View Controllers should be as small as possible.\n\n### Predictable\n\nBy scrutinizing each dependency we bring in, the code we write is our responsibility. Unit tests are a key portion of the code we write, so as time passes, the code that worked 2 years ago still works today.\n\n### Automation\n\nWe don't do any manual QA of our products. We write code that tests our apps for us.\n\n### Prune Legacy Code\n\n😬 One day React Native, Cocoapods, and other old frameworks will be fully replaced by the swift architecture in Core. Eventually. Hopefully. 🤞\n\n\n## Using the Canvas Apps\n\n### How to connect to a local canvas instance or a Portal instance\nhttps://instructure.atlassian.net/wiki/spaces/MOBILE/pages/563937366/Manual+Oauth+Login+Bypassing+mobile+verify\n\nIf you are connecting to a portal instance you must be connected to the VPN. This requires Full VPN tunnel and not just the typical Employee VPN connection. After you hit connect in the Cisco VPN client to connect to vpn.instructure.com there will be a drop down where you can select Full Tunnel\n\n### Generating icons from [instructure.design](https://instructure.design/#iconography)\n\nMost, if not all of the icons used in the Canvas apps can be found in instructure-icons, but are defined as React components, SVG, \u0026 Sketch files. Since iOS does not handle SVG files in UIImageViews natively, these are converted to PDF.\n\n```sh\nyarn build-icons\n```\n\n### Generating code coverage report\n\nYou can generate code coverage reports with `yarn coverage --scheme \u003cSCHEME\u003e`\n\n#### Student\n```bash\nyarn coverage --scheme Student\n```\n\n#### Core\n```bash\nyarn coverage --scheme Core\n```\n\nTo run tests first use `yarn test`\n```bash\nyarn test --scheme Core\n```\n\n| Option | Description |\n| ------ | ----------- |\n| scheme  | The scheme to run against  |\n| os  | Specify simulator os. Only available when running tests  |\n\n\n## Open Source Licenses Used\n\nWe have a script that should ensure the correct license header comments are in place:\n\n```sh\nyarn update-headers\n```\n\n#### Our applications are licensed under the AGPLv3 License.\n\n```\nThis file is part of Canvas.\nCopyright (C) 2019-present  Instructure, Inc.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as\npublished by the Free Software Foundation, either version 3 of the\nLicense, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n```\n\n## MDM Configurations\n\nMDM Profile settings are saved in `UserDefaults.standard` and keyed by\n`com.apple.configuration.managed`.\nThese logins are added to the list of previous logins on the start screen.\n\nUse our `MDMManager` to observe changes such as managed logins.\n\nYou can test this locally with command line arguments.\n\n`Scheme` \u003e `Edit Scheme` \u003e `Run` \u003e `Arguments` \u003e `Arguments Passed on Launch`\n\n```\n-com.apple.configuration.managed '\u003cdict\u003e\u003ckey\u003eenableLogin\u003c/key\u003e\u003ctrue/\u003e\u003ckey\u003eusers\u003c/key\u003e\u003carray\u003e\u003cdict\u003e\u003ckey\u003ehost\u003c/key\u003e\u003cstring\u003ecanvas.instructure.com\u003c/string\u003e\u003ckey\u003eusername\u003c/key\u003e\u003cstring\u003estudent\u003c/string\u003e\u003ckey\u003epassword\u003c/key\u003e\u003cstring\u003eCanvas2019\u003c/string\u003e\u003c/dict\u003e\u003c/array\u003e\u003c/dict\u003e'\n```\n\nChange the `username`, `password`, and `host` to your test credentials. You can also add `host` and `authenticationProvider` strings to the top level dict to skip the \"Find my school\" screen during login.\n\n## Xcode Templates\n\nXcode templates can be found under the `./.github/templates` directory. Copy the contents of that directory to `~/Library/Developer/Xcode/Templates/`. Run `make sync` to update your project after you have created your files from these templates.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstructure%2Fcanvas-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstructure%2Fcanvas-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstructure%2Fcanvas-ios/lists"}