Skip to content

Feature/ui save document#32

Merged
TomTasche merged 6 commits intoopendocument-app:developmentfrom
Metaxa007:feature/ui-save-document
Dec 8, 2019
Merged

Feature/ui save document#32
TomTasche merged 6 commits intoopendocument-app:developmentfrom
Metaxa007:feature/ui-save-document

Conversation

@Metaxa007
Copy link
Copy Markdown
Contributor

No description provided.

@Metaxa007 Metaxa007 changed the base branch from development to master December 2, 2019 20:18
@Metaxa007 Metaxa007 changed the base branch from master to development December 2, 2019 20:52
} else {
closeCurrentDocument()
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please remove blank lines at the end of a method

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@TomTasche fixed

} else {
self.dismiss(animated: true, completion: nil)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove blank line

return
}

doc.revert(toContentsOf: doc.fileURL, completionHandler: nil)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

need to look into why this is working. I don't get how this could work...

}

func saveContent() {
if let URL = document?.fileURL {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

would a guard be more appropriate (and readable) in this case?

}

func saveContent() {
if let URL = document?.fileURL {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lowercase variable name please


func saveContent() {
if let URL = document?.fileURL {
document?.save(to: URL, for: .forOverwriting) { success in
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

does this use the correct save-method? (i.e. goes back to CoreWrapper.backTranslate)

} else {
self.showToast(controller: self, message: "Error while saving", seconds: 1, color: .red)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove blank

}

}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove blank


completion?()
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

blaank

@TomTasche
Copy link
Copy Markdown
Member

Code looks good, thank you! Only very minor things where we have to agree on best practice...

Also needs some debugging of me / us to make sure everything is working as expected (see my comment on "document.save")

@TomTasche
Copy link
Copy Markdown
Member

TomTasche commented Dec 7, 2019

Thanks for the clarifications and fixes! A few more things before we can merge and release it:

General question: is the color of the alert toast if saving failed the standard color for such toasts? It really doesn't look like native iOS to me... I might be wrong though.

@Metaxa007
Copy link
Copy Markdown
Contributor Author

@TomTasche
Increased alert time to 1.5s. Not sure that blocking ui for too long is good for UX.
I use a regular UIColor.red. But i agree, it looks a bit weird. From my experience the default background color of alerts is rarely changed to some other one.

@TomTasche
Copy link
Copy Markdown
Member

As far as I can tell we are not blocking the main thread anyway because we're using asyncAfter?

Changes look good, will merge and release tomorrow!

@Metaxa007
Copy link
Copy Markdown
Contributor Author

i mean from user perspective: during these > 1 sec he can not interact with the app, what in my opinion can have a negative effect on user experience.

@TomTasche
Copy link
Copy Markdown
Member

Oh I see, didn't know that. 1.5s should be fine then

@TomTasche TomTasche merged commit 0012654 into opendocument-app:development Dec 8, 2019
@TomTasche
Copy link
Copy Markdown
Member

FYI, made one more followup commit: 84f4939

Pushing release to App Store now.

@TomTasche TomTasche mentioned this pull request Dec 8, 2019
2 tasks
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