我正在使用iOS8的今日小部件来显示与当天相关的信息.问题是如果没有要显示的相关消息,我根本不想显示小部件/部分.
我知道它必须是可能的,因为BA应用程序会这样做(它只在有航班时显示小部件,其余时间根本不可见).我只是想办法实现这种行为.
有谁知道如何做到这一点?
objective-c ios-app-extension ios8-extension ios8-today-widget
最近,我一直在研究iOS 8共享扩展,以了解系统如何工作并找出这些功能的限制.我意识到目前的文档https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/index.html只是一个初步文件.我有一些关于iOS8 app扩展的一般限制/可能性的问题:
我想使用自定义UIPresentationController.对于它,当我想要显示新场景时,我称之为代码
UIViewController *cv = [[...]];
cv.transitionManager=[[MyTransition alloc] init];
cv.transitioningDelegate=actionSheet.transitionManager;
cv.modalTransitionStyle = UIModalPresentationCustom;
[self presentViewController:cv animated:YES completion:^{
}];
Run Code Online (Sandbox Code Playgroud)
我的过渡经理有方法:
#pragma mark - UIViewControllerTransitioningDelegate
- (id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source{
    return self;
}
- (id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed{
    return self;
}
- (id <UIViewControllerInteractiveTransitioning>)interactionControllerForPresentation:(id <UIViewControllerAnimatedTransitioning>)animator{
    return  nil;
}
- (id <UIViewControllerInteractiveTransitioning>)interactionControllerForDismissal:(id <UIViewControllerAnimatedTransitioning>)animator{
    return self;
}
- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source {
    MyPresentationController *presentationController = [[MyPresentationController alloc] initWithPresentedViewController:presented presentingViewController:presenting];
    return presentationController;
}
Run Code Online (Sandbox Code Playgroud)
但方法presentationControllerForPresentedViewController不调用!
为什么?
我在iOS8中有一个共享扩展,我正在从Safari调用.它运行后有一些数据要与主应用程序共享(两者都使用共享的应用程序组),但数据太大而无法填入用户设置,需要将其存储为文件.如何编写文件,以便在加载主应用程序时可以看到文件?
为清楚起见,我不是在谈论下载远程文件,该文件是由共享扩展在内存中创建的.
编辑:拼写纠正.
我们有我们的应用程序目标,在该Info.plist中,我们定义了可用于通过URL打开应用程序的URL方案。
现在,我们添加了今天的扩展。我们将需要一个表格视图,该表格视图将通过扩展名打开该URL。我们看到API如何支持它。
我们可以从应用程序的Info.plist中获取URL方案,还是从根本上对扩展名中的值进行“硬编码”以使其调用以打开?
我正在尝试创建一个共享扩展.我将它们显示在表视图中.我的数据即将到来,但我无法看到.它也冻结了(就像我们有数据和弹出窗口但没有显示).
这是我的示例代码
//
//  ShareViewController.m
//  myAppShare
//
//  
//
//
#import "ShareViewController.h"
#import "MBProgressHUD.h"
@import MobileCoreServices;
static NSString *const AppGroupId = @"group.tag.BiblioHive7";
@implementation ShareViewController
{
    NSArray *arrayCategory;
    __weak IBOutlet UITextField *textFieldCategoryName;
    __weak IBOutlet UIButton *btnPost;
    __weak IBOutlet UIBarButtonItem *btnCancel;
    __weak IBOutlet UINavigationItem *nayTitle;
    __weak IBOutlet UINavigationBar *navBar;
}
-(void)viewDidLoad
{
    sharedUserDefaults = [[NSUserDefaults alloc] initWithSuiteName:AppGroupId];
    [sharedUserDefaults setObject:@"hello" forKey:@"hello"];
    NSString *userId= [sharedUserDefaults objectForKey:@"userId"];
    NSLog(@"%@", [[sharedUserDefaults objectForKey:@"categories"] class]);
    NSError* error;
    [self didSelectPost];
    if (userId==nil || [userId isEqualToString:@""] )
    {
        [self hideBackground]; …Run Code Online (Sandbox Code Playgroud) 因此,在过去的两周里,我一直致力于我的GitHub回购https://github.com/satheeshwaran/iOS-8-Features-Demo我试图演示iOS 8中引入的Share扩展.我知道了我可以添加SLComposeSheetConfigurationItem到a的方式,SLComposeServiceViewController但我无法弄清楚如何更改色调或文本颜色SLComposeSheetConfigurationItem.
到目前为止我做了什么,

在上图中看到我想将描述和My First Share设置为我选择的某种颜色,也可能是我想自定义字体或其他东西.我挖了一下SocialFramework但是却无法从中得到任何东西.
我在iPad上看到了Evernote的分享扩展,它看起来像这样,

如果你看到底部有一个图标,文字颜色等也与导航栏的主题相匹配.
引用WWDC 2014关于扩展编程的演示,
SLComposeServiceViewController用于标准UI
UI/NSViewController用于自定义UI来到我的问题,
SLComposeServiceViewController并SLComposeSheetConfigurationItem看起来像这样?SLComposeServiceViewController定制吗?或者我应该使用UIViewController子类来做我自己的UI.UIViewController子类以复制行为或使用SLComposeServiceViewController(我不确定是否要问这个,但我想要答案)我遵循了本教程并添加了我的数据库。我确实针对我的应用程序和扩展程序。从我的应用程序中,我可以对数据库执行 SELECT、INSERT、DELETE 和 UPDATE。我希望我的应用程序和扩展程序共享同一个数据库。所以我在我的应用程序中添加信息,然后在扩展程序中显示该信息。
由于它现在工作(我已经测试过),该应用程序有一个数据库实例,而扩展程序有一个实例。我只添加了一个数据库。任何人都知道为什么我的数据库有两个实例以及为什么我无法访问从扩展程序中的应用程序添加的数据?
尝试使用键盘扩展名进行自动布局.最初我以为我会以编程方式制作按钮,但后来我意识到最好用xib做这个因为我的要求和多种屏幕尺寸.
请参阅下面的屏幕截图,了解我所做的当前配置.按钮2:

按钮1和应用程序上的问题:

所有约束配置如下所示:

我想在这里做的就是确保按钮填满屏幕宽度.它们可以扩展宽度以匹配屏幕尺寸和方向.不知怎的,我觉得它无法理解设备的宽度.我需要为此指定一些东西吗?
谢谢
如标题所示,我希望用户共享* .wav文件时显示我的扩展名
我遇到了以下苹果文档:https : //developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW8
我试图弄清楚如何实际使用文档中提到的内容。该文档使我感到自己拥有的大部分(如果不是全部的话)我需要的东西,而不是它们如何一起使用。
我知道我很可能必须构建一个“ SUBQUERY(..)”语句,但是它在哪里呢?如何使用?
ios8-extension ×10
ios8 ×7
ios ×5
objective-c ×3
swift ×2
xcode6 ×2
cordova ×1
database ×1
ios8.3 ×1
iphone ×1
nspredicate ×1
sqlite ×1
xamarin ×1
xcode ×1