Hi! I am making a phone number recognition app based off of Apple's example code. I am new to swift and coding in general. When I run the project I get the "Thread 1: EXC_BAD_ACCESS (code=257, address=0x7e700019ec0ad79)" error on line 68 "previewView.session = captureSession" . I think it has something to do with line 26 "@IBOutlet weak var previewView: PreviewView!" ?
I have a view controller with 2 views and one label. The IB Outlets seem fine for two of them but does not look the same for line 26.. the color of the text PreviewView! is gray instead of blue like the others. Could this be the problem?
import AVFoundation
import Vision
class TextScanViewController: UIViewController {
// MARK: - UI objects
@IBOutlet weak var previewView: PreviewView!
@IBOutlet weak var cutoutView: UIView!
@IBOutlet weak var numberView: UILabel!
var maskLayer = CAShapeLayer()
// Device orientation. Updated whenever the orientation changes to a
// different supported orientation.
var currentOrientation = UIDeviceOrientation.portrait
// MARK: - Capture related objects
private let captureSession = AVCaptureSession()
let captureSessionQueue = DispatchQueue(label: "com.example.apple-samplecode.CaptureSessionQueue")
var captureDevice: AVCaptureDevice?
var videoDataOutput = AVCaptureVideoDataOutput()
let videoDataOutputQueue = DispatchQueue(label: "com.example.apple-samplecode.VideoDataOutputQueue")
// MARK: - Region of interest (ROI) and text orientation
// Region of video data output buffer that recognition should be run on.
// Gets recalculated once the bounds of the preview layer are known.
var regionOfInterest = CGRect(x: 0, y: 0, width: 1, height: 1)
// Orientation of text to search for in the region of interest.
var textOrientation = CGImagePropertyOrientation.up
// MARK: - Coordinate transforms
var bufferAspectRatio: Double!
// Transform from UI orientation to buffer orientation.
var uiRotationTransform = CGAffineTransform.identity
// Transform bottom-left coordinates to top-left.
var bottomToTopTransform = CGAffineTransform(scaleX: 1, y: -1).translatedBy(x: 0, y: -1)
// Transform coordinates in ROI to global coordinates (still normalized).
var roiToGlobalTransform = CGAffineTransform.identity
// Vision -> AVF coordinate transform.
var visionToAVFTransform = CGAffineTransform.identity
// MARK: - View controller methods
override func viewDidLoad() {
super.viewDidLoad()
// Set up preview view.
previewView.session = captureSession
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
What animation program do most developers or designers use for adding animations to their apps?
I am a graphic/UI designer and have been working with XCode lately to develop an app. I would like to add animations to buttons, menus, and even full blown instructional animations for the user on how to use our products. I have used CoreAnimator, Adobe Animate and struggled with both. Adobe animate has issues with sizing for different devices and I have been working with them for months now trying to resolve the issue as it doesn't seem to be the constraints in Xcode.
I am not the best at coding but I am willing to learn. Do I need to learn Core Animation code to be able to animate buttons menus etc? Or are libraries easier?
As for the full blown instructional animations I feel like that would be more a long the lines of something similar to Adobe Animate?
TIA!
Hi! I have a table in my Xcode project that is displaying very differently in iPhone7 iOS15 vs iPhone7 iOS14.5. iOS15 has white spaces/bars appearing above each header as you can see pictured. I use Xcode interface builder auto layout constraints and am wondering if I now have to change constraints to work for this in code instead to specify iOS15? I am a graphic/UI designer so please be easy on me! :)