Hi,
I'm trying the new Swift Testing instead of XCTest for my new project. I am using RxSwift+UIKit. And when I am trying to test my ViewModel that has a Driver in it, it crashes due to the driver is not being called form main thread.
Thread 5: Fatal error: `drive*` family of methods can be only called from `MainThread`.
Here is the test code:
struct PlayerViewModelTest {
@Test func testInit_shouldPopulateTable_withEmpty() async throws {
// Arrange
let disposeBag = DisposeBag()
var expectedSongTableCellViewData: [SongTableCellViewData]?
// Act
let sut = PlayerViewModel(provideAllSongs: { return .just(mockSongList) },
provideSongByArtist: { _ in return .just(mockSongList) },
disposeBag: disposeBag)
sut.populateTable
.drive(onNext: { expectedSongTableCellViewData = $0 })
.disposed(by: disposeBag)
// Assert
#expect(expectedSongTableCellViewData != nil, "Should emit something so it should not be nil")
#expect(expectedSongTableCellViewData!.isEmpty, "Should emit empty array")
}
}
This never happen in XCTest. So I assume Swift Testing is not being run in the main thread? How do I fix this?
Thanks
This is a dedicated space for developers to connect, share ideas, collaborate, and ask questions. Introduce yourself, network with other developers, and join us in fostering a supportive community.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello, why is apple won’t adding Just-In-Time compiler to ”Emulators” in the app store. And/or hypervisor for newer devices.
i feel like UTM (which is a PC Emulator) or other Apps that emulate need JIT to work properly, and will consume significantly less battery to emulate/virtualize, And will have a noticeably better performance than just not enabling JIT, and by the way jit is already being used on iPadOS/iOS 18.3/18.3.1 and newer/older version of that so being enabled by the choice of the developer of the App is more convenient than doing it with tools.
and by the why apple wont let emulators on iPads and newer iPhones do hypervisor, it’s better than JIT but requires a good cpu, like making it available to people with newer/powerful devices, hypervisor is better than JIT by a lot and removing it in iPadOS/iOS 18.4 was an unnecessary choice?, becuase it had a better potential in virtualization instead of emulating, and I feel like enabling it In M1-M2 iPads and A14-18pro and newer devices is just better from having it disabled, to unlock the fullest potential of the iPad it needs to have a app or something to do instead of just running high graphics games/or Apps.
i am seeing a call icon on CallKit incoming call screen for a PushKit-initiated call (without caller information like name or number)
Hello, I am trying to enroll to apple developer program as solo developer. While trying to enroll via app my passport and drivers license are not validated. When trying to enroll via web, I fill in the details and try to make the payment, but payment itself is not deducted from my bank account. I receive email that payment is being processed, but nothing further happens.
Topic:
Community
SubTopic:
Apple Developers
我们的App被AppStoreNotices直接下架,说我们侵权,但我们找到对应公司的负责人,他们说没有投诉过我们,是别人冒用他们的名义投诉,并且给我们开了带公章的证明文件发给AppStoreNotices。但已经两个月了,AppStoreNotices一直没有回复我们。他们没有经过仔细的审核就因为别人的诬告直接下架我们的APP,而且两个月了还不回复我们邮件,这是什么问题?请问该怎么联系上他们,有没有除了邮件外的其他方式
Our App was removed from App Store by AppStoreNotices, saying that we infringed Copyright. And we called the person in charge of the corresponding company, and they said that they had not complained about us, others had falsely complained in their name, and issued us a certification document with official seal and sent it to AppStoreNotices. But it's been two months, and AppStoreNotices hasn't gotten back to us. They removed our APP because of false accusations without careful review, and they haven't replied to our email for two months. What's the problem? How can I contact them? Is there any other way besides email
Topic:
Community
SubTopic:
Apple Developers
ISAC Client is crashing on macOS 15.4 Beta 1 which is from from the WebKit engine the underlying framework of WKWebView. And the "ResourceLoadNotifier" is from WebKit's internal framework.It seems to be related to resource loading failure which is potentially triggered by changes in macOS 15.4 Beta.
Hi,
I am testing my app with TestFlight. The app is developed with React Native Expo.
Step 1: Log into the app – everything works fine.
Step 2: Use the app – everything works fine.
Step 3: Close the app without logging out, just close it.
Step 4: Remove the app from the recent apps window.
Step 5: Try to open the app again, but it requires login again.
I don’t understand why the login parameters are not retained and why the app asks me to log in again.
Code used for login handling:
import AsyncStorage from "@react-native-async-storage/async-storage";
useEffect(() => {
const loadToken = async () => {
const token = await AsyncStorage.getItem(TOKEN_KEY);
if(token) {
axiosInstance.defaults.headers.common['Authorization'] = `Bearer ${token}`;
try {
const response = await axiosInstance.get('/auth/check');
const data = response.data;
setSession(token);
setUser(data.user);
} catch (e) {
setSession(null);
setUser(null);
}
}
}
loadToken().then(() => setIsLoading(false));
}, []);
Important Note:
This issue only occurs when we switch to production. In the test environment, everything works fine, and we don’t experience this problem. However, as soon as we build for production and test on multiple devices, this issue appears.
Thanks in advance!
Topic:
Community
SubTopic:
Apple Developers
Hi! can someone please help me?
the chase app will not work nor can I access it in the browser. I have tried literally everything - restarting my phone, deleting the app and reinstalling, resetting network settings, resetting all settings, clearing caches on all browsers. Everything is up to date. apps and my OS. nothing.
I don’t want to wipe my phone by doing a factory reset. I called chase and they said it was a known issue and they’re working on a solution and that it would be resolved that day. this was 3 days ago. Is anyone else experiencing this issue?? What caused it and what is a solution?
Topic:
Community
SubTopic:
Apple Developers
I am developing a flutter app that connects the app to the boat VCU through Wi-Fi. In the iOS version of the mobile app, when the device connects to a Wi-Fi network, iOS assumes that all network traffic should route through Wi-Fi. As the connected Wi-Fi network has no internet access, iOS prompts the user with the options: "Use Mobile Data" or "Keep Trying Wi-Fi."
If the user selects "Keep Trying Wi-Fi," mobile data will not be used by other apps on the phone.
If the user selects "Use Mobile Data," the app switches to mobile data while remaining connected to the Wi-Fi network (VCU) without any issues. The issue is we need to find a way to prevent showing that prompt and instead handle this through code. After connecting to VCU, the mobile network is available for a few second but then it switches to wifi and no internet! I checked all the online documentation but there is not any solution for it. So, I need to stay connect to vcc and other apps use mobile data. I tried WiFiForIoTPlugin.forceWifiUsage(false); but didn't work. I tried adding delay that also didn't work. This is the function in my code that handles connecting to Wi-fI: Future connectToWifi() async {
try {
if (Platform.isAndroid) {
isConnected = await WiFiForIoTPlugin.connect(
_vesselData['ssid'],
password: _vesselData['passphrase'],
security: NetworkSecurity.WPA,
// Enable Internet access
withInternet: false,
isHidden: true,
timeoutInSeconds: 10,
joinOnce: true,
);
// Force Android to treat Wi-Fi as the primary network using
await WiFiForIoTPlugin.forceWifiUsage(true);
} else if (Platform.isIOS){
isConnected = await WiFiForIoTPlugin.connect(
_vesselData['ssid'],
password: _vesselData['passphrase'],
security: NetworkSecurity.WPA,
isHidden: true,
timeoutInSeconds: 10,
// Ensures the connection remains persistent, preventing the system from disconnecting the device.
joinOnce: false,
);
}
if (isConnected) {
log("Connected to ${_vesselData['ssid']}");
streamData();
} else {
log("Failed to connect to ${_vesselData['ssid']}");
}
} catch (e) {
log("Error: $e");
}
}
I use :Device Model: iPhone 12 Pro Max
iOS Version: iOS 18.3.1
Xcode Version: Xcode 16.2
Mac Version: macOS Sonoma 14.3
Newbie in Xcode and in coding in general. Getting this massive error code and can’t seem to fix it. Please help
Topic:
Community
SubTopic:
Apple Developers
I have the following questions that need official answers:
1: Whether the Bluetooth scanning cycle can be controlled through the software level. If it can be controlled, please tell me how to control it.
2: Now the IOS mobile phone scanning strategy, how long is the scanning cycle, and what is the scanning duty cycle in this scanning cycle
Topic:
Community
SubTopic:
Apple Developers
I am a startup founder based in India. Recently the iOS developer we were working with left the company in some what acrimonious circumstances.
Post his departure from the company, he has made it clear that he will try to cause damage to our iOS app to the extent that it starts to crash.
Even though we have removed his access, as a non tech founder, I am not sure what ways he can edit or hamper our iOS app and what measures we can take to protect the same.
Please advise us with steps for us to secure our code and ensure no one can edit the same or hamper our iOS app on the app store.
Thank you
I upgraded my macOS to 13.7.5 and since then I cannot open Adobe InDesing on my iMac.
I contacted Adobe Support to assist with the issue and they couldn't find any solution from their side. Probably the update is not compatible?
Is there a way I can solve this issue? Or remove the beta version from my system?
Topic:
Community
SubTopic:
Apple Developers
Hi, I'm trying to figure out how to edit the bootps.plist which is in the system / library directory. I have an M4 MacBook running OS 15.3.2 and I've held down the power button to go into recovery mode, and in terminal entered the 'csrutil disable' command and have restarted but when I go back to 'get info - Sharing & Permissions' I can't change any of the permissions. I need to be able to edit this file to create DHCP server.
How can I change edit permissions on the bootps.plist?
Topic:
Community
SubTopic:
Apple Developers
After I got my repaired phone back from the shop, I noticed that iphone mirroring is not functioning like normal. I tried every solutions from deleting the .plist files and reset my phone's connection, but now it seems like the problem comes from the mirroring app itself. After deleting the .plist file and resetting the MBP, the setup for the mirroring app won't let me continue, as clicking the "continue" button only flash the descriptions of the mirroring feature for a slight moment, then return to the same setup UI as before. Is there anyway to completely delete and reinstall this app so that it functions again?
Topic:
Community
SubTopic:
Apple Developers
Dear Apple Support Team,
I am trying to shared data between two different App target. Target A is main iOS app and Target B is Intent Extension. I have create app group and utilise app group to share data between different target but when setting the user default from Target B stile getting container null.
Target B UserDefault object details
sharedDefaults UserDefaults 0x0000600000c05110
baseNSObject@0 NSObject
kvo id 0x0 0x0000000000000000
[0] id
identifier __CFString * "group.com.xxxx. xxxx" 0x0000600001704900
container __CFString * NULL 0x0000000000000000
_volatileDomainNames id 0x0 0x0000000000000000
[0] id
Code snippet in Target B to setting UserDefault
guard let sharedDefaults = UserDefaults(suiteName: SharedUserDefaults.suitName)else {
completion(MuteIntentResponse(code: .failure, userActivity: nil))
return
}
///["event": AudioCommand.mute.rawValue]
sharedDefaults.set("test", forKey: SharedUserDefaults.Keys.audioCommand)
let didSynchronize = sharedDefaults.synchronize()
print("Intent Extension: Wrote Synchronize successful: \(didSynchronize)")
guard let command = sharedDefaults.string(forKey: SharedUserDefaults.Keys.audioCommand) else {
completion(MuteIntentResponse(code: .failure, userActivity: nil))
return
}
print("userDef \(command)")
While reading UserDefault value in Target A
UserDefault object details
baseNSObject@0 NSObject isa Class NSUserDefaults 0x01000001efe1a8a9 kvo id 0x0 0x0000000000000000 identifier __CFString * "group.com.xxxx. xxxx” 0x0000600001782200 container __CFString * NULL 0x0000000000000000 _volatileDomainNames id 0x0 0x0000000000000000 [0] id
Reading UserDefault value Code
if let def = UserDefaults(suiteName: SharedUserDefaults.suitName){
print("commandInfo (def.string(forKey: SharedUserDefaults.Keys.audioCommand))")
}
Please let me know what I am doing wrong.
Topic:
Community
SubTopic:
Apple Developers
when I receive calls on my mobile number and I am connected to a Wifi, the calls is cancelled after the second ring and the caller receives a busy signal. That means I cannot receive calls anymore.
This problems happens with different mobile providers and does not occur on my Samsung Galaxy Phone with the same number (eSim).
Even when I disable WIFI Calling the problem persists, when I am connected to a WIFI.
Only when I disable the WIFI Connect and I am only connected to the mobile carrier, the calls go throuhg in a normal way.
VERY annoying and hast not been fixed with Beta 3 of iOS 18.4.
Any clue how this can be solved with settings?
Hope Apple fixes this very soon!
Topic:
Community
SubTopic:
Apple Developers
I‘m getting tired of having to reinstall apps because of the amount of datas. I deleted alot of photos. Deleted apps. The thing that gets my storage full is the System data. I searched up for tutorials, it was full with clearing safari history or deleting old messages, offloading apps. I did them all, none of them decreased my system data and its at 12GB while my phone‘s GB is only up to 64GB. I use IOS 16 Iphone 11. Can someone help?
i need help, i have a groupchat with friends, but it recently glitched and now i have 2 of the same one with half of the original conversation. i already tried leaving the duplicate and deleting the convo but it still reappears and it glitched back. i asked others in the chat if they’re experiencing the same issue and they are.
I am having trouble passing custom data in an array with a navigation stack. I want to display a subview with the same data structure (title, headline, picture placement etc), with different data attached for each of my list view items