rubymotion

How to set a custom background image to tabbar?

馋奶兔 提交于 2020-01-06 08:24:09
问题 I am writing a Rubymotion app and I want to customize the TabBar. On NSScreencasts.com they explain how to do it in Objective-C but how can I transform the below code into Ruby? - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self customize]; } return self; } - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { [self customize]; } return self; } - (void)customize { UIImage *tabbarBg = [UIImage imageNamed:@"tabbar

How to use .on_delete callback in ProMotion-Formotion

不问归期 提交于 2020-01-01 19:33:28
问题 I use ProMotion with PM::FormotionScreen screen. How to use row.on_delete callback from Formotion in ProMotion? I have this table_data method def table_data { sections: [{ rows: [ { title: "URL", key: :url, placeholder: "http://myapp/dj_mon/", action: :delete_account, deletable: true, type: :string, auto_correction: :no, auto_capitalization: :none } ] }] } end screenshot: http://i.stack.imgur.com/e1dlu.png 回答1: Instead of using a hash to initialize the Formotion form, you'll have to use the

What is the iOS (or RubyMotion) idiom for waiting on a block that executes asynchronously?

旧巷老猫 提交于 2019-12-30 05:22:50
问题 I have been pulling my hair out for weeks on this niggling problem, and I just can't find any info or tips on how or what to do, so I'm hoping someone here on the RubyMotion forums can help me out. Apologies in advance if this is a little long, but it requires some setup to properly explain the issues. As background, I've got an app that uses a JSON/REST back-end implemented ina Rails app. This is pretty straightforward stuff. The back-end is working fine, and up to a point, so is the front

iOS push notification app not asking for permission on registration

不羁岁月 提交于 2019-12-25 06:38:04
问题 I am working on an app which requires push notifications to be enabled. I have followed this article and worked fine till I downloaded the provisioning profile. I am using Rubymotion to develop this app and hence in my Rakefile I Did this, app.name = 'Myapp' app.identifier = 'com.myapp.development' app.provisioning_profile = '/Users/sunilkumar/Library/MobileDevice/Provisioning Profiles/Myapp_Development.mobileprovision' 'My App' is the name of my app. Identifier is the project identifier (as

Segue type to be used for a user registration process - iOS 5

允我心安 提交于 2019-12-25 04:18:11
问题 This is my first ios app & I have a user registration process which is separated out into 3 screens. The first screen has user to enter his mobile number, the second screen asks him select his location & the third screen asks him to enter his birthday and a few other details. So in total, there are totally 3 controllers which I have used. 1) mobile_number_controller.rb 2) location_controller.rb 3) miscellaneous_details_controller.rb Each detail the user enters is validated and is stored into

Unrecognized selector sent to UIImage?

依然范特西╮ 提交于 2019-12-25 03:47:08
问题 hoping you can help me out. Code is Rubymotion but I'm pretty sure it's an iOS issue. Code is simple enough that hopefully it being Rubymotion doesn't get in the way of an answer. And I can read Obj-C, so if you can answer with Obj-C only, I'm good with that. I have a UIImage object. I'm trying to get the size of it. When I do the following: image = info.objectForKey(UIImagePickerControllerOriginalImage) @image = UIImage.alloc.initWithCIImage(image) puts @image.to_s puts @image.size puts

Using a unicode character in a UILabel through RubyMotion

回眸只為那壹抹淺笑 提交于 2019-12-24 15:25:18
问题 I'm attempting to use a Unicode private space character and set it to the text property of a UILabel . This is using RubyMotion. The character I want is part of the Entypo family and is U+1F554 ( 🕔 ). I create a new UILabel : @lblIcon = UILabel.alloc.initWithFrame([[0,(self.view.frame.size.height/2) - 128],[self.view.frame.size.width,96]]) And set it's text to the Unicode character using the pack syntax. @lblIcon.text = [0x1f554].pack('U*') I then apply the icon font and add it to the view:

RubyMotion async programming with BubbleWrap

狂风中的少年 提交于 2019-12-22 11:24:58
问题 I am confused with how to write decent code when using a lot of asynchronous code. In the following code snippet I log in to get the authentication cookie and use that cookie for the next request to get a list of projects name (as an example): def self.populateProjectsTable(projects_controller) payload = {email: "email", password: "pass"} HTTP.post("http://example.com/login", {payload: payload}) do |response| authCookie = response.headers['Set-Cookie'] HTTP.get("http://example.com/projects

Parsing string to time in RubyMotion

放肆的年华 提交于 2019-12-22 09:37:09
问题 I try to parse a text representation of a time into a ruby Time object. Normally in ruby I would do it like this: require 'time' Time.parse('2010-12-15T13:16:45Z') # => 2010-12-15 13:16:45 UTC In RubyMotion I am unable to require libs and Time.parse is not available: (main)> require 'time' => #<RuntimeError: #require is not supported in RubyMotion> (main)> (main)> Time.parse => #<NoMethodError: undefined method `parse' for Time:Class> Is there a way to require the time library provided by

Include not finding module RubyMotion

混江龙づ霸主 提交于 2019-12-22 08:56:09
问题 Are mixins allowed in RubyMotion? I have a directory with two files. One is a class, the other a module. When I include the module (mixin) in my class, I get a not found error. Everything under app is automatically required in RM right? Thanks for any help. 回答1: Found it! http://dylanmarkow.com/blog/2012/05/06/load-order-with-rubymotion/ 回答2: I'm using Bundler, so I ended up putting something like this in the Motion::Project::App.setup do |app| block: app_files = app.files.reverse.pop app