I am programming an app for the iphone in Objective C in Xcode. What I am trying to do is to make a splash screen at the start of my app last for about 2 or 3 seconds, I have looked throughout the internet, but all of the tutorials on how to do this were outdated and did not work with the current versions of Xcode and Interface Builder. So I was wondering how would I use NSTimer to post an image for about 3 seconds and then change the alpha of the image to 0. By the way, I am wondering how to do this while using a Window Based Application preset. Any help would be greatly appreciated and an example would probably help as well.
How to use NSTimer to make an image alpha change/fade?
785 views Asked by Ryan S At
2
There are 2 answers
0
Paul.s
On
@David Schiefer is correct. For more info see the Apple Docs (scroll down to Application Launch Images).
But if you wanted to actually implement something regardless you can do as suggested and use the standard mechanism. Then in
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
you could throw up the same image (your splash) in an imageview then use animation blocks like this.
[UIView animateWithDuration:0.5
delay:3
options:UIViewAnimationCurveLinear
animations:^{
myImageView.alpha = 0;
}
completion:^(BOOL finished){
[myImageView removeFromSuperview];
}];
If you want it every time the app is launched add to this instead
- (void)applicationDidBecomeActive:(UIApplication *)application
Related Questions in OBJECTIVE-C
- How to control the volume of an iPhone programmatically in objective-c
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- How to set value the descriptor of iOS BLE in Objective-C?
- Unexpected #selector() Behavior in Swift-Objective-C Interop?
- In what context can we use an unqualified #selector() expression in Swift?
- AVPictureInPictureController crashes during initialization
- How to use pow() in Objective-C?
- How to change the image on the MGSwipeButton in MGSwipeTableCell
- Using sort descriptors in Outline View
- Why is my Swift function not printing from inside the dataTask closure?
- Using UICollectionViewCell with IBOutlet
- Undefined symbol: _OBJC_CLASS_$_ only on simulator
- Why can't I receive a notification sent from Camera Extension(Swift) to an observer application (obj-c++)
- Behavior of __block modifier in objc
- Inserting subview into view where I've added subviews and sublayers
Related Questions in XCODE
- I am getting lots of errors when building react native app in Xcode
- Xcode commits (possibly outside of any branch) disappeared, how to get them back?
- Can't run built SFML project from Xcode template
- Postal Framework crash in iPhone but runs successfully in simulator
- React Native - RealmJS - Linker command failed with exit code 1
- how to install xcode on macos hight sierra without apple account
- Xcode: Can't Attach to process
- Issue with Xcode Target and settings for Apple Watch App
- There are no active runners online GitLab
- My project code not running in Xcode(15.3) but the same code running in Xcode 14.2 in swift how to fix in xcode 15.3?
- How to press and hold in Xcode simulator
- Memory management for image data storing and retrieving with SwiftData (or CoreData)
- Error: spawn flutter ENOENT in flutter build_runner
- Can a project using Crashlytics have a GoogleService-Info.plist file renamed to something else?
- What changed from xcode 13.2.1 to 14.2 that would affect an app's entitlements?
Related Questions in NSTIMER
- iOS Swift Timer sometimes fires much later than expected
- matplotlib animation vs python event loop (event loop gives choppy results)
- Timer not running when the app is in background
- Is there max limit that a timer can be set for?
- NSTimer interfering with user clicks
- How to setup long running timers on iOS
- Cannot convert value of type 'Timer' to expected argument type '(() -> Void)?' Swift 5
- Timer crashing screens in SwiftUI
- Xamarin NSTime RepeatingScheduledTimer is not getting called on Release Mode - Backgroud
- Invalidating a Timer created multiple times
- stop the timer which is executed after button click
- Making a spriteNode fade away
- How to run timer for two dates subtraction in Swift
- Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFTimer encodeWithCoder:]
- How to run a timer-based app at the same speed when the screensaver is active
Related Questions in ALPHA
- Blender to Unity Vertex Color (Alpha) Data Doesn't Work
- How to calculate pooled Cronbach's Alpha after multiple imputation
- PyQT5 QAbstractVideoSurface: Play Video with alpha channel (on windows)
- How do I control the alpha of a geom_point fill?
- How to improve color layer mask to have mid tones?
- how do I change the alpha channel along a path in cairo?
- Compare theoretical and empirical alpha
- REST API to identify Stable Maven Version of any Maven dependency
- How to set p5.js alpha channel transparency in a shader?
- How to add transparency values correctly?
- THREE.js GLTFLoader alpha does not show transparency(shows white background instead)
- "Replacement has x rows" error in code that previously worked (geom_sf/gganimate/shadow_mark)
- overlapping colors in ggplot geom_point
- Three Fiber not showing transparent png texture
- Is the alpha flag for the canvas tag getContext function advisory only?
Related Questions in IPHONE-SDK-3.2
- Post as a fan page on iOS Facebook SDK 3.0
- iPhone in-call status bar size?
- ERROR: Request for member 'rootview controller' in something not a structure or union?
- how to call a method in iphone applications?
- What is the difference between view 'did load' method and 'didFinishLaunching' application
- Display login screen before Tab bar controller
- what are connections need to to be done for tab bar controller in the main window.xib?
- show a login screen before Tab bar controller
- Insert excel file in SQLite Database in Iphone
- Tapku calendar Add Events
- How to overide UIToolbar method with later version of iOS 4.2
- Iphone sdk not installed error while installing phonegap template
- Peer-to-Peer (w/ iPhones)?
- How to use NSTimer to make an image alpha change/fade?
- dyld: Symbol not found: error in iOS 3.2
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Apple does not like seeing splashscreens. But if you're insisting, have you tried just setting a
Default.pngimage? Just drag an image calledDefault.pnginto your App's "Resources" folder and your splashscreen will be shown at startup.Info: The real purpose of
Default.pngis to make the UI appear in an "almost ready" state before the app is actually ready and that's what Apple intends you to use this for, but apps don't get rejected for using this function for their Splashscreens.