Last active
June 27, 2024 14:25
-
-
Save superarts/6786c583a63c5a7dfa6b to your computer and use it in GitHub Desktop.
MBProgressHUD+Parse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let obj = PFObject(className: "sg_text") | |
obj.setObject(text_view!.text, forKey: SG.const.text) | |
MBProgressHUD.show("Analyzing...", view:view) | |
obj.saveInBackgroundWithBlock({ | |
(success: Bool?, error: NSError?) in | |
MBProgressHUD.hideAllHUDsForView(self.view, animated:true) | |
if error == nil { | |
LF.log("TEXT saved", obj) | |
} else { | |
MBProgressHUD.show(error!.localizedDescription, view:self.view, duration:2) | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var query = PFQuery(className: "sg_question") | |
MBProgressHUD.show("Initializing...", view:view) | |
query.getObjectInBackgroundWithId(question.objectId, block:{ | |
(object: PFObject?, error: NSError?) in | |
MBProgressHUD.hideAllHUDsForView(self.view, animated:true) | |
if error == nil { | |
LF.log("QUESTION loaded", object) | |
} else { | |
LF.log("QUESTION failed", error) | |
MBProgressHUD.show(error!.localizedDescription, view:self.view, duration:2) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment