Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for UIKit #2

Open
bircni opened this issue Jun 3, 2023 · 3 comments
Open

Example for UIKit #2

bircni opened this issue Jun 3, 2023 · 3 comments

Comments

@bircni
Copy link

bircni commented Jun 3, 2023

I suggest adding an example how to use it in UIKit - I did it like this:
In the main class I initialize aptabase and it just works:

    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
        Aptabase.shared.initialize(appKey: "")
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
         Aptabase.shared.initialize(appKey: "")
    }
@goenning
Copy link
Member

goenning commented Jun 3, 2023

That's a good suggestion, I'm not too familiar with UIKit, so I need to experiment a bit.

In your example you have called initialize twice. Is that really needed? Have you tried initialising it on AppDelegate?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        Aptabase.shared.initialize(appKey: "")
        return true
    }

@bircni
Copy link
Author

bircni commented Jun 3, 2023

no but this should work i guess

@bircni
Copy link
Author

bircni commented Aug 27, 2023

it depends on how init is called...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants