rubymotion

Better autocomplete in VIM

女生的网名这么多〃 提交于 2019-12-03 06:33:34
All, I have been working with vim for some time now, and love everything about it - there is only one thing I really miss from IDEs like RubyMine, and that is advanced autocompletion. For reference, here is my standard VIM setup: https://github.com/wrwright/.vim I have tried ctags with omnicomplete + supertab, and the one major element I miss is the ability to bring up a context sensitive list of attributes/constants/methods. For example, as I learn RubyMotion, I'd love to have some help remembering iOS SDK constants/attributes/methods, but my VIM autocomplete stops with suggesting class names

How to get a snappy UICollectionView with lots of images (50-200)?

我的梦境 提交于 2019-12-03 05:09:49
问题 I'm using UICollectionView in an app that is displaying quite a lot of photos (50-200) and I'm having issues getting it to be snappy (as snappy as Photos app for example). I have a custom UICollectionViewCell with a UIImageView as it's subview. I'm loading images from the filesystem, with UIImage.imageWithContentsOfFile: , into the UIImageViews inside the cells. I've tried quite a few approaches now but they have either been buggy or had performance issues. NOTE: I'm using RubyMotion so I'll

How can I create a horizontal gradient background for my iOS nav bar?

て烟熏妆下的殇ゞ 提交于 2019-12-03 03:49:18
问题 I know how to set a navigation bar background color (with barTintColor), but now I am working on an iOS app that calls for a horizontal gradient (not the typical vertical gradient). How can I create a navigation bar with a horizontal gradient background? 回答1: If you want to programmatically set the gradient of a given UINavigationBar I have a solution for you. First setup a CAGradientLayer with your desired colors and locations. CAGradientLayer *gradientLayer = [CAGradientLayer layer];

How to get a snappy UICollectionView with lots of images (50-200)?

吃可爱长大的小学妹 提交于 2019-12-02 18:27:13
I'm using UICollectionView in an app that is displaying quite a lot of photos (50-200) and I'm having issues getting it to be snappy (as snappy as Photos app for example). I have a custom UICollectionViewCell with a UIImageView as it's subview. I'm loading images from the filesystem, with UIImage.imageWithContentsOfFile: , into the UIImageViews inside the cells. I've tried quite a few approaches now but they have either been buggy or had performance issues. NOTE: I'm using RubyMotion so I'll write any code snippets out in the Ruby-style. First of all, here's my custom UICollectionViewCell

How can I create a horizontal gradient background for my iOS nav bar?

£可爱£侵袭症+ 提交于 2019-12-02 18:07:56
I know how to set a navigation bar background color (with barTintColor), but now I am working on an iOS app that calls for a horizontal gradient (not the typical vertical gradient). How can I create a navigation bar with a horizontal gradient background? JulianM If you want to programmatically set the gradient of a given UINavigationBar I have a solution for you. First setup a CAGradientLayer with your desired colors and locations. CAGradientLayer *gradientLayer = [CAGradientLayer layer]; gradientLayer.frame = navigationBar.bounds; gradientLayer.colors = @[ (__bridge id)[UIColor greenColor]

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

↘锁芯ラ 提交于 2019-11-30 16:43:09
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 end. I can make calls to populate model objects in the RubyMotion client and everything is great. The

How to use UIButton as Toggle Button?

痞子三分冷 提交于 2019-11-30 08:22:23
I am trying to create a toggle button for each cell in my table. When pressed, it will change the image and when pressed again it will change the image again -- Toggle. In the UIButton class I don't see a selected state. I'm looking for a way to create a toggle button with UIButton so that I can change the state on each click. This is how I'm doing it in rubymotion right now using rmq @fav_button.on(:touch) do |sender| puts "pressed fav button for id: " + data[:id] + " and name: " + data[:name] #how do I change the state here? end Jan Cássio You can create toggle button easily, you just need

How to use UIButton as Toggle Button?

China☆狼群 提交于 2019-11-29 11:04:57
问题 I am trying to create a toggle button for each cell in my table. When pressed, it will change the image and when pressed again it will change the image again -- Toggle. In the UIButton class I don't see a selected state. I'm looking for a way to create a toggle button with UIButton so that I can change the state on each click. This is how I'm doing it in rubymotion right now using rmq @fav_button.on(:touch) do |sender| puts "pressed fav button for id: " + data[:id] + " and name: " + data[

AFNetworking with request error code 999

旧时模样 提交于 2019-11-29 06:12:46
I'm new to objective-c and i'm having a hard time with a AFNetworking. So the thing is that i want to make a simple POST request to a server who will send me back a salt. I'v make a simple app, in order to test my request but i don't understand why i'm getting the error code 999. Here a sample of my code. + (void)simpleRequest; { NSURL *mailserver = [NSURL URLWithString:@"https://localhost:4443/"]; AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc]initWithBaseURL:mailserver]; manager.securityPolicy.allowInvalidCertificates = TRUE; manager.responseSerializer =

Poor UICollectionView Scrolling Performance With UIImage

感情迁移 提交于 2019-11-27 20:17:58
I have a UICollectionView in my app, and each cell is a UIImageView and some text labels. The problem is that when I have the UIImageViews displaying their images, the scrolling performance is terrible. It's nowhere near as smooth as the scrolling experience of a UITableView or even the same UICollectionView without the UIImageView. I found this question from a few months ago, and it seems like an answer was found, but it's written in RubyMotion, and I don't understand that. I tried to see how to convert it to Xcode, but since I have never used NSCache either, it's a little hard to. The poster