Post not yet marked as solved
Is there a way to create a 3D animation that occurs in the same exact locations each time it runs. From what i understand from the anchors that when the app launches it detects a flat surface and plays the animation there. I’m looking mg for it to occur in the same position each time.
Post not yet marked as solved
Hey I wanted to ask you how I can implement the Swipe back Gesture in Swift. So I want that the user start at the Home View Controller and then he can tap on the "happy number Rechner"-Button and then the calculator View Controller appears. Like the same way with the transitions in the Settings App of iOS. And if you swipe left the Home View should appear again. Thank you!
import UIKit
let alert = UIAlertController(title: "Warning",
message: "Your number is too big.",
preferredStyle: .alert)
class ViewController: UIViewController {
// Verbindungen zu Storyboard
@IBAction func rechnerEntry(_ sender: Any) {
}
@IBOutlet weak var resultLabel: UILabel!
@IBOutlet weak var buttons: UIButton!
@IBAction func clear(_ sender: Any) {
calculatorLabel.text = ""
number = 0
}
override func viewDidLoad() {
super.viewDidLoad()
buttons.backgroundColor = UIColor.gray
}
// Aufführung happyFuncs
func happyFunc(number: Int) -> Int {
var myNum = number
var sum = 0
while myNum > 0 {
let x = myNum % 10
sum += (x * x)
myNum /= 10
}
return sum
}
// happyCheckerFunc
func happyChecker(_ x: Int) -> Bool {
var alreadychecked: Set<Int> = Set()
var result = happyFunc(number: x)
while !alreadychecked.contains(result) {
if result == 1 {
resultLabel.text = "your number is a happy number"
return true
}
alreadychecked.insert(result)
result = happyFunc(number: result)
}
resultLabel.text = "your number is a unhappy number"
return false
}
// Eingabe Werte
var number = 0
var x = 0
@IBOutlet weak var calculatorLabel: UILabel!
var isTypingNumber = false
// Nummer getippt
@IBAction func numberTapped(_ sender: UIButton) {
let number = sender.currentTitle ?? (sender.titleLabel?.text ?? "0")
if isTypingNumber {
calculatorLabel.text = calculatorLabel.text! + number
} else {
calculatorLabel.text = number
isTypingNumber = true
}
}
// Überprüfung happy?
@IBAction func happycheck(_ sender: UIButton) {
number = Int(calculatorLabel.text!)!
x = number
if x > 9999999999999999 {
alert.addAction(UIAlertAction(title: "OK",
style: .default,
handler: { _ in
print("OK tap")
}))
present(alert, animated: true, completion: nil)
}
func happyFunc(number: Int) -> Int {
var myNum = number
var sum = 0
while myNum > 0 {
let x = myNum % 10
sum += (x * x)
myNum /= 10
}
return sum
}
func happyChecker(_ x: Int) -> Bool {
var alreadychecked: Set<Int> = Set()
var result = happyFunc(number: x)
while !alreadychecked.contains(result) {
if result == 1 {
resultLabel.text = "your number is a happy number"
return true
}
alreadychecked.insert(result)
result = happyFunc(number: result)
}
resultLabel.text = "your number is a unhappy number"
return false
}
happyChecker(x)
}
}
Post not yet marked as solved
Hi,
I have updated to latest software ios 16.2, and my option for 5G is there but it is not working.
I have checked my with my carrier shows that my 5G plan is active and i am in a 5G available area.
Is this some kind bug from ios?
Post not yet marked as solved
Hi, quartz debug 4.2 (from the "Additional Tools for Xcode 14.2") doesn't show most tracking rectangles on macOS Ventura. I tested this on two Macs.
Any solution to debug tracking areas on this OS?
Thanks.
Hello
I have been trying to draw an apple with SwiftUI using path, but I can't make it good as it looks like a circle.
Can someone tell me how to do it?
Thank you
Post not yet marked as solved
𝐈 𝐭𝐫𝐢𝐞𝐝 𝐭𝐨 𝐩𝐨𝐫𝐭 𝐦𝐲 𝐚𝐧𝐝𝐫𝐨𝐢𝐝 𝐠𝐚𝐦𝐞, 𝐛𝐮𝐭 𝐰𝐡𝐞𝐧 𝐢 𝐜𝐡𝐚𝐧𝐠𝐞𝐝 𝐦𝐲 𝐩𝐥𝐚𝐭𝐟𝐨𝐫𝐨𝐦 𝐭𝐨 𝐢𝐨𝐬 , 𝐚𝐧𝐝 𝐬𝐭𝐚𝐫𝐭𝐞𝐝 𝐛𝐮𝐢𝐥𝐝𝐢𝐧𝐠 , 𝐢𝐭 𝐠𝐢𝐯𝐞𝐬 𝐦𝐞 𝐞𝐫𝐫𝐨𝐫 𝐭𝐡𝐚𝐭 𝐛𝐮𝐫𝐬𝐭 𝐜𝐨𝐦𝐩𝐢𝐥𝐞𝐫 𝐟𝐚𝐢𝐥𝐞𝐝 𝐫𝐮𝐧𝐧𝐢𝐧𝐠, 𝐢 𝐭𝐫𝐢𝐞𝐝 𝐦𝐚𝐧𝐲 𝐬𝐨𝐥𝐮𝐭𝐢𝐨𝐧𝐬 𝐟𝐫𝐨𝐦 𝐮𝐧𝐢𝐭𝐲 𝐟𝐨𝐫𝐮𝐦𝐬, 𝐛𝐮𝐭 𝐭𝐡𝐞𝐲 𝐝𝐢𝐝𝐧'𝐭 𝐰𝐨𝐫𝐤.𝐚𝐧𝐲 𝐢𝐝𝐞𝐚 𝐡𝐨𝐰 𝐢 𝐜𝐚𝐧 𝐟𝐢𝐱 𝐭𝐡𝐨𝐬𝐞 𝐞𝐫𝐫𝐨𝐫𝐬 𝐚𝐧𝐝 𝐛𝐮𝐢𝐥𝐝 𝐟𝐨𝐫 𝐢𝐨𝐬.
Post not yet marked as solved
I'm in Changsha, China. get my current location from Apple Maps. but the WeatherKit result is not same with Weather App.
request:
GET /api/v1/weather/zh-CN/28.212151/112.955606?countryCode=cn&timeZone=Asia%2FShanghai&dataSets=forecastHourly&hourlyStart=2022-12-12T22%3A19%3A05Z&hourlyEnd=2022-12-17T22%3A19%3A05Z
host: weatherkit.apple.com
response:
{
"forecastStart": "2022-12-17T22:00:00Z",
"cloudCover": 0.01,
"conditionCode": "Clear",
"daylight": false,
"humidity": 0.65,
"precipitationAmount": 0.0,
"precipitationIntensity": 0.0,
"precipitationChance": 0.0,
"precipitationType": "clear",
"pressure": 1036.48,
"pressureTrend": "falling",
"snowfallIntensity": 0.0,
"snowfallAmount": 0.0,
/// this is -2.83°C
"temperature": -2.83,
"temperatureApparent": -3.64,
"temperatureDewPoint": -8.47,
"uvIndex": 0,
"visibility": 18656.25,
"windDirection": 318,
"windGust": 9.61,
"windSpeed": 4.08
}
Weather App temperature is 2°C
Post not yet marked as solved
Trying to locate the sample code from the WWDC video on the updated PDKKit for iOS 16+ with overlay functionality. Looks like the only references are pointing to an older 2017 project. Is this sample code available anywhere? Here is the link to the announcement video: https://developer.apple.com/videos/play/wwdc2022/10089/
Post not yet marked as solved
an AVDepthData class method converting(toDepthDataType: kCVPixelFormatType_DepthFloat16) does not work.
let depthData = photo.depthData
depthData.converting(toDepthDataType: kCVPixelFormatType_DepthFloat16)
let ddType = depthData.depthDataType
ddType value is 1751411059 which means kCVPixelFormatType_DisparityFloat16.
How do I get the DepthFloat16 format data?
Post not yet marked as solved
When altool notarizes my apps, I get an email confirmation to my Apple ID email address. This does not happen with notarytool. Is this expected behavior?
Post not yet marked as solved
Hi community,
I'm a new iOS developer and I'd like to develop application using Room Plan API/UIKit/ARKit.
Currently I'm able to :
Scan room
Detect room objects (in console logs)
Export data file (.usdz) from scanned room
using the default UIViewController from UIKit.
But now I would like to add my custom display when objects are detected.
I google it but don't found anything around it.
I think I have to use this method from RoomPlan API to display category of detected objects.
func captureSession(_ session: RoomCaptureSession, didUpdate room: CapturedRoom) {
RoomPlan can't display custom data right ? If yes, I have to use ARKit or UIKit in this method to add custom text to the frame of the detected object ?
I can share code if necessary.
Thanks in advance,
Goat.
Post not yet marked as solved
Hello Guys,
I am writing a program using PencilKit. Yesterday, everything worked fine with this line:
@State var pencilStyle: PKInkingTool.InkType = .monoline
But today, i am getting this Error:
Type 'PKInkingTool.InkType' has no member 'monoline'"
When I started Xcode Today, it downloaded a new Simulator for iOS 16.2.
How can I fix this issue? I can't use my Projekt without fixing this...
Thanks in advance <3
Post not yet marked as solved
Hello,
I am new to Swift and have a specific requirement needing to be implemented through the VideoToolbox API. I am using MethodChannel() from Flutter SDK to invoke Swift functions. I need access to the HW video decoder and the plan is to receive encoded frames from flutter application, decode with VideoToolbox API, then return the decoded image back through the MethodChannel().
I am having trouble checking if the session succeeds in decoding a frame. The callback given to VTDecompressionSessionDecodeFrame() via the VTDecompressionOutputCallbackRecord class may only return a void. However, this callback recieves as argument the decoded image buffer and status, which I have no way of accessing at the moment; this is essentially my problem.
I tried some method such as creating a variable at a higher level scope but I get compiler error A C function pointer cannot be formed from a closure that captures context. It was also quite frustrating that I simply cannot get the base address of a variable like in C/C++ so I can perform memcpy(), but that is another topic.
So my question is, how may I return/access data within a closure that may only return void? Are there any helpful classes to facilitate communication between the closure and function calling VTDecompressionSessionDecodeFrame(). My idea would be to have the calling function wait until the value of the image buffer or status changes. This doesn't sound like a good implementation but it's only what I can think of at the moment. Any help would be appreciated. Thank you.
Post not yet marked as solved
AVPlayerItemStatus(rawValue: 2)
error: Optional(Error Domain=CoreMediaErrorDomain Code=-12927 "(null)").
when play video from m3u8 url player plays some videos but some videos not played.
how to fix this error?
Post not yet marked as solved
Anyone else have this problem where the DeviceActivityCenter is silently failing/hanging on startMonitoring?
No error caught but the code won't progress, and the intervalDidStart never runs.
Post not yet marked as solved
How to hide keyboard on tap outside of TextField in SwiftUI?
SwiftUI on iOS 16
Within a List a Section with a TextField
I want to dismiss the keyboard if I tap outside the focused TextField.
I thought, searched and found no solution the does this correctly. Either it does not dismiss in all cases or it does dismiss while clicking into the TextField, too.
What is the best or a good solution for this problem?
Post not yet marked as solved
I've been working on the open source code of the Signal-iOS project recently. I want to add some functionality to Signal. But I found that I can't add "com.apple.developer.pushkit.unrestricted-voip" in entitlements. How can I solve this problem please.
Post not yet marked as solved
Hello,
I am getting reports from some users that one of my apps is behaving weirdly when:
Stage Manager is enabled
with an external display connected (presumably with app windows on the external display).
I would like to debug this issue. However, I do not have an iPad compatible with Stage Manager. On the Simulator in Xcode, I can run an iPad with Stage Manager (good) and pretend to connect an external display (good), but I cannot move windows to the external display, so I cannot reproduce the issue.
What can I do?
(the app uses SwiftUI and UIScene. It does work with multiple windows on standard iPads, it does work with StageManager on the iPad simulator).
Post not yet marked as solved
Greetings,
I'm discovering Xcode program for the first time and found on YT one training video how to create logging screen which I could try to code. But in 3/4 of the video I had met with a problem 🙈 while writing NavigationLink command. The command was written same way as was in tutorial video, but in this version of Xcode popped up attention message : " 'init(destination:isActive:label:)' was deprecated in iOS 16.0: use NavigationLink(value:label:) inside a NavigationStack or NavigationSplitView". Have you any idea how to correctly write for actual version of IOS?
I'll look 4wrd for your suggestions. 🙂
Sincerly,
Jim
Post not yet marked as solved
When I delete a tester from the TestFlight panel, he is not actually deleted, just marked as deleted. As a result, people who have already exited the test cannot be truly deleted, and new testers cannot join.
All testers is 8056.
Tester deleted is 1944.
After I delete 2 testers,all testers is 8054, tester deleted is 1946.
When new testers try to join, they get error:This beta is fully booked.