GithubHelp home page GithubHelp logo

uiss's People

Contributors

bfoz avatar robertwijas avatar sergeytimoshin avatar tonklon 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

uiss's Issues

UIButton titleColor not working - swift

Hi,

I'm using Swift 3.0.
"titleColor:highlighted": "white"
This is not working. Also i tried UISS pod but error
[!] Unable to find a specification for UISS (~> 1.1.0)
Also there is no class UIButton+UISS in my version from git.
-Thanks !!

Compiler error when targeting iOS 6

Hi, I am getting a compiler error in the most recent code from master. It appears that dispatch_release (used by the dealloc method in uiss.m) is not allowed if the project is targeting iOS 6.0 and above.

I found this information which might be relevant:
http://stackoverflow.com/questions/8618632/does-arc-support-dispatch-queues

In particular: "...if your deployment target is at least iOS 6.0 or Mac OS X 10.8, and you have ARC enabled, ARC will retain and release your queue, and the compiler will flag any attempt to use dispatch_retain or dispatch_release as an error."

Hope that helps!

Tim

Deprecated methods in iOS 6.0

Getting a couple of errors in the library (1.1.0 from Cocoapods):

  1. [self dismissModalViewControllerAnimated:YES]; on line 90 in UISSConsoleViewController.m

  2. NSAssert(dispatch_get_current_queue() == dispatch_get_main_queue(), @"notifications should arrive on main thread", nil); on line 145 in UISSStatusViewController.m

I fixed the first one (replaced it with: [self dismissViewControllerAnimated:YES completion:nil];). Not sure how to fix the second one though, not alot of experience with GCD.

No comments into uiss.json

First of all, great work, Robert!

You should put a note somewhere that you cannot use comments in the uiss.json, this seems to break the system.

UISS 2.0

Can i know when the UISS 2.0 will be available ?

is UISS support iOS7 ??

When i run UISS on iOS 7 i got this message

Ld /Users/knetmac3/Library/Developer/Xcode/DerivedData/ThemesDemo-gqxxcwvjavqbeeettltrpfsohmoe/Build/Products/Debug-iphonesimulator/ThemesDemo.app/ThemesDemo normal i386
cd /Users/knetmac3/Desktop/ThemesDemo
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/knetmac3/Library/Developer/Xcode/DerivedData/ThemesDemo-gqxxcwvjavqbeeettltrpfsohmoe/Build/Products/Debug-iphonesimulator -F/Users/knetmac3/Library/Developer/Xcode/DerivedData/ThemesDemo-gqxxcwvjavqbeeettltrpfsohmoe/Build/Products/Debug-iphonesimulator -filelist /Users/knetmac3/Library/Developer/Xcode/DerivedData/ThemesDemo-gqxxcwvjavqbeeettltrpfsohmoe/Build/Intermediates/ThemesDemo.build/Debug-iphonesimulator/ThemesDemo.build/Objects-normal/i386/ThemesDemo.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -framework Foundation -framework UIKit -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework CoreGraphics -framework UIKit -framework Foundation -lPods -Xlinker -dependency_info -Xlinker /Users/knetmac3/Library/Developer/Xcode/DerivedData/ThemesDemo-gqxxcwvjavqbeeettltrpfsohmoe/Build/Intermediates/ThemesDemo.build/Debug-iphonesimulator/ThemesDemo.build/Objects-normal/i386/ThemesDemo_dependency_info.dat -o /Users/knetmac3/Library/Developer/Xcode/DerivedData/ThemesDemo-gqxxcwvjavqbeeettltrpfsohmoe/Build/Products/Debug-iphonesimulator/ThemesDemo.app/ThemesDemo

ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Wondering about how to install

Hi,

Could somebody explain what's meant by this?

  • add UISS.xcodeproj to your project

This is from the installation instruction. Does it mean to be done literally? I.e., via the 'Add files to project' function, and choose the xcodeproj file? I did this, which results in the UISS project now being inside my app's project (visually, in the project navigator pane). XCode appeared to compile the project, but when I add this: [UISS configureWithDefaultJSONFile];, the UISS class is not found.

UISS greatly hinders app startup in iOS 9

Whereas I used iOS 8.4 previously, now I am using iOS 9 GM Seed, and UISS is slowing down app startup significantly (by about 10-20 seconds). It looks like the main bottleneck exists in the many [NSInvocation invoke] calls when setting up UISS.

OSX support?

Would you consider reviewing a pull request to add support for osx styling?

How can i setBackButtonBackgroundImage?

UIImage *backButtonImage = [[UIImage imageNamed:@"NavigationBarBackButtonBackground"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 12.5, 0, 5)];
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

I tried:

"backButtonBackgroundImage:normal":["NavigationBarBackButtonBackground", [0, 5, 0, 5]],

and

"backBackgroundImage:normal":["NavigationBarBackButtonBackground", [0, 5, 0, 5]],

but it's not working.

Removing code generation feature

I'm planning to remove code generation feature.
I not sure anyone uses it and it slows the development of new UISS features quite a bit.
If you're using UISS please let me know what you think about this decision. Thanks.

Crash.

Log:
objc[56776]: cannot form weak reference to instance (0xbfffd768) of class NSStackBlock

Line 112 of class UISSVariablesPreprocessor cause this crash.

__block __weak ResolveBlock resolveBlock = ^(NSString *n) {
    if ([unresolved.allKeys containsObject:n]) {
        id value = [unresolved objectForKey:n];
        [unresolved removeObjectForKey:n];

        [self setVariableValue:value forName:n withResolveBlock:resolveBlock];
    }

    return [weakSelf getValueForVariableWithName:n];
};

After remove __weak,the crash disapplear,but the compiler start to complain retain cycle.

Support for UITraitCollection?

Hi,
are there any plans to support UITraitCollection, i.e. appearanceForTraitCollection: and appearanceForTraitCollection:whenContainedInInstancesOfClasses: ?

Best regards,
Thomas

Switching between two stylesheets?

Hi, this library is incredible. It's pretty amazing to see it "just work".

My apps has two modes, and it needs to switch between two look-and-feels. It seems like having two stylesheets makes the most sense. But I'm not sure how to instruct the UI to refresh after switching.

Here's what I'm experimenting with: creating a new UISS instance, and then instructing it to refresh somehow. It's not refreshing, however:

self.uiss = [UISS configureWithURL:...
[self.uiss loadStyleSynchronously];

Bug. Using a variables in an array.

I found a bug when using the library. I can not use variables in the array construction.
Maybe I incorrect use this library?

Json file:
{
"Variables": {
"lightBlueColor": [[13, 107, 180, 1.0]],
},
"MyButton": {
"titleColor": [["$lightBlueColor", "normal"], ["white", "highlighted"]],
},
}

Error:
-[__NSArrayM intValue]: unrecognized selector sent to instance

File: UISSColorValueConverter.m, line 167
// red = [[array objectAtIndex:0] intValue] / 255.0f;

How to use local paths in JSON file ?

"UIButton": {
"image" : "/Users/knetmac3/Library/Application Support/iPhone Simulator/7.0.3/Applications/49EEBD4A-2ADC-485C-9764-D58475792F7F/myfiles/image1.png"
}

I want to do like this .. how i can ??

UISS by ID or Class

Just discoved UISS and its really great...
Is there any way to specify a class or Id to a object and then change its theme?
I have a UIButton subclass that has 2 status... if the status = 0 it has a grey background image and if its 1 it has a green background image and when I change the theme I want the status = 0 to use a red image and when 1 I want a blue image instead.
Is it possible to have something like:

{
"UIButton#Status0": {
"backgroundImage": "$img0"
},
"UIButton#Status1": {
"backgroundImage": "$img1"
}
}

titleTextAttributes on UINavigationBar not auto reloading when changed

Styling a UINavigationBar changing any 'titleTextAttributes' won't auto reload the titlebar. Making a change to the 'tintColor' on 'UINavigationBar' will force a change and also apply any changes set to 'titleTextAttributes'.

Example uiss.json style file.

"UINavigationBar":{
        "tintColor":"white",
        "titleTextAttributes": {
                "textColor": "#333333",
                "textShadowOffset":[0,1],
                "textShadowColor":"#eeeeee"
            }
    }

No status bar without enabling live reload

#ifdef DEBUG_UISS_INTERVAL
    UISS *uiss = [[UISS alloc] init];
    uiss.style.url = [NSURL URLWithString:@"http://localhost/uiss.json"];
    [uiss load];
    uiss.statusWindowEnabled = YES; // works when DEBUG_UISS_INTERVAL > 0
#if DEBUG_UISS_INTERVAL
    [uiss enableAutoReloadWithTimeInterval:DEBUG_UISS_INTERVAL];
#endif

Is there a way to use `UIFontTextStyles` (for dynamic type) using UISS?

Well, I think the question is clear enough :), just in case I'm looking for something like.

// some themeing
"UITableViewHeaderFooterView": {
        "tintColor": "$someTintColor",
        "UILabel": {
            "textColor": "$TextSubtitleColor",
            "font": UIFontTextStyleCaption1
        }
    },
// some additional themeing

Set images from URL

Is it possible to set a background image (or other image) from an external URL so that it's possible to update/change images on the fly as well without having to have them already be packaged in the app? If not, would there be a recommended way to do something like this - for example, download a new bundle from an external location and then use the bundle to set the image?

App Extension support

There are references to [UIApplication sharedApplication] and UIAlertView in the UISS iOS library, which is forbidden in (Today)App Extension context .It would be great if UISS can be used for app extensions. Can you please fix this by using a preprocessor macro?

Add BackgroundImage Generation from color Spec

This Feature would greatly simplify customization for Controls where only BackgroundImages can be set.

By specfiying only the Color UISS should generate the Image.
So Properties for Images would be easily customized.

Crash - EXC_BAD_ACCESS in [UISS loadStyleSynchronously]

In the UISS class, queue is defined as a nonatomic, assign property.

When calling the loadStyleSynchronously method, queue isn't retained and a EXC_BAD_ACCESS crash results.

The workaround is to declare the queue property as strong in line 30:

@property(nonatomic, strong) dispatch_queue_t queue; // all style parsing is done on the queue

Crash on iOS5 -[__NSArrayM objectAtIndexedSubscript:]: unrecognized selector sent to instance

Looks like the lib has an issue with the array subscript syntax used inside the NSArray+UISS category code. When you use this on iOS 5 it will crash with the following exception:
-[__NSArrayM objectAtIndexedSubscript:]: unrecognized selector sent to instance

From my research it look like that the back warts support for array subscription does not work from within a category.

I'm not sure if this lib is still supporting / or should be still supporting iOS 5 but from the pod file found in the example I expect that it does at the moment. So it would perhaps make sense to fix the code.

@implementation NSArray (UISS)

- (BOOL)canConvertToIntObjectAtIndex:(NSUInteger)index {
    return self.count > index && [[self objectAtIndex:index] respondsToSelector:@selector(intValue)];
}

- (BOOL)canConvertToFloatObjectAtIndex:(NSUInteger)index {
    return self.count > index && [[self objectAtIndex:index] respondsToSelector:@selector(floatValue)];
}

@end

How to style with method?

I am being able to modify components through properties, but I need to modify a UIBarItem with this method:

-(void)setTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;

I have not found any example that indicates how should the JSON look, and everything I have tried does not compile.

Thanks in advance

unknown appearance class

i get the error 5704 "Unknown appearance class" on one of my viewControllers.
i have no clue why this happens... any hints?

Style photo skins

Hi Robert,

Iā€™m building an app that let the users share photos with football live scores over it, we have multiple score designs right now, iā€™m styling using interfacebuilder .xib files, my current problem is that i have some sports teams that want to join with oficial skins packs, and we have to update the app everytime we want to add a new skins pack.

What we do right now is, we create an image 1080x1080 with the non dynamic items of each skin and then we position the dynamic elements in place using interfacebuilder.

I know that UISS can be used to style app UI/UX elements, my skin pack are 8 skins per pack, my specific question is :

Can i use UISS to create multiple UISS/Json to style (font-family,font-size, background-image, images-fields, position etc) each skin even from the server ?

Note: Dynamic items i get from a live scores api and are always the same , home_team , away_team, home_score, away_score, so i create a skin model with this items and just replicate

Thank you for your help

Support for IOS 7

Currently compiling for iOS 7 generates warnings for deprecated API

Can't get button colours to work

Hi,

I'm having a problem getting button colours to work. Based on the demo project, I think I should be able to style buttons using titleColor:normal, but it doesn't seem to work. I've put up an example at https://github.com/percysnoodle/uissbuttondemo - I'm using this UISS:

{
    "UBDView" : {
        "backgroundColor" : "#999999"
    },

    "UILabel" : {
        "textAttributes" : {
            "textColor" : "purple"
        },
        "backgroundColor" : "clear"
    },

    "UIButton" : {
        "backgroundColor:normal" : "blue",
        "backgroundColor:highlighted" : "red",
        "titleColor:normal" : "yellow",
        "titleColor:highlighted" : "green",
    }
}

So I expect my buttons to be blue with yellow text. But what I see is this:

Screen Shot 2013-02-21 at 10 29 26

Am I using UISS wrongly, or is there an issue with button colours?

Getter for variables

// I want to be able to get the value of variables.

// Create json file.
{
"Variables": {
"defaultBackgroundColor": "red"
},

"@Controllers": {
    "MyViewController": {
        "UITableView": {
            "backgroundColor": "$defaultBackgroundColor"
        }
    },   
}

}

// UISS init. And appearance is work.
UISS *uiss = [UISS configureWithDefaultJSONFile];
[UISS setSharedUISS:uiss];

// But sometimes I need write code
@implementation MyView

  • (void)drawRect:(CGRect)rect {
    UIColor *color = [[UISS sharedUISS] colorForVariable:@"defaultBackgroundColor"];

    UIBezierPath* bezier = [UIBezierPath bezierPath];
    // ... my bezier code
    [color setFill];
    [bezier fill];
    }

@EnD

// Other UISS methods

  • (id)valueForVariable:(NSString *)name;
  • (UIColor *)colorForVariable:(NSString *)name;
  • (UIFont *)fontForVariable:(NSString *)name;
  • (UIImage *)imageForVariable:(NSString *)name;

CSS-like style sheets over JSON format

Sorry if this has been brought up before, didn't find anything.

Has a CSS like format been considered? We could probably absorb the parser used by NUI.
I find the JSON format a little messy and the variables aren't very elegant. JSON is always a good start, but I think something unique to UISS would be better for the future.

Thoughts?

Copperplate Font not showing up in Demo

UISS sounds like a great idea. Unfortunately, when I tried it, I had some immediate very simple problems with it. (iPad Simulator 7.0.3).

When I run the UISSDemo it looks like this:

uissdemo

There is obviously no Copperplate font in sight, though the JSON thinks, there should be:

"UISSDemoFirstViewController": {
    "UIButton": {
        "backgroundImage:normal": ["button-background-normal", [0,10,0,10]],
        "backgroundImage:highlighted": ["button-background-highlighted", [0,10,0,10]],
        "titleColor:normal": ["white", 0.8],
        "titleColor:highlighted": "white",
        "titleEdgeInsets": [1,0,0,0],
        "UILabel": {
            "font": ["Copperplate-Bold", 18]
        }
    }
}

Also it would be nice, if there is a JSON parser error, to get at least in DEBUG some sort of console output.

iOS 8 support

When i run the application on iOS 8 i found that this lines doesn't work.

"UITextField": {
"backgroundImage":"../textField_background"
}

"UIButton": {
"backgroundImage:normal":"../button_background",
"backgroundImage:highlighted":"../button_press_background"
}

"UINavigationBar": {
"backgroundImage:default": "../navigationBar_background"
}

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.