Buglife / Buglife-iOS

Awesome bug reporting for iOS apps
Apache License 2.0
509 stars 63 forks source link

Can't Set Invocation Option to None #17

Closed merktassel closed 8 years ago

merktassel commented 8 years ago

We've decided to switch from using a floating button to manually triggering bug reports. This of course means setting Buglife.sharedBuglife().invocationOptions = .None as shown on your documentation.

Previous AppDelegate.swift (Truncated)

...

import Buglife

@UIApplicationMain
class AppDelegate: ..., BuglifeDelegate {

    ...

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

        ...

        // Setup Bug Reporting
        Buglife.shared().start(withAPIKey: "xxx")
        Buglife.shared().invocationOptions = [.floatingButton]
        Buglife.shared().delegate = self

        ...

        // Finish Setup
        return true
    }

...

However, this doesn't seem to be working:

Attempt 1 Code: swift Buglife.sharedBuglife().invocationOptions = .None Error: 'None' has been renamed to 'none'

Attempt 2 Code: swift Buglife.sharedBuglife().invocationOptions = .none Error :'none' is unavailable: use [:] to construct an empty option set

Attempt 3 Code: swift Buglife.sharedBuglife().invocationOptions = [:] Error: Contextual type 'LIFEInvocationOptions' cannot be used with dictionary literal

Attempt 4 Code: swift Buglife.sharedBuglife().invocationOptions = [.None] Error: 'None' has been renamed to 'none'

Attempt 5 Code: swift Buglife.sharedBuglife().invocationOptions = [.none] Error: 'none' is unavailable: use [:] to construct an empty option set

As you can see, for some strange reason we can utilize every invocation option enumerated by LIFEInvocationOptions except for none. I'm using Swift 3 with Xcode 8. Any ideas?

merktassel commented 8 years ago

After some further investigation we decided to make a sixth attempt: Buglife.shared().invocationOptions = []. It now works perfectly! However, the documentation should probably be updated to reflect this new syntax.

schukin commented 8 years ago

Thanks! Documentation has been updated accordingly. The rest of our docs should be updated for Swift 3 shortly :)

merktassel commented 8 years ago

Awesome, thanks! I just reviewed the new invocation options and did notice one slight error though: the third invocation option (floating button) has two Swift 2 examples. It looks like the second example just wasn't incremented to Swift 3.