« first day (1158 days earlier)      last day (998 days later) » 

09:34
MORNING.
Welcome to Talk Radio with your host Owatch, in Room 15942. It's 10:35 AM, Greenwich Mean Time +1, and we've got sunny skies with a low chance of showers and cloudy weather moving in for Monday.
 
6 hours later…
15:31
Well, another Help Vampire.
Updated the sheets document.
 
1 hour later…
16:37
Hello My Childs
How can I make Xcode load faster?
 
4 hours later…
user457812
20:44
By not using Xcode, usually.
user457812
3 messages moved to bin
Getting real frustrated again with PaintCode.
It's only useful if you want to draw something thats colors will never change onto a single UIView subclass.
user457812
21:06
I considered buying it once then decided it was a bad idea.
user457812
  def thumbPath(width: Float, height: Float): Path = {
    // Path based on a 16x16 image (see design/thumb-path)
    val path = new Path()

    @inline def left(n: Float): Float = width * (n / 16f)
    @inline def top(n: Float): Float = height * (n / 16f)
    @inline def right(n: Float): Float = width * ((16f - n) / 16f)
    @inline def bottom(n: Float): Float = height * ((16f - n) / 16f)
    @inline def centerX(n: Float): Float = width * ((8f + n) / 16f)

    path moveTo (centerX(0f),  top(1f))
user457812
↑ That's basically how vectorized UI elements in my Android app were done.
21:24
Alright.
Well, considering the draw methods are pages long, I think I'll either try to make as few icons as possible, or just use images.
My main problem is that the draw color is accessed from a singleton with a UIColor drawColor property. And despite printing the color it's about to draw, and printing the color saved on the singleton. It displays a different color.
user457812
You should use images if something is sufficiently detailed.
user457812
It's easy to blit an image, it's hard to render paths.
Well, I can draw what I want just fine, it's the colors that create all the problems. I do have the option to export them as images from PaintCode though, so I could eventually do that if I can't figure it out.
22:18
@nil Explain to me why this method:
+ (UIColor*)drawColor { NSLog(@"Draw Color: %@",[[CXTheme sharedTheme]drawColor]); return [[CXTheme sharedTheme]drawColor]; }
user457812
Because it exists.
returns a different color, even after setting [CXTheme sharedTheme]drawColor
user457812
What's a CXTheme?
Its an NSObject subclass (singleton), that holds some colors I use around the App.
user457812
So go look at the code for that.
22:20
Set Theme draw color: UIDeviceRGBColorSpace 0.945098 0.94902 0.921569 1
2015-11-01 23:17:38.145 Alice[1493:554956] Draw Color: UIDeviceRGBColorSpace 0.94902 0.372549 0.360784 1
The output displayed in the first line is where I log a change to the 'Theme color'
It prints it's color using the same method that the StyleKit calls to obtain the color, and it's evident that it's what I set it to.
Yet a millisecond later, it's not that color.
user457812
So go review the code for that and figure out why.
Well I've been doing that for an hour now, and I just can't see anything wrong with what I'm doing. It's the same singleton, I've double checked I'm asking for the right color, I've logged the color each time it gets passed down to another method, and it doesn't change (As it shouldn't). But somehow it does when the draw method is called.
It's like it gets set once, and never after.
I'll set a breakpoint..
Wait no, I can't.
It gets called before that.
..
22:43
Overrode the setter.
Looks like the color is overridden right before a draw occurs.
I don't know why. Or what, is calling this.
23:22
I found it. I thought of this in the shower, it's another view that's setting the draw color before the one I want gets called. I didn't think it would be called again.
Also, I don't know who starred your comment Nil, but I'd really like to find out.
I suspect it's Enrico, I saw him here earlier.
@EnricoSusatyo Did you star that comment of Nil's up there? ^
user457812
Almost guaranteed.
user457812
Anyway, don't write stuff that depends on a shared object always being correct for one object.
Yes, I've found a better solution.
I've modified all methods in the StyleKit class to take a color when called. It's going to suck when exporting from Paintcode, since it will overwrite this all every time. But it will allow (should) me to color things as I please, without the nonsense involving the singleton.
And I'd like to be pinged if Enrico slithers back in here sometime later, if I'm not around...
user457812
gist.github.com/nilium/e9b9ec31a583b918f473 ← Something like this would probably be easier. Keep a global, shared color set and fork it every time a view needs to keep its own state.
user457812
Example written in Go because it's easier to think in Go.
23:38
Well, I've starred it. I'm about halfway done with my current solution though. So I'll try it first.
The problem with your shared color set.
Is that it will need to change its state.
Actually, I'm not sure that what I do is entirely different in the end, as each view does have it's own set of colors.
They're just stored a bit differently, and the problem was my bad solution in trying to work with Paintcode's drawing methods.
user457812
Which is why you fork it and then change the fork.
user457812
That way the view has its state and has a base color set to draw from.
Right, and all my views do have their own colors. They're just properties. What was happening is that I'd set a single color instance to the color I wanted to draw, then expect the UIView to be re-drawn in that color. But underlying views that also had their own custom draw methods would set the color instance to their color, right before mine actually would draw, then I'd draw in their color. Even though I had changed it before the call.
user457812
Which is why you either don't share state or ensure that what is shared is immutable.
I went with the first. Just not sharing.
Yes. It works.
I don't like the design. Oh well.
At least I can see it

« first day (1158 days earlier)      last day (998 days later) »