GithubHelp home page GithubHelp logo

Comments (12)

robertwijas avatar robertwijas commented on September 22, 2024

Can you paste here your Podfile and uiss.json file?
BTW UIButton+UISS category is not needed.

from uiss.

ypawar82 avatar ypawar82 commented on September 22, 2024

Hi,

Podfile contents

target 'MyOrder' do
  use_frameworks!
  pod 'UISS', '~> 1.1.0'
end

UISS json i'm using

{
    
    "Variables": {
        "tint":"#13A9FA"
    },
    "UIWindow": {
        "tintColor":"$tint"
    },
    "UITabBar": {
        "tintColor": "white"
    },
    "UINavigationBar": {
        "Phone": {
            "tintColor":"$tint",
            "titleTextAttributes": { "NSForegroundColorAttributeName":"#13A9FA"}
        }
    },
    "SubmitButton": {
        "backgroundColor": "#13A9FA",
        "titleColor":"white",
        "UILabel": {
            "font": ["Montserrat-Regular", 16],
            "textColor":"white"
        }
        
    }
}

SubmitButton is swift class with no extra body logic and is subclass of UIButton.
I'm trying to change title color of UIButton.
-Thanks !!

from uiss.

robertwijas avatar robertwijas commented on September 22, 2024

Try:

{
    "titleColor:normal": "white"
}

from uiss.

ypawar82 avatar ypawar82 commented on September 22, 2024

I used
{ "titleColor:normal": "white" }

but app is not loading, only launch screen shows for long time.

from uiss.

robertwijas avatar robertwijas commented on September 22, 2024

I'll try creating a sample Swift 3.x project tomorrow.

from uiss.

ypawar82 avatar ypawar82 commented on September 22, 2024

Thanks !!

For Swift project
I'm using this function in UISSParser.m to use UISS with Swift 3.0 (referred in issue topics)

- (Class)classFromString:(NSString *)className {
    Class class = NSClassFromString(className);
    if (!class) {
        // if the class doesn't exist as a pure Obj-C class then try to retrieve it as a Swift class.
        NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
         //MyApp has hypen so modifying app name for sake to connect swift classes
        if ([appName isEqualToString:@"MyApp2-2"]) {   
            appName = @"MyApp2_2";
        }
        NSString *classStringName = [NSString stringWithFormat:@"_TtC%d%@%d%@", appName.length, appName, className.length, className];
               class = NSClassFromString(classStringName);
    }
    return class;
}

Above is called from this function

- (void)processKey:(NSString *)key object:(id)object context:(UISSParserContext *)context; {
    if ...
 else {
        //  Earlier version line commented    
       //  Class class = NSClassFromString(key);
        // For Swift class calling function classFromString
        Class class = [self classFromString:(key)];
        if (class) {
            [self processClass:class object:object context:context];
        } else {
            [self processPropertyWithKey:key value:object context:context];
        }
    }
}

from uiss.

robertwijas avatar robertwijas commented on September 22, 2024

Regarding CocoaPods, can you check the output of pod repo list? Do you have https://github.com/CocoaPods/Specs.git configured as your master CocoaPods repository?

from uiss.

robertwijas avatar robertwijas commented on September 22, 2024

So Swift classes are prefixed with module name.
So for your custom class you need to use ModuleName.SubmitButton in uiss.json file.
Also I recommend using the most recent UISS version which is 1.1.2.

Please let me know if you have any further questions.

from uiss.

robertwijas avatar robertwijas commented on September 22, 2024

@ypawar82 BTW I've created a sample project to confirm, please let me know if you'd like to have it. Thanks!

from uiss.

ypawar82 avatar ypawar82 commented on September 22, 2024

Sure !! How can I access ?

from uiss.

robertwijas avatar robertwijas commented on September 22, 2024

@ypawar82 https://dl.dropboxusercontent.com/u/530014/UISSTestSwift.zip

from uiss.

ypawar82 avatar ypawar82 commented on September 22, 2024

Thank you !! Appreaciate !! Works for me !!

from uiss.

Related Issues (20)

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.