How do I use Core Bluetooth in the simplest possible way to send a value of 0 to 1 from an iOS device to a bluetooth peripheral that does nothing but interpret the value sent to it as how strongly a vibrating component on the bluetooth peripheral should vibrate. A value of zero would mean the peripheral device doesn't vibrate at all, of course.
The bluetooth peripheral would be the bluetooth ***** of course, and the iOS device would be the bluetooth master. The ***** device doesn't need to send anything at all to the master iOS device, except to link to the master. I don't know if that would allow the ***** bluetooth device to be any less expensive or smaller or simpler.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Why did I get an error in playground in debug window for this code?
print("// MARK: - Start execable code here...")
do {
let store = CNContactStore()
if try await store.requestAccess(for: .contacts) {
// Do something with Contacts.
let phoneNumber = CNPhoneNumber(stringValue: "903-276-1046")
let predicateForContactsMatchingPhoneNumber = CNContact.predicateForContacts(matching: phoneNumber)
let contactFetchRequest = CNContactFetchRequest(keysToFetch: thoroughKeysToCompare)
contactFetchRequest.predicate = predicateForContactsMatchingPhoneNumber
contactFetchRequest.unifyResults = true
var contactOfMe: CNContact! = nil
try! store.enumerateContacts(with: contactFetchRequest) {
contact, stop in
contactOfMe = contact
stop.pointee = true
}
let contact = Contact(cnContact: contactOfMe)
for property in contact.enumerated() {
print("- \(property)")
}
} else {
// Handle if Contacts access is denied.
fatalError()
}
} catch {
// Handle any error.
print("error requesting access: \(error.localizedDescription)")
}
Debug window:
// MARK: - Start execable code here...
Playground execution failed:
error: Execution was interrupted, reason: shared-library-event.
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
* thread #1, queue = 'com.apple.main-thread'
frame #0: 0x00007ff80002f931 libobjc.A.dylib`_mapStrHash(_NXMapTable*, void const*) + 73
frame #1: 0x00007ff80002fc7f libobjc.A.dylib`_NXMapMember(_NXMapTable*, void const*, void**) + 35
frame #2: 0x00007ff80003b7ae libobjc.A.dylib`getProtocol(char const*) + 41
frame #3: 0x00007ff8000428e6 libobjc.A.dylib`class_conformsToProtocol + 337
frame #4: 0x00007ff80004ab4e libobjc.A.dylib`-[NSObject conformsToProtocol:] + 47
frame #5: 0x0000000109c27951 UIKitCore`_UIFocusItemContainerIsScrollableContainer + 74
frame #6: 0x0000000109c28e38 UIKitCore`-[_UIFocusEnvironmentContainerTuple initWithOwningEnvironment:itemContainer:] + 194
frame #7: 0x0000000109c28fed UIKitCore`+[_UIFocusEnvironmentContainerTuple tupleWithOwningEnvironment:itemContainer:] + 70
frame #8: 0x0000000109c4f41e UIKitCore`_UIFocusRegionContainerFromEnvironmentAndContainer + 44
frame #9: 0x0000000109c27ed3 UIKitCore`_UIFocusItemContainerAddChildItemsInContextWithArguments + 1162
frame #10: 0x000000010a99c439 UIKitCore`-[UIView _searchForFocusRegionsInContext:] + 962
frame #11: 0x0000000109c6b37f UIKitCore`-[_UIFocusMapSnapshot addRegionsInContainer:] + 4583
frame #12: 0x0000000109c69740 UIKitCore`-[_UIFocusMapSnapshot _capture] + 456
frame #13: 0x0000000109c67fc5 UIKitCore`-[_UIFocusMapSnapshot _initWithSnapshotter:mapArea:searchArea:] + 628
frame #14: 0x0000000109c6cce2 UIKitCore`-[_UIFocusMapSnapshotter captureSnapshot] + 227
frame #15: 0x0000000109c5f450 UIKitCore`-[_UIFocusMap _inferredDefaultFocusItemInEnvironment:] + 147
frame #16: 0x0000000109c2b1cf UIKitCore`-[_UIFocusEnvironmentPreferenceEnumerationContext _inferPreferencesForEnvironment:] + 157
frame #17: 0x0000000109c2abbc UIKitCore`-[_UIFocusEnvironmentPreferenceEnumerationContext _resolvePreferredFocusEnvironments] + 118
frame #18: 0x0000000109c2ab12 UIKitCore`-[_UIFocusEnvironmentPreferenceEnumerationContext prefersNothingFocused] + 31
frame #19: 0x0000000109c2beeb UIKitCore`_enumeratePreferredFocusEnvironments + 198
frame #20: 0x0000000109c2c061 UIKitCore`_enumeratePreferredFocusEnvironments + 572
frame #21: 0x0000000109c2c061 UIKitCore`_enumeratePreferredFocusEnvironments + 572
frame #22: 0x0000000109c2c061 UIKitCore`_enumeratePreferredFocusEnvironments + 572
frame #23: 0x0000000109c2bd11 UIKitCore`-[_UIFocusEnvironmentPreferenceEnumerator enumeratePreferencesForEnvironment:usingBlock:] + 230
frame #24: 0x0000000109c2c747 UIKitCore`-[_UIDeepestPreferredEnvironmentSearch deepestPreferredFocusableItemForEnvironment:withRequest:] + 817
frame #25: 0x0000000109c95837 UIKitCore`-[UIFocusUpdateContext _updateDestinationItemIfNeeded] + 265
frame #26: 0x0000000109c95627 UIKitCore`-[UIFocusUpdateContext _destinationItemInfo] + 22
frame #27: 0x0000000109c95535 UIKitCore`-[UIFocusUpdateContext nextFocusedItem] + 24
frame #28: 0x0000000109c71ea6 UIKitCore`-[UIFocusSystem updateFocusIfNeeded] + 1347
frame #29: 0x0000000109c7608c UIKitCore`__43-[UIFocusSystem _updateFocusUpdateThrottle]_block_invoke + 34
frame #30: 0x000000010a94b971 UIKitCore`-[_UIAfterCACommitBlock run] + 57
frame #31: 0x000000010a94be71 UIKitCore`-[_UIAfterCACommitQueue flush] + 191
frame #32: 0x000000010a3926eb UIKitCore`_runAfterCACommitDeferredBlocks + 782
frame #33: 0x000000010a380fa2 UIKitCore`_cleanUpAfterCAFlushAndRunDeferredBlocks + 96
frame #34: 0x000000010a3b6be1 UIKitCore`_afterCACommitHandler + 58
frame #35: 0x00007ff8003b1c12 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
frame #36: 0x00007ff8003ac57f CoreFoundation`__CFRunLoopDoObservers + 515
frame #37: 0x00007ff8003acaa2 CoreFoundation`__CFRunLoopRun + 1121
frame #38: 0x00007ff8003ac264 CoreFoundation`CFRunLoopRunSpecific + 560
frame #39: 0x00007ff8003ad234 CoreFoundation`CFRunLoopRun + 40
frame #40: 0x00007ff83755a4e3 libswift_Concurrency.dylib`swift_task_asyncMainDrainQueueImpl() + 35
frame #41: 0x00007ff83755a4b4 libswift_Concurrency.dylib`swift_task_asyncMainDrainQueue + 52
frame #42: 0x00000001015d409f $__lldb_expr32`main at <unknown>:0
frame #43: 0x0000000100e25560 EnumeratedContactsCNContact`linkResources + 256
frame #44: 0x00007ff8003b2986 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
frame #45: 0x00007ff8003b2148 CoreFoundation`__CFRunLoopDoBlocks + 399
frame #46: 0x00007ff8003ace09 CoreFoundation`__CFRunLoopRun + 1992
frame #47: 0x00007ff8003ac264 CoreFoundation`CFRunLoopRunSpecific + 560
frame #48: 0x00007ff809b4024e GraphicsServices`GSEventRunModal + 139
frame #49: 0x000000010a3827bf UIKitCore`-[UIApplication _run] + 994
frame #50: 0x000000010a3875de UIKitCore`UIApplicationMain + 123
* frame #51: 0x0000000100e256c5 EnumeratedContactsCNContact`main + 357
frame #52: 0x0000000100fbb384 dyld_sim`start_sim + 10
frame #53: 0x000000010943341f dyld`start + 1903```
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags:
Swift Playground
Debugging
Contacts
LLDB
I'm getting message "This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode. You may also need to restart your mac and device in order to correctly detect compatibility." when I try to run an Xcode iOS project on my iPhone 8. I'm using Xcode 13.2.1 and iOS 15.4 on my iPhone 8.
This post in this forums gives the solution to restart the iOS device and I did that and also restarted the mac. My Mac has macOS Monterey 12.3. My Xcode, Mac, and iPhone 8 all have the most recent updates. That post gives an answer for the same problem but with iOS 15.2.
I have recently changed settings in my iPhone 8 in Accessibility. Could that affect anything?
If I want to compare characters in iOS using the character code, how do I decide whether to compare the characters by their utf8 or utf16 or ascii code values?
I specifically would like to remove all characters from a CNPhoneNumber.stringValue that other than digits.
I have this error:
[AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:963
It is preceded by lots of this message, if it matters:
[Assert] +[UIInputViewSetPlacementInvisible placementWithPlacement:]: Should not be called with an invisible placement
I thought it was because I didn't include a key in Info.plist, but I put keys in there that I thought might be needed.
I am using CloudKit sharing and silent push notifications for CloudKit subscriptions, and the Apple documentation says when I set the capabilities for background fetch and remote notifications, the keys would be put in Info.plist by Xcode.
Does this have anything to do with the fact that when my app is run for the first time it asks the user for permission to send notifications. If it's a silent notification that I'm using, I thought the documentation meant the user is not notified at all?
I have searched on the internet and on stack overflow and in Apple developer forums for a solution. Any help will be appreciated.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags:
CloudKit
Background Tasks
User Notifications
Anyone know how to use the Share Extension for iOS that either shows an alert or shows nothing at all when another app shares with your app?
Am I allowed to use a UIAlertController?
I am preparing to submit an app for the very first time.Why is the default version number 1.0? Doesn't that 0 get truncated? Would it be better if I changed the version number to 1? Would it make a difference?
I'm trying out Apple's Document Browser
I am trying to find what UTTypeIdentifier com.apple.coreaudio-format conforms to for the UTTypeConformsTo item in Info.plist of said project. I was able to find com.apple.coreaudio-format, but I am having trouble finding the UTTypeConformsTo value for that.
Anyone can guide me or give me a hint?
Have any of you ever tried using a UITextView in stead of UITextField to do what UITextField does and does not do? I think it would make coding easier to since the two classes are similar but has to be treated a little differently by the code.
If I've already set contraints using code in iOS, how do I change the constraits?
Which build caches and unused SDKs can I delete to free up storage on my Mac Pro with the latest macOS Monterey that I just updated? The all fall under the heading "Xcode Project Build Files". I see some that are considered "Xcode Project Build Files" and some "iOS Device Support" and some that are considered "BridgeOS Device Support". They all have the Xcode icon. I explain in detail below how I get to this screen. Basically it's in the System Information app. I'm not sure what is safe to delete.
I have to free up space to update my Xcode on my Mac Pro. When I look at the screen that shows when I got to the Apple Logo on the very top left-hand corner of the menu, then go to About this Mac, then the Storage Tab and then click on the button that says "Manage...", then click on the button that says "Review Files"... When I click on "Developer" on the left tab, I see some rather large files. At the top it says, "Remove project build caches and unused SDKs to free storage space."
Does a database subscription send a notification when the current user of the device accept a CloudKit share?
Has anyone noticed that with the latest iOS (16.1.2), UICloudSharingController doesn't restrict who can have access to the share when you set the availablePermissions to include .allowReadOnly and exclude .allowReadWrite. It behaves as I expect in the previous versions of iOS.
Anyone know anything that would help me with this problem?
Is the owner and the the app the only ones that can change the value of CKShare.publicPermission using UICloudSharingController?
I mean, can a participant change the the value of CKShare.publicPermission using UICloudSharingController if the permission property of that participant is readWrite and the participant has access to the presented UICloudSharingController and its availablePermissions property includes allowReadWrite?
What exactly does UICloudSharingController.PermissionOptions.allowReadWrite grant read and write access to? Does that mean the current user can change the CKShare.publicPermission property? I don't think the user can change the values of the permission properties of participants if he/she changes CKShare.publicPermission. The way participants are affected is that they may lose access to the CKShare, but their permission property can only be set by the owner.
Am I right about this?
I have an app that uses CKShare and UICloudSharingController to share data with other users of my app. I noticed that when Owner shares with UserA, UserA is able to "copy" the link or "send" the link, as the title of the button use. How do I disable that completely so that only the owner can copy or send the link? Also, what determines whether it says "Copy Link" or "Send Link"? Does that have to do with the version of iOS?
I've tried every combination of UICloudSharingController.PermissionOptions to set to UICloudSharingController..availablePermissions ... [.allowPrivate, .allowReadOnly], [.allowReadOnly], [.allowPrivate], and []. Setting the value to [] sets it to .standard, which does the exact same thing as [.allowPrivate, .allowReadOnly], though the value is different for availablePermissions property.