• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Pixate/pixate-freestyle-ios: Pixate Freestyle for iOS

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

Pixate/pixate-freestyle-ios

开源软件地址:

https://github.com/Pixate/pixate-freestyle-ios

开源编程语言:

Objective-C 85.0%

开源软件介绍:

Pixate Freestyle

Pixate Freestyle is a native iOS (and Android) library that styles native controls with CSS. With Freestyle, you can replace many complicated lines of Objective-C with a few lines of CSS. This simplifies and centralizes your styling code, and offers other benefits as well.

Note: Pixate Freestyle iOS is no longer being directly supported. You may want to consider StylingKit which is a maintained (as of 2017-08) fork of Pixate Freestyle. Pixate Freestyle has problems with naming conflicts with some Apple classes on iOS 10 and 11.

Getting Started

Installation

There are several ways to download and install the Pixate Freestyle framework.

The easiest is to download the installer, which always contains the latest version, and drag PixateFreestyle.framework into your Xcode project. Alternatively, you can download the framework file only (i.e. no samples) by going to the releases section of this repo.

NOTE: The installer will place the files into your Documents folder in a folder named PixateFreestyle.

Once installed, add the following import to the top of your main.m file:

#import <PixateFreestyle/PixateFreestyle.h>

In the body of your main method, add the following line before the return:

[PixateFreestyle initializePixateFreestyle];

Your main method should look something like this:

int main(int argc, char *argv[])
{
    @autoreleasepool {
        [PixateFreestyle initializePixateFreestyle];
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

If you use CocoaPods, install the Freestyle cocoapod by adding PixateFreestyle to your Podfile:

pod 'PixateFreestyle'

RubyMotion, Xamarin, and Titanium

Modules are also available (with source code) for using Pixate Freestyle on iOS with:

Migrating from Pixate Framework

If you are migrating from the Pixate Framework, you’ll only need to make a few changes, namely updating your imports to use ‘PixateFreestyle’ and updating your initialization method in your main.m.

In terms of your ‘#import” lines, just update them to read as follows:

#import <PixateFreestyle/PixateFreestyle.h>

And like the Installation step above, just change your main.m to look like the following, you no longer need to use a license key or user name.

#import <PixateFreestyle/PixateFreestyle.h>

int main(int argc, char *argv[])
{
    @autoreleasepool {
        [PixateFreestyle initializePixateFreestyle];
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

Styling Apps with CSS

Pixate Freestyle allows you to add IDs, Class'es, and inline styles to your native components, and style them with CSS. Learn more about this here.

For now, let’s make a simple app that styles a single button. Follow this short video and then add the following CSS code to a new file, default.css, in your Xcode project.

```
view {
  background-color: #ffffff
}

.btn-green {
  color            : #446620;
  background-color : linear-gradient(#87c44a, #b4da77);
  border-width     : 1px;
  border-color     : #84a254;
  border-style     : solid;
  border-radius    : 10px;
  font-size        : 13px;
}
```

Moving Faster with Themes

You can build the style of your app piece-by-piece using the method above. For even faster development, use a pre-built Freestyle theme. Themes have pre-built CSS and Sass that can be quickly customized to style an entire app. Learn more here.

Mailing List & Twitter

Keep up with notifications and announcements by joining Pixate's mailing list and follow us on Twitter.

Docs

You can find the latest Pixate Freestyle documentation here.

Compiling Freestyle Source

To compile the Pixate Freestyle source outside of Xcode or your project, just clone the repo and go into the scripts/ directory. From there, run the 'build_framework.sh' script. It will compile the framework and create a "FAT" binary and place it in a build/ folder at the root level of the repo.

Contributing

Pixate welcomes contributions to our product. Just fork, make your changes, and submit a pull request. All contributors must sign a CLA (contributor license agreement).

To contribute on behalf of yourself, sign the individual CLA here:

http://www.freestyle.org/cla-individual.html

To contribute on behalf of your employer, sign the company CLA here:

http://www.freestyle.org/cla-company.html

All contributions:

  1. MUST be be licensed using the Apache License, Version 2.0
  2. authors MAY retain copyright by adding their copyright notice to the appropriate flies

More information on the Apache License can be found here: http://www.apache.org/foundation/license-faq.html

Support

Pixate offers various levels of free and paid support. Please visit our support site for more details.

License

Except as otherwise noted, Pixate Freestyle for iOS is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
pwn20wndstuff/Undecimus: unc0ver jailbreak for iOS 11.0 - 12.4发布时间:2022-06-21
下一篇:
Sponsor @stomita on GitHub Sponsors · GitHub发布时间:2022-06-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap