#StackBounty: #ios #iphone #app-store #swift4.2 #xcode10.1 iPhone XS Max | Swift 4.2 | App crashing libsystem_kernel.dylib abort_with_p…

Bounty: 50

After updating to iOS 12.1.2, and updating new version from App Store. App keeps crashing on launch.

Got the report from crashlitics but not helpful. Anyone can suggest what to do?

Date: 2019-01-03T06:48:00Z

OS Version: 12.1.2

Device: iPhone XS Max

RAM Free: 3.8%

Disk Free: 81.6%

1. Crashed: com.apple.root.default-qos

0 libsystem_kernel.dylib 0x22193fdd4 __abort_with_payload + 8
1 libsystem_kernel.dylib 0x221939594
abort_with_payload_wrapper_internal + 104 2 (Missing)
0x28ec82219395c8 (Missing) 3 (Missing)
0x4a728224c6f9fc (Missing) 4 (Missing)
0x6d688224c6f92c (Missing) 5 (Missing)
0x66cd0224c73cbc (Missing) 6 (Missing)
0x3e2e8221a01324 (Missing) 7 (Missing)
0x748c02219f4430 (Missing) 8 (Missing)
0x130d02217b9378 (Missing) 9 (Missing)
0x1b1382217d0f28 (Missing) 10 (Missing)
0x552902217c8e74 (Missing) 11 (Missing)
0x613182219b9b30 (Missing) 12 (Missing)
0x39f882219bfdd4 (Missing)

0. com.apple.main-thread

0 “libobjc.A.dylib” 0x220facf4c
_NXMapMember(_NXMapTable*, void const*, void**) + 232


Get this bounty!!!

#StackBounty: #ios #ssl-certificate #ios12 #ssl-client-authentication create iOS 12 NWConnection that uses client cert

Bounty: 50

I’m trying to set up an NWConnection that does client side certs:

self.connection = NWConnection(
    host: NWEndpoint.Host("servername"),
    port: NWEndpoint.Port(integerLiteral: 8899),
    using: .tls)

But I think that simple .tls class var needs to be a much more involved NWParameters object, but I’m at a complete loss (documentation is pretty sparse) as to what I create there to attach the client certs to the parameters. Nor do I know how I even move from .crt/.pem file to something the app manages programatically.

What is an example of how one would configure the NWParameters to support the client certs?

Context

I’m trying to set up a client connection to communicate with an MQTT broker using client side certificates. I’ve been able to proof-of-concept this all on the Linux side using command line. The MQTT broker is set to require client cert, and a command like:

mosquitto_pub -h servername -p 8899 -t 1234/2/Q/8 -m myMessage --cafile myChain.crt --cert client.crt --key client.pem

does the job nicely. But OpenSSL is enough a black box (to me) on iOS that I don’t know where to go from here. I have been able to get all of the other MQTT communications work with my NWConnection instances, including server side TLS and even if it’s self signed.


Get this bounty!!!

#StackBounty: #ios #swift #avfoundation #zoom #uipangesturerecognizer Pan gesture (hold/drag) zoom on camera like Snapchat

Bounty: 50

I am trying to replicate Snapchat camera’s zoom feature where once you have started recording you can drag your finger up or down and it will zoom in or out accordingly. I have been successful with zooming on pinch but have been stuck on zooming with the PanGestureRecognizer.

Here is the code I’ve tried the problem is that I do not know how to replace the sender.scale that I use for pinch gesture recognizer zooming. I’m using AVFoundation. Basically, I’m asking how I can do the hold zoom (one finger drag) like in TikTok or Snapchat properly.

let minimumZoom: CGFloat = 1.0
let maximumZoom: CGFloat = 15.0
var lastZoomFactor: CGFloat = 1.0
var latestDirection: Int = 0

@objc func panGesture(_ sender: UIPanGestureRecognizer) {

    let velocity = sender.velocity(in: doubleTapSwitchCamButton)
    var currentDirection: Int = 0

    if velocity.y > 0 || velocity.y < 0 {

                let originalCapSession = captureSession
                var devitce : AVCaptureDevice!

                let videoDeviceDiscoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInWideAngleCamera, .builtInDuoCamera], mediaType: AVMediaType.video, position: .unspecified)
                let devices = videoDeviceDiscoverySession.devices
                devitce = devices.first!

                guard let device = devitce else { return }

                    // Return zoom value between the minimum and maximum zoom values
                    func minMaxZoom(_ factor: CGFloat) -> CGFloat {
                        return min(min(max(factor, minimumZoom), maximumZoom), device.activeFormat.videoMaxZoomFactor)
                        }

                        func update(scale factor: CGFloat) {
                            do {

                                try device.lockForConfiguration()
                                defer { device.unlockForConfiguration() }
                                device.videoZoomFactor = factor
                            } catch {
                                print("(error.localizedDescription)")
                            }
                        }

//These 2 lines below are the problematic ones, pinch zoom uses this one below, and the newScaleFactor below that is a testing one that did not work.
                let newScaleFactor = minMaxZoom(sender.scale * lastZoomFactor)
                       //let newScaleFactor = CGFloat(exactly: number + lastZoomFactor)


                    switch sender.state {

                    case .began: fallthrough                
                    case .changed: update(scale: newScaleFactor!)                
                    case .ended:
                        lastZoomFactor = minMaxZoom(newScaleFactor!)
                        update(scale: lastZoomFactor)

                    default: break
                    }

        } else {

        }

        latestDirection = currentDirection

    }


Get this bounty!!!