Category "swift"

Read and write a String from text file

I need to read and write data to/from a text file, but I haven't been able to figure out how. I found this sample code in the Swift's iBook, but I still don't

iOS image editor in swift

Is it possible to us iOS default image editor my existing app, like screenshot

How to set the value of checkboxes with a single variable

Hello folks of StackOverflow today I bring forth an optimization problem for you in swift As shown in the screenshot I have checkboxes in my screen and I have

iOS SwiftyZeroMQ get status

I am using SwiftyZeroMQ in iOS for zeromq. I can connect and communicate via sockets. But issue is I can't find anyway to know how can I get event/status that s

NotificationCenter to pass data in Swift

I am working on a test project in Swift 3. I am trying to pass textField string from one class to another class using NotificationCenter. I am trying to workout

Observe window resize event with SwiftUI

I currently have a LazyVGrid setup as such: struct NetworkGrid: View { var networks: [Network] let columns = [ GridItem(.flexible()),

iOS 10 don't call Notification Service Extension

I tried to implement the new Notification Service Extension, but I have a problem. In my NotificationService.swift file I have this code: class NotificationSe

Make Line chart gradient color go from line to bottom - SwiftUI

I am trying to make it so the line chart display a gradient color from the line and down but I can't seem to get it to only go from the line. Instead it just fi

Swift. Get binary string from an integer

I have binary 0000010 which is represented as an array of ints. From this binary I get an Integer: let number = Int32([0, 0, 0, 0, 0, 1, 0].reduce(0, combine:

tracking down/working around UnsafeRawBufferPointer with negative count (presumably somewhere out of SwiftUI intestines/Swift runtime)

What do I do about this? I get no useful info predictably. A search for UnsafeMutablePointer yields func scrollViewWillEndDragging(_ scrollView: UIScrollView,

Swift won't recognize /n line breaks after base64 string decoding

I am trying to take my base64 decoded string and print it, but the result does not recognize the line breaks. For example, print("Hi \n hello \n hi") Print l

How to fix "Invalid API key format" while implement the comet-chat in iOS

The problem is that when I am going to initialize the comet-chat then they generate the error like - "Terminating app due to uncaught exception 'NSInvalidA

RealityKit – Getting runtime warning when placing a model in ARView

I get the following warning during runtime when I tap to load the model in ARView: Warning (secondary thread): in AppendProperty at line 859 of sdf/path.cpp --

How to implement a regex for password validation in Swift?

I want to implement a regex validaton for passwords in Swift? I have tried the following regex, but not successful ([(0-9)(A-Z)(!@#$%ˆ&*+-=<>)]+

How to change the color of `color set` programmatically in iOS?

There is any way to change the color of color set programmatically. I use theme color in Xcode and now I want this color come from API. Anyone can solve my

iOS constraints doesn't allow to use multiplier

I am trying to layout some custom views and when I try to activate the constraints, Xcode says that I can't use multiplier. Here is an example of the code: cla

Firebase Storage Error - FIRStorageErrorDomain Code=-13021 "User does not have permission to access"

Im having a problem Iv been dealing with for a while. Basically im trying to grab images from Firebase Storage into my UICollectionView. When i segue to that V

onDelete causing NSRangeException

In this app, there is a main screen (WorkoutScreen) that displays the contents of a list one at a time as it iterates through the list (current workout in a lis

No such module 'FirebaseFirestore'

Trying to build my app but can't it always gives me problems with FirebaseFirestore. It seems to recognize FirebaseStorage and Firebase fine but not FireStore.

Big configuration object as a parameter in Swift?

In JavaScript/TypeScript, we have this pattern that is often used in libraries where you have one optional parameter as the last function argument which default