iOS Development

ios – Concern with OSLog on swift XCFramework swiftinterface

Spread the love


I’m making a quite simple XCFramework. The framework has just one class and one perform:

import Basis
import OSLog

public class MyFrameWork {
    public func setLog(log: os.OSLog) {
        
    }
    
    public func sendLogs(entries: [OSLogEntry]) {
        
    }
}

I then archive it, and create an XCFramework utilizing command line instruments as within the following script:

perform archive() {
    xcodebuild archive 
        -project "./TestFramework.xcodeproj" 
        -scheme "TestFramework" 
        -configuration "Launch" 
        -destination 'generic/platform=iOS' 
        -archivePath "$BASE_PATH/TestFramework.framework-iphoneos.xcarchive" 
        SKIP_INSTALL=NO 
        BUILD_LIBRARIES_FOR_DISTRIBUTION=YES

    xcodebuild archive 
        -project "./TestFramework.xcodeproj" 
        -scheme "TestFramework" 
        -configuration "Launch" 
        -destination 'generic/platform=iOS Simulator' 
        -archivePath "$BASE_PATH/TestFramework.framework-iphonesimulator.xcarchive" 
        SKIP_INSTALL=NO 
        BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
}

perform create_framework() {
    xcodebuild -create-xcframework 
        -framework "$BASE_PATH/TestFramework.framework-iphoneos.xcarchive/Merchandise/Library/Frameworks/TestFramework.framework" 
        -framework "$BASE_PATH/TestFramework.framework-iphonesimulator.xcarchive/Merchandise/Library/Frameworks/TestFramework.framework" 
        -output "$OUTPUT_PATH/TestFramework.xcframework"
}

archive
create_framework

Since I construct for distribution the next swift interface file is created

// swift-interface-format-version: 1.0
// swift-compiler-version: Apple Swift model 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
// swift-module-flags: -target arm64-apple-ios17.2 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name TestFramework
// swift-module-flags-ignorable: -enable-bare-slash-regex
import Basis
import OSLog
import Swift
@_exported import TestFramework
import _Concurrency
import _StringProcessing
import _SwiftConcurrencyShims
@_hasMissingDesignatedInitializers public class MyFrameWork {
  public func setLog(log: os.OSLog)
  public func sendLogs(entries: [OSLog.OSLogEntry])
  @objc deinit
}

Discover the OSLogEntry is written as OSLog.OSLogEntry the place OSLog is the OSLog Module.

Nonetheless, after I put this framework in a take a look at challenge I obtain a construct time error:

'OSLogEntry' just isn't a member sort of sophistication 'os.OSLog'

Because the compiler interprets OSLog because the OSLog class below os Module and never OSLog Module.

All assist will probably be appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *