Search results for

Swift 6

49,212 results found

Post

Replies

Boosts

Views

Activity

Sending 'notification' risks causing data races
I'm attempting to leverage notifications in an app that is in Swift 6 language mode. I have the following code: func startLocationUpdates() { //if self.manager.authorizationStatus == .notDetermined { // self.manager.requestWhenInUseAuthorization() //} self.logger.info(Starting location updates) Task { do { let updates = CLLocationUpdate.liveUpdates() for try await update in updates { if !self.updatesStarted { break } // End location updates by breaking out of the loop. self.lastUpdate = update if let loc = update.location { self.lastLocation = loc self.isStationary = update.stationary self.count += 1 self.logger.info(Location (self.count): (self.lastLocation)) } if lastUpdate!.insufficientlyInUse { let notification = UNNotificationRequest(identifier: com.example.mynotification, content: notificationContent, trigger: nil) try await UNUserNotificationCenter.current().add(notification) } } } catch { self.logger.error(Could not start location updates) } return } } As an aside, the above is directly taken
1
0
499
Oct ’24
Reply to Is it recommended to update to swift 2.0 to support ios 9 on our app?
Depends on the bugs you faced.If fixing any of them requires iOS 9 SDK, you have no choice. Migrate your app to iOS 9/Xcode 7/Swift 2.If you can fix all bugs with iOS 8 SDK/Xcode 6, you have no need to rush into Swift 2. Though testing your app on iOS 9 devices or sims is not easy, maybe some of your developer have thoughts about it. Well-made apps built with Xcode 6 will be approved by Apple and run on iOS 9.Generally, in production scale of an app, you need some amount of time to migrate it to Swift, which is far longer than `re-build it in a new Xcode, and fix a few parts marked as errors`.
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’15
IPad mini 6
I have buyed iPad mini 6 for pubg it’s totally waste of money so many bugs I can’t play withi this iPad mini 6 ipad view problem joystick movement problem aiming problem so many so many bugs maybe I will broke my iPad and post it to my channel don’t bye iPad mini 6 for pubg gaming no one will not fix this issue it can never fix even iPad mini 5 no problems on pubg why Apple why
1
0
545
Oct ’22
Bidirectional Text Rendering Issue in Swift UILabel for Arabic
I'm encountering an issue displaying a large HTML string (over 11470 characters) in a UILabel. Specifically, the Arabic text within the string is rendering left-to-right instead of the correct right-to-left direction. I've provided a truncated version of the HTML string and the relevant code snippet below. I've tried setting the UILabel's text alignment to right, but this didn't resolve the issue. Could you please advise on how to resolve this bidirectional text rendering problem? The results of the correct and incorrect approaches are shown in the image below. Here's the relevant Swift code: let labelView: UILabel = { let label = UILabel() label.textAlignment = .right label.translatesAutoresizingMaskIntoConstraints = false label.numberOfLines = 0 label.semanticContentAttribute = .forceRightToLeft label.backgroundColor = .white label.lineBreakMode = .byWordWrapping return label }() //Important!! //It must exceed 11470 characters. let htmlString = <p style=text-align: center;><strong>İSTİ
0
0
328
Jan ’25
Xcode 7 beta 6 can't call Obj-C block inside swift block
As per rdar://22471309Xcode 7b6 causes iOS app to crash (and doesn’t even attempt to execute the completionBlock) when calling a block created in Objective-C, within a Swift block (in this case NSURLSession’s dataTaskWithRequest).At first we thought the completionBlock was nil (even though it’s of type ImplicitlyUnwrappedOptional<T>), and when unwrapping it in a `if let cb = completionBlock`, we get a malloc error saying we’re trying allocate 1.7 Petabytes of memory.When it does try to call the completionBlock (without the if-let), it breaks with a EXC_BAD_ACCESS error.I can confim the same code works when calling Obj-C from Objc-C but breaks when calling Obj-C from swift.Below is the swift code that causes the crash mentioned above:import Foundation class TestWebServer: NSObject, GCDWebServerDelegate{ private let webServer = GCDWebServer() private let urlSession = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration()) override init() { super.init() GCDWeb
0
0
623
Aug ’15
Reply to Swift OS 10.6
Xcode 6 was the first version with Swift, and it requires OS X 10.9.4 or later. However, you wouldn't want to use that version of Xcode / Swift anyway, because Swift is still changing and you would be learning outdated Swift syntax and features. Your best bet is to buy a used Mac that can run the current version of OS X and therefore the current version of Xcode. Or, set up an Ubuntu linux machine and use the open source version of Swift from https: // swift.org (space inserted to avoid post getting stuck in moderation).
Mar ’16
Xcode13.3 error: Abort trap: 6
Running pass 'Function Pass Manager' on module '/Users/wuxiangru/Library/Developer/Xcode/DerivedData/Huatong-ahaooeosfhlssshifbkjdgrqapwx/Build/Intermediates.noindex/Huatong.build/Release-iphoneos/Store.build/Objects-normal/arm64/UIButton+StatusColor.o'. Running pass 'Module Verifier' on function '@$ss20_ArrayBufferProtocolPsE15replaceSubrange_4with10elementsOfySnySiG_Siqd__ntSlRd__7ElementQyd__AGRtzlFs01_aB0Vy5Store11WarrantTypeO_SbtG_SayAN_SbtGTg5' Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var LLVM_SYMBOLIZER_PATH to point to it): 0 swift-frontend 0x0000000108996f88 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56 1 swift-frontend 0x0000000108995f9c llvm::sys::RunSignalHandlers() + 112 2 swift-frontend 0x0000000108997618 SignalHandler(int) + 344 3 libsystem_platform.dylib 0x00000001971a44e4 _sigtramp + 56 4 libsystem_pthread.dylib 0x000000019718ceb0 pthread_kill + 288 5 libsystem_c.dylib 0x00000001970ca314 abor
1
0
733
Apr ’22
Reply to Server part on Swift
For Swift on the server side, take a look at IBM's offering: www.ibm.com/cloud-computing/bluemix/swift/My guess is that Microsoft will soon (6-12 months) add Swift to Visual Studio, enabling Swift-based Azure servers.I'm not sure it's any easier to stick with OS X Server, because any OS X APIs you rely on will likely not scale as well as the APIs of the mainstream providers such as Microsoft and IBM. But that remains to be seen.
Topic: Programming Languages SubTopic: Swift Tags:
May ’16
iPhone 6 wont update to iOS 11.3 Beta 6
So I have an iPhone 6 32GB fairly new bought in December 2017, so I didn't think I would be experiencing problems this soon but recently I have. I'm trying to update to iOS 11.3 Beta 6, But everytime I press Download and Install the button turns from blue to grey and has a buffering symbol towards the right of the text box, then about 45 secs later it turns back to blue and does not download and install the update. I've already tried a lot of things,I've checked my storage and it has more than enough for the required amount for the update (1.97GB required and I have 5.9GB free) I've rebooted my iPhone a couple of times, I tried disconnecting from wifi then reconnecting, I've tried to just wait like 15 mins and keep pressing the button everytime it goes back to blue, and I've tried connected my phone to my computer with iTunes to update but it says i'm already on the newest firmware (iOS 11.3), even though my phone legit says im able to update to the newest firmware (iOS 11.3 Beta 6)
0
0
325
Mar ’18