Giter Club home page Giter Club logo

chameleon's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chameleon's Issues

UITextField Doesn't Right Justify

Setting the textAlignment field in a UITextField to UITextAlignmentRight doesn't appear to do anything; the text remains justified left. I'd guess the same is true for UITextView since they both appear to use the same private, UITextLayer.

UIScrollView doesn't bounce in Lion

In Lion, all of the scroll views are bouncy now, similar to iOS. Ideally we could somehow piggyback on OSX's implementation of this so that it always feels the same/correct, but even if we can't we really need to support this so that Chameleon apps feel right on 10.7.

Drag and Drop

Any idea how I would add Drag and Drop support to a UIWindow or UIView class? Thx!

just noticied

passing zerorect does not work properly the layout is wrong, anyway good and solid job,

I created a set of experimental classes

NSUIWindowController (Nav Bar based and more)
NSUIWindow
NSUIApplicationDelegate
NSUIApplication

why ?call me crazy but it's just I tried it using cocotron,

I also added an experimental NSCoding capability to the view, xcode sucks about the XIB, they are totally convertible IB just ignore not found/ or "not understood" properties (except for the main one sure)

I also noticed that your tableView Object is really in a state of draft, maybe if people want to commit work, it would be nice to focus on this element as it's the base (I know implementation of the animations needed first)

Cheers!

Trouble using MediaPlayer framework

Will there be an example for MediaPlayer? I am having trouble compiling any project with MediaPlayer framework. I can compile the UIKit and MediaPlayer framework fine, but as soon as I use include something like

import <MediaPlayer/MPMoviePlayerController.h>

in one of the header file, the compile will flag

MPMoviePlayerController.h
MPMediaPlayback.h: No such file or directory
Cannot find protocol declaration for 'MPMediaPlayback'

Tried on MultiApple and BigApple samples and same issue.

NSView animateWithDuration always takes UIViewAnimationCurveEaseInOut option

In the example presented below:

UIView animateWithDuration:1.5 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^(void) {
// property animations
} completion:nil ];

the argument "options" always takes the same value (UIViewAnimationCurveEaseInOut) regardless of actual value.
The fact that the implementation of that method lies the error. In this situation you can not work with enums as with bit-fields!

If we replace this:

// In UIView
// + (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay
// options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion

if ((options & UIViewAnimationOptionCurveEaseInOut) == UIViewAnimationOptionCurveEaseInOut) {
animationCurve = UIViewAnimationCurveEaseInOut;
} else if ((options & UIViewAnimationOptionCurveEaseIn) == UIViewAnimationOptionCurveEaseIn) {
animationCurve = UIViewAnimationCurveEaseIn;
} else if ((options & UIViewAnimationOptionCurveEaseOut) == UIViewAnimationOptionCurveEaseOut) {
animationCurve = UIViewAnimationCurveEaseOut;
} else {
animationCurve = UIViewAnimationCurveLinear;
}

On simple:

animationCurve = (options >> 16) & 0x03;

Then the behavior will be correct

Weird behavior with UITextLayer on OS X 10.8

Has anyone tested their Chameleon apps on 10.8? I have and UITextFields and UITextViews are not working correctly.

If I build the app with the latest 10.7 SDK and run it on 10.8:

  1. UITextFields do not render any text.
  2. UITextViews work correctly

If I build the app with the latest 10.8 SDK and run it on 10.8:

  1. Neither worked at all at first (wouldn't become first responder), but after mucking with some of the hit testing code I got them mostly working.

Reading the 10.8 release notes from Apple makes me think the changes they made to NSView/CALayer is messing with Chameleon. Before I investigate for hours I wanted to see if anyone else had a solution already.

Unit tests

Unit tests that can easily be run against both Chameleon and Apple's UIKit would be amazingly useful.

UITextField tabbing support

In the simulator and on iOS devices when using a keyboard, you can hit tab when in a UITextField and it'll move to the next one. Does anyone have any idea how that's accomplished automatically? It needs to work in Chameleon, too.

Cursor leaving UIScrollView causes momentum to stop or transfer to another UIView

I've got an application that uses two UIScrollViews side-by-side.

If I begin scrolling the left-side scrollview and move my cursor to the right, the right-side scroll view has the momentum from the left-side scrollview applied.

You can also reproduce a similar issue by scrolling a large UIScrollView and moving your cursor outside of the view. The scrollview suddenly stops scrolling even though it should continue.

dyld: Library not loaded: @executable_path/

I'm fighting for a while with this error message when running my App with the Chameleon project:

dyld: Library not loaded: @executable_path/../Frameworks/UIKit.framework/Versions/A/UIKit
  Referenced from: /Users/Documents/Projects/libs/Chameleon/Examples/BigApple/build/Debug/CME.app/Contents/MacOS/CME
  Reason: image not found

Chameleon is not known to be GC-safe

Chameleon is not known to be GC-safe. It probably should become so, but if anyone wants to tackle this, be aware that it cannot be GC-only at this point.

Very buggy NSWindow behavior with Lion full screen

I've pulled Chameleon changes after not having done so for many months, and suddenly my app's window is exhibiting some very strange and buggy behavior. (On 10.7; I haven't tested other platforms.) The "BigApple" example app demonstrates this as well.

Steps to reproduce: Tweak BigApple's NSWindow instance in MainMenu.xib to enable Full Screen (Primary Window) and ensure that it has no maximum window size set. Run the application. Enter full screen, then exit.

Results: Notice that the top bar of the window no longer responds to clicking and dragging to reposition. Hover over the edges of the window and notice that it does not display the resize arrows, but the window can be resized from the bottom right corner.

In our app, we also crash EXC_BAD_ACCESS trying to send a message to a deallocated instance of a private AppKit class ( [_NSThemeFullScreenButton isDescendantOf:]). But I have not been able to reproduce that with BigApple.

If I point either our app or BigApple to older Chameleon source (even 687c7e5 from the downloadable .zip archive on github), they both behave as expected.

NSHelpManager

When creating a tooltip using NSHelpManager, make the calls 'setContextHelp' and 'showContextHelpForObject' The tooltip displays fine. The problem is that when I click on the view below the exposed tooltip, the first mouse click is completely comsumed by NSHelpManager. I get no notice anywhere the mouse is down. The user is then forced to click a second time to invoke the button. Not sure if this is a Chameleon issue or not. But any insights would be helpful. Thanks.

initWithNibName not working for UIViewControllers

Is there a plan to add this support?

I see following code in UIViewcontroller.m:

  • (id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle
    {
    if ((self=[super init])) {
    _contentSizeForViewInPopover = CGSizeMake(320,1100);
    _hidesBottomBarWhenPushed = NO;
    }
    return self;
    }

UITableViewStyleGrouped implementation

Dear Illusion of Chameleons,

(Side Note: http://wiki.answers.com/Q/What_is_the_Name_for_a_group_of_chameleons)

You are such a tease. All this beautiful UIKit on OSX and no UITableViewStyleGrouped implementation for UITableView.

Just wondering on a development status on this before diving in to build this functionality myself.

If implementing it isn't in your foreseeable future is there anything other than the Coding Style Guidelines I should be aware of before tackling this?

Kind Regards
-neozenith

Misisng method UIPopoverController [ - setPopoverContentSize:animated: ]

Popovers are looking great on Mac with Chameleon, but I was surprised to find that a call to UIPopoverController's [ - setPopoverContentSize:animated: ] compiles on iOS but not on Mac. The API has been around since iOS 3.2, according to the docs. Is this a known issue? Is there a reason it can't be implemented?

does the UITableViewCell subviews receive events?

I was testing the framework with a basic application : a table view with some cells. The UITableView works great! No memory issues, scrolling works like expected, etc. But the UITableViewCell looks problematic, I’ve added a button, set the target/action and nothing happened. Worse, the "down state" of the button was propagated to the next selected cell (looks like the button didn’t receive a "touch up" event, and never had a chance to redraw / update itself).

Then, I looked into UIGestureRecognizers, but they are mostly no-op currently, so I’m out of ideas, except for asking : should I do something special to UIButtons work inside UITableViewCells or isn’t implemented yet?

Table accessoryView Doesn't Work with UITextField, UITextView

The accessoryView in tables is limited to UILabels and other classes that respond meaningfully to sizeThatFits: . If you instead try to use a UIView child, such as UITextField, the accessory ends up writing right over the main label because sizeThatFits: in UIView just returns the size that it's given.

It's the layoutSubviews method in UITableViewCell that does the wrong thing.

(Under iOS, a UIView in an accessoryView instead behaves as expected.)

UIKitView goes blank after app restart when using fast user switching

Users of my application have run into this bug while using fast user switching on mac osx lion. The specific issue occurs when a Chameleon app restarts while the owner is 'switched out' and another user is logged in. This may seem like an odd case, but this occurs when users of my application are "autoupdated" while their user account is 'switched out'.

I have a mac book pro running osx lion.

This is the simplest way to repro:
I have a mac book pro running osx lion.
1.) Login to your Mac as 'User A'
1.) Create a new user account 'User B', and ensure that 'fast user switching' is enabled.
2.) Build the BigApple example application, and copy it to ~/Applications
3.) run this command from the command line 'sleep 10 ; open ~/Applications/BigApple.app'. The sleep will give you enough time to execute the next step.
4.) quickly 'fast user switch' to 'User B'. This needs to be completed before the BigApple is launched.
5.) wait for 10 seconds until BigApple is running under 'User A'.
6.) fast user switch back to 'User A'

Expected:
You see BigApple running and the screen renders as normal

Actual:
You see a blank screen.

It appears the the UIKitView stops rendering all together. The application seems to be responsive and executing, but no UI is being drawn. I have seen a similar issue when the app is running and the machine switches to using the integrated graphics card from the descrete graphics card.

Any help would be appreciated. Perhaps there is a workaround I could employ in these cases to get the view hierarchy re-initialized.

UIApplication.h does not like objc++

Needed to extern two consts:

extern const UIBackgroundTaskIdentifier UIBackgroundTaskInvalid;
extern const NSTimeInterval UIMinimumKeepAliveTimeout;

__weak does not play well with 10.6 runtime and ARC

When Chameleon is included into an ARC project, the __weak references cause errors because 10.6 does not support zeroing weak refs. My suggestion would be to ditch GC and move the whole thing to ARC. I'll try to convert it on my own branch for now.

UIButton title blurry

I am running into an issue where a UIButton with a simple title is being shown with blurry text. The code below renders a UILabel and an UIButton with the same font name and size. The UILabel shows is rendered clearly, but the UIButton appears blurry:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
  window.backgroundColor = [UIColor lightGrayColor];
  window.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  
  
  UILabel* sillyLabel = [[UILabel alloc] init];
  sillyLabel.text = @"silly label";
  sillyLabel.font = [UIFont fontWithName:@"Helvetica" size:12];
  sillyLabel.textColor = [UIColor darkGrayColor];
  sillyLabel.frame = CGRectMake(22, 100, 60, 50);
  sillyLabel.backgroundColor = [UIColor clearColor];
  [window addSubview:sillyLabel];
  
  UIButton* sillyButton = [UIButton buttonWithType:UIButtonTypeCustom];
  sillyButton.titleLabel.textAlignment = UITextAlignmentLeft;
  [sillyButton setTitle:@"silly button" forState:UIControlStateNormal];
  [sillyButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
  sillyButton.titleLabel.font = [UIFont fontWithName:@"Helvetica" size:12];
  sillyButton.frame = CGRectMake(22,125,60, 50);
  [window addSubview:sillyButton];
  
  
  [window makeKeyAndVisible];
    return YES;
}

I verified that this code results in the correct behavior in iOS.

Please add semantic version tags

I’ve recently added Chameleon to the CocoaPods package manager repo.

CocoaPods is a tool for managing dependencies for OSX and iOS Xcode projects and provides a central repository for iOS/OSX libraries. This makes adding libraries to a project and updating them extremely easy and it will help users to resolve dependencies of the libraries they use.

However, Chameleon doesn't have any version tags. I’ve added the current HEAD as version 0.0.1, but a version tag will make dependency resolution much easier.

Semantic version tags (instead of plain commit hashes/revisions) allow for resolution of cross-dependencies.

In case you didn’t know this yet; you can tag the current HEAD as, for instance, version 1.0.0, like so:

$ git tag -a 1.0.0 -m "Tag release 1.0.0"
$ git push --tags

General UINavigationController problems

Here's a few issues I remember existing with UINavigationController:

Updating the top view controller's UINavigationItem after all the UI layout has been done doesn't necessarily update the display (changing titles, etc). This is a non-issue in Apple's implementation and needs to be fixed.

The calling of viewWill/DidAppear: and viewWill/DidDisappear on the child UIViewControllers when they push/pop/first-appear/etc happens in a pretty different order/sequence from how Apple does it and this could be problematic in some cases. I remember noticing that Apple's own behavior for this seems very dependent on a number of factors (possibly for their own internal legacy reasons). Sometimes they are deferred for a run loop cycle, sometimes not, etc. It will take a ton of tests to try to work out the "correct" patterns, I think.

UIViewController's -hidesBottomBarWhenPushed probably doesn't work right, although at the moment I can't remember for sure.

Animating the UIToolbar in/out of view on push/pops is rough and how it looks might depend somewhat on when/where other code calls -setToolbarHidden:animated:.

UIWebView can't focus

Using a UIWebView, the website cannot take focus. Clicking on a text box does nothing, and highlighting text is grayed out.

Tutorial

Can anyone write up a short tutorial?

I'm bogged down by stuff that's probably very simple, like redefinitions of UIScreen being detected.

Implementation of -subviews in UIView

I did some testing, and the real iOS (at least in the emulator) doesn't re-order the subviews to match sublayer order.

NSLog(@"View %@ \n", [[self.window subviews] objectAtIndex:0]);
NSLog(@"Layer %@ \n", [[windowLayer sublayers] objectAtIndex:0]);
[self.window exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
NSLog(@"View after view swap %@ \n", [[self.window subviews] objectAtIndex:0]); //Swapped
NSLog(@"Layer after view swap %@ \n", [[windowLayer sublayers] objectAtIndex:0]); //Swapped
[magentaLayer removeFromSuperlayer];
[yellowLayer removeFromSuperlayer];
[windowLayer insertSublayer:yellowLayer atIndex:1];
[windowLayer insertSublayer:magentaLayer atIndex:0];
NSLog(@"View after layer swap %@ \n", [[self.window subviews] objectAtIndex:0]); //Still the same
NSLog(@"Layer after layer swap %@ \n", [[windowLayer sublayers] objectAtIndex:0]); //Swapped

__unsafe_unretained and __bridge not available in Xcode 4.1

When compiling Chameleon in Lion + Xcode 4.1, there are tens of errors like this:

file://localhost/Users/191919/Desktop/cocoa/Chameleon/UIKit/Classes/NSFetchedResultsController.h: error: Parse Issue: Unknown type name '__unsafe_unretained'

How to compile and add framework?

Hi,

I've added the framework to my xcode 4 project by dragging UIKit.framework to my project, and then adding a copy frameworks build file.

I think the framework was correct added because I don't get any error where I require it with #import <UIKit/UIKitView.h>, but I get a lot of other erros like:

Cannot find interface declaration for UIView,
Cannot find interface declaration for UILabel,
etc

I assume those should work out of the box, so maybe I'm adding the framework the wrong way?

UIGestureRecognizers don't fire events

UIGestureRecognizer's -addTarget:action: is a no-op, and none of the gestures are wired up to fire events. Looks like the workaround is to use -touchesBegan: and friends.

[UIDevice uniqueIdentifier] changes each time it is invoked

The Apple documentation defines [UIDevice uniqueIdentifier] as returning "An alphanumeric string unique to each device based on various hardware details." Invoking [UIDevice uniqueIdentifier] in iOS returns the same unique identifier each time.

The current Chameleon implementation of [UIDevice uniqueIdentifier] invokes [NSProcessInfo globallyUniqueString] which "generates a new string each time it is invoked".

UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin resize mask not working properly

The floorf() call causes the view to slowly drift away from where it should be if you resize the superview over and over. Removing the floorf() call solves the problem for me.

else if (hasAutoresizingFor(UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin)) {
            frame.origin.x = frame.origin.x + (delta.width / 2.f); //floorf(frame.origin.x + (delta.width / 2.f));
        }

UIViewContentMode is vertically flipped

The various UIViewContentMode values that involve a vertical position are showing up inverted. The problem is resolved by inverting the CALayer gravity setter values.

For example, in [UIView setContentMode:], instead of UIViewContentModeTop being mapped to kCAGravityTop, it should be mapped to kCAGravityBottom, and so on.

Quick use inside a NSViewController not working

I'm trying to quickly get an inner frame to draw UIstuff into. Tried to use the given UIWindow property for this but this code won't work in one of my ViewControllers:viewDidLoad() :

UIButton *previewButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[previewButton setTitle:@"Click Me!" forState:UIControlStateNormal];
[previewButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
previewButton.frame = CGRectMake(0,0,200,50);

self.uiView.UIWindow.backgroundColor = [UIColor greenColor];
self.uiView.UIWindow.opaque = YES;
self.uiView.UIWindow.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

[self.uiView.UIWindow addSubview:previewButton];
[self.uiView.UIWindow makeKeyAndVisible];

Where uiView is a UIKitView from a .xib
Is there another way to achieve this?

MapKit

The MapKit framework is missing.

topView in UINavigationController is not well displayed

The first viewController (rootView) added to a UINavigationController is not correctly positioned at the first use.

The first viewController appear behind the UINavigationBar so the top of it is not visible (with a UITableView on the view, the half of the first row is not visible)

After navigating to the next view and coming back the topView is well positioned.

This appear related, from what i can found, to the use of autoresizingMask in loadView.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.