Permalink
Browse files

best focalplacing, location bug fix

  • Loading branch information...
1 parent 7f5a441 commit 3c5941cd0bce0e53c88401dbda09a285b011db3e @casparwylie committed May 17, 2017
@@ -17,10 +17,11 @@
B0023B7C1EBA1C1800F1EC09 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0023B7B1EBA1C1800F1EC09 /* AppDelegate.swift */; };
B0023B7E1EBA1C1D00F1EC09 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = B0023B7D1EBA1C1D00F1EC09 /* Info.plist */; };
B0023B801EBA1C2200F1EC09 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B0023B7F1EBA1C2200F1EC09 /* Assets.xcassets */; };
+ B03395231ECC80FE00A09786 /* Default-568.png in Resources */ = {isa = PBXBuildFile; fileRef = B03395221ECC80FE00A09786 /* Default-568.png */; };
+ B03395251ECC868400A09786 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B03395241ECC868400A09786 /* Default-568h@2x.png */; };
B03D88E81EBA1DFA007EE08E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B03D88E51EBA1DFA007EE08E /* Main.storyboard */; };
B0476C6B1DA28CFE000FC661 /* Starscream in Frameworks */ = {isa = PBXBuildFile; fileRef = B0476BF81DA28BCD000FC661 /* Starscream */; settings = {ATTRIBUTES = (Required, ); }; };
B053ECD71D9D3ACC009DA4AB /* Network.swift in Sources */ = {isa = PBXBuildFile; fileRef = B053ECD61D9D3ACC009DA4AB /* Network.swift */; };
- B05E050E1EC0C158009D20E5 /* splash.png in Resources */ = {isa = PBXBuildFile; fileRef = B05E050D1EC0C158009D20E5 /* splash.png */; };
B05E05161EC0C3AD009D20E5 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B05E05151EC0C3AD009D20E5 /* Launch Screen.storyboard */; };
B069B17B1E0D4EC400873A2E /* opencv2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B069B17A1E0D4EC400873A2E /* opencv2.framework */; };
B07944E21EBFB1DB00CA6379 /* CryptoSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B07944E11EBFB1DB00CA6379 /* CryptoSwift.framework */; };
@@ -65,10 +66,11 @@
B0023B7B1EBA1C1800F1EC09 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Astral/AppDelegate.swift; sourceTree = SOURCE_ROOT; };
B0023B7D1EBA1C1D00F1EC09 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Astral/Info.plist; sourceTree = SOURCE_ROOT; };
B0023B7F1EBA1C2200F1EC09 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Astral/Assets.xcassets; sourceTree = SOURCE_ROOT; };
+ B03395221ECC80FE00A09786 /* Default-568.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568.png"; path = "logos/Default-568.png"; sourceTree = "<group>"; };
+ B03395241ECC868400A09786 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "logos/Default-568h@2x.png"; sourceTree = "<group>"; };
B03D88E61EBA1DFA007EE08E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Astral/Base.lproj/Main.storyboard; sourceTree = SOURCE_ROOT; };
B0476BF81DA28BCD000FC661 /* Starscream */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Starscream; path = ../../startest/Starscream; sourceTree = "<group>"; };
B053ECD61D9D3ACC009DA4AB /* Network.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Network.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
- B05E050D1EC0C158009D20E5 /* splash.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = splash.png; path = ../../../../Downloads/appicon/ios/screenshots/splash.png; sourceTree = "<group>"; };
B05E05151EC0C3AD009D20E5 /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
B069B17A1E0D4EC400873A2E /* opencv2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = opencv2.framework; sourceTree = "<group>"; };
B07944E11EBFB1DB00CA6379 /* CryptoSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CryptoSwift.framework; path = "Build/Products/Debug-iphoneos/CryptoSwift/CryptoSwift.framework"; sourceTree = "<group>"; };
@@ -145,8 +147,9 @@
B0E355D31D995DBF0088EB10 = {
isa = PBXGroup;
children = (
+ B03395241ECC868400A09786 /* Default-568h@2x.png */,
+ B03395221ECC80FE00A09786 /* Default-568.png */,
B05E05151EC0C3AD009D20E5 /* Launch Screen.storyboard */,
- B05E050D1EC0C158009D20E5 /* splash.png */,
B0023B731EBA0E6D00F1EC09 /* vd_down_icon.png */,
B0023B741EBA0E6E00F1EC09 /* vd_up_icon.png */,
B0023B6F1EB8CBD400F1EC09 /* v_down_icon.png */,
@@ -349,12 +352,13 @@
B0E356221D995E1E0088EB10 /* focalpost in Resources */,
B0023B761EBA0E6E00F1EC09 /* vd_up_icon.png in Resources */,
B0023B721EB8CBD400F1EC09 /* v_up_icon.png in Resources */,
- B05E050E1EC0C158009D20E5 /* splash.png in Resources */,
B0023B711EB8CBD400F1EC09 /* v_down_icon.png in Resources */,
B03D88E81EBA1DFA007EE08E /* Main.storyboard in Resources */,
B05E05161EC0C3AD009D20E5 /* Launch Screen.storyboard in Resources */,
B0023B6E1EAA586C00F1EC09 /* focal_icon.png in Resources */,
+ B03395231ECC80FE00A09786 /* Default-568.png in Resources */,
B0023B751EBA0E6E00F1EC09 /* vd_down_icon.png in Resources */,
+ B03395251ECC868400A09786 /* Default-568h@2x.png in Resources */,
B0023B7E1EBA1C1D00F1EC09 /* Info.plist in Resources */,
B0E356231D995E1E0088EB10 /* focalpost.dae in Resources */,
B0023B801EBA1C2200F1EC09 /* Assets.xcassets in Resources */,
@@ -550,13 +554,15 @@
"$(PROJECT_DIR)/Build/Products/Debug-iphoneos/CryptoSwift",
);
INFOPLIST_FILE = "$(SRCROOT)/Astral/Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = casparwylie.casparwylie;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Strands-Bridging-Header.h";
SWIFT_VERSION = 3.0;
+ TARGETED_DEVICE_FAMILY = 1;
};
name = Distribution;
};
@@ -708,6 +714,7 @@
"$(PROJECT_DIR)/Build/Products/Debug-iphoneos/CryptoSwift",
);
INFOPLIST_FILE = "$(SRCROOT)/Astral/Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = casparwylie.casparwylie;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -716,6 +723,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "Strands-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
+ TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
@@ -735,13 +743,15 @@
"$(PROJECT_DIR)/Build/Products/Debug-iphoneos/CryptoSwift",
);
INFOPLIST_FILE = "$(SRCROOT)/Astral/Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = casparwylie.casparwylie;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Strands-Bridging-Header.h";
SWIFT_VERSION = 3.0;
+ TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
View
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key></key>
+ <string></string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
@@ -17,9 +19,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>1.0.1</string>
+ <string>1.0.2</string>
<key>CFBundleVersion</key>
- <string>1.0.1</string>
+ <string>1.0.3</string>
+ <key>Item</key>
+ <string></string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
@@ -35,8 +39,17 @@
<string>So we know where to locate you in the virtual world.</string>
<key>NSMotionUsageDescription</key>
<string>So that your reality is augmented!</string>
+ <key>UILaunchImages</key>
+ <array>
+ <dict>
+ <key>UILaunchImageName</key>
+ <string>Default-568</string>
+ <key>UILaunchImageSize</key>
+ <string>{320, 568}</string>
+ </dict>
+ </array>
<key>UILaunchStoryboardName</key>
- <string>Launch Screen.storyboard</string>
+ <string>Launch Screen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
@@ -146,6 +146,7 @@ class ViewController: UIViewController, LocationDelegate, UIActionDelegate, mapA
let coordinateRegion: MKCoordinateRegion = self.map.centerToLocationRegion(currentLocation);
self.map.mapView.setRegion(coordinateRegion, animated: false);
+ self.userInterface.locationFocused = true;
let distFromPrevPos = currentLocation.distance(from: self.oldRenderPosition);
if((distFromPrevPos>thresholdDistRerender)||firstRender==true){
self.networkRequest.getRegionData(self.networkWebSocket, currLocation: currentLocation);
@@ -439,6 +440,16 @@ class ViewController: UIViewController, LocationDelegate, UIActionDelegate, mapA
func connWebRetry(){
networkWebSocket.connect();
}
+
+ var checkLocatedTimer: Timer!;
+ func locatingDeviceMessage(){
+ if(self.userInterface.locationFocused == false){
+ self.userInterface.updateInfoLabel("Locating your device, please wait...", show: true, hideAfter: 3);
+ }else{
+ self.checkLocatedTimer.invalidate();
+ self.checkLocatedTimer = nil;
+ }
+ }
//MARK: Main stem
override func viewDidLoad() {
@@ -505,6 +516,7 @@ class ViewController: UIViewController, LocationDelegate, UIActionDelegate, mapA
}
+ checkLocatedTimer = Timer.scheduledTimer(timeInterval: 2, target: self, selector: #selector(self.locatingDeviceMessage), userInfo: nil, repeats: true);
super.viewDidLoad();
}
View
@@ -21,23 +21,16 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
- <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="splash.png" translatesAutoresizingMaskIntoConstraints="NO" id="j1f-IJ-CXz">
+ <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Default-568.png" translatesAutoresizingMaskIntoConstraints="NO" id="d24-uc-Ffb">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
</imageView>
- <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text=" Copyright © 2017 Caspar Wylie. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="eGv-QJ-tCc">
- <rect key="frame" x="16" y="617" width="335" height="21"/>
- <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
- <fontDescription key="fontDescription" type="system" pointSize="17"/>
- <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
- <nil key="highlightedColor"/>
- </label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
- <constraint firstAttribute="trailing" secondItem="j1f-IJ-CXz" secondAttribute="trailing" id="3ux-D2-BhV"/>
- <constraint firstItem="j1f-IJ-CXz" firstAttribute="bottom" secondItem="xb3-aO-Qok" secondAttribute="top" id="53C-9H-vxQ"/>
- <constraint firstItem="j1f-IJ-CXz" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="hgT-eQ-Der"/>
- <constraint firstItem="j1f-IJ-CXz" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="l8Z-Md-Ssm"/>
+ <constraint firstItem="d24-uc-Ffb" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="Wm8-e0-7w6"/>
+ <constraint firstItem="d24-uc-Ffb" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="h1w-qY-oJ5"/>
+ <constraint firstAttribute="trailing" secondItem="d24-uc-Ffb" secondAttribute="trailing" id="l42-mL-RgE"/>
+ <constraint firstItem="d24-uc-Ffb" firstAttribute="bottom" secondItem="xb3-aO-Qok" secondAttribute="top" id="tA3-1I-UsG"/>
</constraints>
</view>
</viewController>
@@ -47,6 +40,6 @@
</scene>
</scenes>
<resources>
- <image name="splash.png" width="1242" height="2208"/>
+ <image name="Default-568.png" width="1242" height="2208"/>
</resources>
</document>
View
@@ -32,23 +32,13 @@ class Location: NSObject, CLLocationManagerDelegate{
//MARK: setup location service and request permission
func initLocation() -> Bool{
-
- //Check location permission
- locManager.requestWhenInUseAuthorization();
- if( CLLocationManager.authorizationStatus() == CLAuthorizationStatus.authorizedAlways ||
- CLLocationManager.authorizationStatus() == CLAuthorizationStatus.authorizedWhenInUse){
-
- //Location header data
locManager.distanceFilter = 3;
locManager.desiredAccuracy = kCLLocationAccuracyBest;
locManager.startUpdatingLocation();
//todo : check headingAvaliable
locManager.startUpdatingHeading();
locManager.delegate = self;
return true;
- }else{
- return false;
- }
}
@@ -113,6 +103,28 @@ class Location: NSObject, CLLocationManagerDelegate{
}
+ func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
+ switch status {
+ case .authorizedWhenInUse:
+ locManager.startUpdatingLocation();
+ break;
+ case .notDetermined:
+ locManager.requestWhenInUseAuthorization();
+ break;
+ case .authorizedAlways:
+ locManager.startUpdatingLocation();
+ break;
+ case .restricted:
+ self.ui.updateInfoLabel("You will need to allow location services.", show: true, hideAfter: 10);
+ break;
+ case .denied:
+ self.ui.updateInfoLabel("You will need to allow location services.", show: true, hideAfter: 10);
+ break;
+ default:
+ break;
+ }
+ }
+
//MARK: Automatic delegation call on heading update, update heading data.
@objc func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading){
currentHeading = newHeading;
@@ -123,9 +135,8 @@ class Location: NSObject, CLLocationManagerDelegate{
@objc func locationManager(_ manager: CLLocationManager,didUpdateLocations locations: [CLLocation]) {
if(currentHeading != nil){
-
- currentLocation = locations.last;
- delegateLoc?.regionDataUpdate(currentLocation!, currentHeading: currentHeading!);
+ self.currentLocation = locations.last;
+ self.delegateLoc?.regionDataUpdate(self.currentLocation!, currentHeading: self.currentHeading!);
}
}
View
@@ -92,6 +92,7 @@ class NetworkSocketHandler{
self.networkResponseDelegate?.votedCommentResponse!(responseString);
case "keyData":
self.networkResponseDelegate?.keyDataResponse!(responseString);
+
case "userKnowsFocals":
self.networkResponseDelegate?.userKnowsFocalsResponse!(responseString);
default:
View
@@ -204,7 +204,7 @@ class Scene{
//hide non-street visible focals
for hideID in toHideAsArr{
if (hideID == String(i)){
- //focals[i].isHidden = true;
+ focals[i].isHidden = true;
break;
}else{
focals[i].isHidden = false;
Oops, something went wrong.

0 comments on commit 3c5941c

Please sign in to comment.