-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve documentation, update README.md
- Loading branch information
1 parent
73ee20b
commit d05c703
Showing
42 changed files
with
62 additions
and
59 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"kind":"article","metadata":{"roleHeading":"Article","modules":[{"name":"GreenAlert"}],"role":"article","title":"Introduction"},"abstract":[{"text":"What is GreenAlert, and why should you use it?","type":"text"}],"sections":[],"hierarchy":{"paths":[["doc:\/\/GreenAlert\/documentation\/GreenAlert"]]},"schemaVersion":{"minor":3,"patch":0,"major":0},"primaryContentSections":[{"kind":"content","content":[{"type":"heading","text":"What is GreenAlert?","anchor":"What-is-GreenAlert","level":2},{"inlineContent":[{"text":"GreenAlert is a really useful way to use ","type":"text"},{"type":"codeVoice","code":"UIAlertController"},{"text":", using extensions.","type":"text"}],"type":"paragraph"},{"inlineContent":[{"text":"Let’s say you want to show a basic alert.","type":"text"}],"type":"paragraph"},{"inlineContent":[{"text":"Rather than writing this:","type":"text"}],"type":"paragraph"},{"code":["let alertController = UIAlertController(title: \"Title\", message: \"Message\")","","let okAction = UIAlertAction(title: \"OK\", style: .default) { _ in"," ()","}","","alertController.addAction(okAction)","","present(alertController, animated: true, completion: nil)"],"type":"codeListing","syntax":"Swift"},{"inlineContent":[{"type":"text","text":"You can write this:"}],"type":"paragraph"},{"syntax":"Swift","type":"codeListing","code":["UIAlertController.showBasicAlert(\"Title\", message: \"Message\")"]},{"type":"paragraph","inlineContent":[{"text":"Not a big enough difference for you? Okay, let’s suppose you’ve got a more complicated one.","type":"text"}]},{"inlineContent":[{"type":"text","text":"Instead of THIS:"}],"type":"paragraph"},{"code":["let alertController = UIAlertController(title: \"Title\", message: \"Message\")","","let cancelAction = UIAlertAction(title: \"Cancel\", style: .cancel) { _ in"," \/\/ handle Cancel","}","","let okAction = UIAlertAction(title: \"OK\", style: .default) { _ in"," \/\/ handle OK","}","","alertController.addAction(cancelAction)","alertController.addAction(okAction)","","present(alertController, animated: true, completion: nil)"],"type":"codeListing","syntax":"Swift"},{"inlineContent":[{"text":"Why not have this:","type":"text"}],"type":"paragraph"},{"code":["UIAlertController.showOKCancelAlert(\"Title\", message: \"Message\") { confirmed in"," \/\/ Handle OK or Cancel based on `confirmed` being true or false","}"],"syntax":"Swift","type":"codeListing"},{"type":"paragraph","inlineContent":[{"type":"text","text":"Or, if you’re using Swift Concurrency:"}]},{"type":"codeListing","code":["if await UIAlertController.showOKCancelAlert(\"Title\", message: \"Message\") {"," \/\/ User tapped OK!","}"],"syntax":"Swift"},{"inlineContent":[{"type":"text","text":"Now, isn’t that nicer?"}],"type":"paragraph"},{"inlineContent":[{"inlineContent":[{"type":"text","text":"But wait, there’s more."}],"type":"emphasis"}],"type":"paragraph"},{"inlineContent":[{"text":"With GreenAlert, you’re granted all sorts of ","type":"text"},{"type":"codeVoice","code":"UIAlertController"},{"text":" superpowers, including the following:","type":"text"}],"type":"paragraph"},{"items":[{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Customizations galore"}]},{"items":[{"content":[{"inlineContent":[{"type":"text","text":"SAFELY set alert style to action sheet, using enums to enforce the presence of source information."}],"type":"paragraph"},{"items":[{"content":[{"inlineContent":[{"type":"text","text":"I say “safely” here because you can easily crash an iPadOS app by creating an "},{"type":"codeVoice","code":".actionSheet"},{"type":"text","text":" and forgetting to set the "},{"type":"codeVoice","code":"popoverPresentationController"},{"type":"text","text":"‘s "},{"type":"codeVoice","code":"sourceView"},{"text":", ","type":"text"},{"code":"sourceRect","type":"codeVoice"},{"text":", or ","type":"text"},{"type":"codeVoice","code":"barButtonItem"},{"type":"text","text":". These crashes don’t occur on iPhones, and are therefore easy to miss if you don’t test throughly. Using GreenAlert eliminates these crashes."}],"type":"paragraph"}]}],"type":"unorderedList"}]},{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Custom button action icons, via SF Symbols (preferred) or a "},{"code":"UIImage","type":"codeVoice"}]}]}],"type":"unorderedList"}]},{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"Show prompts for values"}]},{"type":"unorderedList","items":[{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"With all the customizations listed above, but also including customizable:"}]},{"items":[{"content":[{"inlineContent":[{"text":"preset text","type":"text"}],"type":"paragraph"}]},{"content":[{"inlineContent":[{"type":"text","text":"placeholder"}],"type":"paragraph"}]},{"content":[{"inlineContent":[{"text":"keyboard type","type":"text"}],"type":"paragraph"}]}],"type":"unorderedList"}]}]}]},{"content":[{"inlineContent":[{"type":"text","text":"Add progress bars to alert controllers"}],"type":"paragraph"}]}],"type":"unorderedList"},{"type":"paragraph","inlineContent":[{"text":"…And even more!","type":"text"}]},{"inlineContent":[{"text":"So give it a shot! 😁","type":"text"}],"type":"paragraph"},{"inlineContent":[{"type":"text","text":"If you’re anything less than delighted, or have any ideas on how to improve GreenAlert, be sure to "},{"isActive":true,"identifier":"https:\/\/github.com\/JacobSyndeo\/GreenAlert\/issues","type":"reference"},{"type":"text","text":", and I’ll be sure to address it!"}],"type":"paragraph"},{"type":"paragraph","inlineContent":[{"text":"If you like GreenAlert, be sure to check out my other projects:","type":"text"}]},{"items":[{"content":[{"inlineContent":[{"type":"text","text":"🎆 "},{"isActive":true,"type":"reference","identifier":"https:\/\/github.com\/JacobSyndeo\/Ether"},{"type":"text","text":", a delightful and easy to understand networking library for Swift"}],"type":"paragraph"}]}],"type":"unorderedList"}]}],"variants":[{"paths":["\/documentation\/greenalert\/introduction"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/GreenAlert\/documentation\/GreenAlert\/Introduction","interfaceLanguage":"swift"},"references":{"doc://GreenAlert/documentation/GreenAlert":{"title":"GreenAlert","url":"\/documentation\/greenalert","type":"topic","role":"collection","kind":"symbol","identifier":"doc:\/\/GreenAlert\/documentation\/GreenAlert","abstract":[]},"https://github.com/JacobSyndeo/Ether":{"identifier":"https:\/\/github.com\/JacobSyndeo\/Ether","titleInlineContent":[{"text":"Ether","type":"text"}],"url":"https:\/\/github.com\/JacobSyndeo\/Ether","type":"link","title":"Ether"},"https://github.com/JacobSyndeo/GreenAlert/issues":{"identifier":"https:\/\/github.com\/JacobSyndeo\/GreenAlert\/issues","title":"open an issue","titleInlineContent":[{"type":"text","text":"open an issue"}],"type":"link","url":"https:\/\/github.com\/JacobSyndeo\/GreenAlert\/issues"}}} | ||
{"schemaVersion":{"major":0,"patch":0,"minor":3},"sections":[],"metadata":{"role":"article","roleHeading":"Article","modules":[{"name":"GreenAlert"}],"title":"Introduction"},"identifier":{"url":"doc:\/\/GreenAlert\/documentation\/GreenAlert\/Introduction","interfaceLanguage":"swift"},"primaryContentSections":[{"content":[{"text":"What is GreenAlert?","level":2,"anchor":"What-is-GreenAlert","type":"heading"},{"type":"paragraph","inlineContent":[{"type":"text","text":"GreenAlert is a really useful way to use "},{"code":"UIAlertController","type":"codeVoice"},{"type":"text","text":", using extensions."}]},{"type":"paragraph","inlineContent":[{"text":"Let’s say you want to show a basic alert.","type":"text"}]},{"type":"paragraph","inlineContent":[{"text":"Rather than writing this:","type":"text"}]},{"type":"codeListing","code":["let alertController = UIAlertController(title: \"Title\", message: \"Message\")","","let okAction = UIAlertAction(title: \"OK\", style: .default) { _ in"," ()","}","","alertController.addAction(okAction)","","present(alertController, animated: true, completion: nil)"],"syntax":"swift"},{"type":"paragraph","inlineContent":[{"type":"text","text":"You can write this:"}]},{"code":["UIAlertController.showBasicAlert(\"Title\", message: \"Message\")"],"type":"codeListing","syntax":"swift"},{"type":"paragraph","inlineContent":[{"text":"Not a big enough difference for you? Okay, let’s suppose you’ve got a more complicated one.","type":"text"}]},{"type":"paragraph","inlineContent":[{"type":"text","text":"Instead of THIS:"}]},{"type":"codeListing","syntax":"swift","code":["let alertController = UIAlertController(title: \"Title\", message: \"Message\")","","let cancelAction = UIAlertAction(title: \"Cancel\", style: .cancel) { _ in"," \/\/ handle Cancel","}","","let okAction = UIAlertAction(title: \"OK\", style: .default) { _ in"," \/\/ handle OK","}","","alertController.addAction(cancelAction)","alertController.addAction(okAction)","","present(alertController, animated: true, completion: nil)"]},{"type":"paragraph","inlineContent":[{"text":"Why not have this:","type":"text"}]},{"syntax":"swift","code":["UIAlertController.showOKCancelAlert(\"Title\", message: \"Message\") { confirmed in"," \/\/ Handle OK or Cancel based on `confirmed` being true or false","}"],"type":"codeListing"},{"type":"paragraph","inlineContent":[{"text":"Or, if you’re using Swift Concurrency:","type":"text"}]},{"syntax":"swift","code":["if await UIAlertController.showOKCancelAlert(\"Title\", message: \"Message\") {"," \/\/ User tapped OK!","}"],"type":"codeListing"},{"type":"paragraph","inlineContent":[{"type":"text","text":"Now, isn’t that nicer?"}]},{"inlineContent":[{"type":"emphasis","inlineContent":[{"type":"text","text":"But wait, there’s more."}]}],"type":"paragraph"},{"type":"paragraph","inlineContent":[{"text":"With GreenAlert, you’re granted all sorts of ","type":"text"},{"type":"codeVoice","code":"UIAlertController"},{"type":"text","text":" superpowers, including the following:"}]},{"items":[{"content":[{"inlineContent":[{"type":"text","text":"Customizations galore"}],"type":"paragraph"},{"type":"unorderedList","items":[{"content":[{"inlineContent":[{"type":"text","text":"SAFELY set alert style to action sheet, using enums to enforce the presence of source information."}],"type":"paragraph"},{"items":[{"content":[{"type":"paragraph","inlineContent":[{"text":"I say “safely” here because you can easily crash an iPadOS app by creating an ","type":"text"},{"type":"codeVoice","code":".actionSheet"},{"text":" and forgetting to set the ","type":"text"},{"code":"popoverPresentationController","type":"codeVoice"},{"type":"text","text":"‘s "},{"code":"sourceView","type":"codeVoice"},{"type":"text","text":", "},{"code":"sourceRect","type":"codeVoice"},{"type":"text","text":", or "},{"code":"barButtonItem","type":"codeVoice"},{"type":"text","text":". These crashes don’t occur on iPhones, and are therefore easy to miss if you don’t test throughly. Using GreenAlert eliminates these crashes."}]}]}],"type":"unorderedList"}]},{"content":[{"inlineContent":[{"type":"text","text":"Custom button action icons, via SF Symbols (preferred) or a "},{"type":"codeVoice","code":"UIImage"}],"type":"paragraph"}]}]}]},{"content":[{"inlineContent":[{"type":"text","text":"Show prompts for values"}],"type":"paragraph"},{"type":"unorderedList","items":[{"content":[{"inlineContent":[{"type":"text","text":"With all the customizations listed above, but also including customizable:"}],"type":"paragraph"},{"type":"unorderedList","items":[{"content":[{"inlineContent":[{"type":"text","text":"preset text"}],"type":"paragraph"}]},{"content":[{"type":"paragraph","inlineContent":[{"text":"placeholder","type":"text"}]}]},{"content":[{"type":"paragraph","inlineContent":[{"type":"text","text":"keyboard type"}]}]}]}]}]}]},{"content":[{"inlineContent":[{"type":"text","text":"Add progress bars to alert controllers"}],"type":"paragraph"}]}],"type":"unorderedList"},{"inlineContent":[{"text":"…And even more!","type":"text"}],"type":"paragraph"},{"inlineContent":[{"type":"text","text":"So give it a shot! 😁"}],"type":"paragraph"},{"level":2,"type":"heading","text":"Support","anchor":"Support"},{"type":"paragraph","inlineContent":[{"text":"If you’re anything less than delighted, or have any ideas on how to improve GreenAlert, be sure to ","type":"text"},{"isActive":true,"type":"reference","identifier":"https:\/\/github.com\/JacobSyndeo\/GreenAlert\/issues"},{"text":", and I’ll be sure to address it!","type":"text"}]},{"anchor":"More","type":"heading","level":2,"text":"More"},{"inlineContent":[{"type":"text","text":"If you like GreenAlert, be sure to check out my other projects:"}],"type":"paragraph"},{"items":[{"content":[{"inlineContent":[{"type":"text","text":"🎆 "},{"isActive":true,"type":"reference","identifier":"https:\/\/github.com\/JacobSyndeo\/Ether"},{"type":"text","text":", a delightful and easy to understand networking library for Swift"}],"type":"paragraph"}]}],"type":"unorderedList"}],"kind":"content"}],"kind":"article","hierarchy":{"paths":[["doc:\/\/GreenAlert\/documentation\/GreenAlert"]]},"abstract":[{"type":"text","text":"What is GreenAlert, and why should you use it?"}],"variants":[{"paths":["\/documentation\/greenalert\/introduction"],"traits":[{"interfaceLanguage":"swift"}]}],"references":{"doc://GreenAlert/documentation/GreenAlert":{"role":"collection","url":"\/documentation\/greenalert","title":"GreenAlert","abstract":[],"type":"topic","kind":"symbol","identifier":"doc:\/\/GreenAlert\/documentation\/GreenAlert"},"https://github.com/JacobSyndeo/Ether":{"titleInlineContent":[{"type":"text","text":"Ether"}],"identifier":"https:\/\/github.com\/JacobSyndeo\/Ether","url":"https:\/\/github.com\/JacobSyndeo\/Ether","type":"link","title":"Ether"},"https://github.com/JacobSyndeo/GreenAlert/issues":{"identifier":"https:\/\/github.com\/JacobSyndeo\/GreenAlert\/issues","titleInlineContent":[{"type":"text","text":"open an issue"}],"type":"link","url":"https:\/\/github.com\/JacobSyndeo\/GreenAlert\/issues","title":"open an issue"}}} |
Oops, something went wrong.