我得到了Xcode 8和一个带图像的文件夹.我用Photoshop,Pixalate中的特定滤镜替换了所有图像.
当我运行我的项目时,我收到一个错误:
[Graphics]使用远远超出预期范围的组件值创建的UIColor,在UIColorBreakForOutOfRangeColorComponents上设置断点以进行调试.此消息仅记录一次.
我怎么解决这个问题?
我正在YouTube上观看本教程,并且在弹出窗口中添加了按钮。按钮正在添加硬币(IAP),但是问题是当我关闭弹出窗口时,它不会刷新视图以查看更新的硬币。如果我按下后退按钮,然后再次出现,它将被更新。
所以问题是如何在按下关闭按钮后刷新父视图。
这是popupVC
import UIKit
class PopUpViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.8)
self.showAnimate()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func closePopUp(sender: AnyObject) {
self.removeAnimate()
//HERE SHOULD BE CODE TO RELOAD PARENT VIEWCONTROLER
}
func showAnimate()
{
self.view.transform = CGAffineTransformMakeScale(1.3, 1.3)
self.view.alpha = 0.0;
UIView.animateWithDuration(0.25, animations: {
self.view.alpha = 1.0
self.view.transform = CGAffineTransformMakeScale(1.0, 1.0) …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Alomofire 和 swiftyJSON 从 json 加载图像。Json 是字典:
{"name": {"image": "https://...",}}
Run Code Online (Sandbox Code Playgroud)
Alamorefire 和 SwiftyJSON
var imageLoad: String!
Alamofire.request(.GET, url).responseJSON { (response) -> Void in
if let value = response.result.value {
let json = JSON(value)
if let jsonDict = json.dictionary {
let image = jsonDict["name"]!["image"].stringValue
print(image) // https://....
self.imageLoad = image
}
self.tableView.reloadData()
}
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! TVCell
// Configure the cell...
cell.imageTableView.image = UIImage(named: imageLoad) …
Run Code Online (Sandbox Code Playgroud)