Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kellyroach/swift4 #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# * http://www.objc.io/issue-6/travis-ci.html
# * https://github.com/supermarin/xcpretty#usage

osx_image: xcode7.3
osx_image: xcode9.4
language: objective-c
# cache: cocoapods
# podfile: Example/Podfile
# before_install:
# - gem install cocoapods # Since Travis is not always on latest version
# - pod install --project-directory=Example
script:
- set -o pipefail && xcodebuild test -workspace Example/MLKit.xcworkspace -scheme MLKit-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
- set -o pipefail && xcodebuild test -workspace Example/MLKit.xcworkspace -scheme MLKit-Example -sdk iphonesimulator11.4 ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
236 changes: 113 additions & 123 deletions Example/MLKit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "0940"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
67 changes: 67 additions & 0 deletions Example/MLKit/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="MLKit EXAMPLE" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="g0d-O9-zq5" userLabel="MLKit Label">
<rect key="frame" x="0.0" y="71" width="375" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchImage.png" translatesAutoresizingMaskIntoConstraints="NO" id="4Zk-ga-VeF" userLabel="Launch Image">
<rect key="frame" x="0.0" y="146" width="375" height="375"/>
<constraints>
<constraint firstAttribute="width" secondItem="4Zk-ga-VeF" secondAttribute="height" multiplier="1:1" id="r3P-wA-Qr4"/>
</constraints>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="Us2-dD-SKi" userLabel="Copyright Label">
<rect key="frame" x="0.0" y="553" width="375" height="61"/>
<string key="text">Copyright (c) 2017-2018 Guled Ahmed.
All rights reserved. Credit goes to
fullstackio for Flappy Bird game. </string>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Us2-dD-SKi" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="9Tf-Oj-5jE"/>
<constraint firstAttribute="trailing" secondItem="g0d-O9-zq5" secondAttribute="trailing" id="CZd-mV-4cI"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="4Zk-ga-VeF" secondAttribute="trailing" id="Fsj-9O-dKH"/>
<constraint firstItem="4Zk-ga-VeF" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="Qqw-sq-PiA"/>
<constraint firstItem="4Zk-ga-VeF" firstAttribute="top" secondItem="g0d-O9-zq5" secondAttribute="bottom" constant="32" id="RNr-de-NLT"/>
<constraint firstItem="g0d-O9-zq5" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="cCU-wQ-cyN"/>
<constraint firstItem="4Zk-ga-VeF" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="djQ-eJ-4Pc"/>
<constraint firstAttribute="trailing" secondItem="Us2-dD-SKi" secondAttribute="trailing" id="p0c-OO-QuX"/>
<constraint firstItem="Us2-dD-SKi" firstAttribute="top" secondItem="4Zk-ga-VeF" secondAttribute="bottom" constant="32" id="pZP-cj-XLz"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="52" y="374.66266866566718"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage.png" width="249" height="280"/>
</resources>
</document>
45 changes: 0 additions & 45 deletions Example/MLKit/Base.lproj/LaunchScreen.xib

This file was deleted.

14 changes: 7 additions & 7 deletions Example/MLKit/GameScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ class GameScene: SKScene, SKPhysicsContactDelegate {

if bird.fitness >= 9.0 {
print("FOUND RARE BIRD")
print(bird.brain?.layers[0].weights)
print(bird.brain?.layers[1].weights)
print(bird.brain?.layers[0].bias)
print(bird.brain?.layers[1].bias)
print(bird.brain?.layers[0].weights as Any)
print(bird.brain?.layers[1].weights as Any)
print(bird.brain?.layers[0].bias as Any)
print(bird.brain?.layers[1].bias as Any)
}
}

Expand Down Expand Up @@ -396,7 +396,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
if generation.count > currentFlappy {
currentBird = generation[currentFlappy]
} else {
if let bestBird = maxBird {
if maxBird != nil {
currentBird = maxBird
}
}
Expand Down Expand Up @@ -549,7 +549,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
moving.speed = 0

bird.physicsBody?.collisionBitMask = worldCategory
bird.run( SKAction.rotate(byAngle: CGFloat(M_PI) * CGFloat(bird.position.y) * 0.01, duration:1), completion: {self.bird.speed = 0 })
bird.run( SKAction.rotate(byAngle: CGFloat.pi * CGFloat(bird.position.y) * 0.01, duration:1), completion: {self.bird.speed = 0 })

// Flash background if contact is detected
self.removeAction(forKey: "flash")
Expand Down Expand Up @@ -587,7 +587,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
moving.speed = 0

bird.physicsBody?.collisionBitMask = worldCategory
bird.run( SKAction.rotate(byAngle: CGFloat(M_PI) * CGFloat(bird.position.y) * 0.01, duration:1), completion: {self.bird.speed = 0 })
bird.run( SKAction.rotate(byAngle: CGFloat.pi * CGFloat(bird.position.y) * 0.01, duration:1), completion: {self.bird.speed = 0 })

// Flash background if contact is detected
self.removeAction(forKey: "flash")
Expand Down
138 changes: 124 additions & 14 deletions Example/MLKit/Images.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,158 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"filename" : "Icon-40.png",
"size" : "40x40",
"idiom" : "ipad",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "40x40",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"size" : "60x60",
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
"scale" : "2x"
},
{
"filename" : "Icon-72.png",
"size" : "72x72",
"idiom" : "ipad",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "72x72",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "Icon-76.png",
"size" : "76x76",
"idiom" : "ipad",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "76x76",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "Icon-Small-50.png",
"size" : "50x50",
"idiom" : "ipad",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "50x50",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "Icon-Small.png",
"size" : "29x29",
"idiom" : "iphone",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "29x29",
"idiom" : "iphone",
"scale" : "2x"
},
{
"filename" : "Icon.png",
"size" : "57x57",
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "57x57",
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"size" : "29x29",
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"filename" : "[email protected]",
"size" : "40x40",
"idiom" : "iphone",
"scale" : "3x"
},
{
"filename" : "[email protected]",
"size" : "60x60",
"idiom" : "iphone",
"scale" : "3x"
},
{
"filename" : "[email protected]",
"size" : "40x40",
"idiom" : "iphone",
"scale" : "2x"
},
{
"filename" : "Icon-Small.png",
"size" : "29x29",
"idiom" : "ipad",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "29x29",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"size" : "83.5x83.5",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"size" : "20x20",
"idiom" : "iphone",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"size" : "20x20",
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"filename" : "NotificationIcon~ipad.png",
"size" : "20x20",
"idiom" : "ipad",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "20x20",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "ios-marketing.png",
"size" : "1024x1024",
"idiom" : "ios-marketing",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Example/MLKit/LaunchImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ target 'MLKit_Example' do
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
Expand Down
Loading