当我们尝试在屏幕截图中附加图像时,我正在尝试制作在iOS上的消息应用中显示的操作表.
我意识到在新的UIAlertController中,我们无法适应任何自定义视图.我有什么方法可以做到这一点?
我的代码看起来很标准.
let alertController = UIAlertController(title: "My AlertController", message: "tryna show some images here man", preferredStyle: UIAlertControllerStyle.ActionSheet)
let okAction = UIAlertAction(title: "oks", style: .Default) { (action: UIAlertAction) -> Void in
alertController.dismissViewControllerAnimated(true, completion: nil)
}
let cancelAction = UIAlertAction(title: "Screw it!", style: .Cancel) { (action: UIAlertAction) -> Void in
alertController.dismissViewControllerAnimated(true, completion: nil)
}
alertController.addAction(okAction)
alertController.addAction(cancelAction)
self.presentViewController(alertController, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)
尝试按降序对Swift中的数组进行排序.这很好用
objectArray.sort{ $0.date!.compare($1.date!) == .orderedDescending}
Run Code Online (Sandbox Code Playgroud)
如你所见,我强行解开约会.我正在寻找另一种方式,以便如果日期是nil,对象移动到数组的末尾.
我可以为个人 Apple Dev 帐户设置 2 个单独的配置文件吗?
基本上我需要使用 2 台不同的笔记本电脑进行开发。如果不从我的第一台笔记本电脑 + 电子邮件中撤销已经存在的证书,我将无法生成新证书。我有办法解决这个问题吗?
这与目标C有关.我有3个班级.
ClassA,ClassB和ClassC.
ClassB并且ClassC是.的子类ClassA.
@interface ClassB : ClassA
@interface ClassC : ClassA
Run Code Online (Sandbox Code Playgroud)
我需要做的检查classA,不论是否self是ClassB或ClassC.
我正在使用现有代码.这里有一个popovercontroller已在.h文件中声明,它在实现行中给出了错误.
.h文件
@property (nonatomic, strong) VFImagePickerController *imagePicker;
@property (nonatomic, strong) UIPopoverController *popoverController;
@property (nonatomic, strong) UINavigationController *targetVC;
Run Code Online (Sandbox Code Playgroud)
.m文件:

请建议如何解决这个问题.
此代码在iPhone上运行良好,但在iPad上,操作表显示在屏幕中间.不在触发按钮所在的角落.此外,没有取消按钮显示.
此外,该应用程序仅处于横向模式.相机触发按钮位于屏幕的右上角.
mediaPicker = [[UIImagePickerController alloc] init];
mediaPicker.allowsEditing = YES;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Take photo", @"Choose Existing", nil];
//[actionSheet showInView:self.view];
[actionSheet showInView:self.navigationController.view];
}
// If device doesn't has a camera, Only "Choose Existing" and "Cancel" options will show up.
else {
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Choose Existing", nil];
[actionSheet showInView:self.view];
}
Run Code Online (Sandbox Code Playgroud)
我需要动作表来显示按钮的位置.我应该怎么做呢.
ios ×2
objective-c ×2
swift ×2
alignment ×1
date ×1
inheritance ×1
ios9 ×1
ipad ×1
optional ×1
properties ×1
sorting ×1