Code Monkey home page Code Monkey logo

Comments (10)

ryanlinxc avatar ryanlinxc commented on June 3, 2024

你是不是对源码做了修改?做了哪些修改?

from swifttheme.

marychenyuan avatar marychenyuan commented on June 3, 2024

没有,直接下载后编译就失败了

from swifttheme.

ryanlinxc avatar ryanlinxc commented on June 3, 2024

我这边没有问题,你可以试下重新下载编译,如果还有问题最好提供具体的错误日志

from swifttheme.

shannonchou avatar shannonchou commented on June 3, 2024

@marychenyuan 确认你的xcode 版本是否为7.3,老版本的xcode 是更早的swift 语法

from swifttheme.

wxxsw avatar wxxsw commented on June 3, 2024

@marychenyuan

Swift2.2版本之前声明选择器的方法是 Selector("someMethod") 或者 "someMethod",在Swift2.2之后语法改为了 #selector(someMethod)

例如你报错那行的代码是这样的:
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(_updateTheme), name: ThemeUpdateNotification, object: nil)

如果你暂时不想升级Xcode,为了编译通过,你可以暂时将此处修改为旧的写法:
NSNotificationCenter.defaultCenter().addObserver(self, selector: "_updateTheme", name: ThemeUpdateNotification, object: nil)

😄

注:类似的语法在Demo中有三处,同样的方法修改即可

from swifttheme.

marychenyuan avatar marychenyuan commented on June 3, 2024

谢谢你们的耐心指导! 确实是xcode未升级到7.3版本的问题。 升级后就正常运行了!

另外,是否能提供一份使用objective-c来调用这个框架的代码呢? 我现在急需使用换肤功能,觉得这套框架很适合放在我的项目中,但由于不熟悉swift所以有点力不从心。。。。
如果有示例的话我会更容易使用它!

from swifttheme.

shannonchou avatar shannonchou commented on June 3, 2024

把SwiftTheme 源代码拷贝到你的项目中,在.m 文件中引入 import "xxx-Swift.h",这里的xxx 一般是你的target 名称,具体的看你项目的Build Settings 中的“Objective-C Generated Interface Header Name” 配置。

SwiftTheme 的OC 接口一般用法如下:
lbl.theme_backgroundColor = [ThemeColorPicker pickerWithColors:@[@"#FAF9F9", @"#E2E2E2"]];

from swifttheme.

marychenyuan avatar marychenyuan commented on June 3, 2024

好的,非常感谢~

from swifttheme.

wxxsw avatar wxxsw commented on June 3, 2024

@marychenyuan 刚刚增加了Objective-C的Demo

from swifttheme.

marychenyuan avatar marychenyuan commented on June 3, 2024

好!麻烦了~!

from swifttheme.

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.