Coder Social home page Coder Social logo

tingxins / sakurakit Goto Github PK

View Code? Open in Web Editor NEW
689.0 20.0 116.0 12.15 MB

🤡SakuraKit, a lightweight and powerful library for application to switching themes or skins.

Home Page: https://tingxins.com/2017/08/ios-theme-skin-resolution/

License: MIT License

Ruby 0.72% Objective-C 99.28%
theme sakura objective-c swift skin color image icon font

sakurakit's Issues

能否增加一个切换主题的block 回调

能否增加一个切换主题的block 回调,像这样的:
_secondView.sakura.backgroundColor(Kbg_card)
.addCustomConfig(@"", ^(id item) { // 改变主题的切换
NSString *colorStr = [TXSakuraManager getThemeColorString:Kfont_strong];
_secondView.rateColor = HexColor(colorStr);
});

__MACOSX 错处。

解压产生__MACOSX文件夹,当资质文件没首字母小于M时下载后移除文件操作错误。
应修改为:

+ (void)formatSakuraPath:(NSString *)sakuraPath cleanCachePath:(NSString * _Nullable)cachePath {
    if (!sakuraPath || !sakuraPath.length) return;
    if (cachePath) {
        [TXSakuraManager tx_clearSakuraCacheWithPath:cachePath];
    }
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSError *error = nil;
   //修改处 start
    NSMutableArray *folders = [fileManager contentsOfDirectoryAtPath:sakuraPath error:&error].mutableCopy;
    if ([folders containsObject:@"__MACOSX"]) {
        [folders removeObject:@"__MACOSX"];
    }
    //end
    NSString *folderName = sakuraPath.lastPathComponent;
    NSString *tempName = [folders.lastObject stringByAppendingString:folderName];
    NSString *moveItemPath = [sakuraPath stringByAppendingPathComponent:folders.lastObject];
    NSString *tempItemPath = [[sakuraPath stringByDeletingLastPathComponent] stringByAppendingPathComponent:tempName];
    [fileManager moveItemAtPath:moveItemPath toPath:tempItemPath error:&error];
    [fileManager removeItemAtPath:sakuraPath error:&error];
    [fileManager moveItemAtPath:tempItemPath toPath:sakuraPath error:&error];
#ifdef DEBUG
    NSLog(@"folders:%@", folders);
    NSLog(@"sakuraPath:%@--%@",sakuraPath, error);
#endif
}

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.