For option 2...
...you could consider using Swift Package Manager, to make a number of separate self-contained modules.
Each App would be it's own Xcode project, and could include whichever Swift Packages it requires.
Of course, you could use a single Swift Package, for all the shared code.
But I would lean towards using a number of packages, each with a clearly-defined purpose.
I find the modular approach cleaner, and easier to maintain.
Post
Replies
Boosts
Views
Activity
No, this is not possible.
Also, your Caps Lock key appears to be stuck.
Reported as spam.
Instead of:
let decodedResponse = try JSONDecoder().decode(Response.self, from: data)
try:
let decodedResponse = try JSONDecoder().decode([Response.self], from: data)
Tip:
To help people understand your code, paste it into a code block (using "Paste and Match Style")
-(void)viewDidLoad {
UIApplication *applicaiton = [UIApplication sharedApplication];
if (applicaiton.applicationState == UIApplicationStateActive) {
if (@available(iOS 14, *)) {
ATTrackingManagerAuthorizationStatus status = [ATTrackingManager trackingAuthorizationStatus];
if (status == ATTrackingManagerAuthorizationStatusNotDetermined) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
// Tracking authorization completed. Start loading ads here.
[[NSOperationQueue mainQueue] addOperationWithBlock:^ {
[[GADMobileAds sharedInstance] startWithCompletionHandler:nil];
}];
}];
}
} else {
[[GADMobileAds sharedInstance] startWithCompletionHandler:nil]; // Fallback on earlier versions
}
}
[super viewDidLoad];
}
Did you add the NSUserTrackingUsageDescription key to your info.plist?
e.g.
<key>NSUserTrackingUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to tracking information.</string>
Also, it's probably best not to put the tracking request in your viewDidLoad, as the UI hasn't finished laying-out at this point.
Might be better to have it in viewDidAppear, or on a button action.
Also Also...
The system-permission alert will only show when the app’s tracking authorization status is .notDetermined
Once the authorization status is set, calling the function will just trigger the completion handler without showing the alert
The alert will not be displayed if “Allow Apps to Request to Track” is turned off in the system privacy settings
the notification is sent each time the user goes to the view controller.
The notification is scheduled in viewDidLoad.
This suggests that when you leave firstViewController, it is destroyed.
So when you re-visit it, it is recreated, and the notification is scheduled again.
You don't include the supporting code, showing how firstViewController is instantiated...
... so you could either:
Keep firstViewController in memory, so it is not repeatedly created and destroyed
or
Save a Bool flag somewhere permanent (e.g. in your Data Model, or in the calling ViewController), to record that the notification has been scheduled (and test this flag, before scheduling the notification)
Tip: the class "firstViewController" should really be named with a capital first letter: "FirstViewController"
For a more general solution, in your PreviewProvider:
create an instance of the type you are using (Root)
configure it (if necessary)
pass it to RootView
struct RootView_Previews: PreviewProvider {
static var previews: some View {
let root = Root()
/// configure root, if necessary, e.g. root.register = 5
return RootView(rootToView: root)
}
}
Your init does not initialize your var "show".
Hence the message "Return from initializer without initializing all stored properties".
If you are thinking of using the App Store, you might want to consider "Unlisted" app distribution.
See here: https://developer.apple.com/support/unlisted-app-distribution/
You might want to consider App Store "Unlisted" app distribution.
See here: https://developer.apple.com/support/unlisted-app-distribution/
Like the error message says, you cannot compare an Int and a Bool for equality.
Instead of
if currentHR == isInTarget {
Try
if isInTarget {
And later, use:
} else if isBelowTarget {
Using the iPad mini (6th generation) is a complication here, as it uses a different (smaller) screen size than any previous iPad.
Could it be that your code does not take account of this?
Do you get the same crash on a "normal" (or larger) iPad?
System Preferences > Security & Privacy > Privacy > Location Services
Allow the apps and services below to determine your location.
Choose the app, and untick it's permission.
Show your code.