No commit activity in last 3 years
No release in over 3 years
Adds weak_attr_accessor that wraps objects with WeakRef, for RubyMotion
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

#weak_attr_accessor for RubyMotion

Usage

Do this:

class MainView < UIView
  weak_attr_accessor :view_controller
end

instead of this:

class MainView < UIView
  def view_controller
    @view_controller
  end

  def view_controller=(obj)
    if obj.nil?
      @view_controller = nil
    else
      @view_controller = WeakRef.new(obj)
    end
  end
end

Installation

  1. Add this to your Gemfile: gem 'weak_attr_accessor'
  2. Run bundle install

License

BSD. See LICENSE file.

Questions