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

Add edit #5

Closed
wants to merge 1 commit into from
Closed

Add edit #5

wants to merge 1 commit into from

Conversation

VicV
Copy link

@VicV VicV commented Dec 19, 2016

Just opens the current selected file.

Caveat: Some of the pre-existing plists (the ones you've made default) don't seem to open.

Can't figure out why but I gotta run for now. Will check it later if you haven't.

For #4


@IBAction func editCurrentScale(_ sender: Any) {
let currentScale = preferences.scales.value[statusBarStylePopUp.indexOfSelectedItem]
NSWorkspace.shared().open((FileManager.default.applicationSupportDirectory?.appendingPathComponent(currentScale.fileName))!)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to avoid force unwrapping anything in this project, could you restructure this code with a guard to maybe look something like the following:

guard let fileURL = FileManager.default.applicationSupportDirectory?.appendingPathComponent(currentScale.fileName) else {
    return
}

NSWorkspace.shared().open(fileURL)

@brianmichel
Copy link
Owner

@VicV is this still something you're interested in? If not I can add it to my backlog.

@brianmichel
Copy link
Owner

Closing due to inactivity.

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

Successfully merging this pull request may close these issues.

2 participants