Post

Replies

Boosts

Views

Activity

Reply to Drawing UIImage with perspective on Apple Watch
Thanks, Claude31. I tried something along those lines, but the problem turns out to be even more complex. Because it is perspective, the pixels at the top of the image actually need to become smaller because they appear "further away" from the viewer, and the pixels at the bottom of the image become larger because they appear "closer". This means the height of each input and output row is different. I've gotten pretty close, but it still doesn't look quite right. I'm continuing to work on it...
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’23
Reply to Combining 2 UIImage to create a new UIImage in WatchKit
Found a solution using UIGraphicsBeginImageContext, etc. Gotta adjust for my needs, but it's exactly what I need! var bottomImage = UIImage(named: "bottom.png") var topImage = UIImage(named: "top.png") var size = CGSize(width: 300, height: 300) UIGraphicsBeginImageContext(size) let areaSize = CGRect(x: 0, y: 0, width: size.width, height: size.height) bottomImage!.draw(in: areaSize) topImage!.draw(in: areaSize, blendMode: .normal, alpha: 0.8) var newImage:UIImage = UIGraphicsGetImageFromCurrentImageContext()! UIGraphicsEndImageContext()
Topic: App & System Services SubTopic: General Tags:
Mar ’23
Reply to Combining 2 UIImage to create a new UIImage in WatchKit
I found some sample code for combining UIImages (see below), but cannot use it because is uses UIImageView, which is not in WatchKit (although, it is kinda what I want to do). I am using Swift, not SwiftUI. let bgimg = UIImage(named: "image-name") // The image used as a background let bgimgview = UIImageView(image: bgimg) // Create the view holding the image bgimgview.frame = CGRect(x: 0, y: 0, width: 500, height: 500) // The size of the background image let frontimg = UIImage(named: "front-image") // The image in the foreground let frontimgview = UIImageView(image: frontimg) // Create the view holding the image frontimgview.frame = CGRect(x: 150, y: 300, width: 50, height: 50) // The size and position of the front image bgimgview.addSubview(frontimgview) // Add the front image on top of the background
Topic: App & System Services SubTopic: General Tags:
Mar ’23
Reply to WKInterfacePicker focus problems WatchOS 9.0
From what I can gather, it looks like I will have to migrate from Swift (using Storyboards) to SwiftUI. Basically I think I have to completely rewrite my app. Guess I won't be making other updates for a couple of months! Additional question: if I recreate my Watch app to no longer include an iOS stub (my app predates watch-only apps), how will that affect updating the app in the App Store?
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’22
Reply to Add for review greyed out
Same here. I think I found the solution. I'm trying it now, and the app is back in "Waiting for Review". I'll try to remember to update this post with the eventual outcome. You need to cancel the current submission first. Do this by: Going to the app that's in limbo (with the dimmed "Add for Review" button) Tap "App Review" under "General" on the left For the stuck item under "In Progress", tap "View" on the right On the following screen, tap "Cancel Submission" at the bottom When I did this, the "Add for Review" button became highlighted and I was able to resubmit. I got the usual emails that the status has changed all the way to "Waiting for Review". Fingers crossed!
Aug ’22
Reply to Relative To Container in Interface Builder rounds value in Xcode
Just noticed that some of the fields actually display multiple decimal places. I can find no rhyme or reason which field work and which don't.
Replies
Boosts
Views
Activity
Sep ’23
Reply to Drawing UIImage with perspective on Apple Watch
Thanks, Claude31. I tried something along those lines, but the problem turns out to be even more complex. Because it is perspective, the pixels at the top of the image actually need to become smaller because they appear "further away" from the viewer, and the pixels at the bottom of the image become larger because they appear "closer". This means the height of each input and output row is different. I've gotten pretty close, but it still doesn't look quite right. I'm continuing to work on it...
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Drawing UIImage with perspective on Apple Watch
Cannot be done. I even tried using ChatGPT to create code, but it tries to use some Core Image calls (even though I told it not to), which are not available on Apple Watch. I'm trying to do it now via brute force, with marginal success so far.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Combining 2 UIImage to create a new UIImage in WatchKit
Found a solution using UIGraphicsBeginImageContext, etc. Gotta adjust for my needs, but it's exactly what I need! var bottomImage = UIImage(named: "bottom.png") var topImage = UIImage(named: "top.png") var size = CGSize(width: 300, height: 300) UIGraphicsBeginImageContext(size) let areaSize = CGRect(x: 0, y: 0, width: size.width, height: size.height) bottomImage!.draw(in: areaSize) topImage!.draw(in: areaSize, blendMode: .normal, alpha: 0.8) var newImage:UIImage = UIGraphicsGetImageFromCurrentImageContext()! UIGraphicsEndImageContext()
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Combining 2 UIImage to create a new UIImage in WatchKit
I found some sample code for combining UIImages (see below), but cannot use it because is uses UIImageView, which is not in WatchKit (although, it is kinda what I want to do). I am using Swift, not SwiftUI. let bgimg = UIImage(named: "image-name") // The image used as a background let bgimgview = UIImageView(image: bgimg) // Create the view holding the image bgimgview.frame = CGRect(x: 0, y: 0, width: 500, height: 500) // The size of the background image let frontimg = UIImage(named: "front-image") // The image in the foreground let frontimgview = UIImageView(image: frontimg) // Create the view holding the image frontimgview.frame = CGRect(x: 150, y: 300, width: 50, height: 50) // The size and position of the front image bgimgview.addSubview(frontimgview) // Add the front image on top of the background
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to WKInterfaceTextField input stops running WKInterfaceTimer?
UPDATE: I discovered that not only is didDeactivate() being called, but willDisappear() as well. This is where I stop my timer because I believe the user is done with this screen. Now I need a way to figure out that the user is entering text and NOT stop my timer. Hopefully more updates to follow...
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to WKInterfacePicker focus problems WatchOS 9.0
Yup. WatchOS 9.1 fixed the bug!
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to WKInterfacePicker focus problems WatchOS 9.0
From what I can gather, it looks like I will have to migrate from Swift (using Storyboards) to SwiftUI. Basically I think I have to completely rewrite my app. Guess I won't be making other updates for a couple of months! Additional question: if I recreate my Watch app to no longer include an iOS stub (my app predates watch-only apps), how will that affect updating the app in the App Store?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to Add for review greyed out
Worked for me too! Yay!
Replies
Boosts
Views
Activity
Aug ’22
Reply to Add for review greyed out
Same here. I think I found the solution. I'm trying it now, and the app is back in "Waiting for Review". I'll try to remember to update this post with the eventual outcome. You need to cancel the current submission first. Do this by: Going to the app that's in limbo (with the dimmed "Add for Review" button) Tap "App Review" under "General" on the left For the stuck item under "In Progress", tap "View" on the right On the following screen, tap "Cancel Submission" at the bottom When I did this, the "Add for Review" button became highlighted and I was able to resubmit. I got the usual emails that the status has changed all the way to "Waiting for Review". Fingers crossed!
Replies
Boosts
Views
Activity
Aug ’22