Closed lexuanquynh closed 6 years ago
can not build in Xcode 10 'State' is ambiguous for type lookup in this context Ambiguous type name 'State' in 'TripleButton'
can not build in Xcode 10 'State' is ambiguous for type lookup in this context Ambiguous type name 'State' in 'TripleButton'
change: State -> State1 It will build success.
-----TripleButton.swift------- struct State1 { let title: String let image: UIImage }
let states: [State1] var selectedIndex: Int = 0
init(states: [State1]) { self.states = states super.init(frame: .zero) setup() } -------CameraView.swift---------- func makeFlashButton() -> TripleButton { let states: [TripleButton.State1] = [ TripleButton.State1(title: "Gallery.Camera.Flash.Off".g_localize(fallback: "OFF"), image: GalleryBundle.image("gallery_camera_flash_off")!), TripleButton.State1(title: "Gallery.Camera.Flash.On".g_localize(fallback: "ON"), image: GalleryBundle.image("gallery_camera_flash_on")!), TripleButton.State1(title: "Gallery.Camera.Flash.Auto".g_localize(fallback: "AUTO"), image: GalleryBundle.image("gallery_camera_flash_auto")!) ]
The master branch already has the fix.
Just need
1) Change the Podfile with:
pod 'Gallery', :git => 'https://github.com/hyperoslo/Gallery.git', :branch => 'master'
2) Update Swift Language Version with 4.2
Go to Xcode -> Choose Pods project -> Choose the Gallery Target -> Choose Buiding Setting tab -> Find the option: Swift Language Version and select 4.2.
Then the project should be able to compile.
This works for me.
@lexuanquynh @GesanTung @simonibs Hi, I just released https://github.com/hyperoslo/Gallery/releases/tag/2.2.0
I try install in xcode 10 and get the issue: Ambiguous type name 'State' in 'TripleButton' Please fix it. p/s: I rename 'State' to other name (ex: State1), the project will run success. I think admin should change it for someone.