Posts

Sort by:
Post not yet marked as solved
0 Replies
9 Views
I have a two-view app where the main view is a procedural animation and a secondary view controls settings for the animation. I want to use Play/Pause to toggle between the views, but can't figure out how to do this. Ideally the main view does not have any visible control and the whole screen can be dedicated to the animation view. Attaching onPlayPauseCommand to the main view does not work. I've also tried managing focus using onFocus without success. I'm open to other ways to toggle between the main and settings views, it's just that Play/Pause seems the most intuitive.
Posted
by
Post not yet marked as solved
0 Replies
12 Views
hi, in the settings in the application settings, how do I put a button there to allow the use of the camera?
Posted
by
Post not yet marked as solved
0 Replies
14 Views
In this code, I aim to enable users to select an image from their phone gallery and display it with less opacity on top of the z-index. The selected image should appear on top of the user's phone camera feed, allowing them to see the canvas on which they are drawing as well as the low-opacity image. The app's purpose is to enable users to trace an image on the canvas while simultaneously seeing the camera feed. CameraView.swift import SwiftUI import AVFoundation struct CameraView: View { let selectedImage: UIImage var body: some View { ZStack { CameraPreview() Image(uiImage: selectedImage) .resizable() .aspectRatio(contentMode: .fill) .opacity(0.5) // Adjust the opacity as needed .edgesIgnoringSafeArea(.all) } } } struct CameraPreview: UIViewRepresentable { func makeUIView(context: Context) -> UIView { let cameraPreview = CameraPreviewView() return cameraPreview } func updateUIView(_ uiView: UIView, context: Context) {} } class CameraPreviewView: UIView { private let captureSession = AVCaptureSession() override init(frame: CGRect) { super.init(frame: frame) setupCamera() } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } private func setupCamera() { guard let backCamera = AVCaptureDevice.default(for: .video) else { print("Unable to access camera") return } do { let input = try AVCaptureDeviceInput(device: backCamera) if captureSession.canAddInput(input) { captureSession.addInput(input) let previewLayer = AVCaptureVideoPreviewLayer(session: captureSession) previewLayer.videoGravity = .resizeAspectFill previewLayer.frame = bounds layer.addSublayer(previewLayer) captureSession.startRunning() } } catch { print("Error setting up camera input:", error.localizedDescription) } } } Thanks for helping and your time.
Posted
by
Post not yet marked as solved
0 Replies
15 Views
I have an iPhone app that was created in Xcode that downloads some data from Google Firebase (Firestore). Today I got a scary email from Google Firebase (as seen on the screenshot below). I'm not an expert on Google Firebase and honestly don't understand what this means. Two questions: Does this mean our database is publicly available on the surface web (so for example search engines can crawl/index it)? What do I do about this? Extremely thankful for any help!
Posted
by
Post not yet marked as solved
0 Replies
12 Views
Please run the following UIKit app. It uses a collection view with compositional layout (list layout) and a diffable data source. It has one section with one row. The cell has an image view as a leading accessory. Unfortunately, as soon as I set an image for the image view, the accessory is no longer centered: import UIKit class ViewController: UIViewController { var collectionView: UICollectionView! var dataSource: UICollectionViewDiffableDataSource<String, String>! override func viewDidLoad() { super.viewDidLoad() configureHierarchy() configureDataSource() } func configureHierarchy() { collectionView = .init(frame: .zero, collectionViewLayout: createLayout()) view.addSubview(collectionView) collectionView.frame = view.bounds } func createLayout() -> UICollectionViewLayout { UICollectionViewCompositionalLayout { section, layoutEnvironment in let config = UICollectionLayoutListConfiguration(appearance: .insetGrouped) return NSCollectionLayoutSection.list(using: config, layoutEnvironment: layoutEnvironment) } } func configureDataSource() { let cellRegistration = UICollectionView.CellRegistration<UICollectionViewListCell, String> { cell, indexPath, itemIdentifier in let iv = UIImageView() iv.backgroundColor = .systemRed // iv.image = .init(systemName: "camera") iv.contentMode = .scaleAspectFit iv.frame.size = .init( width: 40, height: 40 ) cell.accessories = [.customView(configuration: .init( customView: iv, placement: .leading(), reservedLayoutWidth: .actual, maintainsFixedSize: true ))] } dataSource = .init(collectionView: collectionView) { collectionView, indexPath, itemIdentifier in collectionView.dequeueConfiguredReusableCell(using: cellRegistration, for: indexPath, item: itemIdentifier) } var snapshot = NSDiffableDataSourceSnapshot<String, String>() snapshot.appendSections(["main"]) snapshot.appendItems(["demo"]) dataSource.apply(snapshot, animatingDifferences: false) } } This seems like a bug but then if I set the image view's size to 100x100, even without giving it an image, the cell doesn't resize, which makes me think I'm making a mistake.
Posted
by
Post not yet marked as solved
1 Replies
34 Views
With the newest version of Xcode (15.3) I cannot get Preview to load and am getting the following error: HumanReadableSwiftError CancellationError: CancellationError() I'd had this same issue a few months ago and opening up an older project's previews and then opening the project I was working on would allow Preview to show. The last few weeks I've not been getting this error and after 3 or 4 days not being in Xcode I'm getting this same error again. I'm relatively new to Xcode and Swift so not being able to load the darn preview and work through tutorials after seemingly doing the exact same thing I've been doing for months is quite ridiculous and frustrating. Any ideas on how to resolve this issue would be greatly appreciated.
Posted
by
Post not yet marked as solved
0 Replies
26 Views
My build is successful but exited with status code 1. The error is: Print: Entry, "CFBundleVersion", Does Not Exist /var/folders/yh/f54dxg054vn342yg8yz3blvm0000gn/T/SchemeScriptAction-qfIJYo.sh: line 5: File Doesn't Exist, Will Create: + 1: syntax error: invalid arithmetic operator (error token is "'t Exist, Will Create: + 1") My Info.plist file contains all the required parameters. How to resolve?
Posted
by
Post not yet marked as solved
0 Replies
29 Views
On App Store Connect, we're required to upload a screenshot of in-app purchase screens to submit them for approval. Unfortunately the uploader only seems to work about 5% of the time, with it failing (see screenshot) every other time. I've tried several different browsers and it's the same every time. Can something please be done about this? It's not acceptable for the developer tooling to be this buggy, and it's preventing many people from being able to submit in-app purchases.
Posted
by
Post not yet marked as solved
0 Replies
28 Views
I'm trying to find out of SF Symbols is the correct tool for job I have in mind. I'm wanting to create custom box drawing symbols, like those in the unicode block. Box drawing requires the lines from one symbol to connect to the lines of an adjacent symbol. Does SF Symbols allow for this connecting of symbols, or does it create some padding restriction around each symbol, preventing lines from connecting to one another?
Posted
by
Post not yet marked as solved
1 Replies
43 Views
I am puzzled by a deluge of warnings like "This code path does I/O on the main thread underneath that can lead to UI responsiveness issues. Consider ways to optimize this code path" on code that sems perfectly inocuous, like `class FileOrFolderCell: UICollectionViewCell { //... let emojiLabelInitialFontSize: CGFloat = 64. //<--- flagged as a potential hang pont (wha!!?) //... var isNew = false { //<--- potential hang point didSet { newBadge.isHidden = !isNew } } //.... }` Can anybody offer insights on how to address this? Thanks.
Posted
by
Post not yet marked as solved
0 Replies
76 Views
Hello! I'm playing around with QUIC and Swift and using the Network framework. So far, the process has been really straightforward, but I noticed that I can't seem to get a handle on the stream with identifier 0. If I use NWConnection directly, I only have access to the first stream, which has the stream ID 0. This not what I want since I wanna use multiple streams. Following the documentation, I started using NWMultiplexGroup and starting a NWConnectionGroup with it. Everything works fine and I can get all streams that my backend service opens using NWMultiplexGroup's newConnectionHandler property. However, whenever backend sends a message on stream_id 0, none of my connections receive it. Looking around with connection.metadata(definition: NWProtocolQUIC.definition) as? NWProtocolQUIC.Metadata for each connection, I see that all streams are accounted for except stream 0. Then, using the NWConnectionGroup variant of the above connectionGroup.metadata(definition: NWProtocolQUIC.definition) as? NWProtocolQUIC.Metadata I see that the connection group itself has Stream ID 0. However, calling setReceiveHandler does nothing (it's never called, even when backend is sending messages) and when I attempt to send a message using NWConnectionGroup's -send method, a new stream is opened (instead of it being sent on stream ID 0). How can one get a handle on NWConnection for stream ID 0?
Posted
by
Post not yet marked as solved
0 Replies
36 Views
I using a Macbook pro with an m2 pro chip. I was trying to work with TensorFlow but I encountered an illegal hardware instruction error. To resolve it I initiated the installation of a metal plugin which is throwing the following error. or semicolon (after version specifier) awscli>=1.16.100boto3>=1.9.100 ~~~~~~~~~~~^ Unable to locate awscli [end of output]
Posted
by
Post not yet marked as solved
0 Replies
45 Views
I am including the glm library in my Xcode project and want to suppress this warning: /opt/extlibs/macosx/include/glm/./ext/../gtc/bitfield.inl:343:15: warning: Although the value stored to 'x' is used in the enclosing expression, the value is never actually read from 'x' [deadcode.DeadStores] uint16 REG2(x >>= 1); ^ ~ Is there a way to do that via a #pragma or a #define or something else in the Build Settings?
Posted
by
Post not yet marked as solved
0 Replies
37 Views
https://developer.apple.com/documentation/xcodekit/creating_a_source_editor_extension I created new MacOS project and added a Xcode Source Editor Extension target to the project. I run the extension in debug mode with extension target, but the extension is not show up in Editor menu debug mode Xcode. Xcode version is 15.3(released) MacOS version is 14.4.1 Sonoma
Posted
by
Post not yet marked as solved
0 Replies
37 Views
Hi, Someone sent me this on snapchat, can anyone tell what it is? opened it i think its a virus trying to steal information. file:///private/var/mobile/Containers/Data/Application/********************39B16/tmp/asf.pdf
Posted
by
Post not yet marked as solved
0 Replies
36 Views
I am trying to fetch static routes added on my mac machine by DHCP server. I am able to get DHCP info using SCDynamicStoreCopyDHCPInfo and then get DHCP options using DHCPInfoGetOptionData. However, I could not find any API that can help me parse the raw data returned by DHCPInfoGetOptionData. Since macOS is parsing and adding these static routes and also displaying them in AdditionalRoutes of service, is there any API available to developers to parse this raw data into destination, mask and gateway?
Posted
by

TestFlight Public Links

Get Started

Pinned Posts

Categories

See all