I still get the same error at this line
let theHeight = bitmap.height
Post
Replies
Boosts
Views
Activity
This is the code for Color.Swift
import UIKit
class Color: UIViewController {
public struct Color {
public var r, g, b, a: UInt8
public init(r: UInt8, g: UInt8, b: UInt8, a: UInt8 = 255)
{
self.r = r
self.g = g
self.b = b
self.a = a
}
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
extension Color {
static let clear = Color(r: 0, g: 0, b: 0, a: 0)
static let black = Color(r: 0, g: 0, b: 0)
static let white = Color(r: 255, g: 255, b: 255)
static let gray = Color(r: 192, g: 192, b: 192)
static let red = Color(r: 255, g: 0, b: 0)
static let green = Color(r: 0, g: 255, b: 0)
static let blue = Color(r: 0, g: 0, b: 255)
}
The convenience initializer is called within an extension not within itself. Also, I removed the class from Color.swift so it's just the public struct function and the extension function. I tried adding public init () {} and it did not work.
Update: I rewrote the last line in UIImage+Bitmap.swift to self.init(cgImage: cgImage) and it worked. Appreciate the help.
It worked, thanks so much!
I appreciate it the code you provided worked thanks for the help.
You are right. In ProfileSummary.swift I forgot to put `.environmentObject(ModelData()) in the ProfileSummary_Previews struct. Thank you.
Sorry for just seeing this was asleep when you replied. Now that I look at it maybe it could have something to do with it? fromUser and currentUser should both represent different PFUsers.
Update, after some time of testing and modifying, it seems that it's not the issue