Skip to content

Commit

Permalink
tvOS target for example app and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
rhummelmose committed May 17, 2016
1 parent 1fa4c39 commit 4bcedcc
Show file tree
Hide file tree
Showing 9 changed files with 312 additions and 20 deletions.
5 changes: 2 additions & 3 deletions BluetoothKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'BluetoothKit'
s.version = '0.2.1'
s.version = '0.3.0'
s.license = { :type => 'MIT' }
s.homepage = 'https://github.com/rasmusth/BluetoothKit'
s.authors = { 'Rasmus Taulborg Hummelmose' => '[email protected]' }
Expand All @@ -15,6 +15,5 @@ Pod::Spec.new do |s|
'Source/BKPeripheral.swift',
'Source/BKPeripheralConfiguration.swift',
'Source/BKPeripheralStateMachine.swift',
'Source/BKRemoteCentral.swift',
'Source/BKSendDataTask.swift'
'Source/BKRemoteCentral.swift'
end
2 changes: 2 additions & 0 deletions BluetoothKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
C687E3B91B8B4A2800B702D8 /* BKConnectionPool.swift in Sources */ = {isa = PBXBuildFile; fileRef = C687E3AD1B8B4A2800B702D8 /* BKConnectionPool.swift */; };
C687E3BA1B8B4A2800B702D8 /* BKScanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = C687E3AE1B8B4A2800B702D8 /* BKScanner.swift */; };
C687E3C41B8B4CF100B702D8 /* BluetoothKit.h in Headers */ = {isa = PBXBuildFile; fileRef = C687E3C31B8B4CF100B702D8 /* BluetoothKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
C69770021CEBA21B004955E0 /* BKSendDataTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = C67A227B1B8CECB400CB74CE /* BKSendDataTask.swift */; };
C6B2E3711CE52C7700D25393 /* BKErrorDomain.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6B2E3701CE52C7700D25393 /* BKErrorDomain.swift */; };
C6B2E3721CE52C7700D25393 /* BKErrorDomain.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6B2E3701CE52C7700D25393 /* BKErrorDomain.swift */; };
C6B2E3731CE52C7700D25393 /* BKErrorDomain.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6B2E3701CE52C7700D25393 /* BKErrorDomain.swift */; };
Expand Down Expand Up @@ -346,6 +347,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C69770021CEBA21B004955E0 /* BKSendDataTask.swift in Sources */,
C64CDDFB1BE4C56C00F72549 /* BKAvailability.swift in Sources */,
C64CDDFC1BE4C56C00F72549 /* BKCBCentralManagerDelegateProxy.swift in Sources */,
C64CDDFD1BE4C56C00F72549 /* BKCBPeripheralDelegateProxy.swift in Sources */,
Expand Down
278 changes: 268 additions & 10 deletions Example/BKExample.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"images" : [

],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"images" : [

],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
7 changes: 3 additions & 4 deletions Example/Resources/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8187.4" systemVersion="14F19a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8151.3"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -20,11 +20,10 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text=":)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="53h-pw-AGX">
<rect key="frame" x="20" y="20" width="560" height="560"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle1"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
Expand Down
4 changes: 4 additions & 0 deletions Example/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ internal class RemotePeripheralViewController: UIViewController, BKRemotePeriphe
Logger.delegate = self
view.addSubview(logTextView)
view.backgroundColor = UIColor.whiteColor()
logTextView.editable = false
#if os(iOS)
logTextView.editable = false
#endif
logTextView.alwaysBounceVertical = true
applyConstraints()
Logger.log("Awaiting data from peripheral")
Expand Down
14 changes: 12 additions & 2 deletions Example/Source/View Controllers/RoleSelectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ internal class RoleSelectionViewController: UIViewController {
peripheralButton.setTitle("Peripheral", forState: UIControlState.Normal)
preparedButtons([ centralButton, peripheralButton ], andAddThemToView: view)
applyConstraints()
#if os(tvOS)
peripheralButton.enabled = false
#endif
}

// MARK: Functions
Expand All @@ -51,7 +54,12 @@ internal class RoleSelectionViewController: UIViewController {
for button in buttons {
button.setBackgroundImage(UIImage.imageWithColor(buttonColor), forState: UIControlState.Normal)
button.titleLabel?.font = UIFont.boldSystemFontOfSize(30)
button.addTarget(self, action: #selector(RoleSelectionViewController.buttonTapped(_:)), forControlEvents: UIControlEvents.TouchUpInside)
#if os(iOS)
button.addTarget(self, action: #selector(RoleSelectionViewController.buttonTapped(_:)), forControlEvents: UIControlEvents.TouchUpInside)
#elseif os(tvOS)
button.addTarget(self, action: #selector(RoleSelectionViewController.buttonTapped(_:)), forControlEvents: UIControlEvents.PrimaryActionTriggered)
#endif

view.addSubview(button)
}
}
Expand All @@ -76,7 +84,9 @@ internal class RoleSelectionViewController: UIViewController {
if button == centralButton {
navigationController?.pushViewController(CentralViewController(), animated: true)
} else if button == peripheralButton {
navigationController?.pushViewController(PeripheralViewController(), animated: true)
#if os(iOS)
navigationController?.pushViewController(PeripheralViewController(), animated: true)
#endif
}
}

Expand Down

0 comments on commit 4bcedcc

Please sign in to comment.