Welcome to the Apple Developer Forums

Post your questions, exchange knowledge, and connect with fellow developers and Apple engineers on a variety of software development topics.

For questions about using Apple hardware and services, visit Apple Support Communities

Posts

Sort by:
Post not yet marked as solved
0 Replies
30 Views
I set up my Mac to power off automatically at night a while back (pre-update) but now want to change back. I can't find where the energy saver settings have moved. Is there any way for me to disable this?
Posted
by
Post not yet marked as solved
0 Replies
36 Views
Hello, I wonder why new overlay (and background too) function introduced in iOS 15 isn't available in previous versions, but Section inits are available? Probably according to articles in the internet it uses _alwaysEmitIntoClient swift attribute. Is it design flaw? iOS 15 overlay, which is limited only to iOS15: @inlinable public func overlay<V>(alignment: Alignment = .center, @ViewBuilder content: () -> V) -> some View where V : View pre iOS 15 overlay:     @available(iOS, introduced: 13.0, deprecated: 100000.0, message: "Use `overlay(alignment:content:)` instead.")     @available(macOS, introduced: 10.15, deprecated: 100000.0, message: "Use `overlay(alignment:content:)` instead.")     @available(tvOS, introduced: 13.0, deprecated: 100000.0, message: "Use `overlay(alignment:content:)` instead.")     @available(watchOS, introduced: 6.0, deprecated: 100000.0, message: "Use `overlay(alignment:content:)` instead.")     @inlinable public func overlay<Overlay>(_ overlay: Overlay, alignment: Alignment = .center) -> some View where Overlay : View Section iOS 15 ViewBuilder init, which is available in previous versions: public init(@ViewBuilder content: () -> Content, @ViewBuilder header: () -> Parent, @ViewBuilder footer: () -> Footer) Section iOS 13 init: extension Section where Parent : View, Content : View, Footer : View {     @available(iOS, deprecated: 100000.0, renamed: "Section(content:header:footer:)")     @available(macOS, deprecated: 100000.0, renamed: "Section(content:header:footer:)")     @available(tvOS, deprecated: 100000.0, renamed: "Section(content:header:footer:)")     @available(watchOS, deprecated: 100000.0, renamed: "Section(content:header:footer:)")     public init(header: Parent, footer: Footer, @ViewBuilder content: () -> Content) }
Posted
by
Post not yet marked as solved
1 Replies
22 Views
I did an update on my Mac recently that made me re-install Xcode and Cocoapods. I tried to archive the latest version of my iOS app and I specify it as "1.28" under the "General" tab and in the "Identity" section. When it is done archiving and the Organiser pops up it shows the app as version 1.0. I've been told I should try cleaning my build folder. I did that under Product --> Clean Build Folder but that doesn't help.
Posted
by
Post not yet marked as solved
0 Replies
16 Views
Hi everyone! Ladies and gents, I am struggling with the issue for 2+ weeks in a raw, still stuck and I appreciate any help / advices / suggestions! What I am dealing with: web page + backend (php), swift app (wkwebview + some native components). What I am trying to achieve: I need to let the web page know my app is changing it's state, by executing some java scripts (one script for "enter background mode", another one for "enter foreground", and so on). What is my issue: I can't handle the case of app termination. Whenever the user is killing the app by home-double-click/swipe up, ApplicationWillTerminate method from AppDelegate is being called, but it fails to execute webView.evaluateJavaScript from here, as far as I was able to understand - due to the closure / completion handler is has, for it is async by design. All other cases are covered, works fine, and with the last one for termination I am desperately stuck. I am playing around with the following code: func applicationWillTerminate(_ application: UIApplication) {         if let callback = unloadListenerCallback {             if callback == "" {                 debugPrint("got null callback - stop listening")                 unloadListenerCallback = nil             }             else {                 jsCallbackInjection(s: callback) //executing JS callback injection into WebView             }         }     } unloadListenerCallback is the string? variable, works as a charm in other cases (just to mention it for clarity). jsCallbackInjection is the function, also works perfectly elsewhere: func jsCallbackInjection(s: String) {         let jscallbackname = s         HomeController.instance.webView?.evaluateJavaScript(jscallbackname) { (result, error) in              if error == nil {                  print(result as Any)                  print("Executed js callback: \(jscallbackname)")              } else {                  print("Error is \(String(describing: error)), js callback is: \(jscallbackname)")              }          }     } My ask is: How do I made this code working, if possible? Any ideas, suggestions, tips or tricks? If not possible, any ideas on "how do I let my web counterpart know my app was terminated"? What do I do from here? Many many thanks in advance!
Posted
by
Post not yet marked as solved
0 Replies
13 Views
Hi, Anyone found a way, to prevent automounting the downloadable components (watchOS 9 SDK/simulator and tvOS 16 SDK/simulator) from Xcode 14 on every boot? Maybe, changing the 'mountPolicy' property on '/Library/Developer/CoreSimulator/Images/images.plist' will works? If it works, or if I are already umounted the dmg's, there are any way to manually mount it? Because, i need to reboot my Mac, if i would like to do something in Xcode that are related to watchOS/tvOS.
Posted
by
Post marked as solved
1 Replies
33 Views
Right now I am having a very difficult time trying to get CMake+LLVM (clang) working proper on macos. Microsoft Visual Studio doesn't seem to support C++ development on macos, XCode seems to want to completely ignore the ~/bin and /usr/bin folders when executing custom build commands (I wrote a script to call cmake and make in the proper directories), and VSCode just SKIPS all my breakpoints (and it appears LLVM is completely ignoring the -g and excluding debug symbols)... Has anyone been able to get a platform-independent toolset running on macos??? If so how have you been able to do this and what toolset + IDE are you using? If you were able to get XCode of VSCode to work how did you do it? maybe I'm doing somthing wrong. Here is my cmakelists.txt: (https://pastebin.com/RymrmUfk) Here is my build command: (https://pastebin.com/wbdpccZ6)
Posted
by
Post not yet marked as solved
0 Replies
17 Views
The examples in LearnMetalCpp do in the renderer's draw method something like this: select a frame for the instance buffer create a new command buffer call dispatch_semaphore_wait to make sure that the selected instance buffer is not used by Metal put dispatch_semaphore_signal into the command buffer's completed handler modify the instance buffer and some other Metal related variables commit the command buffer Depending on the number of frames used and the complexity of the scene there can be a couple of frames in the command queue. Suppose the window (and its related view) is closed while Metal is still busy with items in the command queue. This means that the semaphore is still in use. How is it guaranteed that the semaphore is destroyed after the view is closed? Or is it guaranteed that the view's destructor is only called after the command queue has finished all its work?
Posted
by
Post not yet marked as solved
0 Replies
22 Views
Hey, there's an issue in the latest Xcode 14.1 beta (14B5024h) where importing the GameController module causes the build to fail. It produces the following error: Failed to build module 'GameController' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug Steps to reproduce Create new Xcode app project Add the line import GameController to the top of the file It can't build and fails with the above error. I've also filed a bug report with Apple (FB11538209). Please fix this issue!
Posted
by
Post not yet marked as solved
0 Replies
20 Views
The colors of led indicator mentioned are blue and red, but we are currently using blue and orange. I like to confirm that is it mandatory to be blue/red, or we can keep blue/orange instead and use orange led to follow the behavior of red led in the test case?
Posted
by
Post not yet marked as solved
0 Replies
30 Views
Each time I try to run or build project with Xcode 14 (any version up to 14.0.1) it builds like it is building after Clean Build Folder, even if I changed 1 line of code. For example, Xcode 13 building my project in 220 sec for the first time (after Clean Build Folder), and after that (changing 1 line) build time is 35-60 sec. In Xcode 14 every build takes 220-240 sec. Tried to change Optimization Level, Compilation Mode (it's Incremental) in build settings, but that doesn't matter. Where do I need to look to find the problem?
Posted
by
Post not yet marked as solved
1 Replies
25 Views
I'm unable to use XCode 14 to develop my app because as soon as a compiler error is shown, it is immediately withdrawn from the Issue Navigator pane. This makes it impossible to see what is wrong. The errors are also immediately withdrawn from the editor. This video shows 3 attempts to compile the project: after the first attempt no error shows, after the second attempt the error shows for a moment then is automatically removed (no mouse or keypress from me), after the third attempt same. https://youtu.be/bmK_k6oLYpQ I have tried rebooting, and deleting ~/Library/Developer/Xcode/DerivedData, to no effect.
Posted
by
Post marked as solved
1 Replies
21 Views
Why is there no custom label displayed? Thanks for an answer. struct ContentView: View{     @State var selection = 0     let numbers = [1,2,3,4,5]     var body: some View{         Picker(selection: $selection, content: {             ForEach(numbers,id:\.self){i in                 Text("Number \(i)").tag(i)             }         }, label: {             Text("\(selection)")                 .padding()                 .background(Circle().foregroundColor(.red))         })         .pickerStyle(MenuPickerStyle())     } }
Posted
by
Post not yet marked as solved
0 Replies
18 Views
There is no sound in video playback implemented by AVFoundation elements, in iPad 9 (maybe other as well, but not all models) in iPadOS 16.1 (beta 1 + 2). The issue is solve-able by explicitly setting AVAudioSession mode (ambient, mix, exclusive, etc.). But there is no such behaviour in iphone's, so it's a bug, or if it's intended change, then it should be documented.
Posted
by
Post not yet marked as solved
0 Replies
21 Views
Although having a .ignoresSafeArea modifier attached, the button for the menu gets pushed up a little bit. I don't know why. When using a regular picker with .pickerStyle(MenuPickerStyle()) I can't get a custom label. Thanks for an answer import SwiftUI struct ContentView: View { @State var text = "" @State var selection = "" let foo = ["a","b","c"] @FocusState var focus var body: some View{ GeometryReader{_ in ZStack{ Color(UIColor.systemGray6) ScrollView{ VStack{ TextField("title", text: $text) .focused($focus) .frame(maxWidth: .infinity, maxHeight: .infinity) .border(.orange) Spacer() } .frame(maxWidth: .infinity, maxHeight: .infinity) } overlayInZStack // <-------- here is the overlay } .frame(maxWidth: .infinity, maxHeight: .infinity) } .ignoresSafeArea(.keyboard, edges: .bottom) // <------ modifier attached } var overlayInZStack: some View { VStack{ Spacer() HStack{ Button("focus"){ focus = true } Menu(content:{ // <----- menu picker in bottom tool row Picker(selection: $selection, label: EmptyView() , content: { ForEach(foo,id:\.self){f in Label(f, systemImage: "house") .tag(f) } }) Picker(selection: $selection, label: EmptyView() , content: { Label("test", systemImage: "plus.circle.fill") .tag("test 1") }) },label:{ Image(systemName: "house") .padding(10) .background(Circle().foregroundColor(.red)) .border(Color.red) }) .border(Color.orange) } .border(Color.green) } .frame(maxWidth: .infinity, maxHeight: .infinity) .border(Color.black) } }
Posted
by
Post not yet marked as solved
0 Replies
18 Views
Hi! I'm working with a drag and drop method, using a collection view. Is there possible to return UICollectionViewDropProposal (in the collectionView(_ collectionView: UICollectionView, dropSessionDidUpdate session: UIDropSession, withDestinationIndexPath destinationIndexPath: IndexPath?) -> UICollectionViewDropProposal method) with both intents: .insertAtDestinationIndexPath and .insertIntoDestinationIndexPath? I would like to recive a feature like on iOS Reminders - you may insert into list (and create a group) or insert at (and reorder). Thanks in advance.
Posted
by

Pinned Posts

Categories

See all