https://qiita.com/marty-suzuki/items/b96ab053611aa4c9f9d3
この記事を参考に実装しているのですが、
ExceptionHandler.m
#import "ProjectName-Bridging-Header.h" #import <Foundation/Foundation.h> @implementation ExceptionHandler : NSObject + (BOOL)catchExceptionWithTryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))tryBlock error:(NSError * _Nullable __autoreleasing * _Nullable)error { @try { tryBlock(); return YES; } @catch (NSException *exception) { *error = [NSError errorWithDomain:exception.name code:-9999 userInfo:exception.userInfo]; return NO; } } @end
ExceptionCatchable.swift
swift
1import Foundation 2@objc protocol ExceptionCatchable {} 3 4extension ExceptionCatchable { 5 func execute(_ tryBlock: () -> ()) throws { 6 try ExceptionHandler.catchException(try: tryBlock) 7 } 8}
このように書いてるのですが
Use of unresolved identifier 'ExceptionHandler'とエラーが出てしまいます。
Bridging-Headerの設定もしております。
どこを間違えているのでしょうか?よろしくお願いします。
補足情報(FW/ツールのバージョンなど)
Xcode9.2 iOS11
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/06/06 11:05