MediaGallery models a list of GalleryDate-based sections (in practice, months), each of which has a certain number of items. Sections are loaded on demand (that is, there may be newer and older sections that are not in the model), and always know their number of items. Items are also loaded on demand, potentially non-contiguously. This model is designed around the needs of UICollectionView (a thread's All Media view), but it also supports flat views of media (swiping between items in the media detail view, which can cross album boundaries). This model is a result of refactoring I did last year to improve the performance and UX of the All Media view, but the implementation in MediaGallery.swift is entangled with the actual attachments and messages in the database, making it hard to test. This commit pulls the state management part out into its own struct, MediaGallerySections, which wraps the OrderedDictionary of items-by-section. Our MediaGalleryItem model references TSAttachmentStream directly and our queries go straight to the database, so to avoid having to set up real attachments in testing, MediaGallerySections is generic over a loader (delegate? data source?) of items with "gallery dates" and unique IDs. Now all the basic section- and item-loading APIs can be unit-tested. |
||
|---|---|---|
| .github | ||
| fastlane | ||
| Instruments | ||
| Pods@76e1e21283 | ||
| Scripts | ||
| Signal | ||
| Signal.xcodeproj | ||
| Signal.xcworkspace | ||
| SignalMessaging | ||
| SignalNSE | ||
| SignalServiceKit | ||
| SignalShareExtension | ||
| SignalUI | ||
| SignalUITests | ||
| ThirdParty | ||
| .clang-format | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| .ruby-version | ||
| .swiftlint.yml | ||
| .xcode-version | ||
| BUILDING.md | ||
| CONTRIBUTING.md | ||
| Gemfile | ||
| Gemfile.lock | ||
| Jenkinsfile | ||
| LICENSE | ||
| MAINTAINING.md | ||
| Makefile | ||
| Podfile | ||
| Podfile.lock | ||
| README.md | ||
| SignalServiceKit.podspec | ||
Signal iOS
Signal is a free, open source, messaging app for simple private communication with friends.
Also available on Android and Desktop.
Questions?
For troubleshooting and questions, please visit our support center or unofficial community forum.
Contributing Bug Reports
We use GitHub for bug tracking. Please search existing issues and create a new one if the issue is not yet tracked. For Android users, please use the Signal for Android issue tracker.
Contributing Translations
Help us translate Signal! The translation effort happens on Transifex.
Contributing Code
Instructions on how to setup your development environment and build Signal-iOS can be found in BUILDING.md. Other useful instructions for development can be found in the Development Guide wiki page. We also recommend reading the contribution guidelines.
Contributing Ideas
Have something you want to say about Signal Foundation projects or want to be part of the conversation? Get involved in the community forum.
Cryptography Notice
This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.
The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.
License
Licensed under GPLv3
Copyright 2014-2022 Open Whisper Systems
Apple and the Apple logo are trademarks of Apple Inc., registered in the U.S. and other countries. App Store is a service mark of Apple Inc., registered in the U.S. and other countries.