Comments (2)
I did not include ViewController.m
in the project to be compiled. It's just there to give you an example of how to use SevenSwitch
within obj-c code. You'll get the same exact example and result from compiling the project normally with ViewController.swift
.
If you want to use a swift source file within obj-c code you simply need to add an import statement like #import "SevenSwitchExample-Swift.h"
. Where the first part of the import statement is your project/module name (in this case it's SevenSwitchExample
). You can see this at the top of ViewController.m
. This will take care of providing access to the swift code you would like to use. Xcode will automatically create this file for you so just adding the import statement is all you need to do.
If you want to use an obj-c source file within swift code you need to create what's called a bridging header. More information can be found in the documentation from Apple. I would suggest you read through it to get a good sense of how to mix and match obj-c and swift source files.
from sevenswitch.
Thanks 👍
from sevenswitch.
Related Issues (20)
- Create podspec for 1.4.0 HOT 1
- Dows not work with iOS 8 / Xcode 6 HOT 2
- Background color in off state HOT 1
- updating the onLabel text repeatedly? HOT 1
- CocoaPods Issue HOT 3
- Cocoapods, use_frameworks! option, and non-public class HOT 3
- switches don't toggle properly on objc version HOT 4
- Getting "Initializer does not override a designated initializer from its superclass" error HOT 2
- Release version with Swift 1.2 support HOT 1
- Does not work with Swift 2.0 HOT 2
- Thumbview shadow is not correctly set when using autolayout and a different sizes from the default HOT 1
- Podspec for SevenSwitch 2.0 requires iOS 8.0 HOT 2
- Add SevenSwitch to Navigation Bar HOT 2
- Weird behavior in scroll view
- Problem in UScrollView
- images are not resizing HOT 1
- swift 3 HOT 6
- iOS 10 display issue
- onThumbTintColor not updated when thumbTintColor is set to a new value
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sevenswitch.