motion-screenshots 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02d6f0fa7d8d44cb3b0e2b1a89b2cdf3733546b2
4
- data.tar.gz: 9093ab4e06a885d7ec590f73526b196157ff7e09
3
+ metadata.gz: 38f1b9b8b99b23e3f94840539981e9cb7189a7b3
4
+ data.tar.gz: e892bca6863617110b6913e8591353e102d6b4dc
5
5
  SHA512:
6
- metadata.gz: 91409adec0e4bb20fff6c469f82e749a0f575ece400409354ec1e5ef77c514ff9e6283265dc2ee0388b13d90806acdc41f897c55cda4d5bb6b9f0415f5ec097a
7
- data.tar.gz: 649b937670aff8f7953df4f650fa9ced36b1515a49faaf8f7dee493063b3881a5c409beb5d0e6ebc938d16708c68461258c0be83c52b6d6db647ea3d1b84116f
6
+ metadata.gz: 36d7af91fe53a023941defff6a6cf1ee165491aa54414c2eee4a0011e8d57878467bfbda57f529b30c73ff76afb88934731b37bab46cfc074ca17cb9dbc383ec
7
+ data.tar.gz: 0916cd645857ded0d874f5935a54a3c4b289864503368bf62ec26de97bd89dff55715383efd333d0c8f50acfdf21ebde2b06847352f287aec548653c1de387c9
data/README.md CHANGED
@@ -51,6 +51,8 @@ class AppScreenshots < Motion::Screenshots::Base
51
51
  # at some point in the future (i.e. a timer, network calls, etc)
52
52
  # Invoke `#ready!` to take the shot
53
53
  async_screenshot "profile" do
54
+ ready_delay 3 # delays the screenshot to 3 seconds after ready! is called
55
+
54
56
  before do
55
57
  App.delegate.table_view_controller.selectRowAtIndexPath(
56
58
  NSIndexPath.indexPathForRow(0, inSection: 1),
@@ -58,10 +60,7 @@ class AppScreenshots < Motion::Screenshots::Base
58
60
  scrollPosition: UITableViewScrollPositionNone
59
61
  )
60
62
 
61
- # give the network some time...
62
- Dispatch::Queue.main.after(3) {
63
- ready!
64
- }
63
+ ready!
65
64
  end
66
65
 
67
66
  # clean-up
@@ -72,14 +71,15 @@ class AppScreenshots < Motion::Screenshots::Base
72
71
  end
73
72
  ```
74
73
 
75
- Then, elsewhere in your code, simply let motion-screenshots know when to start the process:
74
+ Then, after your initial views have appeared, simply let motion-screenshots know when to start the process:
76
75
 
77
76
  ```ruby
78
- class AppDelegate
77
+ class MyFirstViewController
79
78
 
80
- def application(application, didFinishLaunchingWithOptions:launchOptions)
81
- # do other stuff...
79
+ def viewDidAppear(animated)
80
+ super
82
81
 
82
+ # May need to wrap in a Dispatch::Queue.main.async{} block
83
83
  AppScreenshots.start!
84
84
  end
85
85
  end
@@ -94,7 +94,17 @@ module Motion
94
94
  end
95
95
 
96
96
  def ready!
97
- @manager.actionIsReady
97
+ if @delay
98
+ Dispatch::Queue.main.after(@delay.to_f) {
99
+ @manager.actionIsReady
100
+ }
101
+ else
102
+ @manager.actionIsReady
103
+ end
104
+ end
105
+
106
+ def ready_delay(amount)
107
+ @delay = amount
98
108
  end
99
109
 
100
110
  def to_KSScreenshotAction
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "motion-screenshots"
5
- spec.version = "0.0.5"
5
+ spec.version = "0.0.6"
6
6
  spec.authors = ["Clay Allsopp"]
7
7
  spec.email = ["clay@usepropeller.com"]
8
8
  spec.description = "Take screenshots with RubyMotion"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-screenshots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clay Allsopp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-04 00:00:00.000000000 Z
11
+ date: 2014-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: motion-cocoapods