- The user enters the URL of a text file, a filter for selecting lines, and starts the download (for example, by pressing a button).
- The application loads the file, selects lines that meet the filter criteria, and displays them in a list.
Assume that the text file is an ANSI text file (no need to rely on UTF-8). Line selection is based on the conditions of a simple regexp (at least the * and ? operators):
- The '*' symbol represents a sequence of any characters of unlimited length;
- The '?' symbol represents any single character;
- Masks such as Some, Some, Some, **Some should work correctly — there are no restrictions on the position of * in the mask.
For example:
- The mask abc selects all lines containing abc, starting and ending with any sequence of characters.
- The mask abc* selects all lines starting with abc and ending with any sequence of characters.
- The mask abc? selects all lines starting with abc and ending with any additional character.
- The mask abc selects all lines that are equal to this mask.
- Use Objective C or Swift - author's choice.
- Text processing (and displaying results) should be done as each new portion of data is loaded. It is not recommended to download the entire file and then process it.
- The size of the original text file (and possibly the results) can be hundreds of megabytes.
- Memory usage should be minimal (within reasonable limits).
- Parsing results should be written to a results.log file in the application directory.
- The result should be presented as a list (UITableView \ UICollectionView).
- The code must be absolutely "bulletproof" and protected from errors.
- The code should be as simple as possible;
- The code should be clean, beautiful, and understandable;
- The result should be a ready-to-use application project in a ZIP archive.