Giter VIP home page Giter VIP logo

chameleon's Introduction

Chameleon

Chameleon is a port of Apple's UIKit (and some minimal related frameworks) to Mac OS X. It is meant to be as much of a drop-in replacement for the real UIKit as possible. It also adapts some iOS user interface conventions to the Mac (such as UIAlertView being represented by NSAlert) so that apps built using Chameleon have as much chance as possible of feeling at home on the desktop with relatively little porting effort.

Chameleon requires OS X 10.6 or higher. Apps built with it have been proven to be acceptable to Apple for the Mac App Store. Chameleon was first built by The Iconfactory to unify the codebase of Twitterrific for both Mac and iOS.

The UIKit implementation mostly targets iOS 3.2's version of UIKit. Not everything is implemented at this time, but a surprisingly large subset is. There are some methods and/or behaviors from later versions of iOS implemented as well. Any UIKit methods that were deprecated around iOS 3.2 are not included.

As a general rule, if Apple's UIKit behaves in a certain way for some piece of code, that behavior should be considered correct even if you don't like how Apple's version does things. If Chameleon's behavior differs, Chameleon is wrong. That said, before immediately blaming problems on Chameleon, be absolutely sure that your code is, in fact, behaving differently than it would on Apple's implementation. Also be certain that there isn't a good reason Chameleon's behavior may differ. (An example of a difference that is intended is the behavior of UIAlertView - in Apple's UIKit, it is a UIView and has certain expected behaviors and capabilities as a result. In Chameleon, it is still a UIView, but it is presented as an NSAlert and that is simply how it should be to achieve a more native feel but it also means any UIView tricks that may have worked with a UIAlertView on iOS will not work the same under Chameleon. UIActionSheet and UITextView are other examples of areas that have sometimes large but intentional differences.)

Usage

Chameleon is actually a collection of several frameworks, the largest of which is UIKit. The others are mostly stubs that made porting simple demos and test apps from iOS very simple with minimal (in some cases, zero) code changes and may or may not be necessary for you.

The Xcode projects build embeddable frameworks which can then be bundled within your own app's bundle and distributed in a self-contained way.

Design

The UIKit port in Chameleon starts at a very low level and attempts to go so far as to even route UIEvent objects along a similar path starting in the single UIApplication instance and getting routed from there to the correct UIWindows and UIViews.

The interface between AppKit's NSViews and NSWindows and Chameleon's UIWindow and UIViews occurs at the "screen" level. UIKitView is an NSView which you add to your NSView hierarchy in whatever way you want. The UIKitView hosts a UIScreen instance which is home to UIKit's interface elements.

Each UIWindow belongs to a UIScreen, and UIViews must exist on UIWindows. This should mostly work the same as you've come to expect on iOS. An important thing to note is that Mac applications often have more than one window. If you use more than one UIKitView in your app, be aware that this means your application now has more than one UIScreen and as a result some methods such as [UIScreen mainScreen] may suddenly do unexpected things. When porting Twitterrific from iOS, this was one source of unexpected bugs as a few things were making assumptions about there only being a single, main screen since that is normal on current iOS devices.

Once a UIKitView exists and there's a UIScreen available to work with, your code can proceed to build a UIWindow and UIViews on top of it and be largely unaware that it is actually running on OSX instead of iOS. For those cases where you need to customize some UI, UIUserInterfaceIdiomDesktop has been added so that your code can differentiate between running on a pad, phone, or desktop in a consistent way. To keep code cross platform, the following is a good way to structure things so that Apple's UIKit doesn't encounter the unknown UIUserInterfaceIdiomDesktop symbol when compiling for iOS:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
// iPhone
} else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// iPad
} else {
// Mac
}

(You can always use #ifdef or other compile-time approaches for platform differentiation, too - especially since a Mac app built with Chameleon doesn't need to adapt to multiple UI idioms at runtime the way a universal iOS app does. I just find it nice to have a similar pattern for all 3 idioms - but maybe that's just me.)

You can usually just create an instance of your iOS app's UIApplicationDelegate object and then pass it into UIKitView's helper method -launchApplicationWithDelegate:afterDelay: which will emulate the startup process of an iOS app (it will even attempt to show a Default.png if a delay is given). You might perform this step in your NSApplicationDelegate object's -applicationDidFinishLaunching: method. It is not necessary to use UIKitView's helper method to "launch" your app, but it can be a good way to get started.

Generally the interfaces to the classes are the same as Apple's documented interfaces. Some objects have additional methods that are useful for OS X and are defined in (ClassName)AppKitIntegration.h headers which are not included by the standard UIKit.h header. To easily include all AppKit extensions into your code, import UIKit/AppKitIntegration.h when compiling on OS X. There are also a couple of non-standard UI classes defined such as UIKey and UIViewAdapter that I designed out of necessity. (Keyboard handling in particular is a weak spot of Apple's current UIKit and so I developed my own rough API in place of anything "official" being documented by Apple.)

Examples

Right now there's hardly any demos or examples or documentation. There's a simple app called BigApple in the Examples folder which might be enough to get started. It also shows how the UIKit Xcode project can be referenced from another Xcode project and setup as a dependency so that it is built automatically when the BigApple project is built.

Authors

The Chameleon project was created by Sean Heber (Twitter: @BigZaphod) of The Iconfactory and he wrote nearly all of the initial version over several months. Craig Hockenberry (Twitter: @chockenberry) was the first user/tester of Chameleon and found many holes and edge cases in the first implementation.

License

Copyright (c) 2011, The Iconfactory. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of The Iconfactory nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ICONFACTORY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

chameleon's People

Contributors

alanquatermain avatar bigzaphod avatar cartera avatar catsby avatar cmelbye avatar cvee avatar davbeck avatar feosuna1 avatar hpique avatar indragie avatar ivanandriollo avatar joshaber avatar mdales avatar mikr avatar nheagy avatar qvivo-tom avatar steipete avatar themartorana avatar

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

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.

[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".

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

__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?

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.

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.

__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.

UIApplication.h does not like objc++

Needed to extern two consts:

extern const UIBackgroundTaskIdentifier UIBackgroundTaskInvalid;
extern const NSTimeInterval UIMinimumKeepAliveTimeout;

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.

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.

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.

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:.

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

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

Unit tests

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

Drag and Drop

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

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));
        }

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.

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?

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.

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

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.

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;
    }

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.

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.

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.

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.

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.

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!

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.)

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

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.

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?

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?

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.

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.