SwiftOverlays icon indicating copy to clipboard operation
SwiftOverlays copied to clipboard

Swift Overlays 4 and Objective-C

Open joaocorreia opened this issue 8 years ago • 2 comments

Right now it seems it's not possible to use SwiftOverlays 4.0.0 in Objective-C code. I believe this is because the public methods in Swift need to be marked with @objc in order to be made available to the Objective-C code (@objc inference was deprecated). Am I right or it's just me messing something? :) Is this a natural evolution and we need to use v3.0.0 of Swift Overlays if we want to continue using it in Objective-C? Thanks!

joaocorreia avatar Sep 22 '17 11:09 joaocorreia

@joaocorreia my apologies. This was not intentional, but due to lack of testing for ObjC. This will be fixed in the next release (meanwhile you can use v3.0.0 if you don't need support for notifications over status bar)

peterprokop avatar Sep 22 '17 17:09 peterprokop

@peterprokop Thanks! Right now I'm adding support for iPhone X, so I need the v4. As I'm using CocoaPods I'm temporarily solving it by changing the configuration directly in the Podfile, just for reference:

post_install do |installer|
	  installer.pods_project.targets.each do |target|
		  if target.name == 'SwiftOverlays'
			  target.build_configurations.each do |config|
				  config.build_settings['SWIFT_SWIFT3_OBJC_INFERENCE'] = 'On'
			  end
		  end
	  end
  end

joaocorreia avatar Sep 25 '17 10:09 joaocorreia