Skip to content

Commit c970bce

Browse files
committed
feat: improve settings onboarding, and show on tweak update
1 parent 718e817 commit c970bce

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/Settings/SCISettingsViewController.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@ - (void)viewDidLoad {
6060
[self.view addSubview:self.tableView];
6161
}
6262

63+
- (void)viewWillDisappear:(BOOL)animated {
64+
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"SCInsta Settings Info"
65+
message:@"In the future: Hold down on the three lines at the top right of your profile page, to re-open SCInsta settings."
66+
preferredStyle:UIAlertControllerStyleAlert];
67+
68+
[alert addAction:[UIAlertAction actionWithTitle:@"I understand!"
69+
style:UIAlertActionStyleDefault
70+
handler:nil]];
71+
72+
UIViewController *presenter = self.presentingViewController;
73+
[presenter presentViewController:alert animated:YES completion:nil];
74+
}
75+
6376
#pragma mark - UITableViewDataSource
6477

6578
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

src/Tweak.x

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ BOOL dmVisualMsgsViewedButtonEnabled = false;
4747

4848
// Open settings for first-time users
4949
if (
50-
[[NSUserDefaults standardUserDefaults] objectForKey:@"SCInstaFirstRun"] == nil
50+
![[[NSUserDefaults standardUserDefaults] objectForKey:@"SCInstaFirstRun"] isEqualToString:SCIVersionString]
5151
|| [SCIUtils getBoolPref:@"tweak_settings_app_launch"]
5252
) {
5353
NSLog(@"[SCInsta] First run, initializing");
@@ -60,9 +60,8 @@ BOOL dmVisualMsgsViewedButtonEnabled = false;
6060

6161
[rootController presentViewController:navigationController animated:YES completion:nil];
6262

63-
// Done with first-time setup
64-
[[NSUserDefaults standardUserDefaults] setValue:@"SCInstaFirstRun" forKey:@"SCInstaFirstRun"];
65-
63+
// Done with first-time setup for this version
64+
[[NSUserDefaults standardUserDefaults] setValue:SCIVersionString forKey:@"SCInstaFirstRun"];
6665
}
6766

6867
NSLog(@"[SCInsta] Cleaning cache...");

0 commit comments

Comments
 (0)