CameraKit / camerakit-ios

Library for iOS Camera API. Massively increase performance and ease of use within your next iOS Project.
Apache License 2.0
686 stars 82 forks source link

iOS Build Error - Unable to use CKFPhotoSession With Objective-C #28

Closed rahadurr closed 4 years ago

rahadurr commented 4 years ago

Is this a bug report?

I am testing this camerakit-ios library with Objective-C, but unfortunately i am unable to create CKFPhotoSession object it's showing compile time error on Xcode.

Have you read the Contributing Guidelines?

Yes

Environment

Xcode Version 11.3.1 (11C504)

CameraKit Version: v1.2.1

iOS Device: Simulator (iPhone 11 Pro Max)

iOS Version: 13.3

Steps to Reproduce

(Write your steps here:)

  1. Follow installation guide for Objective-C

  2. Import CameraKit_iOS in to ViewController.h Header file

    
    #import <UIKit/UIKit.h>

@import CameraKit_iOS;

@interface ViewController : UIViewController

@end


2. Add flowing code into ViewController.m file
```objectivec
#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    CKFPhotoSession *ckPhotoSession = [[CKFPhotoSession alloc] init];    // Error:  'init' is unavailable

    CKFPreviewView *ckfPreviewView = [[CKFPreviewView alloc] initWithFrame:self.view.bounds];

    *ckfPreviewView.session = ckPhotoSession;  // Error:  Assigning to 'CKFSession' from incompatible type 'CKFPhotoSession *__strong'
}
@end

Expected Behavior

CKFPhotoSession must allow to create an Objective-C object. Unfortunately it's not allow me to create any Session Object.

Actual Behavior

Compile tine error

Reproducible Demo

rahadurr/HelloCamera

rahadurr commented 4 years ago

ohh my bad found the solution:

CameraKitDemo-Objc