Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Set requires_arc on a per file basis #464

indragiek opened this Issue · 2 comments

3 participants


Some libraries have certain files that need to be compiled without ARC. Right now, you can only set requires_arc on every file included in the podspec. I tried using a subspec to separate out the files that have ARC turned off, but I got an error saying that requires_arc can't be set on a subspec.


The support should be available in the next version.


I'm having the same issue trying to create a podspec for MESegmentedControl. There are only two source files; one needs to be compiled with ARC and the other without. I too tried to resolve the difference with subspecs: do |s|         = "MESegmentedControl"
  s.version      = "0.0.1"
  s.summary      = "Podspec for MESegmentedControl"       = { "Dave Thompson" => "" }
  s.license      = {
    :type =>    'Modified BSD',
    :text =>    <<-LICENSE
                Copyright (c) 2012 David Thompson. All rights reserved.
                MESegmentedControl is distributed under the Modified BSD License.
  s.platform     = :ios
  s.source       = { :git => 'git://' }

  s.subspec 'Badges' do |badges|
    badges.source_files = 'MESegmentedControl/CustomBadges.{h,m}'
    badges.requires_arc = false

  s.subspec 'Control' do |control|
    control.source_files    = 'MESegmentedControl/MESegmentedControl.{h,m}'
#    control.dependency     = 'MESegmentedControl/Badges'
    control.requires_arc    = true

but no love. So yes, the subspec allows .requires_arc but... If I use the podspec as is, the "Badges" files aren't copied down. If I uncomment the dependency line, I get an "undefined method `dependency=" error. Am I not getting the syntax right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.