Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuki Nishiyama committed Nov 20, 2018
1 parent 3963d1f commit d562181
Show file tree
Hide file tree
Showing 10 changed files with 299 additions and 34 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/
Example/Podfile.lock
Example/Pods/
Example/com.awareframework.ios.sensor.barometer.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.barometer
import com_awareframework_ios_sensor_barometer

class Tests: XCTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
10AB74A1213BEE5344477911 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
10AB74A1213BEE5344477911 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
29B9CA1E73AFE8484109BF32 /* Pods-com.awareframework.ios.sensor.barometer_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-com.awareframework.ios.sensor.barometer_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-com.awareframework.ios.sensor.barometer_Tests/Pods-com.awareframework.ios.sensor.barometer_Tests.debug.xcconfig"; sourceTree = "<group>"; };
2BE994CD2CBD0D76AD48E42E /* com.awareframework.ios.sensor.barometer.podspec */ = {isa = PBXFileReference; includeInIndex = 1; name = com.awareframework.ios.sensor.barometer.podspec; path = ../com.awareframework.ios.sensor.barometer.podspec; sourceTree = "<group>"; };
2BE994CD2CBD0D76AD48E42E /* com.awareframework.ios.sensor.barometer.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = com.awareframework.ios.sensor.barometer.podspec; path = ../com.awareframework.ios.sensor.barometer.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
39AF8FB81557506307C26D5D /* Pods-com.awareframework.ios.sensor.barometer_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-com.awareframework.ios.sensor.barometer_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-com.awareframework.ios.sensor.barometer_Example/Pods-com.awareframework.ios.sensor.barometer_Example.debug.xcconfig"; sourceTree = "<group>"; };
607FACD01AFB9204008FA782 /* com.awareframework.ios.sensor.barometer_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = com.awareframework.ios.sensor.barometer_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand All @@ -45,7 +45,7 @@
6ECE96EFAE60FAAC4A3BA207 /* Pods-com.awareframework.ios.sensor.barometer_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-com.awareframework.ios.sensor.barometer_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-com.awareframework.ios.sensor.barometer_Tests/Pods-com.awareframework.ios.sensor.barometer_Tests.release.xcconfig"; sourceTree = "<group>"; };
8CAE2DF306B474EC9671B005 /* Pods-com.awareframework.ios.sensor.barometer_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-com.awareframework.ios.sensor.barometer_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-com.awareframework.ios.sensor.barometer_Example/Pods-com.awareframework.ios.sensor.barometer_Example.release.xcconfig"; sourceTree = "<group>"; };
A6CBF099021A8798EF97EC93 /* Pods_com_awareframework_ios_sensor_barometer_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_com_awareframework_ios_sensor_barometer_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
C671B77C1C1433EA8BEDE5DC /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; name = README.md; path = ../README.md; sourceTree = "<group>"; };
C671B77C1C1433EA8BEDE5DC /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
DB54A3F7CA8CC4082657D0C1 /* Pods_com_awareframework_ios_sensor_barometer_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_com_awareframework_ios_sensor_barometer_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* 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 @@ -292,13 +293,25 @@
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-com.awareframework.ios.sensor.barometer_Example/Pods-com.awareframework.ios.sensor.barometer_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.barometer/com_awareframework_ios_sensor_barometer.framework",
"${BUILT_PRODUCTS_DIR}/com.awareframework.ios.sensor.core/com_awareframework_ios_sensor_core.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_barometer.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/com_awareframework_ios_sensor_core.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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 = 39AF8FB81557506307C26D5D /* Pods-com.awareframework.ios.sensor.barometer_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = FH352PYMNC;
INFOPLIST_FILE = com.awareframework.ios.sensor.barometer/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 = 8CAE2DF306B474EC9671B005 /* Pods-com.awareframework.ios.sensor.barometer_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = FH352PYMNC;
INFOPLIST_FILE = com.awareframework.ios.sensor.barometer/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_barometer

class ViewController: UIViewController {

var sensor:BarometerSensor?

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

class Observer:BarometerObserver {
func onDataChanged(data: BarometerData) {
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 <tetujin@ht.sfc.keio.ac.jp>
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.
40 changes: 35 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# com.awareframework.ios.sensor.barometer
# Aware Barometer

[![CI Status](https://img.shields.io/travis/tetujin/com.awareframework.ios.sensor.barometer.svg?style=flat)](https://travis-ci.org/tetujin/com.awareframework.ios.sensor.barometer)
[![Version](https://img.shields.io/cocoapods/v/com.awareframework.ios.sensor.barometer.svg?style=flat)](https://cocoapods.org/pods/com.awareframework.ios.sensor.barometer)
Expand All @@ -10,20 +10,50 @@
To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements
iOS 10 or later

## Installation

com.awareframework.ios.sensor.barometer is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
com.awareframework.ios.sensor.barometer 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.barometer'
```

2. Import com.awareframework.ios.sensor.barometer library into your source code.
```swift
import com_awareframework_ios_sensor_barometer
```

## Example usage
```swift
var barometerSensor = BarometerSensor.init(BarometerSensor.Config().apply{config in
config.sensorObserver = Observer()
config.debug = true
config.dbType = .REALM
})
barometerSensor?.start()
barometerSensor?.stop()
```

```swift
class Observer:BarometerObserver{
func onDataChanged(data: BarometerData) {
// Your code here..
}
}
```

## Author

tetujin, tetujin@ht.sfc.keio.ac.jp
Yuuki Nishiyama, tetujin@ht.sfc.keio.ac.jp

## License

com.awareframework.ios.sensor.barometer 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.barometer.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.barometer'
s.homepage = 'https://github.com/awareframework/com.awareframework.ios.sensor.barometer'
# 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' => 'tetujin@ht.sfc.keio.ac.jp' }
s.source = { :git => 'https://github.com/tetujin/com.awareframework.ios.sensor.barometer.git', :tag => s.version.to_s }
s.source = { :git => 'https://github.com/awareframework/com.awareframework.ios.sensor.barometer.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.barometer/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 d562181

Please sign in to comment.