Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
SwiftTweaks
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Sho Ikeda
May 25, 2016
Programming
680
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SwiftTweaks
関西モバイルアプリ研究会 #14での発表資料です #関モバ
http://kanmoba.connpass.com/event/31750/
Sho Ikeda
May 25, 2016
More Decks by Sho Ikeda
See All by Sho Ikeda
大規模アプリにおけるXcode Previews実用化までの道のり
ikesyo
0
31k
Package Traits
ikesyo
2
1.7k
Open Source Swift Workshop - Foundation and first party libraries
ikesyo
0
3.4k
Renovateで実現するライブラリの自動更新生活 / Automated Library Updates with Renovate
ikesyo
3
750
XcodeのDevelopment Assets探訪
ikesyo
1
1.5k
RenovateによるiOSライブラリーの自動更新
ikesyo
2
4.2k
2019年のSwiftモック事情
ikesyo
3
8.7k
5分でわかる!Xcode 11から使えるXCFrameworks
ikesyo
2
4.1k
Travis CIのBuild Matrixを活用して、Swift製ライブラリをLinux対応させる
ikesyo
3
2.7k
Other Decks in Programming
See All in Programming
sbt 2.0: takeoff
eed3si9n
0
160
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
AWSに止められる覚悟してますか?
morizo_1984
2
540
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
190
Event is what happens
moro
2
780
すこし踏み込む CancellationToken
htkym
2
1.7k
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
280
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
Next.js: The final boss of Web Performance
guaca
0
260
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
590
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
433
67k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
A Soul's Torment
seathinner
8
3.8k
BBQ
matthewcrist
90
10k
Product Roadmaps are Hard
iamctodd
55
13k
The SEO Collaboration Effect
kristinabergwall1
1
590
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
750
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
410
Accessibility Awareness
sabderemane
1
250
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
600
Transcript
SwiftTweaks @ikesyo ؔϞόΠϧΞϓϦݚڀձ #14, 2016-05-25 Wed #ؔϞό
@ikesyo • ͍͚͠ΐʔʗా ᠳ • ͯͳ@ژ • https://twitter.com/ikesyo • https://github.com/ikesyo
✨ Contributions ✨ • ReactiveCocoa • Carthage (Commandant, ReactiveTask) •
Result • Himotoki • APIKit
Tweaking
Why? • Parameters adjustment • Animation (location, duration, ...) •
Color • Layout • ... • Debug mode • Clear settings • Change API environment • Toggle experimental features • ... • And what you want
Facebook/Tweaks
Tweaks An easy way to fine-tune, and adjust parameters for
iOS apps in development.
Objective-C // Value CGFloat animationDuration = FBTweakValue(@"Category", @"Group", @"Duration", 0.5);
// Bind FBTweakBind(self.headerView, alpha, @"Main Screen", @"Header", @"Alpha", 0.85); FBTweakBind(webView.scrollView, scrollEnabled, @"Browser", @"Scrolling", @"Enabled", YES); // Action FBTweakAction(@"Player", @"Audio", @"Volume", ^{ NSLog(@"Action selected."); });
Swift // FBTweak~~ are macro, so those can't be used
in Swift let tweak = FBTweak(identifier: "com.tweaks.example.advanced") tweak.name = "Advanced settings" tweak.defaultValue = false let collection = FBTweakCollection(name: "Enable"); collection.addTweak(tweak) let category = FBTweakCategory(name: "Settings") category.addTweakCollection(collection) let store = FBTweakStore.sharedInstance() store.addTweakCategory(category) tweak.addObserver(self) func tweakDidChange(tweak: FBTweak!) { self.advancedSettingsEnabled = tweak.currentValue as Bool }
!!!
Khan/SwiftTweaks
SwiftTweaks Tweak your iOS app without recompiling! • Supported types
• Bool • Int • CGFloat • Double • UIColor • Group template • Floating window
Steps 1. Create a TweakLibraryType. 2. Reference that TweakLibraryType in
your code to use a Tweak. 3. Use the TweakWindow in your AppDelegate.
Make your TweakLibrary public struct ExampleTweaks: TweakLibraryType { public static
let colorTint = Tweak( "General", "Colors", "Tint", UIColor.blueColor()) public static let marginHorizontal = Tweak<CGFloat>( "General", "Layout", "H. Margins", defaultValue: 15, min: 0) public static let marginVertical = Tweak<CGFloat>( "General", "Layout", "V. Margins", defaultValue: 10, min: 0) public static let featureFlagMainScreenHelperText = Tweak( "Feature Flags", "Main Screen", "Show Body Text", true) public static let buttonAnimation = SpringAnimationTweakTemplate( "Animation", "Button Animation") ... }
Make your TweakLibrary public struct ExampleTweaks: TweakLibraryType { ... public
static let defaultStore: TweakStore = { let allTweaks: [TweakClusterType] = [colorTint, marginHorizontal, marginVertical, featureFlagMainScreenHelperText, buttonAnimation ] #if DEBUG let tweaksEnabled: Bool = true #else let tweaksEnabled: Bool = false #endif return TweakStore( tweaks: allTweaks, enabled: tweaksEnabled ) }() }
Using Your TweakLibrary // Assign button.tintColor = ExampleTweaks.assign(ExampleTweaks.colorTint) // Bind
ExampleTweaks.bind(ExampleTweaks.colorTint) { button.tintColor = $0 } // Bind multiple let tweaksToWatch: [TweakType] = [ ExampleTweaks.marginHorizontal, ExampleTweaks.marginVertical ] ExampleTweaks.bindMultiple(tweaksToWatch) { let horizontal = ExampleTweaks.assign(ExampleTweaks.marginHorizontal) let vertical = ExampleTweaks.assign(ExampleTweaks.marginVertical) scrollView.contentInset = UIEdgeInsets( top: vertical, right: horizontal, bottom: vertical, left: horizontal) }
Roadmaps Let's contribute! ✨ • "Backups" feature • Support String
as a TweakViewDataType • Add a "closure" Tweak Type • Design & Build tvOS UI • Design & Build iPad UI
☺☺☺
!" Happy Tweaking!! "!
Thank you❗"