'Error appsflyer framework file not found at AppsFlyerLib/AppsFlyerLib.h on appdelegate

I have imported AppsFlyer framework using cocoapods in my project. I am adding the #import <AppsFlyerLib/AppsFlyerLib.h> in my AppDelegate.h but i see an error 'AppsFlyerLib/AppsFlyerLib.h' file not found. The weird thing is that the error goes away when i run the project and seems that it starts without any errors. startWithCompletionHandler correctly returns with no error. Is this some kind of bug? Anyone else experienced this behaviour? I am in xcode 13.3.1 and AppsFlyerFramework 6.5.2 . Any help or suggestion appreciated!

 [[AppsFlyerLib shared] startWithCompletionHandler:^(NSDictionary<NSString *,id> *dictionary, NSError *error) {
            if (error) {
                NSLog(@"%@", error);
                return;
            }
            if (dictionary) {
                NSLog(@"%@", dictionary);
                return;
            }
        }];


Solution 1:[1]

Your days assumes day equal 1 is days equal 1, (Monday) starting from the first month (and then progresses through the months, years). I don't think this will accurately calculate the count of Sundays that fall on the first of each month over the years.

If you enter the following code at the beginning of your program (and delete the line before your loop that says days = 1), it will correctly give the number of Sundays == 171. This will start out the day of week for the first day of the first month of the first year accurately.

from calendar import weekday
start, end = 1901, 2001
days = 1 + weekday(start, 1, 1)

Note that the weekday function uses zero based counting, (Monday through Sunday is 0 to 6) so that's why 1 is added to the result in the initialization of days. (Because your Monday to Sunday is 1 to 7).

Just to illustrate how the solution could find Sundays without iterating through every day of all the years:

from calendar import weekday

sundays = 0

for yr in range(1901, 2001):
    for month in range(1, 13):
        if weekday(yr, month, 1) == 6:
            sundays += 1

print(sundays) # prints 171

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1