Post

Replies

Boosts

Views

Activity

Reply to TipKit Rule won't compile
Missed the first line of code: static let hoverEvent: Event = Event(id: "hoverEvent") /// Parameters-Rules @Parameter static var isHovering: Bool = false static var tipCountKey = "UserTipCount" var title: Text var message: Text? var image: Image? var tipShownLimit: Int @ObservedObject var buttonState: ButtonState var rules: [Rule] { [ #Rule(Self.$isHovering) { $0 == true }, #Rule(Self.hoverEvent) { $0.donations.count < 10 } ] } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’24
Reply to Safari trunctates base64 string representing an image
I resolved this issue. I had to specify in the browser to encode as multipart/form-data and then on the server: case http.MethodPost: contentType := request.Header.Get("Content-Type") if strings.HasPrefix(contentType, "multipart/form-data") { p.DataBodyMap = make(url.Values, 0) request.ParseMultipartForm(1000) for key, value := range request.MultipartForm.Value { p.DataBodyMap[key] = value } photoFile, header, err := request.FormFile("photoBytesString") if err == nil { log.Println(header, err) photoContentType := header.Header["Content-Type"][0] log.Println(photoContentType) photoBytes, _ := ioutil.ReadAll(photoFile) log.Println("len(photoBytes): ", len(photoBytes)) encodedImage64 := base64.StdEncoding.EncodeToString(photoBytes) encodedImage64WithPrefix := "data:" + photoContentType + ";base64," + encodedImage64 p.DataBodyMap["photoBytesString"] = []string{encodedImage64WithPrefix} }
Topic: Safari & Web SubTopic: General Tags:
Mar ’22
Reply to TipKit Rule won't compile
first line of code: struct UserTip: Tip {
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’24
Reply to TipKit Rule won't compile
Missed the first line of code: static let hoverEvent: Event = Event(id: "hoverEvent") /// Parameters-Rules @Parameter static var isHovering: Bool = false static var tipCountKey = "UserTipCount" var title: Text var message: Text? var image: Image? var tipShownLimit: Int @ObservedObject var buttonState: ButtonState var rules: [Rule] { [ #Rule(Self.$isHovering) { $0 == true }, #Rule(Self.hoverEvent) { $0.donations.count < 10 } ] } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’24
Reply to I broke my Xcode 15 beta
I was able to fix this. Uninstalled Xcode. Rebooted. Reinstalled Xcode. This time the dialog came up for installing additional pieces. Xcode now runs fine
Replies
Boosts
Views
Activity
Jun ’23
Reply to I broke my Xcode 15 beta
The error is Command RealityAssetsCompile failed with a nonzero exit code
Replies
Boosts
Views
Activity
Jun ’23
Reply to Safari trunctates base64 string representing an image
I resolved this issue. I had to specify in the browser to encode as multipart/form-data and then on the server: case http.MethodPost: contentType := request.Header.Get("Content-Type") if strings.HasPrefix(contentType, "multipart/form-data") { p.DataBodyMap = make(url.Values, 0) request.ParseMultipartForm(1000) for key, value := range request.MultipartForm.Value { p.DataBodyMap[key] = value } photoFile, header, err := request.FormFile("photoBytesString") if err == nil { log.Println(header, err) photoContentType := header.Header["Content-Type"][0] log.Println(photoContentType) photoBytes, _ := ioutil.ReadAll(photoFile) log.Println("len(photoBytes): ", len(photoBytes)) encodedImage64 := base64.StdEncoding.EncodeToString(photoBytes) encodedImage64WithPrefix := "data:" + photoContentType + ";base64," + encodedImage64 p.DataBodyMap["photoBytesString"] = []string{encodedImage64WithPrefix} }
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’22