diff --git a/lib/motion/project/template/ios/spec-helpers/ui.rb b/lib/motion/project/template/ios/spec-helpers/ui.rb index 013690f6..90a99a65 100644 --- a/lib/motion/project/template/ios/spec-helpers/ui.rb +++ b/lib/motion/project/template/ios/spec-helpers/ui.rb @@ -213,10 +213,15 @@ module Bacon attr_accessor :controller def controller - @controller ||= if @options[:id] - storyboard.instantiateViewControllerWithIdentifier(@options[:id]) - else - @controller_class.alloc.init + @controller ||= begin + c = nil + if @options[:id] + c = storyboard.instantiateViewControllerWithIdentifier(@options[:id]) + else + c = @controller_class.alloc.init + end + send(@options[:after_created], c) if @options[:after_created] + c end end