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
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.6k
Open Source Swift Workshop - Foundation and first party libraries
ikesyo
0
3.4k
Renovateで実現するライブラリの自動更新生活 / Automated Library Updates with Renovate
ikesyo
3
730
XcodeのDevelopment Assets探訪
ikesyo
1
1.5k
RenovateによるiOSライブラリーの自動更新
ikesyo
2
4.1k
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
フロントエンドUIフレームワークのこれまでとこれから
ssssota
5
2.4k
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
150
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
140
Deep dive into the select statement (GopherCon UK)
jespino
0
170
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
530
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
330
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
240
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
4
650
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
670
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
typoなんかねぇよ
raspython3
0
690
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
220
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
67k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
690
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
240
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
220
Amusing Abliteration
ianozsvald
1
290
How to Ace a Technical Interview
jacobian
281
24k
Docker and Python
trallard
47
4.2k
Practical Orchestrator
shlominoach
191
12k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
240
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
490
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❗"