Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tetujin committed Nov 20, 2018
1 parent 012b3c5 commit 922260c
Show file tree
Hide file tree
Showing 10 changed files with 283 additions and 39 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ Carthage/Build
# Note: if you ignore the Pods directory, make sure to uncomment
# `pod install` in .travis.yml
#
# Pods/
Pods/
Podfile.lock
Pods/
com.awareframework.ios.sensor.magnetometer.xcworkspace/
2 changes: 1 addition & 1 deletion Example/Tests/Tests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import XCTest
import com.awareframework.ios.sensor.magnetometer
import com_awareframework_ios_sensor_magnetometer

class Tests: XCTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
7BCE819A2BB2741BBEF600BF /* Pods-com.awareframework.ios.sensor.magnetometer_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-com.awareframework.ios.sensor.magnetometer_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-com.awareframework.ios.sensor.magnetometer_Example/Pods-com.awareframework.ios.sensor.magnetometer_Example.release.xcconfig"; sourceTree = "<group>"; };
8133371A7168CAA5F8EEB9B1 /* Pods_com_awareframework_ios_sensor_magnetometer_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_com_awareframework_ios_sensor_magnetometer_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
BDC90A7A9793C44838ED7DA2 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
BDC90A7A9793C44838ED7DA2 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
DB709AD932E4A928BCB2DF6E /* Pods_com_awareframework_ios_sensor_magnetometer_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_com_awareframework_ios_sensor_magnetometer_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E18E8290A0994804BC467432 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; name = README.md; path = ../README.md; sourceTree = "<group>"; };
F3FD70760ABD87C95B1DD33C /* com.awareframework.ios.sensor.magnetometer.podspec */ = {isa = PBXFileReference; includeInIndex = 1; name = com.awareframework.ios.sensor.magnetometer.podspec; path = ../com.awareframework.ios.sensor.magnetometer.podspec; sourceTree = "<group>"; };
E18E8290A0994804BC467432 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
F3FD70760ABD87C95B1DD33C /* com.awareframework.ios.sensor.magnetometer.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = com.awareframework.ios.sensor.magnetometer.podspec; path = ../com.awareframework.ios.sensor.magnetometer.podspec; sourceTree = "<group>"; };
FF9714D43A4F9A99E9E8B4BF /* Pods-com.awareframework.ios.sensor.magnetometer_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-com.awareframework.ios.sensor.magnetometer_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-com.awareframework.ios.sensor.magnetometer_Tests/Pods-com.awareframework.ios.sensor.magnetometer_Tests.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -212,6 +212,7 @@
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = FH352PYMNC;
LastSwiftMigration = 0900;
};
607FACE41AFB9204008FA782 = {
Expand Down Expand Up @@ -314,12 +315,24 @@
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-com.awareframework.ios.sensor.magnetometer_Example/Pods-com.awareframework.ios.sensor.magnetometer_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Networking/Networking.framework",
"${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/Realm/Realm.framework",
"${BUILT_PRODUCTS_DIR}/RealmSwift/RealmSwift.framework",
"${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework",
"${BUILT_PRODUCTS_DIR}/com.awareframework.ios.sensor.core/com_awareframework_ios_sensor_core.framework",
"${BUILT_PRODUCTS_DIR}/com.awareframework.ios.sensor.magnetometer/com_awareframework_ios_sensor_magnetometer.framework",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Networking.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/com_awareframework_ios_sensor_core.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/com_awareframework_ios_sensor_magnetometer.framework",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -422,7 +435,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -468,7 +481,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 10;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -481,7 +494,9 @@
baseConfigurationReference = 2C681EC0B5C4CDAB17028DA2 /* Pods-com.awareframework.ios.sensor.magnetometer_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = FH352PYMNC;
INFOPLIST_FILE = com.awareframework.ios.sensor.magnetometer/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
Expand All @@ -496,7 +511,9 @@
baseConfigurationReference = 7BCE819A2BB2741BBEF600BF /* Pods-com.awareframework.ios.sensor.magnetometer_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = FH352PYMNC;
INFOPLIST_FILE = com.awareframework.ios.sensor.magnetometer/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,28 @@
//

import UIKit
import com_awareframework_ios_sensor_magnetometer

class ViewController: UIViewController {

var sensor:MagnetometerSensor?

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
sensor = MagnetometerSensor.init(MagnetometerSensor.Config().apply{config in
config.debug = true
config.sensorObserver = Observer()
})
sensor?.start()
}

class Observer:MagnetometerObserver {
func onChanged(data: MagnetometerData) {
print(data)
}
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
Expand Down
20 changes: 3 additions & 17 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
Copyright (c) 2018 tetujin <[email protected]>
Copyright (c) 2018 AWARE Mobile Context Instrumentation Middleware/Framework (http://www.awareframework.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
47 changes: 37 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# com.awareframework.ios.sensor.magnetometer
# com.aware.ios.sensor.magnetometer

[![CI Status](https://img.shields.io/travis/tetujin/com.awareframework.ios.sensor.magnetometer.svg?style=flat)](https://travis-ci.org/tetujin/com.awareframework.ios.sensor.magnetometer)
[![Version](https://img.shields.io/cocoapods/v/com.awareframework.ios.sensor.magnetometer.svg?style=flat)](https://cocoapods.org/pods/com.awareframework.ios.sensor.magnetometer)
[![License](https://img.shields.io/cocoapods/l/com.awareframework.ios.sensor.magnetometer.svg?style=flat)](https://cocoapods.org/pods/com.awareframework.ios.sensor.magnetometer)
[![Platform](https://img.shields.io/cocoapods/p/com.awareframework.ios.sensor.magnetometer.svg?style=flat)](https://cocoapods.org/pods/com.awareframework.ios.sensor.magnetometer)
[![CI Status](https://img.shields.io/travis/tetujin/com.aware.ios.sensor.magnetometer.svg?style=flat)](https://travis-ci.org/tetujin/com.aware.ios.sensor.magnetometer)
[![Version](https://img.shields.io/cocoapods/v/com.aware.ios.sensor.magnetometer.svg?style=flat)](https://cocoapods.org/pods/com.aware.ios.sensor.magnetometer)
[![License](https://img.shields.io/cocoapods/l/com.aware.ios.sensor.magnetometer.svg?style=flat)](https://cocoapods.org/pods/com.aware.ios.sensor.magnetometer)
[![Platform](https://img.shields.io/cocoapods/p/com.aware.ios.sensor.magnetometer.svg?style=flat)](https://cocoapods.org/pods/com.aware.ios.sensor.magnetometer)

## Example

Expand All @@ -13,17 +13,44 @@ To run the example project, clone the repo, and run `pod install` from the Examp

## Installation

com.awareframework.ios.sensor.magnetometer is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
com.aware.ios.sensor.magnetometer is available through [CocoaPods](https://cocoapods.org).

1. To install it, simply add the following line to your Podfile:
```ruby
pod 'com.awareframework.ios.sensor.magnetometer'
pod 'com.aware.ios.sensor.magnetometer'
```

2. Import com.aware.ios.sensor.magnetometer library into your source code.
```swift
import com_aware_ios_sensor_magnetometer
```

## Example usage
```swift
var magnetometer = MagnetometerSensor.init( MagnetometerSensor.Config().apply{ config in
config.debug = true
config.sensorObserver = Observer()
})
magnetometer?.start()
```

```swift
class Observer:MagnetometerObserver {
func onChanged(data:MagnetometerData){
// Your code here..
}
}
```

## Author

tetujin, [email protected]
Yuuki Nishiyama, [email protected]

## License

com.awareframework.ios.sensor.magnetometer is available under the MIT license. See the LICENSE file for more info.
Copyright (c) 2018 AWARE Mobile Context Instrumentation Middleware/Framework (http://www.awareframework.com)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

15 changes: 10 additions & 5 deletions com.awareframework.ios.sensor.magnetometer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ Pod::Spec.new do |s|
TODO: Add long description of the pod here.
DESC

s.homepage = 'https://github.com/tetujin/com.awareframework.ios.sensor.magnetometer'
s.homepage = 'https://github.com/awareframework/com.awareframework.ios.sensor.magnetometer'
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.license = { :type => 'Apache2', :file => 'LICENSE' }
s.author = { 'tetujin' => '[email protected]' }
s.source = { :git => 'https://github.com/tetujin/com.awareframework.ios.sensor.magnetometer.git', :tag => s.version.to_s }
s.source = { :git => 'https://github.com/awareframework/com.awareframework.ios.sensor.magnetometer.git', :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

s.ios.deployment_target = '8.0'
s.ios.deployment_target = '10.0'

s.swift_version = '4.0'

s.source_files = 'com.awareframework.ios.sensor.magnetometer/Classes/**/*'

Expand All @@ -37,6 +39,9 @@ TODO: Add long description of the pod here.
# }

# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
s.frameworks = 'CoreMotion' #'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'

s.dependency 'com.awareframework.ios.sensor.core'

end
Loading

0 comments on commit 922260c

Please sign in to comment.