Skip to content

Commit

Permalink
Merge pull request #1 from mobillium/GKTooltip
Browse files Browse the repository at this point in the history
Mobillium Tooltips
  • Loading branch information
serkanerkan authored Jul 23, 2023
2 parents d6184ed + 863bb72 commit b24ee0e
Show file tree
Hide file tree
Showing 60 changed files with 3,375 additions and 120 deletions.
28 changes: 18 additions & 10 deletions Example/MobilliumToolTips.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; };
7EFD825F2A6D46FD00C17EB6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EFD825E2A6D46FC00C17EB6 /* QuartzCore.framework */; };
F430C4A6EA16D430CF9B05E1 /* Pods_MobilliumToolTips_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F523F57AA3B4228071946E65 /* Pods_MobilliumToolTips_Example.framework */; };
/* End PBXBuildFile section */

Expand All @@ -30,7 +31,7 @@
/* Begin PBXFileReference section */
0FD561E777EF2B975C7C848E /* Pods-MobilliumToolTips_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MobilliumToolTips_Example.debug.xcconfig"; path = "Target Support Files/Pods-MobilliumToolTips_Example/Pods-MobilliumToolTips_Example.debug.xcconfig"; sourceTree = "<group>"; };
1C0C55226749EFCA563EFEBA /* Pods-MobilliumToolTips_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MobilliumToolTips_Tests.debug.xcconfig"; path = "Target Support Files/Pods-MobilliumToolTips_Tests/Pods-MobilliumToolTips_Tests.debug.xcconfig"; sourceTree = "<group>"; };
468D42805411B4AE81F5A464 /* MobilliumToolTips.podspec */ = {isa = PBXFileReference; includeInIndex = 1; name = MobilliumToolTips.podspec; path = ../MobilliumToolTips.podspec; sourceTree = "<group>"; };
468D42805411B4AE81F5A464 /* MobilliumToolTips.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = MobilliumToolTips.podspec; path = ../MobilliumToolTips.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
607FACD01AFB9204008FA782 /* MobilliumToolTips_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MobilliumToolTips_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand All @@ -42,8 +43,9 @@
607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
67C14D2AAA8FB3A3E1ABC0FF /* Pods-MobilliumToolTips_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MobilliumToolTips_Example.release.xcconfig"; path = "Target Support Files/Pods-MobilliumToolTips_Example/Pods-MobilliumToolTips_Example.release.xcconfig"; sourceTree = "<group>"; };
98EB8C6FBE4DEE5828ABEF5A /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; name = README.md; path = ../README.md; sourceTree = "<group>"; };
D29FA3FF6CB9F359AF65623B /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
7EFD825E2A6D46FC00C17EB6 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
98EB8C6FBE4DEE5828ABEF5A /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
D29FA3FF6CB9F359AF65623B /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
DA9047A335FCEE6D49935F78 /* Pods-MobilliumToolTips_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MobilliumToolTips_Tests.release.xcconfig"; path = "Target Support Files/Pods-MobilliumToolTips_Tests/Pods-MobilliumToolTips_Tests.release.xcconfig"; sourceTree = "<group>"; };
E7AE46168A3E7A9025CFBAC3 /* Pods_MobilliumToolTips_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MobilliumToolTips_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
F523F57AA3B4228071946E65 /* Pods_MobilliumToolTips_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MobilliumToolTips_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -54,6 +56,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7EFD825F2A6D46FD00C17EB6 /* QuartzCore.framework in Frameworks */,
F430C4A6EA16D430CF9B05E1 /* Pods_MobilliumToolTips_Example.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -72,6 +75,7 @@
566C0BE3FD777F22A4CECDD9 /* Frameworks */ = {
isa = PBXGroup;
children = (
7EFD825E2A6D46FC00C17EB6 /* QuartzCore.framework */,
F523F57AA3B4228071946E65 /* Pods_MobilliumToolTips_Example.framework */,
E7AE46168A3E7A9025CFBAC3 /* Pods_MobilliumToolTips_Tests.framework */,
);
Expand Down Expand Up @@ -156,7 +160,6 @@
1C0C55226749EFCA563EFEBA /* Pods-MobilliumToolTips_Tests.debug.xcconfig */,
DA9047A335FCEE6D49935F78 /* Pods-MobilliumToolTips_Tests.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -227,6 +230,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -419,11 +423,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand Down Expand Up @@ -465,10 +470,11 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -479,12 +485,13 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = MobilliumToolTips/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -494,12 +501,13 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = MobilliumToolTips/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -520,7 +528,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MobilliumToolTips_Example.app/MobilliumToolTips_Example";
};
name = Debug;
Expand All @@ -538,7 +546,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MobilliumToolTips_Example.app/MobilliumToolTips_Example";
};
name = Release;
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>
31 changes: 3 additions & 28 deletions Example/MobilliumToolTips/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// AppDelegate.swift
// MobilliumToolTips
//
// Created by evam-mobile-customer on 07/21/2023.
// Copyright (c) 2023 evam-mobile-customer. All rights reserved.
// Created by mobillium on 07/21/2023.
// Copyright (c) 2023 mobillium. All rights reserved.
//

import UIKit
Expand All @@ -13,34 +13,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


}

5 changes: 4 additions & 1 deletion Example/MobilliumToolTips/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
82 changes: 75 additions & 7 deletions Example/MobilliumToolTips/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,91 @@
// ViewController.swift
// MobilliumToolTips
//
// Created by evam-mobile-customer on 07/21/2023.
// Copyright (c) 2023 evam-mobile-customer. All rights reserved.
// Created by mobillium on 07/21/2023.
// Copyright (c) 2023 mobillium. All rights reserved.
//

import UIKit
import MobilliumToolTips

class ViewController: UIViewController {

let button1 = UIButton(type: .system)
let button2 = UIButton(type: .system)

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
configureContents()
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
configureTooltips()
}
}

// MARK: - Private Functions -
extension ViewController {

private func configureContents() {
button1.setTitle("button", for: .normal)
button1.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(button1)

button2.setTitle("button", for: .normal)
button2.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(button2)

NSLayoutConstraint.activate([
button1.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 32),
button1.centerYAnchor.constraint(equalTo: view.centerYAnchor),
button2.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -32),
button2.centerYAnchor.constraint(equalTo: view.centerYAnchor)
])
}

private func configureTooltips() {
let gkTooltip = GKTooltip()
gkTooltip.startIntro(from: self, withNodes: self.getGKTooltipNodes(), isHighlightedWithOneNode: true)

}
}

// MARK: - Tooltip Walkthrough -
extension ViewController {

fileprivate func getGKTooltipNodes() -> [GKTooltipNode] {
var nodes: [GKTooltipNode] = []

let testNodeButton1 = GKTooltipNode(text: "Lorem ipsum dolor sit amet",
target: .view(button1),
roundedCorners: false,
isLeftButtonHidden: true,
isRightButtonHidden: true,
isIconViewHidden: false,
leftButtonText: "txt_again",
leftButtonType: .again,
leftButtonTintColor: .orange03,
rightButtonText: "txt_next",
rightButtonType: .next,
rightButtonTintColor: .primary)
nodes.append(testNodeButton1)

let testNodeButton2 = GKTooltipNode(text: "Lorem ipsum dolor sit amet, Lorem ipsum dolor sit amet\nLorem ipsum dolor sit amet,\n\nLorem ipsum dolor sit amet,",
target: .view(button2),
roundedCorners: false,
isLeftButtonHidden: false,
isRightButtonHidden: false,
isIconViewHidden: true,
leftButtonText: "txt_close",
leftButtonType: .close,
leftButtonTintColor: .elevation03,
rightButtonText: "txt_again",
rightButtonType: .again,
rightButtonTintColor: .pureBlack)

nodes.append(testNodeButton2)

return nodes
}
}
Loading

0 comments on commit b24ee0e

Please sign in to comment.