diff --git a/BeaconDetection.xcodeproj/project.pbxproj b/BeaconDetection.xcodeproj/project.pbxproj index 3fe8abf..e32ab35 100644 --- a/BeaconDetection.xcodeproj/project.pbxproj +++ b/BeaconDetection.xcodeproj/project.pbxproj @@ -30,6 +30,8 @@ 2C87A178205DF94900379FD4 /* DescriptionViewModelSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C87A177205DF94900379FD4 /* DescriptionViewModelSpec.swift */; }; 2C87A17A205DF97700379FD4 /* SettingViewModelSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C87A179205DF97700379FD4 /* SettingViewModelSpec.swift */; }; 2C87A17C205DF9EF00379FD4 /* DetectionViewModelSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C87A17B205DF9EF00379FD4 /* DetectionViewModelSpec.swift */; }; + 2C87A17E205E21BC00379FD4 /* AMPopTip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C87A17D205E21BC00379FD4 /* AMPopTip.framework */; }; + 2C87A184205E90CC00379FD4 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2C87A186205E90CC00379FD4 /* Localizable.strings */; }; 2CA179BF1F7F0D960086BADF /* SimulatorViewModelSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CA179BE1F7F0D960086BADF /* SimulatorViewModelSpec.swift */; }; 2CB89EE91BEE567C002A4EC7 /* Const.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CB89EE81BEE567C002A4EC7 /* Const.swift */; }; 2CCCF0881F6FFEE000B5B560 /* TabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCCF0871F6FFEE000B5B560 /* TabBarController.swift */; }; @@ -87,6 +89,9 @@ 2C87A177205DF94900379FD4 /* DescriptionViewModelSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DescriptionViewModelSpec.swift; sourceTree = ""; }; 2C87A179205DF97700379FD4 /* SettingViewModelSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingViewModelSpec.swift; sourceTree = ""; }; 2C87A17B205DF9EF00379FD4 /* DetectionViewModelSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetectionViewModelSpec.swift; sourceTree = ""; }; + 2C87A17D205E21BC00379FD4 /* AMPopTip.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AMPopTip.framework; path = Carthage/Build/iOS/AMPopTip.framework; sourceTree = ""; }; + 2C87A185205E90CC00379FD4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + 2C87A187205E90E300379FD4 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; 2CA179BE1F7F0D960086BADF /* SimulatorViewModelSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimulatorViewModelSpec.swift; sourceTree = ""; }; 2CB89EE51BEE4F7C002A4EC7 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 2CB89EE81BEE567C002A4EC7 /* Const.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Const.swift; sourceTree = ""; }; @@ -114,6 +119,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 2C87A17E205E21BC00379FD4 /* AMPopTip.framework in Frameworks */, 2C3F00851F2C58C40086076D /* SnapKit.framework in Frameworks */, 2C4D4AA91F486F690050CB14 /* MMMarkdown.framework in Frameworks */, 2CDDF20D1F35474100101FD7 /* RxDataSources.framework in Frameworks */, @@ -146,6 +152,7 @@ 08E2F86F4D9CD7C0F52361CF /* Frameworks */ = { isa = PBXGroup; children = ( + 2C87A17D205E21BC00379FD4 /* AMPopTip.framework */, 2C7B486B1F52F7F9008616CD /* Nimble.framework */, 2C7B486D1F52F7F9008616CD /* Quick.framework */, 2C4D4AA81F486F690050CB14 /* MMMarkdown.framework */, @@ -241,6 +248,7 @@ 6E7CADCA1BEC95D70046E77B /* LaunchScreen.storyboard */, 6E7CADCD1BEC95D70046E77B /* Info.plist */, 2C21D5A21F75C9C3000E481C /* Settings.bundle */, + 2C87A186205E90CC00379FD4 /* Localizable.strings */, ); path = BeaconDetection; sourceTree = ""; @@ -361,6 +369,7 @@ knownRegions = ( en, Base, + ja, ); mainGroup = 6E7CADB51BEC95D70046E77B; productRefGroup = 6E7CADBF1BEC95D70046E77B /* Products */; @@ -382,6 +391,7 @@ 2CE891551F4B04D80046EC73 /* LICENSE.md in Resources */, 2C4D4AA71F486D620050CB14 /* README.md in Resources */, 2C21D5A31F75C9C3000E481C /* Settings.bundle in Resources */, + 2C87A184205E90CC00379FD4 /* Localizable.strings in Resources */, 6E7CADCC1BEC95D70046E77B /* LaunchScreen.storyboard in Resources */, 6E7CADC91BEC95D70046E77B /* Assets.xcassets in Resources */, 2C87A176205D3FDE00379FD4 /* Default-568h@2x.png in Resources */, @@ -446,6 +456,7 @@ "$(SRCROOT)/Carthage/Build/iOS/RxSwift.framework", "$(SRCROOT)/Carthage/Build/iOS/RxDataSources.framework", "$(SRCROOT)/Carthage/Build/iOS/MMMarkdown.framework", + "$(SRCROOT)/Carthage/Build/iOS/AMPopTip.framework", ); outputPaths = ( ); @@ -515,6 +526,15 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + 2C87A186205E90CC00379FD4 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 2C87A185205E90CC00379FD4 /* en */, + 2C87A187205E90E300379FD4 /* ja */, + ); + name = Localizable.strings; + sourceTree = ""; + }; 6E7CADCA1BEC95D70046E77B /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -572,7 +592,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3.5; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -620,7 +640,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3.5; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -641,6 +661,7 @@ "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = BeaconDetection/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mitsuaki1229.BeaconDetection; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -664,6 +685,7 @@ "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = BeaconDetection/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mitsuaki1229.BeaconDetection; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/BeaconDetection/Detection/DetectionView.swift b/BeaconDetection/Detection/DetectionView.swift index 3f10db8..198f447 100644 --- a/BeaconDetection/Detection/DetectionView.swift +++ b/BeaconDetection/Detection/DetectionView.swift @@ -11,13 +11,13 @@ import UIKit class DetectionView: UIView, CustomView { - let detectionInfoTableView = UITableView() - - let statusLabel = UILabel() let proximityUUIDInputTextField = UITextField() let majorInputTextField = UITextField() let minorInputTextField = UITextField() + let statusLabel = UILabel() + let detectionInfoTableView = UITableView() + private var tabBarHeight: CGFloat { return UITabBarController().tabBar.frame.size.height } @@ -38,23 +38,22 @@ class DetectionView: UIView, CustomView { func addSubviews() { - addSubview(statusLabel) addSubview(proximityUUIDInputTextField) addSubview(majorInputTextField) addSubview(minorInputTextField) + addSubview(statusLabel) addSubview(detectionInfoTableView) } func addOptionalParameters() { proximityUUIDInputTextField.placeholder = "proximityUUID" - majorInputTextField.placeholder = "major" - minorInputTextField.placeholder = "minor" - setInputTextFieldOption(textField: proximityUUIDInputTextField) proximityUUIDInputTextField.keyboardType = .asciiCapable + majorInputTextField.placeholder = "major" setInputTextFieldOption(textField: majorInputTextField) majorInputTextField.keyboardType = .numberPad + minorInputTextField.placeholder = "minor" setInputTextFieldOption(textField: minorInputTextField) minorInputTextField.keyboardType = .numberPad @@ -64,26 +63,26 @@ class DetectionView: UIView, CustomView { func installConstraints() { - statusLabel.snp.makeConstraints { make in + proximityUUIDInputTextField.snp.makeConstraints { make in make.top.equalToSuperview().offset(30) make.left.equalToSuperview().offset(20) make.right.equalTo(majorInputTextField.snp.left).offset(-20) make.height.equalTo(30) } - proximityUUIDInputTextField.snp.makeConstraints { make in - make.top.equalTo(statusLabel.snp.bottom).offset(10) - make.left.right.equalTo(statusLabel) + statusLabel.snp.makeConstraints { make in + make.top.equalTo(proximityUUIDInputTextField.snp.bottom).offset(10) + make.left.right.equalTo(proximityUUIDInputTextField) } majorInputTextField.snp.makeConstraints { make in - make.top.equalTo(statusLabel) + make.top.equalTo(proximityUUIDInputTextField) make.right.equalToSuperview().offset(-10) make.width.equalToSuperview().multipliedBy(0.2) } minorInputTextField.snp.makeConstraints { make in - make.top.equalTo(proximityUUIDInputTextField) + make.top.equalTo(statusLabel) make.left.right.equalTo(majorInputTextField) } diff --git a/BeaconDetection/Detection/DetectionViewController.swift b/BeaconDetection/Detection/DetectionViewController.swift index 3a7c3e1..c841f2e 100644 --- a/BeaconDetection/Detection/DetectionViewController.swift +++ b/BeaconDetection/Detection/DetectionViewController.swift @@ -6,6 +6,7 @@ // Copyright © 2017年 Mitsuaki Ihara. All rights reserved. // +import AMPopTip import RxCocoa import RxSwift import UIKit @@ -29,6 +30,18 @@ class DetectionViewController: UIViewController { viewModel.updateProximityUUIDToDefault() } + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + setUpPopTip() + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + + removePopTips(view: view) + } + override var canBecomeFirstResponder: Bool { return true } @@ -133,6 +146,61 @@ class DetectionViewController: UIViewController { view.majorInputTextField.inputAccessoryView = numberPadToolbar view.minorInputTextField.inputAccessoryView = numberPadToolbar } + + private func setUpPopTip() { + let checkedTips = UserDefaults().integer(forKey: Const.kCheckedTipsUserDefaultKey) + popTipChain(nextTips: (checkedTips + 1)) + } + + private func popTipChain(pt: PopTip = PopTip(), nextTips: Int, completion: (() -> Void)? = nil) { + + guard nextTips >= 1, + nextTips < 8 else { return } + + let view = self.view as! DetectionView + popTipDisplayPosition(tips: nextTips) { (direction, frame) in + pt.show(text: ("CheckedTips" + nextTips.description).localized, direction: direction, maxWidth: 200, in: view, from: frame) + } + + let ptNext = PopTip() + pt.dismissHandler = { [unowned self] _ in + UserDefaults().set(nextTips, forKey: Const.kCheckedTipsUserDefaultKey) + self.popTipChain(pt: ptNext, nextTips: (nextTips + 1), completion: { + if let completion = completion { + completion() + } + }) + } + } + + private func popTipDisplayPosition(tips: Int, position: (_ direction: PopTipDirection, _ frame: CGRect) -> Void) { + let view = self.view as! DetectionView + switch tips { + case 1: + position(.down, view.proximityUUIDInputTextField.frame) + case 2: + position(.down, view.proximityUUIDInputTextField.frame) + case 3: + position(.left, view.majorInputTextField.frame) + case 4: + position(.down, view.statusLabel.frame) + case 5: + position(.down, view.statusLabel.frame) + case 6: + position(.none, view.detectionInfoTableView.frame) + case 7: + position(.none, view.frame) + default: + assert(false, "Implementation error") + } + } + + private func removePopTips(view: UIView) { + for subview in view.subviews { + guard let subview = subview as? PopTip else { continue } + subview.removeFromSuperview() + } + } } extension DetectionViewController: UITableViewDelegate { diff --git a/BeaconDetection/Setting/SettingViewController.swift b/BeaconDetection/Setting/SettingViewController.swift index 2d2dc4b..7ef6568 100644 --- a/BeaconDetection/Setting/SettingViewController.swift +++ b/BeaconDetection/Setting/SettingViewController.swift @@ -23,7 +23,7 @@ class SettingViewController: UIViewController { super.viewDidLoad() navigationController?.navigationBar.isTranslucent = false - navigationItem.title = "Description" + navigationItem.title = "Setting" let view = self.view as! SettingView view.listTableView.rx.setDelegate(self) @@ -34,6 +34,15 @@ class SettingViewController: UIViewController { return (ip, self?.viewModel.dataSource[ip]) } .subscribe(onNext: { [weak self] ip, _ in + + if ip.row == 3 { + self?.viewModel.clearCheckedTips() + let alert = UIAlertController(title: "Info", message: "Clear Checked Tips.", preferredStyle: .alert) + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) + self?.rootViewController().present(alert, animated: false, completion: nil) + return + } + guard let type = DescriptionFileType(rawValue: ip.row), type != .none else { return } let descriptionViewController = DescriptionViewController(type: type) diff --git a/BeaconDetection/Setting/SettingViewModel.swift b/BeaconDetection/Setting/SettingViewModel.swift index c9a7f53..d9a2017 100644 --- a/BeaconDetection/Setting/SettingViewModel.swift +++ b/BeaconDetection/Setting/SettingViewModel.swift @@ -39,7 +39,8 @@ class SettingViewModel: NSObject { SectionSettingListData(header: "", items: [ SettinglistData(title: "README"), SettinglistData(title: "LICENSE"), - SettinglistData(title: "Version:" + version) + SettinglistData(title: "Version:" + version), + SettinglistData(title: "Clear Checked Tips") ]) ] } @@ -52,12 +53,13 @@ class SettingViewModel: NSObject { ?? UITableViewCell(style: .default, reuseIdentifier: "Cell") cell.textLabel?.text = item.title - if DescriptionFileType(rawValue: ip.row) == DescriptionFileType.none { - cell.selectionStyle = .none - cell.accessoryType = .none - } else { + if DescriptionFileType(rawValue: ip.row) == .readme || + DescriptionFileType(rawValue: ip.row) == .license { cell.selectionStyle = .default cell.accessoryType = .disclosureIndicator + } else { + cell.selectionStyle = .none + cell.accessoryType = .none } return cell @@ -67,4 +69,8 @@ class SettingViewModel: NSObject { ds.sectionModels[index].header } } + + func clearCheckedTips() { + UserDefaults().set(0, forKey: Const.kCheckedTipsUserDefaultKey) + } } diff --git a/BeaconDetection/Settings.bundle/com.mono0926.LicensePlist.latest_result.txt b/BeaconDetection/Settings.bundle/com.mono0926.LicensePlist.latest_result.txt index bb5b094..3bfb7c9 100644 --- a/BeaconDetection/Settings.bundle/com.mono0926.LicensePlist.latest_result.txt +++ b/BeaconDetection/Settings.bundle/com.mono0926.LicensePlist.latest_result.txt @@ -1,3 +1,5 @@ +name: AMPopTip, nameSpecified: , owner: andreamazz, version: 3.2.1 + name: MMMarkdown, nameSpecified: , owner: mdiep, version: 0.5.5 name: Nimble, nameSpecified: , owner: Quick, version: v7.0.3 diff --git a/BeaconDetection/Settings.bundle/com.mono0926.LicensePlist.plist b/BeaconDetection/Settings.bundle/com.mono0926.LicensePlist.plist index ace54d8..2710ed6 100644 --- a/BeaconDetection/Settings.bundle/com.mono0926.LicensePlist.plist +++ b/BeaconDetection/Settings.bundle/com.mono0926.LicensePlist.plist @@ -4,6 +4,14 @@ PreferenceSpecifiers + + File + com.mono0926.LicensePlist/AMPopTip + Title + AMPopTip + Type + PSChildPaneSpecifier + File com.mono0926.LicensePlist/MMMarkdown diff --git a/BeaconDetection/Settings.bundle/com.mono0926.LicensePlist/AMPopTip.plist b/BeaconDetection/Settings.bundle/com.mono0926.LicensePlist/AMPopTip.plist new file mode 100644 index 0000000..9620d6e --- /dev/null +++ b/BeaconDetection/Settings.bundle/com.mono0926.LicensePlist/AMPopTip.plist @@ -0,0 +1,36 @@ + + + + + PreferenceSpecifiers + + + FooterText + The MIT License (MIT) + +Copyright (c) 2016 Andrea Mazzini + +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: + +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. + + Type + PSGroupSpecifier + + + + diff --git a/BeaconDetection/Simulator/SimulatorViewController.swift b/BeaconDetection/Simulator/SimulatorViewController.swift index 002f8af..4ca48db 100644 --- a/BeaconDetection/Simulator/SimulatorViewController.swift +++ b/BeaconDetection/Simulator/SimulatorViewController.swift @@ -6,6 +6,7 @@ // Copyright © 2017年 Mitsuaki Ihara. All rights reserved. // +import AMPopTip import RxCocoa import RxSwift import UIKit @@ -71,12 +72,15 @@ class SimulatorViewController: UIViewController { let view = self.view as! SimulatorView view.backgroundScrollView.setContentOffset(contentCenter(view), animated: false) + + setUpPopTip() } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) switchAnimation(animatie: false) + removePopTips(view: view) } // MARK: Tools @@ -112,6 +116,37 @@ class SimulatorViewController: UIViewController { }).disposed(by: disposeBag) } + private func setUpPopTip() { + let checkedTips = UserDefaults().integer(forKey: Const.kCheckedTipsUserDefaultKey) + popTipChain(nextTips: (checkedTips + 1)) + } + + private func popTipChain(pt: PopTip = PopTip(), nextTips: Int, completion: (() -> Void)? = nil) { + + guard nextTips >= 8, + nextTips < 10 else { return } + + let view = self.view as! SimulatorView + pt.show(text: ("CheckedTips" + nextTips.description).localized, direction: .none, maxWidth: 200, in: view, from: view.frame) + + let ptNext = PopTip() + pt.dismissHandler = { [unowned self] _ in + UserDefaults().set(nextTips, forKey: Const.kCheckedTipsUserDefaultKey) + self.popTipChain(pt: ptNext, nextTips: (nextTips + 1), completion: { + if let completion = completion { + completion() + } + }) + } + } + + private func removePopTips(view: UIView) { + for subview in view.subviews { + guard let subview = subview as? PopTip else { continue } + subview.removeFromSuperview() + } + } + private func switchAnimation(animatie: Bool) { let view = self.view as! SimulatorView diff --git a/BeaconDetection/common/Const.swift b/BeaconDetection/common/Const.swift index 83e130d..8032549 100644 --- a/BeaconDetection/common/Const.swift +++ b/BeaconDetection/common/Const.swift @@ -11,4 +11,5 @@ struct Const { static let kDefaultProximityUUIDString = "E621E1F8-C36C-495A-93FC-0C247A3E6E5F" static let kDefaultRegionIdentifier = "BeaconDetection" static let kDetectionInfosMaxNum = 100 + static let kCheckedTipsUserDefaultKey = "CheckedTips" } diff --git a/BeaconDetection/common/Extensions.swift b/BeaconDetection/common/Extensions.swift index 1c0b8c6..5264dd8 100644 --- a/BeaconDetection/common/Extensions.swift +++ b/BeaconDetection/common/Extensions.swift @@ -17,6 +17,13 @@ extension UIViewController { } } +extension String { + + var localized: String { + return NSLocalizedString(self, comment: "") + } +} + extension Reactive where Base: UIBarButtonItem { var image: UIBindingObserver { diff --git a/BeaconDetection/en.lproj/Localizable.strings b/BeaconDetection/en.lproj/Localizable.strings new file mode 100644 index 0000000..265d0e9 --- /dev/null +++ b/BeaconDetection/en.lproj/Localizable.strings @@ -0,0 +1,17 @@ +/* + Localizable.strings + BeaconDetection + + Created by Mitsuaki Ihara on 2018/03/18. + Copyright © 2018年 Mitsuaki Ihara. All rights reserved. +*/ + +"CheckedTips1" = "検知対象のUUIDを入力して下さい。"; +"CheckedTips2" = "Beaconシミュレーターで利用されるUUIDも同一のものが利用されます"; +"CheckedTips3" = "また、major・minorを入力した場合検知対象の絞込が行われます。"; +"CheckedTips4" = "検知中の状態です"; +"CheckedTips5" = "Beacon検知の利用可否や距離感を表示します"; +"CheckedTips6" = "検知したBeaconの一覧です"; +"CheckedTips7" = "ナビゲーションバーのボタンは検知の一時停止/再開を実施します"; +"CheckedTips8" = "動作しているビーコンのシミュレーターです"; +"CheckedTips9" = "ナビゲーションバーのボタンはシミュレーションしているBeaconをmajorとminorをランダムで再生成します"; diff --git a/BeaconDetection/ja.lproj/Localizable.strings b/BeaconDetection/ja.lproj/Localizable.strings new file mode 100644 index 0000000..265d0e9 --- /dev/null +++ b/BeaconDetection/ja.lproj/Localizable.strings @@ -0,0 +1,17 @@ +/* + Localizable.strings + BeaconDetection + + Created by Mitsuaki Ihara on 2018/03/18. + Copyright © 2018年 Mitsuaki Ihara. All rights reserved. +*/ + +"CheckedTips1" = "検知対象のUUIDを入力して下さい。"; +"CheckedTips2" = "Beaconシミュレーターで利用されるUUIDも同一のものが利用されます"; +"CheckedTips3" = "また、major・minorを入力した場合検知対象の絞込が行われます。"; +"CheckedTips4" = "検知中の状態です"; +"CheckedTips5" = "Beacon検知の利用可否や距離感を表示します"; +"CheckedTips6" = "検知したBeaconの一覧です"; +"CheckedTips7" = "ナビゲーションバーのボタンは検知の一時停止/再開を実施します"; +"CheckedTips8" = "動作しているビーコンのシミュレーターです"; +"CheckedTips9" = "ナビゲーションバーのボタンはシミュレーションしているBeaconをmajorとminorをランダムで再生成します"; diff --git a/BeaconDetectionTests/SettingViewModelSpec.swift b/BeaconDetectionTests/SettingViewModelSpec.swift index 0ab4a4a..e1c26e4 100644 --- a/BeaconDetectionTests/SettingViewModelSpec.swift +++ b/BeaconDetectionTests/SettingViewModelSpec.swift @@ -21,5 +21,18 @@ class SettingViewModelSpec: QuickSpec { }) }) } + describe("clearCheckedTips") { + context("使い方ヒントの読込状態を初期化する", { + + UserDefaults().set(2, forKey: Const.kCheckedTipsUserDefaultKey) + + let viewModel = SettingViewModel() + viewModel.clearCheckedTips() + + it("読込状態が初期化されていること", closure: { + expect(UserDefaults().integer(forKey: Const.kCheckedTipsUserDefaultKey)) == 0 + }) + }) + } } } diff --git a/Cartfile b/Cartfile index 42e9089..0c55a1c 100644 --- a/Cartfile +++ b/Cartfile @@ -2,3 +2,4 @@ github "SnapKit/SnapKit" ~> 4.0.0 github "ReactiveX/RxSwift" ~> 3.0 github "RxSwiftCommunity/RxDataSources" ~> 1.0 github "mdiep/MMMarkdown" +github "andreamazz/AMPopTip" diff --git a/Cartfile.resolved b/Cartfile.resolved index c9e59f2..172da4d 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -3,4 +3,5 @@ github "Quick/Quick" "v1.2.0" github "ReactiveX/RxSwift" "3.6.1" github "RxSwiftCommunity/RxDataSources" "1.0.4" github "SnapKit/SnapKit" "4.0.0" +github "andreamazz/AMPopTip" "3.2.1" github "mdiep/MMMarkdown" "0.5.5"