测试已测试 | ✓ |
语言语言 | Obj-CObjective C |
许可协议 | MIT |
发布日期上次发布 | 2015年9月 |
由 Daniel Miedema 维护。
依赖库 | |
GroundControl | ~> 2.1 |
Colours | ~> 5.6 |
这是一个 Soapbox,用于发布您想要的任何内容。基于 panic 的想法,一次性地发布内容。
有时您只需发布某事。例如
为 soapbox 注册一个 URL 进行检查
[DMMSoapBoxDownloader registerURLForSoapboxCheck:[NSURL urlWithString:@"https://soapb.ox/check.plist"]]
然后在您的应用程序中检查是否需要发布通知
[DMMSoapBoxDownloader checkForAnnoucementsWithCompletion:^(NSDictionary *defaults, NSError *error){
// We've downloaded stuff
// Present the soapbox if we want. (we probably want to)
}];
或者直接检查一个 URL。
[DMMSoapBoxDownloader downloadAnnoucementsFromURL:[NSURL urlWithString:@"https://soapb.ox/check.plist"] complete:^(NSDictionary *defaults, NSError *error) {
if (defaults && !error) {
NSDictionary *presenterOptions = DMMDefaultsToOptionsDictionary(defaults);
NSURL *url = [NSURL urlWithString:presenterOptions[kDMMSoapBoxLatestAnnouncementURLKey]];
DMMSoapBoxPresenterViewController *soapbox = [DMMSoapBoxPresenterViewController presentationControllerWithURL:url options:presenterOptions];
[self presentViewController:soapbox animated:YES completion:nil];
}
}];
这需要一个非常特定格式的 plist 文件。如果 某些 键不匹配,它会尽力找到包含 ID
& URL
的 任何一个键
The MIT License (MIT)
Copyright (c) 2015 Daniel Miedema
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.