我收到此警告:在交换机中未处理枚举值'NSFetchedResultsChangeMove'和NSFetchedResultsChangeUpdate'
有任何想法吗?
- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id <NSFetchedResultsSectionInfo>)sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type {
switch(type) {
case NSFetchedResultsChangeInsert:
[self.tableView insertSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade];
break;
case NSFetchedResultsChangeDelete:
[self.tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade];
break;
}
}
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
[self.tableView endUpdates];
}
Run Code Online (Sandbox Code Playgroud)
提前致谢
有没有办法用drawAtPoint绘制多行文字?我试过UILineBreakModeWordWrap但似乎没有工作?
你如何将此代码转换为工作的多行文本?
point = CGPointMake(boundsX, 50);
[self.heading drawAtPoint:point forWidth:labelWidth withFont:mainFont minFontSize:12.0 actualFontSize:NULL lineBreakMode:UILineBreakModeWordWrap baselineAdjustment:UIBaselineAdjustmentAlignBaselines];
Run Code Online (Sandbox Code Playgroud)
谢谢!
这真令人困惑.有没有人有任何想法?
let viewHasMovedToRight == false //initially I want this to be false
Run Code Online (Sandbox Code Playgroud)
然后
func moveViewToRight(sender: UIButton!) {
if viewHasMovedToRight == false {
viewHasMovedToRight == true;
UIView.animateWithDuration(
0.75,
animations: {},
completion: { (value: Bool) in
println(" moved")
}
)
}
else {
viewHasMovedToRight == false;
UIView.animateWithDuration(
0.75,
animations:{},
completion:{ (value: Bool) in
println("not moved")
}
)
}
// println("move view")
}
Run Code Online (Sandbox Code Playgroud)
只有第一个if叫.我无法将值重新分配给true ...
Obj-C现在用swift这么容易的东西是如此令人沮丧......
有没有办法在textLabel中使用两种不同字体大小的UIButton?原生?
我不想让UILabel在上面.
为什么这会给我一个错误?
var colorArray = [UIColor.self]
colorArray.append(UIColor.redColor()) //error here
colorArray.removeLast()
Run Code Online (Sandbox Code Playgroud)
如何定义要存储的可变数组UIColor?
有没有办法将起点从ovalInRect 形式的“右”更改为“左”?似乎无论我如何创建它,“起点”总是在“右侧......
let ovalPath = UIBezierPath(ovalInRect: CGRect(x: 515, y: 276.5, width: 280.5, height: 214.5))
let ovalShapeLayer = CAShapeLayer()
ovalShapeLayer.fillColor = UIColor.clearColor().CGColor
ovalShapeLayer.strokeColor = UIColor.lightGrayColor().CGColor
ovalShapeLayer.lineWidth = 1.5
ovalShapeLayer.path = ovalPath.CGPath
self.view.layer.insertSublayer(ovalShapeLayer, atIndex: 1)
Run Code Online (Sandbox Code Playgroud)
谢谢