Skip to content

Adding a hasAppBeenUpdated property #21

@ChocoChipset

Description

@ChocoChipset

I came across the following scenario:

I have a cache file that I would like to flush on every app update. With the current implementation MTMigration it currently looks like:

[MTMigration applicationUpdateBlock:^{
    flushCache();
}];

if (isCacheAvailable) {    // (1)
    loadCache();
} else {
    writeCache();
}

However, unless a synchronization method is introduced, there is no guarantee that the cache file will be flushed before (1).

Adding a hasAppBeenUpdated property would allow the synchronous execution of code in an easier way:

if (isCacheAvailable && 
    [MTMigration hasAppBeenUpdated] == NO) {
    loadCache();
} else {
    writeCache();
}

Let me know what you think, @pwightman

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions